/* Generated by Cython 0.29.2 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_2"
#define CYTHON_HEX_VERSION 0x001D02F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #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_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 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
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #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_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 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
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #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
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #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(__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_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #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 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

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#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 METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(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
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_USE_DICT_VERSIONS
#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_dict_cached_value;\
        } else {\
            (VAR) = __pyx_dict_cached_value = (LOOKUP);\
            __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
        }\
    }
#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
#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_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #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_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0; // PyThread_create_key reports success always
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif // TSS (Thread Specific Storage) API
#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
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         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, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#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 && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#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 PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
  #define PyObject_Unicode             PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#ifndef __PYX_EXTERN_C
  #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>
#include "numpy/arrayobject.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

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 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 const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#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 PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#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_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __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_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
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_IntOrLong(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_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#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__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __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)
    #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


static const char *__pyx_f[] = {
  "python3/src/HTSeq/_HTSeq.pyx",
  "python3/src/HTSeq/_HTSeq.pxd",
  "stringsource",
  "__init__.pxd",
  "type.pxd",
};
/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  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_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __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;


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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #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
  #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);


/*--- 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_BowtieAlignment;
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation;
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
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":906
 *         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":1162
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')
 * 
 * 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":1179
 *     return build_cigar_list(cl, ref_left, chrom, strand)
 * 
 * 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":1576
 * ###########################
 * 
 * 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":318
 * 
 * 
 * cdef class ChromVector(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef public object array
 */
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;
};


/* "HTSeq/_HTSeq.pyx":486
 *     return cv
 * 
 * cdef class GenomicArray(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef public dict chrom_vectors
 */
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray {
  PyObject_HEAD
  PyObject *chrom_vectors;
  int stranded;
  PyObject *typecode;
  int auto_add_chroms;
  PyObject *storage;
  PyObject *memmap_dir;
};


/* "HTSeq/_HTSeq.pyx":1082
 * 
 * 
 * cdef class BowtieAlignment(AlignmentWithSequenceReversal):             # <<<<<<<<<<<<<<
 * 
 *     """When reading in a Bowtie file, objects of the class BowtieAlignment
 */
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment {
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal __pyx_base;
  PyObject *reserved;
  PyObject *substitutions;
};


/* "HTSeq/_HTSeq.pyx":1118
 *     'X': 'sequence-mismatched'}
 * 
 * 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":442
 *             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":29
 * cdef str strand_nostrand = intern(".")
 * 
 * cdef class GenomicInterval:             # <<<<<<<<<<<<<<
 * 
 *     """A GenomicInterval specifies an interval (i.e., a range of
 */

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":261
 * 
 * 
 * cdef class GenomicPosition(GenomicInterval):             # <<<<<<<<<<<<<<
 * 
 *     """A GenomicPosition specifies the position of a nucleotide or
 */

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":639
 * base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}
 * 
 * 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":789
 * 
 * 
 * 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;

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

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

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

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

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

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

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

/* 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)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

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

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall.proto */
#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 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

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

/* 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 */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    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_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);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
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

/* IncludeStringH.proto */
#include <string.h>

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

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

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

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

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

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

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (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)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (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);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (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);
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);

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

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

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

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

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_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 {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
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(void);

/* 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);
        PyList_SET_ITEM(list, len, x);
        Py_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 PY_MAJOR_VERSION >= 3 && !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

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

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

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

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

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

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, 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);

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

/* decode_c_string_utf16.proto */
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 */
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)) {
    return __Pyx_decode_c_bytes(
        PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
        start, stop, encoding, errors, decode_func);
}

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

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

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

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

/* BufferFormatCheck.proto */
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,
                              __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,
    __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)
/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

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

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

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t);

/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
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

/* 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);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* GetItemIntUnicode.proto */
#define __Pyx_GetItemInt_Unicode(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "string index out of range"), (Py_UCS4)-1))
static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
                                                           int wraparound, int boundscheck);

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

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

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* bytes_index.proto */
static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds);

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

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

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* ClassMethod.proto */
#include "descrobject.h"
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);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

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

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

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

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

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


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

/* None.proto */
static CYTHON_INLINE long __Pyx_pow_long(long, long);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(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_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

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

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 'cpython.buffer' */

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

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

/* Module declarations from '__builtin__' */

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

/* Module declarations from 'cpython' */

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

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

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

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'HTSeq._HTSeq' */
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_Sequence = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_Alignment = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_ChromVector = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation = 0;
static PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = 0;
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_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_CigarOperation__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *, 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*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
#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' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_RuntimeError;
static const char __pyx_k_A[] = "A";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_G[] = "G";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_M[] = "M";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_P[] = "P";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_X[] = "X";
static const char __pyx_k_Z[] = "Z";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_s[] = ">%s\n";
static const char __pyx_k_w[] = "w+";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k__2[] = "<";
static const char __pyx_k__3[] = "', [";
static const char __pyx_k__4[] = ",";
static const char __pyx_k__5[] = "'>";
static const char __pyx_k__6[] = ":[";
static const char __pyx_k__7[] = ")/";
static const char __pyx_k__8[] = ".";
static const char __pyx_k__9[] = "':";
static const char __pyx_k_cv[] = "cv";
static const char __pyx_k_ga[] = "ga";
static const char __pyx_k_iv[] = "iv";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_se[] = "se";
static const char __pyx_k_Inf[] = "Inf";
static const char __pyx_k__10[] = ":";
static const char __pyx_k__11[] = "/";
static const char __pyx_k__12[] = "";
static const char __pyx_k__16[] = ", ";
static const char __pyx_k__17[] = ">";
static const char __pyx_k__19[] = "+";
static const char __pyx_k__20[] = "-";
static const char __pyx_k__21[] = "\t";
static const char __pyx_k__22[] = "\n";
static const char __pyx_k__25[] = ")>";
static const char __pyx_k__26[] = " ";
static const char __pyx_k__27[] = "@";
static const char __pyx_k__28[] = "+\n";
static const char __pyx_k__29[] = " '";
static const char __pyx_k__30[] = "< ";
static const char __pyx_k__31[] = ": ";
static const char __pyx_k__32[] = ") >";
static const char __pyx_k__33[] = "=";
static const char __pyx_k__34[] = "*";
static const char __pyx_k__39[] = ";";
static const char __pyx_k__40[] = "\"";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_csv[] = "csv";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_nmm[] = ".nmm";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_qto[] = "qto";
static const char __pyx_k_rto[] = "rto";
static const char __pyx_k_s_2[] = "@%s\n";
static const char __pyx_k_s_3[] = "s";
static const char __pyx_k_seq[] = "seq";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tid[] = "tid";
static const char __pyx_k_vec[] = "vec";
static const char __pyx_k_w_2[] = "w";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_Read[] = "Read";
static const char __pyx_k_aend[] = "aend";
static const char __pyx_k_auto[] = "auto";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_flag[] = "flag";
static const char __pyx_k_gzip[] = "gzip";
static const char __pyx_k_iadd[] = "__iadd__";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mapq[] = "mapq";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_mpos[] = "mpos";
static const char __pyx_k_mrnm[] = "mrnm";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_none[] = "none";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_part[] = "[part]";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_qual[] = "qual";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_tags[] = "tags";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_type[] = "type_";
static const char __pyx_k_HTSeq[] = "HTSeq";
static const char __pyx_k_apply[] = "apply";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_check[] = "check";
static const char __pyx_k_chrom[] = "chrom";
static const char __pyx_k_cigar[] = "cigar";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_descr[] = "descr";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_end_d[] = "end_d";
static const char __pyx_k_first[] = "first";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_isize[] = "isize";
static const char __pyx_k_log10[] = "log10";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_phred[] = "phred";
static const char __pyx_k_pysam[] = "pysam";
static const char __pyx_k_qfrom[] = "qfrom";
static const char __pyx_k_qname[] = "qname";
static const char __pyx_k_quote[] = "quote";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rfrom[] = "rfrom";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_steps[] = "steps";
static const char __pyx_k_uint8[] = "uint8";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_addval[] = "addval";
static const char __pyx_k_base_s[] = " base(s) ";
static const char __pyx_k_chroms[] = "chroms";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_gettid[] = "gettid";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_memmap[] = "memmap";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_object[] = " object '";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_padded[] = "padded";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_ref_iv[] = "ref_iv";
static const char __pyx_k_rename[] = "rename";
static const char __pyx_k_rstrip[] = "rstrip";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_solexa[] = "solexa";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_strand[] = "strand";
static const char __pyx_k_type_2[] = "type";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_aligned[] = "aligned";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_deleted[] = "deleted";
static const char __pyx_k_matched[] = "matched";
static const char __pyx_k_maxsize[] = "maxsize";
static const char __pyx_k_missing[] = "missing";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_noquals[] = "noquals";
static const char __pyx_k_pattern[] = "pattern";
static const char __pyx_k_qualstr[] = "qualstr";
static const char __pyx_k_samfile[] = "samfile";
static const char __pyx_k_skipped[] = "skipped";
static const char __pyx_k_start_d[] = "start_d";
static const char __pyx_k_storage[] = "storage";
static const char __pyx_k_unknown[] = "unknown";
static const char __pyx_k_unnamed[] = "unnamed";
static const char __pyx_k_ACGTacgt[] = "ACGTacgt";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_Sequence[] = "Sequence";
static const char __pyx_k_StringIO[] = "StringIO";
static const char __pyx_k_TGCAtgca[] = "TGCAtgca";
static const char __pyx_k_contains[] = "contains";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_getrname[] = "getrname";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_getvalue[] = "getvalue";
static const char __pyx_k_inserted[] = "inserted";
static const char __pyx_k_is_read1[] = "is_read1";
static const char __pyx_k_is_read2[] = "is_read2";
static const char __pyx_k_length_2[] = "' (length ";
static const char __pyx_k_object_2[] = " object, ";
static const char __pyx_k_object_3[] = " object: ";
static const char __pyx_k_overlaps[] = "overlaps";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_query_iv[] = ", query iv [";
static const char __pyx_k_ref_left[] = "ref_left";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_strand_2[] = "), strand '";
static const char __pyx_k_strand_3[] = ", strand '";
static const char __pyx_k_stranded[] = "stranded";
static const char __pyx_k_typecode[] = "typecode";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_Alignment[] = "Alignment";
static const char __pyx_k_MIDNSHP_X[] = "([MIDNSHP=X])";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_add_chrom[] = "add_chrom";
static const char __pyx_k_cStringIO[] = "cStringIO";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_is_paired[] = "is_paired";
static const char __pyx_k_is_qcfail[] = "is_qcfail";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_maketrans[] = "maketrans";
static const char __pyx_k_on_ref_iv[] = " on ref iv ";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_qualscale[] = "qualscale";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_storage_2[] = "_storage";
static const char __pyx_k_translate[] = "translate";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_StepVector[] = "StepVector";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_aligned_to[] = "' aligned to ";
static const char __pyx_k_fasta_file[] = "fasta_file";
static const char __pyx_k_is_reverse[] = "is_reverse";
static const char __pyx_k_memmap_dir[] = "memmap_dir";
static const char __pyx_k_paired_end[] = "paired_end";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_query_name[] = "query_name";
static const char __pyx_k_revcomp_of[] = "revcomp_of_";
static const char __pyx_k_solexa_old[] = "solexa-old";
static const char __pyx_k_AlignedRead[] = "AlignedRead";
static const char __pyx_k_ChromVector[] = "ChromVector";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_bowtie_line[] = "bowtie_line";
static const char __pyx_k_cigar_pairs[] = "cigar_pairs";
static const char __pyx_k_cigartuples[] = "cigartuples";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_create_view[] = "_create_view";
static const char __pyx_k_is_unmapped[] = "is_unmapped";
static const char __pyx_k_max_mm_qual[] = "max_mm_qual";
static const char __pyx_k_not_aligned[] = "', not aligned>";
static const char __pyx_k_start_index[] = "start_index";
static const char __pyx_k_GenomicArray[] = "GenomicArray";
static const char __pyx_k_HTSeq__HTSeq[] = "HTSeq._HTSeq";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_cigar_string[] = "cigar_string";
static const char __pyx_k_hard_clipped[] = "hard-clipped";
static const char __pyx_k_is_duplicate[] = "is_duplicate";
static const char __pyx_k_is_secondary[] = "is_secondary";
static const char __pyx_k_mate_aligned[] = "mate_aligned";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_reference_id[] = "reference_id";
static const char __pyx_k_soft_clipped[] = "soft-clipped";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_SAM_Alignment[] = "SAM_Alignment";
static const char __pyx_k_chrom_vectors[] = "chrom_vectors";
static const char __pyx_k_from_SAM_line[] = "from_SAM_line";
static const char __pyx_k_mismatch_prop[] = "mismatch_prop";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_reference_end[] = "reference_end";
static const char __pyx_k_track_options[] = "track_options";
static const char __pyx_k_trim_left_end[] = "trim_left_end";
static const char __pyx_k_AlignedSegment[] = "AlignedSegment";
static const char __pyx_k_CigarOperation[] = "CigarOperation";
static const char __pyx_k_HTSeq_internal[] = "_HTSeq_internal";
static const char __pyx_k_base_to_column[] = "base_to_column";
static const char __pyx_k_is_proper_pair[] = "is_proper_pair";
static const char __pyx_k_not_paired_end[] = "not_paired_end";
static const char __pyx_k_query_sequence[] = "query_sequence";
static const char __pyx_k_re_cigar_codes[] = "_re_cigar_codes";
static const char __pyx_k_stop_too_large[] = "stop too large";
static const char __pyx_k_trim_right_end[] = "trim_right_end";
static const char __pyx_k_BowtieAlignment[] = "BowtieAlignment";
static const char __pyx_k_GenomicInterval[] = "GenomicInterval";
static const char __pyx_k_GenomicPosition[] = "GenomicPosition";
static const char __pyx_k_Paired_end_read[] = "Paired-end read";
static const char __pyx_k_Strand_mismatch[] = "Strand mismatch.";
static const char __pyx_k_is_contained_in[] = "is_contained_in";
static const char __pyx_k_mapping_quality[] = "mapping_quality";
static const char __pyx_k_mate_is_reverse[] = "mate_is_reverse";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_query_qualities[] = "query_qualities";
static const char __pyx_k_read_as_aligned[] = "read_as_aligned";
static const char __pyx_k_reference_start[] = "reference_start";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_start_too_small[] = "start too small";
static const char __pyx_k_template_length[] = "template_length";
static const char __pyx_k_unmatched_quote[] = "unmatched quote";
static const char __pyx_k_convert_to_phred[] = "convert_to_phred";
static const char __pyx_k_file_or_filename[] = "file_or_filename";
static const char __pyx_k_is_supplementary[] = "is_supplementary";
static const char __pyx_k_mate_is_unmapped[] = "mate_is_unmapped";
static const char __pyx_k_sequence_matched[] = "sequence-matched";
static const char __pyx_k_ChromVector_steps[] = "ChromVector_steps";
static const char __pyx_k_Strand_must_be_or[] = "Strand must be'+', '-', or '.'.";
static const char __pyx_k_extend_to_include[] = "extend_to_include";
static const char __pyx_k_is_vector_of_sets[] = "is_vector_of_sets";
static const char __pyx_k_next_reference_id[] = "next_reference_id";
static const char __pyx_k_GenomicArray_steps[] = "GenomicArray_steps";
static const char __pyx_k_Illegal_index_type[] = "Illegal index type";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_characters_per_line[] = "characters_per_line";
static const char __pyx_k_raw_optional_fields[] = "raw_optional_fields";
static const char __pyx_k_sequence_mismatched[] = "sequence-mismatched";
static const char __pyx_k_track_type_bedGraph[] = "track type=bedGraph\n";
static const char __pyx_k_write_to_fastq_file[] = "write_to_fastq_file";
static const char __pyx_k_ChromVector_unpickle[] = "_ChromVector_unpickle";
static const char __pyx_k_Illegal_index_type_2[] = "Illegal index type.";
static const char __pyx_k_Illegal_storage_mode[] = "Illegal storage mode.";
static const char __pyx_k_iadd___locals_addval[] = "__iadd__.<locals>.addval";
static const char __pyx_k_next_reference_start[] = "next_reference_start";
static const char __pyx_k_GenomicArray_unpickle[] = "_GenomicArray_unpickle";
static const char __pyx_k_GenomicInterval_range[] = "GenomicInterval_range";
static const char __pyx_k_SequenceWithQualities[] = "SequenceWithQualities";
static const char __pyx_k_cigar_operation_codes[] = "cigar_operation_codes";
static const char __pyx_k_cigar_operation_names[] = "cigar_operation_names";
static const char __pyx_k_track_type_bedGraph_s[] = "track type=bedGraph %s\n";
static const char __pyx_k_GenomicInterval_ranged[] = "GenomicInterval_ranged";
static const char __pyx_k_Illegal_CIGAR_string_s[] = "Illegal CIGAR string '%s'";
static const char __pyx_k_Quality_string_missing[] = "Quality string missing.";
static const char __pyx_k_from_pysam_AlignedRead[] = "from_pysam_AlignedRead";
static const char __pyx_k_get_reverse_complement[] = "get_reverse_complement";
static const char __pyx_k_pyx_unpickle_Alignment[] = "__pyx_unpickle_Alignment";
static const char __pyx_k_quote_must_be_length_1[] = "'quote' must be length 1";
static const char __pyx_k_split_must_be_length_1[] = "'split' must be length 1";
static const char __pyx_k_Illegal_quality_scale_s[] = "Illegal quality scale '%s'.";
static const char __pyx_k_add_qual_to_count_array[] = "add_qual_to_count_array";
static const char __pyx_k_Chromosome_name_mismatch[] = "Chromosome name mismatch.";
static const char __pyx_k_Quality_string_missing_2[] = "Quality string missing";
static const char __pyx_k_add_bases_to_count_array[] = "add_bases_to_count_array";
static const char __pyx_k_start_is_larger_than_end[] = "start is larger than end";
static const char __pyx_k_trim_left_end_with_quals[] = "trim_left_end_with_quals";
static const char __pyx_k_cigar_operation_code_dict[] = "cigar_operation_code_dict";
static const char __pyx_k_from_pysam_AlignedSegment[] = "from_pysam_AlignedSegment";
static const char __pyx_k_trim_right_end_with_quals[] = "trim_right_end_with_quals";
static const char __pyx_k_pyx_unpickle_SAM_Alignment[] = "__pyx_unpickle_SAM_Alignment";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_pyx_unpickle_CigarOperation[] = "__pyx_unpickle_CigarOperation";
static const char __pyx_k_Inconsistent_CIGAR_operation[] = "Inconsistent CIGAR operation.";
static const char __pyx_k_python3_src_HTSeq__HTSeq_pyx[] = "python3/src/HTSeq/_HTSeq.pyx";
static const char __pyx_k_pyx_unpickle_BowtieAlignment[] = "__pyx_unpickle_BowtieAlignment";
static const char __pyx_k_AlignmentWithSequenceReversal[] = "AlignmentWithSequenceReversal";
static const char __pyx_k_pyx_unpickle_AlignmentWithSequ[] = "__pyx_unpickle_AlignmentWithSequenceReversal";
static const char __pyx_k_Automatic_adding_of_chromosomes[] = "Automatic adding of chromosomes can  only be used with storage type 'StepVector'.";
static const char __pyx_k_Illegal_base_letter_encountered[] = "Illegal base letter encountered.";
static const char __pyx_k_Malformatted_SAM_optional_field[] = "Malformatted SAM optional field '%'";
static const char __pyx_k_Quality_string_has_not_the_same[] = "Quality string has not the same length as sequence.";
static const char __pyx_k_SAM_optional_field_with_illegal[] = "SAM optional field with illegal type letter '%s'";
static const char __pyx_k_assignment_to_qual_with_illegal[] = "assignment to qual with illegal shape";
static const char __pyx_k_chroms_must_be_a_list_or_a_dict[] = "'chroms' must be a list or a dict or 'auto'.";
static const char __pyx_k_count_array_has_too_few_columns[] = "'count_array' has too few columns.";
static const char __pyx_k_count_array_too_small_for_seque[] = "'count_array' too small for sequence.";
static const char __pyx_k_make_translation_table_for_comp[] = "_make_translation_table_for_complementation";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_seq_and_qualstr_do_not_have_the[] = "'seq' and 'qualstr' do not have the same length.";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_Cannot_assign_to_zero_length_int[] = "Cannot assign to zero-length interval.";
static const char __pyx_k_Cannot_extend_an_interval_to_inc[] = "Cannot extend an interval to include None.";
static const char __pyx_k_Cannot_subset_to_zero_length_int[] = "Cannot subset to zero-length interval.";
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static const char __pyx_k_GenomicInterval_from_directional[] = "GenomicInterval_from_directional";
static const char __pyx_k_Incompatible_checksums_s_vs_0x1b[] = "Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x48[] = "Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xb5[] = "Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xf6[] = "Incompatible checksums (%s vs 0xf6933f3 = (_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_Indefinite_length_chromosomes_ca[] = "Indefinite-length chromosomes can  only be used with storage type 'StepVector'.";
static const char __pyx_k_Malformed_SAM_line_MRNM_although[] = "Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared";
static const char __pyx_k_Malformed_SAM_line_RNAME_althoug[] = "Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_Non_stranded_index_used_for_stra[] = "Non-stranded index used for stranded GenomicArray.";
static const char __pyx_k_Please_Install_PySam_to_use_this[] = "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)";
static const char __pyx_k_Required_assignment_signature_no[] = "Required assignment signature not yet implemented.";
static const char __pyx_k_SAM_line_does_not_contain_at_lea[] = "SAM line does not contain at least 11 tab-delimited fields.";
static const char __pyx_k_SAM_optional_field_tag_s_not_fou[] = "SAM optional field tag %s not found";
static const char __pyx_k_SAM_optional_field_tag_s_not_uni[] = "SAM optional field tag %s not unique";
static const char __pyx_k_Sequence_in_SAM_file_contains_wh[] = "Sequence in SAM file contains '=', which is not supported.";
static const char __pyx_k_Start_of_interval_is_after_its_e[] = "Start of interval is after its end.";
static const char __pyx_k_Strand_must_be_specified_for_str[] = "Strand must be specified for stranded GenomicArray.";
static const char __pyx_k_Strand_specified_in_unstranded_G[] = "Strand specified in unstranded GenomicArray.";
static const char __pyx_k_Too_large_quality_value_encounte[] = "Too large quality value encountered.";
static const char __pyx_k_Unknown_CIGAR_code_s_encountered[] = "Unknown CIGAR code '%s' encountered.";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_qual_can_only_be_assigned_a_nump[] = "qual can only be assigned a numpy array of type numpy.uint8";
static const char __pyx_k_Cannot_extend_an_interval_to_inc_2[] = "Cannot extend an interval to include an interval on another chromosome.";
static const char __pyx_k_Cannot_extend_an_interval_to_inc_3[] = "Cannot extend an interval to include an interval on another strand.";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static const char __pyx_k_Sequence_in_SAM_file_contains_wh_2[] = "Sequence in SAM file contains '.', which is not supported.";
static PyObject *__pyx_n_u_A;
static PyObject *__pyx_n_b_ACGTacgt;
static PyObject *__pyx_n_s_AlignedRead;
static PyObject *__pyx_n_s_AlignedSegment;
static PyObject *__pyx_n_s_Alignment;
static PyObject *__pyx_n_s_AlignmentWithSequenceReversal;
static PyObject *__pyx_kp_u_Automatic_adding_of_chromosomes;
static PyObject *__pyx_n_s_BowtieAlignment;
static PyObject *__pyx_n_u_C;
static PyObject *__pyx_kp_u_Cannot_assign_to_zero_length_int;
static PyObject *__pyx_kp_u_Cannot_extend_an_interval_to_inc;
static PyObject *__pyx_kp_u_Cannot_extend_an_interval_to_inc_2;
static PyObject *__pyx_kp_u_Cannot_extend_an_interval_to_inc_3;
static PyObject *__pyx_kp_u_Cannot_subset_to_zero_length_int;
static PyObject *__pyx_n_s_ChromVector;
static PyObject *__pyx_n_s_ChromVector_steps;
static PyObject *__pyx_n_s_ChromVector_unpickle;
static PyObject *__pyx_kp_u_Chromosome_name_mismatch;
static PyObject *__pyx_n_s_CigarOperation;
static PyObject *__pyx_n_u_D;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_n_u_G;
static PyObject *__pyx_n_s_GenomicArray;
static PyObject *__pyx_n_s_GenomicArray_steps;
static PyObject *__pyx_n_s_GenomicArray_unpickle;
static PyObject *__pyx_n_s_GenomicInterval;
static PyObject *__pyx_n_s_GenomicInterval_from_directional;
static PyObject *__pyx_n_s_GenomicInterval_range;
static PyObject *__pyx_n_s_GenomicInterval_ranged;
static PyObject *__pyx_n_s_GenomicPosition;
static PyObject *__pyx_n_u_H;
static PyObject *__pyx_n_s_HTSeq;
static PyObject *__pyx_n_s_HTSeq__HTSeq;
static PyObject *__pyx_n_s_HTSeq_internal;
static PyObject *__pyx_n_u_I;
static PyObject *__pyx_kp_u_Illegal_CIGAR_string_s;
static PyObject *__pyx_kp_u_Illegal_base_letter_encountered;
static PyObject *__pyx_kp_u_Illegal_index_type;
static PyObject *__pyx_kp_u_Illegal_index_type_2;
static PyObject *__pyx_kp_u_Illegal_quality_scale_s;
static PyObject *__pyx_kp_u_Illegal_storage_mode;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x1b;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x48;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb5;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf6;
static PyObject *__pyx_kp_u_Inconsistent_CIGAR_operation;
static PyObject *__pyx_kp_u_Indefinite_length_chromosomes_ca;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_u_Inf;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_u_M;
static PyObject *__pyx_kp_u_MIDNSHP_X;
static PyObject *__pyx_kp_u_Malformatted_SAM_optional_field;
static PyObject *__pyx_kp_u_Malformed_SAM_line_MRNM_although;
static PyObject *__pyx_kp_u_Malformed_SAM_line_RNAME_althoug;
static PyObject *__pyx_n_u_N;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_kp_u_Non_stranded_index_used_for_stra;
static PyObject *__pyx_kp_u_None;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_u_O;
static PyObject *__pyx_n_u_P;
static PyObject *__pyx_kp_u_Paired_end_read;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_u_Please_Install_PySam_to_use_this;
static PyObject *__pyx_kp_u_Quality_string_has_not_the_same;
static PyObject *__pyx_kp_u_Quality_string_missing;
static PyObject *__pyx_kp_u_Quality_string_missing_2;
static PyObject *__pyx_n_u_Read;
static PyObject *__pyx_kp_u_Required_assignment_signature_no;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_u_S;
static PyObject *__pyx_n_s_SAM_Alignment;
static PyObject *__pyx_kp_u_SAM_line_does_not_contain_at_lea;
static PyObject *__pyx_kp_u_SAM_optional_field_tag_s_not_fou;
static PyObject *__pyx_kp_u_SAM_optional_field_tag_s_not_uni;
static PyObject *__pyx_kp_u_SAM_optional_field_with_illegal;
static PyObject *__pyx_n_s_Sequence;
static PyObject *__pyx_n_s_SequenceWithQualities;
static PyObject *__pyx_kp_u_Sequence_in_SAM_file_contains_wh;
static PyObject *__pyx_kp_u_Sequence_in_SAM_file_contains_wh_2;
static PyObject *__pyx_kp_u_Start_of_interval_is_after_its_e;
static PyObject *__pyx_n_s_StepVector;
static PyObject *__pyx_kp_u_Strand_mismatch;
static PyObject *__pyx_kp_u_Strand_must_be_or;
static PyObject *__pyx_kp_u_Strand_must_be_specified_for_str;
static PyObject *__pyx_kp_u_Strand_specified_in_unstranded_G;
static PyObject *__pyx_n_s_StringIO;
static PyObject *__pyx_n_u_T;
static PyObject *__pyx_n_b_TGCAtgca;
static PyObject *__pyx_kp_u_Too_large_quality_value_encounte;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_u_Unknown_CIGAR_code_s_encountered;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_u_X;
static PyObject *__pyx_n_u_Z;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_b__12;
static PyObject *__pyx_kp_u__12;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__19;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__20;
static PyObject *__pyx_kp_u__21;
static PyObject *__pyx_kp_u__22;
static PyObject *__pyx_kp_u__25;
static PyObject *__pyx_kp_b__26;
static PyObject *__pyx_kp_u__26;
static PyObject *__pyx_kp_u__27;
static PyObject *__pyx_kp_u__28;
static PyObject *__pyx_kp_u__29;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__30;
static PyObject *__pyx_kp_u__31;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_kp_b__34;
static PyObject *__pyx_kp_u__34;
static PyObject *__pyx_kp_b__39;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_b__40;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_kp_u__9;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_bases_to_count_array;
static PyObject *__pyx_n_s_add_chrom;
static PyObject *__pyx_n_s_add_qual_to_count_array;
static PyObject *__pyx_n_s_addval;
static PyObject *__pyx_n_s_aend;
static PyObject *__pyx_n_s_aligned;
static PyObject *__pyx_kp_u_aligned_to;
static PyObject *__pyx_n_s_apply;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_kp_u_assignment_to_qual_with_illegal;
static PyObject *__pyx_n_u_auto;
static PyObject *__pyx_kp_u_base_s;
static PyObject *__pyx_n_s_base_to_column;
static PyObject *__pyx_n_s_bowtie_line;
static PyObject *__pyx_n_s_cStringIO;
static PyObject *__pyx_n_s_characters_per_line;
static PyObject *__pyx_n_s_check;
static PyObject *__pyx_n_s_chrom;
static PyObject *__pyx_n_s_chrom_vectors;
static PyObject *__pyx_n_s_chroms;
static PyObject *__pyx_kp_u_chroms_must_be_a_list_or_a_dict;
static PyObject *__pyx_n_s_cigar;
static PyObject *__pyx_n_s_cigar_operation_code_dict;
static PyObject *__pyx_n_s_cigar_operation_codes;
static PyObject *__pyx_n_s_cigar_operation_names;
static PyObject *__pyx_n_s_cigar_pairs;
static PyObject *__pyx_n_s_cigar_string;
static PyObject *__pyx_n_s_cigartuples;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_n_s_convert_to_phred;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_kp_u_count_array_has_too_few_columns;
static PyObject *__pyx_kp_u_count_array_too_small_for_seque;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_view;
static PyObject *__pyx_n_s_csv;
static PyObject *__pyx_n_s_cv;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_u_deleted;
static PyObject *__pyx_n_u_descr;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_end_d;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_extend_to_include;
static PyObject *__pyx_n_u_f;
static PyObject *__pyx_n_s_fasta_file;
static PyObject *__pyx_n_s_file_or_filename;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_u_first;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_from_SAM_line;
static PyObject *__pyx_n_s_from_pysam_AlignedRead;
static PyObject *__pyx_n_s_from_pysam_AlignedSegment;
static PyObject *__pyx_n_s_ga;
static PyObject *__pyx_n_s_get_reverse_complement;
static PyObject *__pyx_n_s_getrname;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_gettid;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_n_s_gzip;
static PyObject *__pyx_kp_u_hard_clipped;
static PyObject *__pyx_n_u_i;
static PyObject *__pyx_n_s_iadd;
static PyObject *__pyx_n_s_iadd___locals_addval;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_u_inserted;
static PyObject *__pyx_n_s_is_contained_in;
static PyObject *__pyx_n_s_is_duplicate;
static PyObject *__pyx_n_s_is_paired;
static PyObject *__pyx_n_s_is_proper_pair;
static PyObject *__pyx_n_s_is_qcfail;
static PyObject *__pyx_n_s_is_read1;
static PyObject *__pyx_n_s_is_read2;
static PyObject *__pyx_n_s_is_reverse;
static PyObject *__pyx_n_s_is_secondary;
static PyObject *__pyx_n_s_is_supplementary;
static PyObject *__pyx_n_s_is_unmapped;
static PyObject *__pyx_n_s_is_vector_of_sets;
static PyObject *__pyx_n_s_isize;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_iv;
static PyObject *__pyx_n_u_j;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_kp_u_length_2;
static PyObject *__pyx_n_s_log10;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_translation_table_for_comp;
static PyObject *__pyx_n_s_maketrans;
static PyObject *__pyx_n_s_mapping_quality;
static PyObject *__pyx_n_s_mapq;
static PyObject *__pyx_n_u_matched;
static PyObject *__pyx_n_s_mate_aligned;
static PyObject *__pyx_n_s_mate_is_reverse;
static PyObject *__pyx_n_s_mate_is_unmapped;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_max_mm_qual;
static PyObject *__pyx_n_s_maxsize;
static PyObject *__pyx_n_s_memmap;
static PyObject *__pyx_n_u_memmap;
static PyObject *__pyx_n_s_memmap_dir;
static PyObject *__pyx_n_s_mismatch_prop;
static PyObject *__pyx_n_u_missing;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_mpos;
static PyObject *__pyx_n_s_mrnm;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_name_2;
static PyObject *__pyx_n_u_ndarray;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_next_reference_id;
static PyObject *__pyx_n_s_next_reference_start;
static PyObject *__pyx_kp_u_nmm;
static PyObject *__pyx_n_u_none;
static PyObject *__pyx_n_u_noquals;
static PyObject *__pyx_kp_u_not_aligned;
static PyObject *__pyx_n_u_not_paired_end;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_kp_u_object;
static PyObject *__pyx_kp_u_object_2;
static PyObject *__pyx_kp_u_object_3;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_kp_u_on_ref_iv;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_overlaps;
static PyObject *__pyx_n_u_padded;
static PyObject *__pyx_n_s_paired_end;
static PyObject *__pyx_kp_u_part;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pattern;
static PyObject *__pyx_n_u_phred;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_pysam;
static PyObject *__pyx_kp_s_python3_src_HTSeq__HTSeq_pyx;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Alignment;
static PyObject *__pyx_n_s_pyx_unpickle_AlignmentWithSequ;
static PyObject *__pyx_n_s_pyx_unpickle_BowtieAlignment;
static PyObject *__pyx_n_s_pyx_unpickle_CigarOperation;
static PyObject *__pyx_n_s_pyx_unpickle_SAM_Alignment;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qfrom;
static PyObject *__pyx_n_s_qname;
static PyObject *__pyx_n_s_qto;
static PyObject *__pyx_n_s_qual;
static PyObject *__pyx_kp_u_qual_can_only_be_assigned_a_nump;
static PyObject *__pyx_n_s_qualscale;
static PyObject *__pyx_n_s_qualstr;
static PyObject *__pyx_kp_u_query_iv;
static PyObject *__pyx_n_s_query_name;
static PyObject *__pyx_n_s_query_qualities;
static PyObject *__pyx_n_s_query_sequence;
static PyObject *__pyx_n_s_quote;
static PyObject *__pyx_kp_u_quote_must_be_length_1;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_raw_optional_fields;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_re_cigar_codes;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_as_aligned;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_ref_iv;
static PyObject *__pyx_n_s_ref_left;
static PyObject *__pyx_n_s_reference_end;
static PyObject *__pyx_n_s_reference_id;
static PyObject *__pyx_n_s_reference_start;
static PyObject *__pyx_n_s_rename;
static PyObject *__pyx_n_u_revcomp_of;
static PyObject *__pyx_n_s_rfrom;
static PyObject *__pyx_n_s_rstrip;
static PyObject *__pyx_n_s_rto;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_n_s_s_3;
static PyObject *__pyx_n_s_samfile;
static PyObject *__pyx_n_s_se;
static PyObject *__pyx_n_u_second;
static PyObject *__pyx_n_s_seq;
static PyObject *__pyx_n_u_seq;
static PyObject *__pyx_kp_u_seq_and_qualstr_do_not_have_the;
static PyObject *__pyx_kp_u_sequence_matched;
static PyObject *__pyx_kp_u_sequence_mismatched;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_u_skipped;
static PyObject *__pyx_kp_u_soft_clipped;
static PyObject *__pyx_n_u_solexa;
static PyObject *__pyx_kp_u_solexa_old;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_kp_u_split_must_be_length_1;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_start_d;
static PyObject *__pyx_n_s_start_index;
static PyObject *__pyx_kp_u_start_is_larger_than_end;
static PyObject *__pyx_kp_u_start_too_small;
static PyObject *__pyx_n_s_stderr;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_u_step;
static PyObject *__pyx_n_s_steps;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_kp_u_stop_too_large;
static PyObject *__pyx_n_s_storage;
static PyObject *__pyx_n_s_storage_2;
static PyObject *__pyx_n_s_strand;
static PyObject *__pyx_kp_u_strand_2;
static PyObject *__pyx_kp_u_strand_3;
static PyObject *__pyx_n_s_stranded;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tags;
static PyObject *__pyx_n_s_template_length;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tid;
static PyObject *__pyx_n_s_track_options;
static PyObject *__pyx_kp_u_track_type_bedGraph;
static PyObject *__pyx_kp_u_track_type_bedGraph_s;
static PyObject *__pyx_n_s_translate;
static PyObject *__pyx_n_s_trim_left_end;
static PyObject *__pyx_n_s_trim_left_end_with_quals;
static PyObject *__pyx_n_s_trim_right_end;
static PyObject *__pyx_n_s_trim_right_end_with_quals;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_type_2;
static PyObject *__pyx_n_s_typecode;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_u_unknown;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_kp_u_unmatched_quote;
static PyObject *__pyx_n_u_unnamed;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vec;
static PyObject *__pyx_kp_u_w;
static PyObject *__pyx_n_u_w_2;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_u_write;
static PyObject *__pyx_n_s_write_to_fastq_file;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_zeros;
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_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__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_8__iadd__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iter__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12values(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14steps(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16apply(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_fun); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__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_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); /* 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 PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10write_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); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12steps(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 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_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_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 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 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_12optional_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_14raw_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_16__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__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_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_18__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_20__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_22__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_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 int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* 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_BowtieAlignment(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___pyx_scope_struct____iadd__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_70;
static PyObject *__pyx_int_28831487;
static PyObject *__pyx_int_75678070;
static PyObject *__pyx_int_125566450;
static PyObject *__pyx_int_190567068;
static PyObject *__pyx_int_258552819;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k_;
static PyObject *__pyx_k__18;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_slice__24;
static PyObject *__pyx_slice__35;
static PyObject *__pyx_slice__36;
static PyObject *__pyx_slice__37;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
/* Late includes */

/* "HTSeq/_HTSeq.pyx":56
 *     """
 * 
 *     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*/
static char __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_COMPILING_IN_CPYTHON
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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_strand,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k_;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 56, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 56, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_chrom = ((PyObject*)values[0]);
    __pyx_v_start = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_start == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error)
    __pyx_v_end = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_end == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error)
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 56, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 57, __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;
  __pyx_L0:;
  __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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":62
 *         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, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 62, __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":63
 *         """
 *         self.chrom = intern(chrom)
 *         self.start = start             # <<<<<<<<<<<<<<
 *         self.end = end
 *         self.strand = strand
 */
  __pyx_v_self->start = __pyx_v_start;

  /* "HTSeq/_HTSeq.pyx":64
 *         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":65
 *         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_n_s_strand, __pyx_v_strand) < 0) __PYX_ERR(0, 65, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":66
 *         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) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":67
 *         self.strand = strand
 *         if self.start > self.end:
 *             raise ValueError, "start is larger than end"             # <<<<<<<<<<<<<<
 * 
 *     property strand:
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_start_is_larger_than_end, 0, 0);
    __PYX_ERR(0, 67, __pyx_L1_error)

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

  /* "HTSeq/_HTSeq.pyx":56
 *     """
 * 
 *     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_AddTraceback("HTSeq._HTSeq.GenomicInterval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":70
 * 
 *     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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_strand);

  /* "HTSeq/_HTSeq.pyx":71
 *     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, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":72
 *         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);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":73
 *             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_4 = (__pyx_t_3 != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":72
 *         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_4 = ((!__pyx_t_2) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":74
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Strand_must_be_or, 0, 0);
    __PYX_ERR(0, 74, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":72
 *         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":75
 *                     strand is strand_nostrand):
 *                 raise ValueError, "Strand must be'+', '-', or '.'."
 *             self._strand = strand             # <<<<<<<<<<<<<<
 * 
 *         def __get__(self):
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_strand))||((__pyx_v_strand) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_strand)->tp_name), 0))) __PYX_ERR(0, 75, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_strand;
  __Pyx_INCREF(__pyx_t_1);
  __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":70
 * 
 *     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_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":77
 *             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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":78
 * 
 *         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":77
 *             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":80
 *             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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

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

  /* "HTSeq/_HTSeq.pyx":82
 *     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_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "HTSeq/_HTSeq.pyx":81
 * 
 *     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, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __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, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":80
 *             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":84
 *                                  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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
  __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;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__copy__", 0);

  /* "HTSeq/_HTSeq.pyx":85
 * 
 *     def __copy__(self):
 *         constr, args = self.__reduce__()             # <<<<<<<<<<<<<<
 *         return constr(*args)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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, 85, __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_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 85, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_constr = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":86
 *     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, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_constr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":84
 *                                  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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":88
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":89
 * 
 *     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);
  __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);

  /* "HTSeq/_HTSeq.pyx":90
 *     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_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_object);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_object);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
  __pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_self->start, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__4);

  /* "HTSeq/_HTSeq.pyx":91
 *         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_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __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, 91, __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, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __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_n_u_Inf);
    __pyx_t_4 = __pyx_n_u_Inf;
  }
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_strand_2);
  __pyx_t_2 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_strand_2);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_strand_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__5);

  /* "HTSeq/_HTSeq.pyx":89
 * 
 *     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_1, 11, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __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":88
 *         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_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":93
 *              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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "HTSeq/_HTSeq.pyx":94
 * 
 *     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);
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;

  /* "HTSeq/_HTSeq.pyx":95
 *     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_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__6);
  __pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_self->start, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__4);

  /* "HTSeq/_HTSeq.pyx":96
 *         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_5 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __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, 96, __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, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":95
 *     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_6 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __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_n_u_Inf);
    __pyx_t_4 = __pyx_n_u_Inf;
  }
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__7);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__7);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__7);

  /* "HTSeq/_HTSeq.pyx":96
 *         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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":94
 * 
 *     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_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __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":93
 *              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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":104
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

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

  /* "HTSeq/_HTSeq.pyx":104
 *         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":107
 *             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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_newLength); {
    __pyx_v_newLength = __Pyx_PyInt_As_long(__pyx_arg_newLength); if (unlikely((__pyx_v_newLength == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":108
 * 
 *         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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":109
 *         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":108
 * 
 *         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":111
 *                 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":107
 *             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;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":119
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":120
 * 
 *         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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":121
 *         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_3 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

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

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

  /* "HTSeq/_HTSeq.pyx":119
 *         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_3);
  __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":125
 *                 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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_newStartd); {
    __pyx_v_newStartd = __Pyx_PyInt_As_long(__pyx_arg_newStartd); if (unlikely((__pyx_v_newStartd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":126
 * 
 *         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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

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

    /* "HTSeq/_HTSeq.pyx":128
 *             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":126
 * 
 *         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":130
 *                 self.start = newStartd
 *             else:
 *                 self.start = newStartd + 1 - self.length             # <<<<<<<<<<<<<<
 *                 self.end = newStartd + 1
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_newStartd + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->start = __pyx_t_6;

    /* "HTSeq/_HTSeq.pyx":131
 *             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":125
 *                 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":135
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":136
 * 
 *         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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":137
 *         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_3 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

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

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

  /* "HTSeq/_HTSeq.pyx":135
 *     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_3);
  __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":142
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":143
 *     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_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":142
 * 
 *     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_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":146
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":147
 *     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_1 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":146
 * 
 *     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_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":150
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":151
 *     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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":150
 * 
 *     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_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":154
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":155
 *     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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":154
 * 
 *     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_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":157
 *             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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "other", 0))) __PYX_ERR(0, 157, __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;
  __pyx_L0:;
  __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;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "HTSeq/_HTSeq.pyx":158
 * 
 *     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":159
 *     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, 159, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":160
 *         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":159
 *     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":161
 *             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, 161, __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":162
 *                 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, 162, __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, 162, __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":158
 * 
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
 *         if op == 2:  # ==             # <<<<<<<<<<<<<<
 *             if other == None:
 *                 return False
 */
    break;
    case 3:

    /* "HTSeq/_HTSeq.pyx":164
 *                 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, 164, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 164, __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, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":163
 *             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":166
 *             return not (self == other)
 *         else:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(GenomicInterval self):
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    __PYX_ERR(0, 166, __pyx_L1_error)
    break;
  }

  /* "HTSeq/_HTSeq.pyx":157
 *             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":168
 *             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) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "HTSeq/_HTSeq.pyx":169
 * 
 *     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_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __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, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":168
 *             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":171
 *         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, PyObject *__pyx_v_iv); /*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;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("is_contained_in", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_contained_in); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":182
 *           - 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, 182, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":183
 *         """
 *         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":182
 *           - self.end <= iv.end
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.chrom != iv.chrom:
 */
  }

  /* "HTSeq/_HTSeq.pyx":184
 *         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_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":185
 *             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":184
 *         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":186
 *         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_5 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __pyx_t_7 = (__pyx_t_5 != 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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __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;
  __pyx_t_5 = (__pyx_t_7 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":187
 *             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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != __pyx_v_iv->_strand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_5 != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":186
 *         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":188
 *         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":186
 *         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":189
 *                 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) != 0);
  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) != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":190
 *             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":189
 *                 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":191
 *         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":171
 *         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, PyObject *__pyx_v_iv); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_contained_in (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 171, __pyx_L1_error)
  __pyx_r = __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));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __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, 171, __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":193
 *         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, PyObject *__pyx_v_iv); /*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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("contains", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_contains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":199
 *         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, 199, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":200
 *         """
 *         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":199
 *         See 'is_contained_in' for the exact criteria.
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         return iv.is_contained_in(self)
 */
  }

  /* "HTSeq/_HTSeq.pyx":201
 *         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, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":193
 *         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, PyObject *__pyx_v_iv); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contains (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
  __pyx_r = __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));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __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, 193, __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":203
 *         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, PyObject *__pyx_v_iv); /*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;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("overlaps", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overlaps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":213
 *           - 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, 213, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":214
 *         """
 *         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":213
 *           - the actual intervals overlap
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.chrom != iv.chrom:
 */
  }

  /* "HTSeq/_HTSeq.pyx":215
 *         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_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":216
 *             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":215
 *         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":217
 *         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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_5 != 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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __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;
  __pyx_t_5 = (__pyx_t_7 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":218
 *             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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = (__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_7 = (__pyx_t_5 != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":217
 *         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":219
 *         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":217
 *         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":220
 *                 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) != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":221
 *             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, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

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

  /* "HTSeq/_HTSeq.pyx":223
 *             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, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":203
 *         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, PyObject *__pyx_v_iv); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("overlaps (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 203, __pyx_L1_error)
  __pyx_r = __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));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __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, 203, __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":225
 *             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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_step;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("range (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "range") < 0)) __PYX_ERR(0, 225, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_step = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_step == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
    } else {
      __pyx_v_step = ((long)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("range", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 225, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("range", 0);

  /* "HTSeq/_HTSeq.pyx":229
 *         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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GenomicInterval_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":225
 *             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_XDECREF(__pyx_t_6);
  __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":231
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_step;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("range_d (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "range_d") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_step = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_step == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L3_error)
    } else {
      __pyx_v_step = ((long)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("range_d", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("range_d", 0);

  /* "HTSeq/_HTSeq.pyx":235
 *         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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GenomicInterval_ranged); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":231
 *         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_XDECREF(__pyx_t_6);
  __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":237
 *         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, PyObject *__pyx_v_iv); /*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;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  long __pyx_t_9;
  long __pyx_t_10;
  __Pyx_RefNannySetupContext("extend_to_include", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extend_to_include); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iv)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iv));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":239
 *     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_5 = (((PyObject *)__pyx_v_iv) == Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":240
 *         """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_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Cannot_extend_an_interval_to_inc, 0, 0);
    __PYX_ERR(0, 240, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":239
 *     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":241
 *         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, 241, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "HTSeq/_HTSeq.pyx":242
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Cannot_extend_an_interval_to_inc_2, 0, 0);
    __PYX_ERR(0, 242, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":241
 *         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":243
 *         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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __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;
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":244
 *             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_n_s_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__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_7 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":243
 *         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_5)) {

    /* "HTSeq/_HTSeq.pyx":245
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Cannot_extend_an_interval_to_inc_3, 0, 0);
    __PYX_ERR(0, 245, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":243
 *         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":246
 *                 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;
  if (((__pyx_t_8 < __pyx_t_9) != 0)) {
    __pyx_t_10 = __pyx_t_8;
  } else {
    __pyx_t_10 = __pyx_t_9;
  }
  __pyx_v_self->start = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":247
 *             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;
  if (((__pyx_t_10 > __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_10;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_v_self->end = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":237
 *         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, PyObject *__pyx_v_iv); /*proto*/
static char __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include[] = "Extend the interval such that it includes iv.";
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extend_to_include (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 237, __pyx_L1_error)
  __pyx_r = __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));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __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, 237, __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":249
 *         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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "HTSeq/_HTSeq.pyx":250
 * 
 *     def copy(self):
 *         return GenomicInterval(self.chrom, self.start, self.end, self.strand)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":249
 *         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_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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 5, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_1GenomicInterval_from_directional = {"GenomicInterval_from_directional", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chrom = 0;
  long __pyx_v_start_d;
  long __pyx_v_length;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GenomicInterval_from_directional (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start_d,&__pyx_n_s_length,&__pyx_n_s_strand,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject*)__pyx_kp_u__8);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, 1); __PYX_ERR(0, 253, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, 2); __PYX_ERR(0, 253, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "GenomicInterval_from_directional") < 0)) __PYX_ERR(0, 253, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_chrom = ((PyObject*)values[0]);
    __pyx_v_start_d = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_start_d == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
    __pyx_v_length = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_length == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 253, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 253, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 253, __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;
  __pyx_L0:;
  __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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("GenomicInterval_from_directional", 0);
  __Pyx_INCREF(__pyx_v_strand);

  /* "HTSeq/_HTSeq.pyx":254
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
 *     strand = intern(strand)             # <<<<<<<<<<<<<<
 *     if strand.se is not 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, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":255
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
 *     strand = intern(strand)
 *     if strand.se is not strand_minus:             # <<<<<<<<<<<<<<
 *         return GenomicInterval(chrom, start_d, start_d + length, strand)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_strand, __pyx_n_s_se); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":256
 *     strand = intern(strand)
 *     if strand.se is not 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_1 = __Pyx_PyInt_From_long(__pyx_v_start_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_start_d + __pyx_v_length)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

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

  /* "HTSeq/_HTSeq.pyx":258
 *         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_4 = __Pyx_PyInt_From_long(((__pyx_v_start_d - __pyx_v_length) + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_start_d + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_strand);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 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.se is not strand_minus:
 */

  /* 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.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":279
 *     """
 * 
 *     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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_pos,&__pyx_n_s_strand,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject*)__pyx_kp_u__8);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 279, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_chrom = ((PyObject*)values[0]);
    __pyx_v_pos = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_pos == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error)
    __pyx_v_strand = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 279, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 279, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 279, __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;
  __pyx_L0:;
  __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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":280
 * 
 *     def __init__(self, str chrom, long int pos, str strand='.'):
 *         GenomicInterval.__init__(self, chrom, pos, pos + 1, strand)             # <<<<<<<<<<<<<<
 * 
 *     property pos:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_v_strand};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_v_strand};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_strand);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":279
 *     """
 * 
 *     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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __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":288
 *         """
 * 
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":289
 * 
 *         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_n_s_start_d); 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
 *         """
 * 
 *         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":291
 *             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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_newValue); {
    __pyx_v_newValue = __Pyx_PyInt_As_long(__pyx_arg_newValue); if (unlikely((__pyx_v_newValue == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __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;
  __Pyx_RefNannySetupContext("__set__", 0);

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

  /* "HTSeq/_HTSeq.pyx":291
 *             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":296
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

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

  /* "HTSeq/_HTSeq.pyx":296
 *     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":301
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":302
 * 
 *         def __get__(self):
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_1);
  __pyx_r = __pyx_int_1;
  goto __pyx_L0;

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

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

/* "HTSeq/_HTSeq.pyx":304
 *             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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":305
 * 
 *     def __repr__(self):
 *         return "<%s object '%s':%d, strand '%s'>" % \             # <<<<<<<<<<<<<<
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);

  /* "HTSeq/_HTSeq.pyx":306
 *     def __repr__(self):
 *         return "<%s object '%s':%d, strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_object);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_object);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__9);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_strand_3);
  __pyx_t_2 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_strand_3);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_strand_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__5);

  /* "HTSeq/_HTSeq.pyx":305
 * 
 *     def __repr__(self):
 *         return "<%s object '%s':%d, strand '%s'>" % \             # <<<<<<<<<<<<<<
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
 * 
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __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":304
 *             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_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":308
 *             (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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "HTSeq/_HTSeq.pyx":309
 * 
 *     def __str__(self):
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(GenomicPosition self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__10);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__11);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__11);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__11);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __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":308
 *             (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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":311
 *         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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":312
 * 
 *     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_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.chrom);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":311
 *         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":314
 *         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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "HTSeq/_HTSeq.pyx":315
 * 
 *     def copy(self):
 *         return GenomicPosition(self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.chrom);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":314
 *         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_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
 * 
 *     @classmethod
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):             # <<<<<<<<<<<<<<
 *         ncv = cls()
 *         ncv.iv = iv
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iv,&__pyx_n_s_typecode,&__pyx_n_s_storage,&__pyx_n_s_memmap_dir,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject*)__pyx_kp_u__12);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typecode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, 1); __PYX_ERR(0, 327, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, 2); __PYX_ERR(0, 327, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memmap_dir);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 327, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 327, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 327, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typecode), (&PyUnicode_Type), 1, "typecode", 1))) __PYX_ERR(0, 327, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), (&PyUnicode_Type), 1, "storage", 1))) __PYX_ERR(0, 327, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memmap_dir), (&PyUnicode_Type), 1, "memmap_dir", 1))) __PYX_ERR(0, 327, __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;
  __pyx_L0:;
  __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;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("create", 0);

  /* "HTSeq/_HTSeq.pyx":328
 *     @classmethod
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         ncv = cls()             # <<<<<<<<<<<<<<
 *         ncv.iv = iv
 *         if storage == "ndarray":
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ncv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":329
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         ncv = cls()
 *         ncv.iv = iv             # <<<<<<<<<<<<<<
 *         if storage == "ndarray":
 *             if typecode != 'O':
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_iv, ((PyObject *)__pyx_v_iv)) < 0) __PYX_ERR(0, 329, __pyx_L1_error)

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

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

      /* "HTSeq/_HTSeq.pyx":332
 *         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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_typecode) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_6) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

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

    /* "HTSeq/_HTSeq.pyx":334
 *                 ncv.array = numpy.zeros(shape=(iv.length, ), dtype=typecode)
 *             else:
 *                 ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)             # <<<<<<<<<<<<<<
 *                 ncv.array[:] = None
 *         elif storage == "memmap":
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_v_typecode) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_5) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

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

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

  /* "HTSeq/_HTSeq.pyx":336
 *                 ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
 *                 ncv.array[:] = None
 *         elif storage == "memmap":             # <<<<<<<<<<<<<<
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_memmap, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":337
 *                 ncv.array[:] = None
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,             # <<<<<<<<<<<<<<
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 *         elif storage == "step":
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_memmap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_typecode) < 0) __PYX_ERR(0, 337, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":338
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')             # <<<<<<<<<<<<<<
 *         elif storage == "step":
 *             ncv.array = StepVector.StepVector.create(typecode=typecode)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_Add(__pyx_v_iv->chrom, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_u_nmm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_memmap_dir, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_memmap_dir, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_memmap_dir);
      __Pyx_GIVEREF(__pyx_v_memmap_dir);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_memmap_dir);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_filename, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_kp_u_w) < 0) __PYX_ERR(0, 337, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":337
 *                 ncv.array[:] = None
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,             # <<<<<<<<<<<<<<
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 *         elif storage == "step":
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":336
 *                 ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
 *                 ncv.array[:] = None
 *         elif storage == "memmap":             # <<<<<<<<<<<<<<
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":339
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 *         elif storage == "step":             # <<<<<<<<<<<<<<
 *             ncv.array = StepVector.StepVector.create(typecode=typecode)
 *         else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_step, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":340
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 *         elif storage == "step":
 *             ncv.array = StepVector.StepVector.create(typecode=typecode)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError, "Illegal storage mode."
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_StepVector); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepVector); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_create); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_typecode, __pyx_v_typecode) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_array, __pyx_t_6) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":339
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
 *                                      filename=os.path.join(memmap_dir, iv.chrom + iv.strand + ".nmm"), mode='w+')
 *         elif storage == "step":             # <<<<<<<<<<<<<<
 *             ncv.array = StepVector.StepVector.create(typecode=typecode)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":342
 *             ncv.array = StepVector.StepVector.create(typecode=typecode)
 *         else:
 *             raise ValueError, "Illegal storage mode."             # <<<<<<<<<<<<<<
 *         ncv._storage = storage
 *         # TODO: Test whether offset works properly
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Illegal_storage_mode, 0, 0);
    __PYX_ERR(0, 342, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":343
 *         else:
 *             raise ValueError, "Illegal storage mode."
 *         ncv._storage = storage             # <<<<<<<<<<<<<<
 *         # TODO: Test whether offset works properly
 *         ncv.offset = iv.start
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_storage_2, __pyx_v_storage) < 0) __PYX_ERR(0, 343, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":345
 *         ncv._storage = storage
 *         # TODO: Test whether offset works properly
 *         ncv.offset = iv.start             # <<<<<<<<<<<<<<
 *         ncv.is_vector_of_sets = False
 *         return ncv
 */
  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_offset, __pyx_t_6) < 0) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":346
 *         # TODO: Test whether offset works properly
 *         ncv.offset = iv.start
 *         ncv.is_vector_of_sets = False             # <<<<<<<<<<<<<<
 *         return ncv
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_n_s_is_vector_of_sets, Py_False) < 0) __PYX_ERR(0, 346, __pyx_L1_error)

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

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

  /* 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_10);
  __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":350
 * 
 *     @classmethod
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         if iv.length == 0:
 *             raise IndexError, "Cannot subset to zero-length interval."
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_view (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_iv,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_view", 1, 2, 2, 1); __PYX_ERR(0, 350, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_view") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_view", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_ChromVector, 1, "vec", 0))) __PYX_ERR(0, 350, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 350, __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;
  __pyx_L0:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("_create_view", 0);

  /* "HTSeq/_HTSeq.pyx":351
 *     @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_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":352
 *     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_Raise(__pyx_builtin_IndexError, __pyx_kp_u_Cannot_subset_to_zero_length_int, 0, 0);
    __PYX_ERR(0, 352, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":351
 *     @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":353
 *         if iv.length == 0:
 *             raise IndexError, "Cannot subset to zero-length interval."
 *         v = cls()             # <<<<<<<<<<<<<<
 *         v.iv = iv
 *         v.array = vec.array
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_v = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":354
 *             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_n_s_iv, ((PyObject *)__pyx_v_iv)) < 0) __PYX_ERR(0, 354, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":355
 *         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_2 = __pyx_v_vec->array;
  __Pyx_INCREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_array, __pyx_t_2) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":356
 *         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_2 = __Pyx_PyInt_From_int(__pyx_v_vec->offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_offset, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":357
 *         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_2 = __Pyx_PyBool_FromLong(__pyx_v_vec->is_vector_of_sets); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_n_s_is_vector_of_sets, __pyx_t_2) < 0) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":361
 *         return v
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         cdef slice index_slice
 *         cdef long int index_int
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_4__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_4__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;
  int __pyx_t_2;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":366
 *         cdef long int start, stop
 *         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 = PyInt_Check(__pyx_v_index); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

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

    /* "HTSeq/_HTSeq.pyx":368
 *         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_1 = ((__pyx_v_index_int < __pyx_v_self->iv->start) != 0);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_index_int >= __pyx_v_self->iv->end) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":369
 *             index_int = index
 *             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_Raise(__pyx_builtin_IndexError, 0, 0, 0);
      __PYX_ERR(0, 369, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":368
 *         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":370
 *             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):
 *             index_slice = index
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = (__pyx_v_index_int - __pyx_v_self->offset);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->array, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":366
 *         cdef long int start, stop
 *         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":371
 *                 raise IndexError
 *             return self.array[index_int - self.offset]
 *         elif isinstance(index, slice):             # <<<<<<<<<<<<<<
 *             index_slice = index
 *             if index_slice.start is not None:
 */
  __pyx_t_2 = PySlice_Check(__pyx_v_index); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":372
 *             return self.array[index_int - self.offset]
 *         elif isinstance(index, slice):
 *             index_slice = index             # <<<<<<<<<<<<<<
 *             if index_slice.start is not None:
 *                 start = index_slice.start
 */
    if (!(likely(PySlice_Check(__pyx_v_index))||((__pyx_v_index) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_index)->tp_name), 0))) __PYX_ERR(0, 372, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_index;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_index_slice = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":373
 *         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_1 = (((PySliceObject*)__pyx_v_index_slice)->start != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":374
 *             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_3 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->start); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
      __pyx_v_start = __pyx_t_3;

      /* "HTSeq/_HTSeq.pyx":375
 *             if index_slice.start is not None:
 *                 start = index_slice.start
 *                 if start < self.iv.start:             # <<<<<<<<<<<<<<
 *                     raise IndexError, "start too small"
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_start < __pyx_v_self->iv->start) != 0);
      if (unlikely(__pyx_t_2)) {

        /* "HTSeq/_HTSeq.pyx":376
 *                 start = index_slice.start
 *                 if start < self.iv.start:
 *                     raise IndexError, "start too small"             # <<<<<<<<<<<<<<
 *             else:
 *                 start = self.iv.start
 */
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_start_too_small, 0, 0);
        __PYX_ERR(0, 376, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":375
 *             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":373
 *         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_L7;
    }

    /* "HTSeq/_HTSeq.pyx":378
 *                     raise IndexError, "start too small"
 *             else:
 *                 start = self.iv.start             # <<<<<<<<<<<<<<
 *             if index_slice.stop is not None:
 *                 stop = index_slice.stop
 */
    /*else*/ {
      __pyx_t_3 = __pyx_v_self->iv->start;
      __pyx_v_start = __pyx_t_3;
    }
    __pyx_L7:;

    /* "HTSeq/_HTSeq.pyx":379
 *             else:
 *                 start = self.iv.start
 *             if index_slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 */
    __pyx_t_2 = (((PySliceObject*)__pyx_v_index_slice)->stop != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":380
 *                 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_3 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->stop); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
      __pyx_v_stop = __pyx_t_3;

      /* "HTSeq/_HTSeq.pyx":381
 *             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) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "HTSeq/_HTSeq.pyx":382
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 *                     raise IndexError, "stop too large"             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = self.iv.end
 */
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_stop_too_large, 0, 0);
        __PYX_ERR(0, 382, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":381
 *             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":379
 *             else:
 *                 start = self.iv.start
 *             if index_slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 */
      goto __pyx_L9;
    }

    /* "HTSeq/_HTSeq.pyx":384
 *                     raise IndexError, "stop too large"
 *             else:
 *                 stop = self.iv.end             # <<<<<<<<<<<<<<
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
 *             if not self.iv.contains(iv):
 */
    /*else*/ {
      __pyx_t_3 = __pyx_v_self->iv->end;
      __pyx_v_stop = __pyx_t_3;
    }
    __pyx_L9:;

    /* "HTSeq/_HTSeq.pyx":385
 *             else:
 *                 stop = self.iv.end
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)             # <<<<<<<<<<<<<<
 *             if not self.iv.contains(iv):
 *                 raise IndexError
 */
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_self->iv->chrom);
    __Pyx_GIVEREF(__pyx_v_self->iv->chrom);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->iv->chrom);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":386
 *                 stop = self.iv.end
 *             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_6 = ((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_6)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = ((!__pyx_t_1) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":387
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
 *             if not self.iv.contains(iv):
 *                 raise IndexError             # <<<<<<<<<<<<<<
 *             return ChromVector._create_view(self, iv)
 *         elif isinstance(index, GenomicInterval):
 */
      __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
      __PYX_ERR(0, 387, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":386
 *                 stop = self.iv.end
 *             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":388
 *             if not self.iv.contains(iv):
 *                 raise IndexError
 *             return ChromVector._create_view(self, iv)             # <<<<<<<<<<<<<<
 *         elif isinstance(index, GenomicInterval):
 *             if not self.iv.contains(index):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(((PyObject *)__pyx_v_iv));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)__pyx_v_iv));
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

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

  /* "HTSeq/_HTSeq.pyx":389
 *                 raise IndexError
 *             return ChromVector._create_view(self, iv)
 *         elif isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if not self.iv.contains(index):
 *                 raise IndexError
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":390
 *             return ChromVector._create_view(self, iv)
 *         elif isinstance(index, GenomicInterval):
 *             if not self.iv.contains(index):             # <<<<<<<<<<<<<<
 *                 raise IndexError
 *             if self.iv.strand is strand_nostrand and \
 */
    if (!(likely(((__pyx_v_index) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 390, __pyx_L1_error)
    __pyx_t_6 = ((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_6)) __PYX_ERR(0, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = ((!__pyx_t_1) != 0);
    if (unlikely(__pyx_t_2)) {

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

      /* "HTSeq/_HTSeq.pyx":390
 *             return ChromVector._create_view(self, iv)
 *         elif isinstance(index, GenomicInterval):
 *             if not self.iv.contains(index):             # <<<<<<<<<<<<<<
 *                 raise IndexError
 *             if self.iv.strand is strand_nostrand and \
 */
    }

    /* "HTSeq/_HTSeq.pyx":392
 *             if not self.iv.contains(index):
 *                 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = (__pyx_t_6 == __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = (__pyx_t_1 != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_2 = __pyx_t_9;
      goto __pyx_L14_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":393
 *                 raise IndexError
 *             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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = (__pyx_t_6 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = (__pyx_t_9 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L14_bool_binop_done:;

    /* "HTSeq/_HTSeq.pyx":392
 *             if not self.iv.contains(index):
 *                 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_2) {

      /* "HTSeq/_HTSeq.pyx":394
 *             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
 *             return ChromVector._create_view(self, iv)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 394, __pyx_L1_error)
      __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":395
 *                     index.strand is not strand_nostrand:
 *                 iv = index.copy()   # Is this correct now?
 *                 iv.strand = strand_nostrand             # <<<<<<<<<<<<<<
 *             return ChromVector._create_view(self, iv)
 *         else:
 */
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_strand, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand) < 0) __PYX_ERR(0, 395, __pyx_L1_error)

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

    /* "HTSeq/_HTSeq.pyx":396
 *                 iv = index.copy()   # Is this correct now?
 *                 iv.strand = strand_nostrand
 *             return ChromVector._create_view(self, iv)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError, "Illegal index type"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(!__pyx_v_iv)) { __Pyx_RaiseUnboundLocalError("iv"); __PYX_ERR(0, 396, __pyx_L1_error) }
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(((PyObject *)__pyx_v_iv));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)__pyx_v_iv));
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

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

  /* "HTSeq/_HTSeq.pyx":398
 *             return ChromVector._create_view(self, iv)
 *         else:
 *             raise TypeError, "Illegal index type"             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Illegal_index_type, 0, 0);
    __PYX_ERR(0, 398, __pyx_L1_error)
  }

  /* "HTSeq/_HTSeq.pyx":361
 *         return v
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         cdef slice index_slice
 *         cdef long int index_int
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_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":400
 *             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_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__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_6__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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "HTSeq/_HTSeq.pyx":403
 *         cdef slice index_slice
 *         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_ptype_5HTSeq_6_HTSeq_ChromVector); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":404
 *         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):
 *                 return
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__pyx_v_self->array == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__pyx_t_1 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_iv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":405
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__pyx_t_5 == Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = (__pyx_t_4 != 0);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L5_bool_binop_done:;

    /* "HTSeq/_HTSeq.pyx":404
 *         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):
 *                 return
 */
    if (likely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":406
 *             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, "Required assignment signature not yet implemented."
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":404
 *         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):
 *                 return
 */
    }

    /* "HTSeq/_HTSeq.pyx":408
 *                 return
 *             else:
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."             # <<<<<<<<<<<<<<
 *         if isinstance(index, int):
 *             self.array[index - self.iv.start] = value
 */
    /*else*/ {
      __Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_kp_u_Required_assignment_signature_no, 0, 0);
      __PYX_ERR(0, 408, __pyx_L1_error)
    }

    /* "HTSeq/_HTSeq.pyx":403
 *         cdef slice index_slice
 *         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":409
 *             else:
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 *         if isinstance(index, int):             # <<<<<<<<<<<<<<
 *             self.array[index - self.iv.start] = value
 *         elif isinstance(index, slice):
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_index); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":410
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 *         if isinstance(index, int):
 *             self.array[index - self.iv.start] = value             # <<<<<<<<<<<<<<
 *         elif isinstance(index, slice):
 *             index_slice = index
 */
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_index, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_self->array, __pyx_t_5, __pyx_v_value) < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":409
 *             else:
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 *         if isinstance(index, int):             # <<<<<<<<<<<<<<
 *             self.array[index - self.iv.start] = value
 *         elif isinstance(index, slice):
 */
    goto __pyx_L10;
  }

  /* "HTSeq/_HTSeq.pyx":411
 *         if isinstance(index, int):
 *             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); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":412
 *             self.array[index - self.iv.start] = value
 *         elif isinstance(index, slice):
 *             index_slice = index             # <<<<<<<<<<<<<<
 *             if index_slice.start is not None:
 *                 start = index_slice.start
 */
    if (!(likely(PySlice_Check(__pyx_v_index))||((__pyx_v_index) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_index)->tp_name), 0))) __PYX_ERR(0, 412, __pyx_L1_error)
    __pyx_t_5 = __pyx_v_index;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_index_slice = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":413
 *         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_2 = (((PySliceObject*)__pyx_v_index_slice)->start != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":414
 *             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_7 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->start); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 414, __pyx_L1_error)
      __pyx_v_start = __pyx_t_7;

      /* "HTSeq/_HTSeq.pyx":415
 *             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) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "HTSeq/_HTSeq.pyx":416
 *                 start = index_slice.start
 *                 if start < self.iv.start:
 *                     raise IndexError, "start too small"             # <<<<<<<<<<<<<<
 *             else:
 *                 start = self.iv.start
 */
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_start_too_small, 0, 0);
        __PYX_ERR(0, 416, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":415
 *             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":413
 *         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":418
 *                     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":419
 *             else:
 *                 start = self.iv.start
 *             if index_slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 */
    __pyx_t_1 = (((PySliceObject*)__pyx_v_index_slice)->stop != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":420
 *                 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_7 = __Pyx_PyInt_As_long(((PySliceObject*)__pyx_v_index_slice)->stop); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error)
      __pyx_v_stop = __pyx_t_7;

      /* "HTSeq/_HTSeq.pyx":421
 *             if index_slice.stop is not None:
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:             # <<<<<<<<<<<<<<
 *                     raise IndexError, "stop too large"
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_stop > __pyx_v_self->iv->end) != 0);
      if (unlikely(__pyx_t_2)) {

        /* "HTSeq/_HTSeq.pyx":422
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 *                     raise IndexError, "stop too large"             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = self.iv.end
 */
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_stop_too_large, 0, 0);
        __PYX_ERR(0, 422, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":421
 *             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":419
 *             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":424
 *                     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":425
 *             else:
 *                 stop = self.iv.end
 *             if start > stop:             # <<<<<<<<<<<<<<
 *                 raise IndexError, "Start of interval is after its end."
 *             if start == stop:
 */
    __pyx_t_2 = ((__pyx_v_start > __pyx_v_stop) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":426
 *                 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_Raise(__pyx_builtin_IndexError, __pyx_kp_u_Start_of_interval_is_after_its_e, 0, 0);
      __PYX_ERR(0, 426, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":425
 *             else:
 *                 stop = self.iv.end
 *             if start > stop:             # <<<<<<<<<<<<<<
 *                 raise IndexError, "Start of interval is after its end."
 *             if start == stop:
 */
    }

    /* "HTSeq/_HTSeq.pyx":427
 *             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_2 = ((__pyx_v_start == __pyx_v_stop) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":428
 *                 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_Raise(__pyx_builtin_IndexError, __pyx_kp_u_Cannot_assign_to_zero_length_int, 0, 0);
      __PYX_ERR(0, 428, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":427
 *             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":429
 *             if start == stop:
 *                 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_5 = __Pyx_PyInt_From_long((__pyx_v_start - __pyx_v_self->offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "HTSeq/_HTSeq.pyx":430
 *                 raise IndexError, "Cannot assign to zero-length interval."
 *             self.array[start - self.offset: stop -
 *                        self.iv.start: index.step] = value             # <<<<<<<<<<<<<<
 *         elif isinstance(index, GenomicInterval):
 *             if index.chrom != self.iv.chrom:
 */
    __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_stop - __pyx_v_self->iv->start)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "HTSeq/_HTSeq.pyx":429
 *             if start == stop:
 *                 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_8 = PySlice_New(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_self->array, __pyx_t_8, __pyx_v_value) < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "HTSeq/_HTSeq.pyx":411
 *         if isinstance(index, int):
 *             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":431
 *             self.array[start - self.offset: stop -
 *                        self.iv.start: index.step] = value
 *         elif isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError, "Chromosome name mismatch."
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":432
 *                        self.iv.start: index.step] = value
 *         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_n_s_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __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, 432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":433
 *         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_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Chromosome_name_mismatch, 0, 0);
      __PYX_ERR(0, 433, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":432
 *                        self.iv.start: index.step] = value
 *         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":434
 *             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_n_s_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = (__pyx_t_8 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_4 = (__pyx_t_2 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L19_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":435
 *                 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_n_s_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__pyx_t_8 != __pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = (__pyx_t_4 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;

    /* "HTSeq/_HTSeq.pyx":434
 *             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":436
 *             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_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Strand_mismatch, 0, 0);
      __PYX_ERR(0, 436, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":434
 *             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":437
 *                     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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":438
 *                 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":437
 *                     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_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_self->array, __pyx_t_6, __pyx_v_value) < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":431
 *             self.array[start - self.offset: stop -
 *                        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":440
 *                        index.iv.end - self.iv.start] = value
 *         else:
 *             raise TypeError, "Illegal index type"             # <<<<<<<<<<<<<<
 * 
 *     def __iadd__(self, value):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Illegal_index_type, 0, 0);
    __PYX_ERR(0, 440, __pyx_L1_error)
  }
  __pyx_L10:;

  /* "HTSeq/_HTSeq.pyx":400
 *             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_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":442
 *             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_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__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":447
 *                        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, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval = {"addval", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval, METH_O, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addval (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(__pyx_self, ((PyObject *)__pyx_v_x));

  /* function exit code */
  __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;
  PyObject *__pyx_t_3 = NULL;
  __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":448
 *         else:
 *             def addval(x):
 *                 y = x.copy()             # <<<<<<<<<<<<<<
 *                 y.add(value)
 *                 return y
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":449
 *             def addval(x):
 *                 y = x.copy()
 *                 y.add(value)             # <<<<<<<<<<<<<<
 *                 return y
 *             self.apply(addval)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 449, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_value);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":450
 *                 y = x.copy()
 *                 y.add(value)
 *                 return y             # <<<<<<<<<<<<<<
 *             self.apply(addval)
 *         return self
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_y);
  __pyx_r = __pyx_v_y;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":447
 *                        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_XDECREF(__pyx_t_3);
  __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":442
 *             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_8__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;
  __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_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, __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, 442, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__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":443
 * 
 *     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 != 0)) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":444
 *     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_3 = __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_3)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "HTSeq/_HTSeq.pyx":445
 *         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_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iadd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_cur_scope->__pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":443
 * 
 *     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":447
 *                        self.offset].__iadd__(value)
 *         else:
 *             def addval(x):             # <<<<<<<<<<<<<<
 *                 y = x.copy()
 *                 y.add(value)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval, 0, __pyx_n_s_iadd___locals_addval, ((PyObject*)__pyx_cur_scope), __pyx_n_s_HTSeq__HTSeq, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_addval = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":451
 *                 y.add(value)
 *                 return y
 *             self.apply(addval)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_addval) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_addval);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":452
 *                 return y
 *             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":442
 *             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":454
 *         return self
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.values()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__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_10__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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "HTSeq/_HTSeq.pyx":455
 * 
 *     def __iter__(self):
 *         return self.values()             # <<<<<<<<<<<<<<
 * 
 *     def values(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":454
 *         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_XDECREF(__pyx_t_3);
  __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":457
 *         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_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12values(((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_12values(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;
  __Pyx_RefNannySetupContext("values", 0);

  /* "HTSeq/_HTSeq.pyx":458
 * 
 *     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, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __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":457
 *         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":460
 *         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_15steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("steps (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14steps(((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_14steps(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;
  __Pyx_RefNannySetupContext("steps", 0);

  /* "HTSeq/_HTSeq.pyx":461
 * 
 *     def steps(self):
 *         return _HTSeq_internal.ChromVector_steps(self)             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, fun):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ChromVector_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":460
 *         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_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":463
 *         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_17apply(PyObject *__pyx_v_self, PyObject *__pyx_v_fun); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17apply(PyObject *__pyx_v_self, PyObject *__pyx_v_fun) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16apply(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_fun));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16apply(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;
  PyObject *__pyx_t_3 = NULL;
  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)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("apply", 0);

  /* "HTSeq/_HTSeq.pyx":464
 * 
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_steps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __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))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 464, __pyx_L1_error)
        }
        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, 464, __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_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 464, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":466
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -
 *                        self.offset] = fun(value)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __Pyx_INCREF(__pyx_v_fun);
    __pyx_t_6 = __pyx_v_fun; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":465
 *     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_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "HTSeq/_HTSeq.pyx":466
 *         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_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "HTSeq/_HTSeq.pyx":465
 *     def apply(self, fun):
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -             # <<<<<<<<<<<<<<
 *                        self.offset] = fun(value)
 * 
 */
    __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_7, &__pyx_t_9, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":464
 * 
 *     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":463
 *         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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __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":468
 *                        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_19__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18__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_18__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":469
 * 
 *     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 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_object_2);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_object_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object_2);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->iv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__16);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__16);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__16);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->_storage); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__17);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__17);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __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":468
 *                        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_4);
  __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":471
 *         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_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__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_20__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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":472
 * 
 *     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(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 == ((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!(__pyx_t_2 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 472, __pyx_L1_error)
    }
  }
  #endif

  /* "HTSeq/_HTSeq.pyx":473
 *     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_n_s_ChromVector_unpickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "HTSeq/_HTSeq.pyx":474
 *         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_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __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, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->array);
  __Pyx_GIVEREF(__pyx_v_self->array);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->array);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->iv));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->iv));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->_storage);
  __Pyx_GIVEREF(__pyx_v_self->_storage);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->_storage);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":473
 *     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, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":471
 *         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":320
 * cdef class ChromVector(object):
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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":321
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 321, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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":322
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset); 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.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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __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:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":323
 *     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_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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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, 323, __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __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:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":324
 *     cdef public int offset
 *     cdef public bint is_vector_of_sets
 *     cdef public str _storage             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */

/* 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 324, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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":477
 * 
 * 
 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_3_ChromVector_unpickle = {"_ChromVector_unpickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ChromVector_unpickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_iv,&__pyx_n_s_offset,&__pyx_n_s_is_vector_of_sets,&__pyx_n_s_storage_2,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 1); __PYX_ERR(0, 477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 2); __PYX_ERR(0, 477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_vector_of_sets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 3); __PYX_ERR(0, 477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, 4); __PYX_ERR(0, 477, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ChromVector_unpickle") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("_ChromVector_unpickle", 0);

  /* "HTSeq/_HTSeq.pyx":478
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):
 *     cv = ChromVector()             # <<<<<<<<<<<<<<
 *     cv.array = array
 *     cv.iv = iv
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cv = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":479
 * 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":480
 *     cv = ChromVector()
 *     cv.array = array
 *     cv.iv = iv             # <<<<<<<<<<<<<<
 *     cv.offset = offset
 *     cv.is_vector_of_sets = is_vector_of_sets
 */
  if (!(likely(((__pyx_v_iv) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_iv, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 480, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_iv;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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":481
 *     cv.array = array
 *     cv.iv = iv
 *     cv.offset = offset             # <<<<<<<<<<<<<<
 *     cv.is_vector_of_sets = is_vector_of_sets
 *     cv._storage = _storage
 */
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_offset); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L1_error)
  __pyx_v_cv->offset = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":482
 *     cv.iv = iv
 *     cv.offset = offset
 *     cv.is_vector_of_sets = is_vector_of_sets             # <<<<<<<<<<<<<<
 *     cv._storage = _storage
 *     return cv
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_vector_of_sets); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L1_error)
  __pyx_v_cv->is_vector_of_sets = __pyx_t_3;

  /* "HTSeq/_HTSeq.pyx":483
 *     cv.offset = offset
 *     cv.is_vector_of_sets = is_vector_of_sets
 *     cv._storage = _storage             # <<<<<<<<<<<<<<
 *     return cv
 * 
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v__storage))||((__pyx_v__storage) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v__storage)->tp_name), 0))) __PYX_ERR(0, 483, __pyx_L1_error)
  __pyx_t_1 = __pyx_v__storage;
  __Pyx_INCREF(__pyx_t_1);
  __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":484
 *     cv.is_vector_of_sets = is_vector_of_sets
 *     cv._storage = _storage
 *     return cv             # <<<<<<<<<<<<<<
 * 
 * cdef class GenomicArray(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_cv));
  __pyx_r = ((PyObject *)__pyx_v_cv);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":477
 * 
 * 
 * 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_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":495
 *     cdef readonly str memmap_dir
 * 
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',             # <<<<<<<<<<<<<<
 *                  str storage='step', str memmap_dir=""):
 *         self.chrom_vectors = {}
 */

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chroms,&__pyx_n_s_stranded,&__pyx_n_s_typecode,&__pyx_n_s_storage,&__pyx_n_s_memmap_dir,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject*)__pyx_n_u_d);
    values[3] = ((PyObject*)__pyx_n_u_step);
    values[4] = ((PyObject*)__pyx_kp_u__12);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chroms)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stranded);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typecode);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memmap_dir);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 495, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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, 495, __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]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 495, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 495, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), (&PyUnicode_Type), 1, "storage", 1))) __PYX_ERR(0, 496, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memmap_dir), (&PyUnicode_Type), 1, "memmap_dir", 1))) __PYX_ERR(0, 496, __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);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __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_chrom = NULL;
  PyObject *__pyx_7genexpr__pyx_v_c = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_chroms);

  /* "HTSeq/_HTSeq.pyx":497
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',
 *                  str storage='step', str memmap_dir=""):
 *         self.chrom_vectors = {}             # <<<<<<<<<<<<<<
 *         self.stranded = stranded
 *         self.typecode = typecode
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __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":498
 *                  str storage='step', str memmap_dir=""):
 *         self.chrom_vectors = {}
 *         self.stranded = stranded             # <<<<<<<<<<<<<<
 *         self.typecode = typecode
 *         self.auto_add_chroms = chroms == "auto"
 */
  __pyx_v_self->stranded = __pyx_v_stranded;

  /* "HTSeq/_HTSeq.pyx":499
 *         self.chrom_vectors = {}
 *         self.stranded = stranded
 *         self.typecode = typecode             # <<<<<<<<<<<<<<
 *         self.auto_add_chroms = chroms == "auto"
 *         if self.auto_add_chroms:
 */
  __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":500
 *         self.stranded = stranded
 *         self.typecode = typecode
 *         self.auto_add_chroms = chroms == "auto"             # <<<<<<<<<<<<<<
 *         if self.auto_add_chroms:
 *             chroms = []
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_chroms, __pyx_n_u_auto, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->auto_add_chroms = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":501
 *         self.typecode = typecode
 *         self.auto_add_chroms = chroms == "auto"
 *         if self.auto_add_chroms:             # <<<<<<<<<<<<<<
 *             chroms = []
 *             if storage != 'step':
 */
  __pyx_t_2 = (__pyx_v_self->auto_add_chroms != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":502
 *         self.auto_add_chroms = chroms == "auto"
 *         if self.auto_add_chroms:
 *             chroms = []             # <<<<<<<<<<<<<<
 *             if storage != 'step':
 *                 raise TypeError, "Automatic adding of chromosomes can " + \
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_chroms, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":503
 *         if self.auto_add_chroms:
 *             chroms = []
 *             if storage != 'step':             # <<<<<<<<<<<<<<
 *                 raise TypeError, "Automatic adding of chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_step, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "HTSeq/_HTSeq.pyx":504
 *             chroms = []
 *             if storage != 'step':
 *                 raise TypeError, "Automatic adding of chromosomes can " + \             # <<<<<<<<<<<<<<
 *                     " only be used with storage type 'StepVector'."
 *         elif isinstance(chroms, list):
 */
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Automatic_adding_of_chromosomes, 0, 0);
      __PYX_ERR(0, 504, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":503
 *         if self.auto_add_chroms:
 *             chroms = []
 *             if storage != 'step':             # <<<<<<<<<<<<<<
 *                 raise TypeError, "Automatic adding of chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 */
    }

    /* "HTSeq/_HTSeq.pyx":501
 *         self.typecode = typecode
 *         self.auto_add_chroms = chroms == "auto"
 *         if self.auto_add_chroms:             # <<<<<<<<<<<<<<
 *             chroms = []
 *             if storage != 'step':
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":506
 *                 raise TypeError, "Automatic adding of chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 *         elif isinstance(chroms, list):             # <<<<<<<<<<<<<<
 *             if storage != 'step':
 *                 raise TypeError, "Indefinite-length chromosomes can " + \
 */
  __pyx_t_3 = PyList_Check(__pyx_v_chroms); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":507
 *                     " only be used with storage type 'StepVector'."
 *         elif isinstance(chroms, list):
 *             if storage != 'step':             # <<<<<<<<<<<<<<
 *                 raise TypeError, "Indefinite-length chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_n_u_step, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "HTSeq/_HTSeq.pyx":508
 *         elif isinstance(chroms, list):
 *             if storage != 'step':
 *                 raise TypeError, "Indefinite-length chromosomes can " + \             # <<<<<<<<<<<<<<
 *                     " only be used with storage type 'StepVector'."
 *             chroms = dict([(c, sys.maxsize) for c in chroms])
 */
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Indefinite_length_chromosomes_ca, 0, 0);
      __PYX_ERR(0, 508, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":507
 *                     " only be used with storage type 'StepVector'."
 *         elif isinstance(chroms, list):
 *             if storage != 'step':             # <<<<<<<<<<<<<<
 *                 raise TypeError, "Indefinite-length chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 */
    }

    /* "HTSeq/_HTSeq.pyx":510
 *                 raise TypeError, "Indefinite-length chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 *             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'."
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_chroms)) || PyTuple_CheckExact(__pyx_v_chroms)) {
        __pyx_t_4 = __pyx_v_chroms; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_chroms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L8_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 510, __pyx_L8_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 510, __pyx_L8_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 510, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_c, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L8_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, 510, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_7genexpr__pyx_v_c);
        __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_7genexpr__pyx_v_c);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
        __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 510, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_chroms, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":506
 *                 raise TypeError, "Automatic adding of chromosomes can " + \
 *                     " only be used with storage type 'StepVector'."
 *         elif isinstance(chroms, list):             # <<<<<<<<<<<<<<
 *             if storage != 'step':
 *                 raise TypeError, "Indefinite-length chromosomes can " + \
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":511
 *                     " only be used with storage type 'StepVector'."
 *             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'."
 *         self.storage = storage
 */
  __pyx_t_3 = PyDict_Check(__pyx_v_chroms); 
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":512
 *             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'."             # <<<<<<<<<<<<<<
 *         self.storage = storage
 *         self.memmap_dir = memmap_dir
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_chroms_must_be_a_list_or_a_dict, 0, 0);
    __PYX_ERR(0, 512, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":511
 *                     " only be used with storage type 'StepVector'."
 *             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'."
 *         self.storage = storage
 */
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":513
 *         elif not isinstance(chroms, dict):
 *             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":514
 *             raise TypeError, "'chroms' must be a list or a dict or 'auto'."
 *         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":516
 *         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_4 = __pyx_v_chroms; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_chroms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 516, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":517
 * 
 *         for chrom in chroms:
 *             self.add_chrom(chrom, chroms[chrom])             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_chroms, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_chrom, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_chrom, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":516
 *         self.memmap_dir = memmap_dir
 * 
 *         for chrom in chroms:             # <<<<<<<<<<<<<<
 *             self.add_chrom(chrom, chroms[chrom])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":495
 *     cdef readonly str memmap_dir
 * 
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',             # <<<<<<<<<<<<<<
 *                  str storage='step', str memmap_dir=""):
 *         self.chrom_vectors = {}
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __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":519
 *             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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":520
 * 
 *     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."
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":521
 *     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 self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 */
    __pyx_t_1 = (__pyx_v_self->stranded != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_4;
    __pyx_L7_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__pyx_t_1 != 0);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":522
 *         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 self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)
 */
      __Pyx_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Non_stranded_index_used_for_stra, 0, 0);
      __PYX_ERR(0, 522, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":521
 *     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 self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 */
    }

    /* "HTSeq/_HTSeq.pyx":523
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError, "Non-stranded index used for stranded GenomicArray."
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 self.add_chrom(index.chrom)
 *             if isinstance(index, GenomicPosition):
 */
    __pyx_t_4 = (__pyx_v_self->auto_add_chroms != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 523, __pyx_L1_error)
    }
    __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_self->chrom_vectors, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_4 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":524
 *                 raise KeyError, "Non-stranded index used for stranded GenomicArray."
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)             # <<<<<<<<<<<<<<
 *             if isinstance(index, GenomicPosition):
 *                 if self.stranded:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":523
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError, "Non-stranded index used for stranded GenomicArray."
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 self.add_chrom(index.chrom)
 *             if isinstance(index, GenomicPosition):
 */
    }

    /* "HTSeq/_HTSeq.pyx":525
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)
 *             if isinstance(index, GenomicPosition):             # <<<<<<<<<<<<<<
 *                 if self.stranded:
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":526
 *                 self.add_chrom(index.chrom)
 *             if isinstance(index, GenomicPosition):
 *                 if self.stranded:             # <<<<<<<<<<<<<<
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
 *                 else:
 */
      __pyx_t_1 = (__pyx_v_self->stranded != 0);
      if (__pyx_t_1) {

        /* "HTSeq/_HTSeq.pyx":527
 *             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, 527, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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":526
 *                 self.add_chrom(index.chrom)
 *             if isinstance(index, GenomicPosition):
 *                 if self.stranded:             # <<<<<<<<<<<<<<
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
 *                 else:
 */
      }

      /* "HTSeq/_HTSeq.pyx":529
 *                     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, 529, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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":525
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 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":531
 *                     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*/ {
      __pyx_t_1 = (__pyx_v_self->stranded != 0);
      if (__pyx_t_1) {

        /* "HTSeq/_HTSeq.pyx":532
 *             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, 532, __pyx_L1_error)
        }
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_6, &__pyx_t_3, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "HTSeq/_HTSeq.pyx":531
 *                     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":534
 *                     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, 534, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, 0, &__pyx_t_3, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;
      }
    }

    /* "HTSeq/_HTSeq.pyx":520
 * 
 *     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":536
 *                     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, 536, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":519
 *             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_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":538
 *             return self.chrom_vectors[index]
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval index2
 *         if isinstance(value, ChromVector):
 */

/* 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "HTSeq/_HTSeq.pyx":540
 *     def __setitem__(self, index, value):
 *         cdef GenomicInterval index2
 *         if isinstance(value, ChromVector):             # <<<<<<<<<<<<<<
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_ChromVector); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":541
 *         cdef GenomicInterval index2
 *         if isinstance(value, ChromVector):
 *             if not isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 *             index2 = index.copy()
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":542
 *         if isinstance(value, ChromVector):
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."             # <<<<<<<<<<<<<<
 *             index2 = index.copy()
 *             if not self.stranded:
 */
      __Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_kp_u_Required_assignment_signature_no, 0, 0);
      __PYX_ERR(0, 542, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":541
 *         cdef GenomicInterval index2
 *         if isinstance(value, ChromVector):
 *             if not isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 *             index2 = index.copy()
 */
    }

    /* "HTSeq/_HTSeq.pyx":543
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 *             index2 = index.copy()             # <<<<<<<<<<<<<<
 *             if not self.stranded:
 *                 index2.strand = strand_nostrand
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 543, __pyx_L1_error)
    __pyx_v_index2 = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":544
 *                 raise NotImplementedError, "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_1 = ((!(__pyx_v_self->stranded != 0)) != 0);
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":545
 *             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_n_s_strand, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand) < 0) __PYX_ERR(0, 545, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":544
 *                 raise NotImplementedError, "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":546
 *             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, "Required assignment signature not yet implemented."
 */
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 546, __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, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_index2), __pyx_n_s_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = (__pyx_t_4 == __pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = (__pyx_t_2 != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_1 = __pyx_t_6;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_iv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_index2), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_6;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":547
 *                 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."
 *         if isinstance(index, GenomicInterval):
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":546
 *             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, "Required assignment signature not yet implemented."
 */
    }

    /* "HTSeq/_HTSeq.pyx":548
 *             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."             # <<<<<<<<<<<<<<
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_kp_u_Required_assignment_signature_no, 0, 0);
    __PYX_ERR(0, 548, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":540
 *     def __setitem__(self, index, value):
 *         cdef GenomicInterval index2
 *         if isinstance(value, ChromVector):             # <<<<<<<<<<<<<<
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError, "Required assignment signature not yet implemented."
 */
  }

  /* "HTSeq/_HTSeq.pyx":549
 *                 return
 *             raise NotImplementedError, "Required assignment signature not yet implemented."
 *         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_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":550
 *             raise NotImplementedError, "Required assignment signature not yet implemented."
 *         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 self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 */
    __pyx_t_1 = (__pyx_v_self->stranded != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_6 = __pyx_t_1;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L13_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    __pyx_t_6 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    if (unlikely(__pyx_t_6)) {

      /* "HTSeq/_HTSeq.pyx":551
 *         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 self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)
 */
      __Pyx_Raise(__pyx_builtin_KeyError, __pyx_kp_u_Non_stranded_index_used_for_stra, 0, 0);
      __PYX_ERR(0, 551, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":550
 *             raise NotImplementedError, "Required assignment signature not yet implemented."
 *         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 self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 */
    }

    /* "HTSeq/_HTSeq.pyx":552
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError, "Non-stranded index used for stranded GenomicArray."
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 self.add_chrom(index.chrom)
 *             if self.stranded:
 */
    __pyx_t_2 = (__pyx_v_self->auto_add_chroms != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_6 = __pyx_t_2;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __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, 552, __pyx_L1_error)
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_4, __pyx_v_self->chrom_vectors, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    __pyx_t_6 = __pyx_t_1;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_6) {

      /* "HTSeq/_HTSeq.pyx":553
 *                 raise KeyError, "Non-stranded index used for stranded GenomicArray."
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)             # <<<<<<<<<<<<<<
 *             if self.stranded:
 *                 self.chrom_vectors[index.chrom][index.strand][
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":552
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError, "Non-stranded index used for stranded GenomicArray."
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 self.add_chrom(index.chrom)
 *             if self.stranded:
 */
    }

    /* "HTSeq/_HTSeq.pyx":554
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)
 *             if self.stranded:             # <<<<<<<<<<<<<<
 *                 self.chrom_vectors[index.chrom][index.strand][
 *                     index.start: index.end] = value
 */
    __pyx_t_6 = (__pyx_v_self->stranded != 0);
    if (__pyx_t_6) {

      /* "HTSeq/_HTSeq.pyx":555
 *                 self.add_chrom(index.chrom)
 *             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, 555, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":556
 *             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_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetSlice(__pyx_t_3, __pyx_v_value, 0, 0, &__pyx_t_4, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
      __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;

      /* "HTSeq/_HTSeq.pyx":554
 *             if self.auto_add_chroms and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)
 *             if self.stranded:             # <<<<<<<<<<<<<<
 *                 self.chrom_vectors[index.chrom][index.strand][
 *                     index.start: index.end] = value
 */
      goto __pyx_L18;
    }

    /* "HTSeq/_HTSeq.pyx":559
 *             else:
 *                 self.chrom_vectors[index.chrom][strand_nostrand][
 *                     index.start: index.end] = value             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError, "Illegal index type."
 */
    /*else*/ {

      /* "HTSeq/_HTSeq.pyx":558
 *                     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, 558, __pyx_L1_error)
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":559
 *             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_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_PyObject_SetSlice(__pyx_t_5, __pyx_v_value, 0, 0, &__pyx_t_4, &__pyx_t_3, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
      __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;
    }
    __pyx_L18:;

    /* "HTSeq/_HTSeq.pyx":549
 *                 return
 *             raise NotImplementedError, "Required assignment signature not yet implemented."
 *         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."
 */
    goto __pyx_L9;
  }

  /* "HTSeq/_HTSeq.pyx":561
 *                     index.start: index.end] = value
 *         else:
 *             raise TypeError, "Illegal index type."             # <<<<<<<<<<<<<<
 * 
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Illegal_index_type_2, 0, 0);
    __PYX_ERR(0, 561, __pyx_L1_error)
  }
  __pyx_L9:;

  /* "HTSeq/_HTSeq.pyx":538
 *             return self.chrom_vectors[index]
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval index2
 *         if isinstance(value, ChromVector):
 */

  /* 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_XDECREF(__pyx_t_7);
  __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":563
 *             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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_start_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_chrom (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_length,&__pyx_n_s_start_index,0};
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k__18;
    values[2] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start_index);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_chrom") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_chrom = values[0];
    __pyx_v_length = values[1];
    __pyx_v_start_index = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_chrom", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("add_chrom", 0);

  /* "HTSeq/_HTSeq.pyx":565
 *     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_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __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, 565, __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, 565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":566
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:
 *             iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")             # <<<<<<<<<<<<<<
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
    __Pyx_INCREF(__pyx_v_start_index);
    __Pyx_GIVEREF(__pyx_v_start_index);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start_index);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_u__8);
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__8);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":565
 *     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":568
 *             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_2 = PyNumber_Add(__pyx_v_start_index, __pyx_v_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
    __Pyx_INCREF(__pyx_v_start_index);
    __Pyx_GIVEREF(__pyx_v_start_index);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start_index);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_u__8);
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__8);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":569
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
 *         if self.stranded:             # <<<<<<<<<<<<<<
 *             self.chrom_vectors[chrom] = {}
 *             iv.strand = "+"
 */
  __pyx_t_3 = (__pyx_v_self->stranded != 0);
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":570
 *             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_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __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 subscriptable");
      __PYX_ERR(0, 570, __pyx_L1_error)
    }
    if (unlikely(PyDict_SetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom, __pyx_t_2) < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":571
 *         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_n_s_strand, __pyx_kp_u__19) < 0) __PYX_ERR(0, 571, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":573
 *             iv.strand = "+"
 *             self.chrom_vectors[ chrom ][ strand_plus ] = \
 *                 ChromVector.create(iv, self.typecode,             # <<<<<<<<<<<<<<
 *                                    self.storage, self.memmap_dir)
 *             iv = iv.copy()
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "HTSeq/_HTSeq.pyx":574
 *             self.chrom_vectors[ chrom ][ strand_plus ] = \
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)             # <<<<<<<<<<<<<<
 *             iv = iv.copy()
 *             iv.strand = "-"
 */
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_4, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_4, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_iv));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_iv));
      __Pyx_INCREF(__pyx_v_self->typecode);
      __Pyx_GIVEREF(__pyx_v_self->typecode);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->typecode);
      __Pyx_INCREF(__pyx_v_self->storage);
      __Pyx_GIVEREF(__pyx_v_self->storage);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_self->storage);
      __Pyx_INCREF(__pyx_v_self->memmap_dir);
      __Pyx_GIVEREF(__pyx_v_self->memmap_dir);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_self->memmap_dir);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":572
 *             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, 572, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_5HTSeq_6_HTSeq_strand_plus, __pyx_t_2) < 0)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":575
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)
 *             iv = iv.copy()             # <<<<<<<<<<<<<<
 *             iv.strand = "-"
 *             self.chrom_vectors[ chrom ][ strand_minus ] = \
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":576
 *                                    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_n_s_strand, __pyx_kp_u__20) < 0) __PYX_ERR(0, 576, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":578
 *             iv.strand = "-"
 *             self.chrom_vectors[ chrom ][ strand_minus ] = \
 *                 ChromVector.create(iv, self.typecode,             # <<<<<<<<<<<<<<
 *                                    self.storage, self.memmap_dir)
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "HTSeq/_HTSeq.pyx":579
 *             self.chrom_vectors[ chrom ][ strand_minus ] = \
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)             # <<<<<<<<<<<<<<
 *         else:
 *             self.chrom_vectors[chrom] = {
 */
    __pyx_t_6 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_iv));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_iv));
      __Pyx_INCREF(__pyx_v_self->typecode);
      __Pyx_GIVEREF(__pyx_v_self->typecode);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_self->typecode);
      __Pyx_INCREF(__pyx_v_self->storage);
      __Pyx_GIVEREF(__pyx_v_self->storage);
      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_self->storage);
      __Pyx_INCREF(__pyx_v_self->memmap_dir);
      __Pyx_GIVEREF(__pyx_v_self->memmap_dir);
      PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_self->memmap_dir);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":577
 *             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, 577, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_5HTSeq_6_HTSeq_strand_minus, __pyx_t_2) < 0)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":569
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
 *         if self.stranded:             # <<<<<<<<<<<<<<
 *             self.chrom_vectors[chrom] = {}
 *             iv.strand = "+"
 */
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":582
 *         else:
 *             self.chrom_vectors[chrom] = {
 *                 strand_nostrand:  ChromVector.create(iv, self.typecode,             # <<<<<<<<<<<<<<
 *                                                      self.storage,
 *                                                      self.memmap_dir)}
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector), __pyx_n_s_create); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "HTSeq/_HTSeq.pyx":584
 *                 strand_nostrand:  ChromVector.create(iv, self.typecode,
 *                                                      self.storage,
 *                                                      self.memmap_dir)}             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
    __pyx_t_6 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_iv));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, ((PyObject *)__pyx_v_iv));
      __Pyx_INCREF(__pyx_v_self->typecode);
      __Pyx_GIVEREF(__pyx_v_self->typecode);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_v_self->typecode);
      __Pyx_INCREF(__pyx_v_self->storage);
      __Pyx_GIVEREF(__pyx_v_self->storage);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_5, __pyx_v_self->storage);
      __Pyx_INCREF(__pyx_v_self->memmap_dir);
      __Pyx_GIVEREF(__pyx_v_self->memmap_dir);
      PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_5, __pyx_v_self->memmap_dir);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand, __pyx_t_1) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":581
 *                                    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, 581, __pyx_L1_error)
    }
    if (unlikely(PyDict_SetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom, __pyx_t_2) < 0)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":563
 *             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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":586
 *                                                      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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":587
 * 
 *     def __reduce__(self):
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))             # <<<<<<<<<<<<<<
 * 
 *     def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GenomicArray_unpickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __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, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->typecode);
  __Pyx_GIVEREF(__pyx_v_self->typecode);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->typecode);
  __Pyx_INCREF(__pyx_v_self->chrom_vectors);
  __Pyx_GIVEREF(__pyx_v_self->chrom_vectors);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->chrom_vectors);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":586
 *                                                      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":589
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
 *     def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):             # <<<<<<<<<<<<<<
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError, "Strand specified in unstranded GenomicArray."
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11write_bedgraph_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11write_bedgraph_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file_or_filename = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_track_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedgraph_file (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_or_filename,&__pyx_n_s_strand,&__pyx_n_s_track_options,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_u__8);
    values[2] = ((PyObject *)__pyx_kp_u__12);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_or_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_track_options);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedgraph_file") < 0)) __PYX_ERR(0, 589, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file_or_filename = values[0];
    __pyx_v_strand = values[1];
    __pyx_v_track_options = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedgraph_file", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 589, __pyx_L3_error)
  __pyx_L3_error:;
  __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_10write_bedgraph_file(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_file_or_filename, __pyx_v_strand, __pyx_v_track_options);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10write_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_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  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;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("write_bedgraph_file", 0);

  /* "HTSeq/_HTSeq.pyx":590
 * 
 *     def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
 *         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 != 0)) != 0);
  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_kp_u__8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 590, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":591
 *     def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Strand_specified_in_unstranded_G, 0, 0);
    __PYX_ERR(0, 591, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":590
 * 
 *     def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):
 *         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":592
 *         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"):
 */
  __pyx_t_2 = (__pyx_v_self->stranded != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_strand);
  __pyx_t_3 = __pyx_v_strand;
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __pyx_L9_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":593
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Strand_must_be_specified_for_str, 0, 0);
    __PYX_ERR(0, 593, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":592
 *         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":594
 *         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_n_u_write); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":595
 *             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":594
 *         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":597
 *             f = file_or_filename
 *         else:
 *             f = open(file_or_filename, "w")             # <<<<<<<<<<<<<<
 *         if track_options == "":
 *             f.write("track type=bedGraph\n")
 */
  /*else*/ {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_file_or_filename);
    __Pyx_GIVEREF(__pyx_v_file_or_filename);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_file_or_filename);
    __Pyx_INCREF(__pyx_n_u_w_2);
    __Pyx_GIVEREF(__pyx_n_u_w_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_w_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_f = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L11:;

  /* "HTSeq/_HTSeq.pyx":598
 *         else:
 *             f = open(file_or_filename, "w")
 *         if track_options == "":             # <<<<<<<<<<<<<<
 *             f.write("track type=bedGraph\n")
 *         else:
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_track_options, __pyx_kp_u__12, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 598, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":599
 *             f = open(file_or_filename, "w")
 *         if track_options == "":
 *             f.write("track type=bedGraph\n")             # <<<<<<<<<<<<<<
 *         else:
 *             f.write("track type=bedGraph %s\n" % track_options)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_kp_u_track_type_bedGraph) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_track_type_bedGraph);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":598
 *         else:
 *             f = open(file_or_filename, "w")
 *         if track_options == "":             # <<<<<<<<<<<<<<
 *             f.write("track type=bedGraph\n")
 *         else:
 */
    goto __pyx_L12;
  }

  /* "HTSeq/_HTSeq.pyx":601
 *             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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_track_type_bedGraph_s, __pyx_v_track_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L12:;

  /* "HTSeq/_HTSeq.pyx":602
 *         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, 602, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_self->chrom_vectors, 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __pyx_t_5 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_9, &__pyx_t_8, &__pyx_t_3, NULL, NULL, __pyx_t_10);
    if (unlikely(__pyx_t_11 == 0)) break;
    if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":603
 *             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, 603, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 603, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_13(__pyx_t_6);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 603, __pyx_L1_error)
          }
          break;
        }
        __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, 603, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_14);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_14);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L18_unpacking_done;
        __pyx_L17_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 603, __pyx_L1_error)
        __pyx_L18_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "HTSeq/_HTSeq.pyx":604
 *         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("%s\t%d\t%d\t%f\n" %
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Negative(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_14, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (!__pyx_t_1) {
      } else {
        __pyx_t_4 = __pyx_t_1;
        goto __pyx_L20_bool_binop_done;
      }
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_end); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_14, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_4 = __pyx_t_1;
      __pyx_L20_bool_binop_done:;
      if (__pyx_t_4) {

        /* "HTSeq/_HTSeq.pyx":605
 *             for iv, value in self.chrom_vectors[chrom][strand].steps():
 *                 if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                     continue             # <<<<<<<<<<<<<<
 *                 f.write("%s\t%d\t%d\t%f\n" %
 *                         (iv.chrom, iv.start, iv.end, value))
 */
        goto __pyx_L15_continue;

        /* "HTSeq/_HTSeq.pyx":604
 *         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("%s\t%d\t%d\t%f\n" %
 */
      }

      /* "HTSeq/_HTSeq.pyx":606
 *                 if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                     continue
 *                 f.write("%s\t%d\t%d\t%f\n" %             # <<<<<<<<<<<<<<
 *                         (iv.chrom, iv.start, iv.end, value))
 *         if not hasattr(file_or_filename, "write"):
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_17 = 0;
      __pyx_t_18 = 127;

      /* "HTSeq/_HTSeq.pyx":607
 *                     continue
 *                 f.write("%s\t%d\t%d\t%f\n" %
 *                         (iv.chrom, iv.start, iv.end, value))             # <<<<<<<<<<<<<<
 *         if not hasattr(file_or_filename, "write"):
 *             f.close()
 */
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_chrom); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_19 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_15), __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
      __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_19);
      __pyx_t_19 = 0;
      __Pyx_INCREF(__pyx_kp_u__21);
      __pyx_t_17 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__21);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_kp_u__21);
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_start); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_15 = __Pyx_PyObject_Format(__pyx_t_19, __pyx_n_u_d); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_18;
      __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_15);
      __pyx_t_15 = 0;
      __Pyx_INCREF(__pyx_kp_u__21);
      __pyx_t_17 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__21);
      PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_kp_u__21);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_end); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_19 = __Pyx_PyObject_Format(__pyx_t_15, __pyx_n_u_d); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
      __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_19);
      __pyx_t_19 = 0;
      __Pyx_INCREF(__pyx_kp_u__21);
      __pyx_t_17 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__21);
      PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_kp_u__21);
      __pyx_t_19 = __Pyx_PyObject_Format(__pyx_v_value, __pyx_n_u_f); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
      __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_19);
      __pyx_t_19 = 0;
      __Pyx_INCREF(__pyx_kp_u__22);
      __pyx_t_17 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__22);
      PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_kp_u__22);

      /* "HTSeq/_HTSeq.pyx":606
 *                 if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                     continue
 *                 f.write("%s\t%d\t%d\t%f\n" %             # <<<<<<<<<<<<<<
 *                         (iv.chrom, iv.start, iv.end, value))
 *         if not hasattr(file_or_filename, "write"):
 */
      __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_14, 8, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_7 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_14, __pyx_t_19) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_19);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "HTSeq/_HTSeq.pyx":603
 *             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_L15_continue:;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":608
 *                 f.write("%s\t%d\t%d\t%f\n" %
 *                         (iv.chrom, iv.start, iv.end, value))
 *         if not hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *             f.close()
 * 
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_n_u_write); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 608, __pyx_L1_error)
  __pyx_t_1 = ((!(__pyx_t_4 != 0)) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":609
 *                         (iv.chrom, iv.start, iv.end, value))
 *         if not hasattr(file_or_filename, "write"):
 *             f.close()             # <<<<<<<<<<<<<<
 * 
 *     def steps(self):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":608
 *                 f.write("%s\t%d\t%d\t%f\n" %
 *                         (iv.chrom, iv.start, iv.end, value))
 *         if not hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *             f.close()
 * 
 */
  }

  /* "HTSeq/_HTSeq.pyx":589
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
 *     def write_bedgraph_file(self, file_or_filename, strand=".", track_options=""):             # <<<<<<<<<<<<<<
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError, "Strand specified in unstranded GenomicArray."
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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":611
 *             f.close()
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         return _HTSeq_internal.GenomicArray_steps(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13steps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("steps (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12steps(((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_12steps(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;
  __Pyx_RefNannySetupContext("steps", 0);

  /* "HTSeq/_HTSeq.pyx":612
 * 
 *     def steps(self):
 *         return _HTSeq_internal.GenomicArray_steps(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GenomicArray_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":611
 *             f.close()
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         return _HTSeq_internal.GenomicArray_steps(self)
 * 
 */

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

/* "HTSeq/_HTSeq.pyx":488
 * cdef class GenomicArray(object):
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 488, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__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;

  /* 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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":489
 * 
 *     cdef public dict chrom_vectors
 *     cdef readonly bint stranded             # <<<<<<<<<<<<<<
 *     cdef readonly str typecode
 *     cdef public bint 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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, 489, __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":490
 *     cdef public dict chrom_vectors
 *     cdef readonly bint stranded
 *     cdef readonly str typecode             # <<<<<<<<<<<<<<
 *     cdef public bint 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":491
 *     cdef readonly bint stranded
 *     cdef readonly str typecode
 *     cdef public bint 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->auto_add_chroms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __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.auto_add_chroms.__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_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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L1_error)
  __pyx_v_self->auto_add_chroms = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __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;
}

/* "HTSeq/_HTSeq.pyx":492
 *     cdef readonly str typecode
 *     cdef public bint auto_add_chroms
 *     cdef readonly str storage             # <<<<<<<<<<<<<<
 *     cdef readonly str memmap_dir
 * 
 */

/* 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":493
 *     cdef public bint auto_add_chroms
 *     cdef readonly str storage
 *     cdef readonly str memmap_dir             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',
 */

/* 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":615
 * 
 * 
 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_5_GenomicArray_unpickle = {"_GenomicArray_unpickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stranded = 0;
  PyObject *__pyx_v_typecode = 0;
  PyObject *__pyx_v_chrom_vectors = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GenomicArray_unpickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stranded,&__pyx_n_s_typecode,&__pyx_n_s_chrom_vectors,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stranded)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typecode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, 1); __PYX_ERR(0, 615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_vectors)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, 2); __PYX_ERR(0, 615, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_GenomicArray_unpickle") < 0)) __PYX_ERR(0, 615, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_stranded = values[0];
    __pyx_v_typecode = values[1];
    __pyx_v_chrom_vectors = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  __Pyx_RefNannySetupContext("_GenomicArray_unpickle", 0);

  /* "HTSeq/_HTSeq.pyx":616
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):
 *     ga = GenomicArray({}, stranded, typecode)             # <<<<<<<<<<<<<<
 *     ga.chrom_vectors = chrom_vectors
 *     return ga
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_stranded);
  __Pyx_GIVEREF(__pyx_v_stranded);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stranded);
  __Pyx_INCREF(__pyx_v_typecode);
  __Pyx_GIVEREF(__pyx_v_typecode);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_typecode);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ga = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":617
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors             # <<<<<<<<<<<<<<
 *     return ga
 * 
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_chrom_vectors))||((__pyx_v_chrom_vectors) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_chrom_vectors)->tp_name), 0))) __PYX_ERR(0, 617, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_chrom_vectors;
  __Pyx_INCREF(__pyx_t_1);
  __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":618
 *     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":615
 * 
 * 
 * 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_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":626
 * 
 * 
 * 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_make_translation_table_for_complementation (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("_make_translation_table_for_complementation", 0);

  /* "HTSeq/_HTSeq.pyx":627
 * 
 * def _make_translation_table_for_complementation():
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')             # <<<<<<<<<<<<<<
 * 
 * cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyBytes_Type)), __pyx_n_s_maketrans); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __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":626
 * 
 * 
 * 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":631
 * cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
 * 
 * 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, PyObject *__pyx_v_seq); /*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;
  __Pyx_RefNannySetupContext("reverse_complement", 0);

  /* "HTSeq/_HTSeq.pyx":635
 *     work with extended IUPAC nucleotide letters or RNA."""
 * 
 *     return seq[::-1].translate(_translation_table_for_complementation)             # <<<<<<<<<<<<<<
 * 
 * base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_slice__24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 635, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":631
 * cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
 * 
 * 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, PyObject *__pyx_v_seq); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reverse_complement (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 631, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(__pyx_self, ((PyObject*)__pyx_v_seq));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __Pyx_RefNannySetupContext("reverse_complement", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __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":643
 *     """
 * 
 *     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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_u_unnamed);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 643, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_seq = ((PyObject*)values[0]);
    __pyx_v_name = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 643, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 643, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 643, __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;
  __pyx_L0:;
  __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":644
 * 
 *     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":645
 *     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":646
 *         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":643
 *     """
 * 
 *     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":648
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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;
  int __pyx_t_6;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_rename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 648, __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":649
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
 *         if rename:             # <<<<<<<<<<<<<<
 *             return Sequence(
 *                 reverse_complement(self.seq),
 */
  __pyx_t_6 = (__pyx_v_rename != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":650
 *     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));

    /* "HTSeq/_HTSeq.pyx":651
 *         if rename:
 *             return Sequence(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 "revcomp_of_" + self.name)
 *         else:
 */
    __pyx_t_1 = __pyx_v_self->seq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":652
 *             return Sequence(
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name)             # <<<<<<<<<<<<<<
 *         else:
 *             return Sequence(
 */
    __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_n_u_revcomp_of, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "HTSeq/_HTSeq.pyx":650
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
 *         if rename:
 *             return Sequence(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name)
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":649
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
 *         if rename:             # <<<<<<<<<<<<<<
 *             return Sequence(
 *                 reverse_complement(self.seq),
 */
  }

  /* "HTSeq/_HTSeq.pyx":654
 *                 "revcomp_of_" + self.name)
 *         else:
 *             return Sequence(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 self.name)
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "HTSeq/_HTSeq.pyx":655
 *         else:
 *             return Sequence(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 self.name)
 * 
 */
    __pyx_t_1 = __pyx_v_self->seq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":654
 *                 "revcomp_of_" + self.name)
 *         else:
 *             return Sequence(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 self.name)
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->name);
    __Pyx_GIVEREF(__pyx_v_self->name);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->name);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":648
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_rename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_reverse_complement (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rename,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rename);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reverse_complement") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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, 648, __pyx_L3_error)
    } else {
      __pyx_v_rename = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_reverse_complement", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  __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, 648, __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":658
 *                 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "HTSeq/_HTSeq.pyx":659
 * 
 *     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, 659, __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, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":658
 *                 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":661
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":662
 * 
 *     def __repr__(self):
 *         return "<%s object '%s' (length %d)>" % (             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.name, len(self.seq))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);

  /* "HTSeq/_HTSeq.pyx":663
 *     def __repr__(self):
 *         return "<%s object '%s' (length %d)>" % (
 *             self.__class__.__name__, self.name, len(self.seq))             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_object);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_object);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_length_2);
  __pyx_t_2 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_length_2);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_length_2);
  __pyx_t_4 = __pyx_v_self->seq;
  __Pyx_INCREF(__pyx_t_4);
  if (unlikely(__pyx_t_4 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 663, __pyx_L1_error)
  }
  __pyx_t_6 = PyBytes_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__25);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__25);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__25);

  /* "HTSeq/_HTSeq.pyx":662
 * 
 *     def __repr__(self):
 *         return "<%s object '%s' (length %d)>" % (             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.name, len(self.seq))
 * 
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __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":661
 *         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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":665
 *             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) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "HTSeq/_HTSeq.pyx":666
 * 
 *     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, 666, __pyx_L1_error)
  }
  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":665
 *             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":668
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":669
 * 
 *     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, 669, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->name, __pyx_kp_u_part, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 669, __pyx_L1_error)
  if ((__pyx_t_1 != 0)) {

    /* "HTSeq/_HTSeq.pyx":670
 *     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":669
 * 
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):             # <<<<<<<<<<<<<<
 *             new_name = self.name
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":672
 *             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_kp_u_part); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __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":673
 *         else:
 *             new_name = self.name + "[part]"
 *         return Sequence(self.seq[item], new_name)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->seq, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_new_name);
  __Pyx_GIVEREF(__pyx_v_new_name);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_new_name);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":668
 *         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_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":675
 *         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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "HTSeq/_HTSeq.pyx":676
 * 
 *     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, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seq, __pyx_v_self->seq) < 0) __PYX_ERR(0, 676, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":677
 *     def __getstate__(self):
 *         return {'seq': self.seq,
 *                 'name': self.name,             # <<<<<<<<<<<<<<
 *                 'descr': self.descr}
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name_2, __pyx_v_self->name) < 0) __PYX_ERR(0, 676, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":678
 *         return {'seq': self.seq,
 *                 'name': self.name,
 *                 'descr': self.descr}             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_descr, __pyx_v_self->descr) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":675
 *         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":680
 *                 '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, PyObject *__pyx_v_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_14__setstate__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __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;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "HTSeq/_HTSeq.pyx":681
 * 
 *     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_n_u_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 681, __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":682
 *     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_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 682, __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":683
 *         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_n_u_descr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 683, __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":680
 *                 '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":685
 *         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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":686
 * 
 *     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_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->seq);
  __Pyx_GIVEREF(__pyx_v_self->seq);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->seq);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->name);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __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":685
 *         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_XDECREF(__pyx_t_5);
  __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":688
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __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 PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fasta_file = 0;
  PyObject *__pyx_v_characters_per_line = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_fasta_file (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fasta_file,&__pyx_n_s_characters_per_line,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_70);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fasta_file)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characters_per_line);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_to_fasta_file") < 0)) __PYX_ERR(0, 688, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fasta_file = values[0];
    __pyx_v_characters_per_line = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_to_fasta_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 688, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  __Pyx_RefNannySetupContext("write_to_fasta_file", 0);

  /* "HTSeq/_HTSeq.pyx":696
 * 
 *         """
 *         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));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":697
 *         """
 *         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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u__17);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__17);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__17);
    __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u__26);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__26);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__26);
    __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_self->descr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u__22);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__22);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__22);
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":696
 * 
 *         """
 *         if self.descr is not None:             # <<<<<<<<<<<<<<
 *             fasta_file.write(">%s %s\n" % (self.name, self.descr))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":699
 *             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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_s, __pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":701
 *             fasta_file.write(">%s\n" % self.name)
 * 
 *         if characters_per_line == 0:             # <<<<<<<<<<<<<<
 *             fasta_file.write(self.seq.decode() + "\n")
 *         else:
 */
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_characters_per_line, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":702
 * 
 *         if characters_per_line == 0:
 *             fasta_file.write(self.seq.decode() + "\n")             # <<<<<<<<<<<<<<
 *         else:
 *             i = 0
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__pyx_v_self->seq == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
      __PYX_ERR(0, 702, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_decode_bytes(__pyx_v_self->seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u__22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":701
 *             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":704
 *             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_int_0);
    __pyx_v_i = __pyx_int_0;

    /* "HTSeq/_HTSeq.pyx":705
 *         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_3 = PyNumber_Multiply(__pyx_v_i, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_v_self->seq;
      __Pyx_INCREF(__pyx_t_4);
      if (unlikely(__pyx_t_4 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 705, __pyx_L1_error)
      }
      __pyx_t_6 = PyBytes_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_2) break;

      /* "HTSeq/_HTSeq.pyx":706
 *             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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fasta_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "HTSeq/_HTSeq.pyx":707
 *             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, 707, __pyx_L1_error)
      }
      __pyx_t_3 = PyNumber_Multiply(__pyx_v_i, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = (__pyx_t_3 == Py_None);
      if (__pyx_t_2) {
        __pyx_t_6 = 0;
      } else {
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
        __pyx_t_6 = __pyx_t_9;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = (__pyx_t_8 == Py_None);
      if (__pyx_t_2) {
        __pyx_t_9 = PY_SSIZE_T_MAX;
      } else {
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_10;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_decode_bytes(__pyx_v_self->seq, __pyx_t_6, __pyx_t_9, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u__22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":708
 *                 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_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;
    }
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":688
 *         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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __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":710
 *                 i += 1
 * 
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.ndarray[numpy.int_t, ndim = 2] count_array = count_array_
 */

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_); /*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;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  npy_intp __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_bases_to_count_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_count_array_)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_count_array_));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":712
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):
 * 
 *         cdef numpy.ndarray[numpy.int_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_int_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, 712, __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":713
 * 
 *         cdef numpy.ndarray[numpy.int_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, 713, __pyx_L1_error)
  }
  __pyx_t_5 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq_length = __pyx_t_5;

  /* "HTSeq/_HTSeq.pyx":715
 *         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_6 = (((PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[0]) < __pyx_v_seq_length) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":716
 * 
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_count_array_too_small_for_seque, 0, 0);
    __PYX_ERR(0, 716, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":715
 *         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":717
 *         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_6 = (((PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[1]) < 5) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":718
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_count_array_has_too_few_columns, 0, 0);
    __PYX_ERR(0, 718, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":717
 *         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":722
 *         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, 722, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":723
 *         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_8 = __pyx_v_seq_length;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "HTSeq/_HTSeq.pyx":724
 *         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":725
 *         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":726
 *             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_11 = __pyx_v_i;
      __pyx_t_12 = 0;
      __pyx_t_13 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
      if (unlikely(__pyx_t_13 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_13);
        __PYX_ERR(0, 726, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":725
 *         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":727
 *             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":728
 *                 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_14 = __pyx_v_i;
      __pyx_t_15 = 1;
      __pyx_t_13 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 1;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
      if (unlikely(__pyx_t_13 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_13);
        __PYX_ERR(0, 728, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":727
 *             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":729
 *             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":730
 *                 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_16 = __pyx_v_i;
      __pyx_t_17 = 2;
      __pyx_t_13 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 1;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
      if (unlikely(__pyx_t_13 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_13);
        __PYX_ERR(0, 730, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":729
 *             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":731
 *             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":732
 *                 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_18 = __pyx_v_i;
      __pyx_t_19 = 3;
      __pyx_t_13 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
      if (unlikely(__pyx_t_13 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_13);
        __PYX_ERR(0, 732, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":731
 *             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":733
 *             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":734
 *                 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_20 = __pyx_v_i;
      __pyx_t_21 = 4;
      __pyx_t_13 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_13 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_13 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_13 = 1;
      if (unlikely(__pyx_t_13 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_13);
        __PYX_ERR(0, 734, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":733
 *             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":736
 *                 count_array[i, 4] += 1
 *             else:
 *                 raise ValueError, "Illegal base letter encountered."             # <<<<<<<<<<<<<<
 * 
 *         return None
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Illegal_base_letter_encountered, 0, 0);
      __PYX_ERR(0, 736, __pyx_L1_error)
      break;
    }
  }

  /* "HTSeq/_HTSeq.pyx":738
 *                 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":710
 *                 i += 1
 * 
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.ndarray[numpy.int_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, PyObject *__pyx_v_count_array_); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_bases_to_count_array (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count_array_), __pyx_ptype_5numpy_ndarray, 1, "count_array_", 0))) __PYX_ERR(0, 710, __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), ((PyArrayObject *)__pyx_v_count_array_));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __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, 710, __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":740
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  char *__pyx_t_10;
  long __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_left_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mismatch_prop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 740, __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":741
 * 
 *     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, 741, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":742
 *     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, 742, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":744
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
  __pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
  if (__pyx_t_9) {

    /* "HTSeq/_HTSeq.pyx":745
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
 */
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":744
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":747
 *             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":748
 *         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, 748, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":749
 *             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, 749, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 749, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":750
 *         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":753
 *         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_11 = (__pyx_v_minlen + 1);
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_12; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "HTSeq/_HTSeq.pyx":754
 *         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":755
 *         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":756
 *             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_9 = (((__pyx_v_seq_cstr[__pyx_v_j]) != (__pyx_v_pat_cstr[((__pyx_v_patlen - __pyx_v_i) + __pyx_v_j)])) != 0);
      if (__pyx_t_9) {

        /* "HTSeq/_HTSeq.pyx":757
 *             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":758
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
 */
        __pyx_t_9 = ((__pyx_v_num_mismatches > (__pyx_v_mismatch_prop * __pyx_v_i)) != 0);
        if (__pyx_t_9) {

          /* "HTSeq/_HTSeq.pyx":759
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
 */
          goto __pyx_L7_break;

          /* "HTSeq/_HTSeq.pyx":758
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
 */
        }

        /* "HTSeq/_HTSeq.pyx":756
 *             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":761
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[match: seqlen]
 * 
 */
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L7_break:;
  }

  /* "HTSeq/_HTSeq.pyx":762
 *             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, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 762, __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":740
 *         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_XDECREF(__pyx_t_7);
  __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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  float __pyx_v_mismatch_prop;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trim_left_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_mismatch_prop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mismatch_prop);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_left_end") < 0)) __PYX_ERR(0, 740, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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, 740, __pyx_L3_error)
    } else {
      __pyx_v_mismatch_prop = ((float)0.);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_left_end", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 740, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 740, __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;
  __pyx_L0:;
  __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;
  __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, 740, __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":764
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  char *__pyx_t_10;
  long __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_right_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mismatch_prop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 764, __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":765
 * 
 *     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, 765, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":766
 *     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, 766, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":768
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
  __pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
  if (__pyx_t_9) {

    /* "HTSeq/_HTSeq.pyx":769
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
 */
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":768
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":771
 *             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":772
 *         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, 772, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":773
 *             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, 773, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":774
 *         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":777
 *         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_11 = (__pyx_v_minlen + 1);
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_12; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "HTSeq/_HTSeq.pyx":778
 *         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":779
 *         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":780
 *             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_9 = (((__pyx_v_seq_cstr[((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j)]) != (__pyx_v_pat_cstr[__pyx_v_j])) != 0);
      if (__pyx_t_9) {

        /* "HTSeq/_HTSeq.pyx":781
 *             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":782
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
 */
        __pyx_t_9 = ((__pyx_v_num_mismatches > (__pyx_v_mismatch_prop * __pyx_v_i)) != 0);
        if (__pyx_t_9) {

          /* "HTSeq/_HTSeq.pyx":783
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
 */
          goto __pyx_L7_break;

          /* "HTSeq/_HTSeq.pyx":782
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
 */
        }

        /* "HTSeq/_HTSeq.pyx":780
 *             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":785
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[0: seqlen - match]
 * 
 */
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L7_break:;
  }

  /* "HTSeq/_HTSeq.pyx":786
 *             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, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 786, __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":764
 *         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_XDECREF(__pyx_t_7);
  __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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  float __pyx_v_mismatch_prop;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trim_right_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_mismatch_prop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mismatch_prop);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_right_end") < 0)) __PYX_ERR(0, 764, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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, 764, __pyx_L3_error)
    } else {
      __pyx_v_mismatch_prop = ((float)0.);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_right_end", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 764, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 764, __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;
  __pyx_L0:;
  __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;
  __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, 764, __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyBytes_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 20, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 22, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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":795
 *     """
 * 
 *     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*/
static char __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_COMPILING_IN_CPYTHON
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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_name_2,&__pyx_n_s_qualstr,&__pyx_n_s_qualscale,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject*)__pyx_n_u_phred);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qualstr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qualscale);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 795, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 795, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 795, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 795, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualstr), (&PyBytes_Type), 1, "qualstr", 1))) __PYX_ERR(0, 795, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualscale), (&PyUnicode_Type), 1, "qualscale", 1))) __PYX_ERR(0, 795, __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;
  __pyx_L0:;
  __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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":804
 *                         "phred", "solexa", "solexa-old", or "noquals" )
 *         """
 *         Sequence.__init__(self, seq, name)             # <<<<<<<<<<<<<<
 *         if qualscale != "noquals":
 *             if len(seq) != len(qualstr):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Sequence), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_seq, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_seq, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_seq);
    __Pyx_GIVEREF(__pyx_v_seq);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_seq);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":805
 *         """
 *         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_6 = (__Pyx_PyUnicode_Equals(__pyx_v_qualscale, __pyx_n_u_noquals, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 805, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":806
 *         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, 806, __pyx_L1_error)
    }
    __pyx_t_8 = PyBytes_GET_SIZE(__pyx_v_seq); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 806, __pyx_L1_error)
    if (unlikely(__pyx_v_qualstr == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 806, __pyx_L1_error)
    }
    __pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_qualstr); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 806, __pyx_L1_error)
    __pyx_t_7 = ((__pyx_t_8 != __pyx_t_9) != 0);
    if (unlikely(__pyx_t_7)) {

      /* "HTSeq/_HTSeq.pyx":807
 *         if qualscale != "noquals":
 *             if len(seq) != len(qualstr):
 *                 raise ValueError, "'seq' and 'qualstr' do not have the same length."             # <<<<<<<<<<<<<<
 *             self._qualstr = qualstr
 *         else:
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_seq_and_qualstr_do_not_have_the, 0, 0);
      __PYX_ERR(0, 807, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":806
 *         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":808
 *             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":805
 *         """
 *         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":810
 *             self._qualstr = qualstr
 *         else:
 *             self._qualstr = b''             # <<<<<<<<<<<<<<
 *         self._qualscale = qualscale
 *         self._qualarr = None
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_b__12);
    __Pyx_GIVEREF(__pyx_kp_b__12);
    __Pyx_GOTREF(__pyx_v_self->_qualstr);
    __Pyx_DECREF(__pyx_v_self->_qualstr);
    __pyx_v_self->_qualstr = __pyx_kp_b__12;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":811
 *         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":812
 *             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":813
 *         self._qualscale = qualscale
 *         self._qualarr = None
 *         self._qualstr_phred = b''             # <<<<<<<<<<<<<<
 * 
 *     cdef _fill_qual_arr(SequenceWithQualities self):
 */
  __Pyx_INCREF(__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_kp_b__12);
  __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
  __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
  __pyx_v_self->_qualstr_phred = __pyx_kp_b__12;

  /* "HTSeq/_HTSeq.pyx":795
 *     """
 * 
 *     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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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":815
 *         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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  char *__pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  __pyx_t_5numpy_uint8_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  __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":816
 * 
 *     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, 816, __pyx_L1_error)
  }
  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq_len = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":817
 *     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_n_u_missing, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 817, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":818
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Quality_string_missing, 0, 0);
    __PYX_ERR(0, 818, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":817
 *     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":819
 *         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, 819, __pyx_L1_error)
  }
  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((__pyx_v_seq_len != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":820
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Quality_string_has_not_the_same, 0, 0);
    __PYX_ERR(0, 820, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":819
 *         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":821
 *         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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_seq_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_8);
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 821, __pyx_L1_error)
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__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, 821, __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_t_11 = 0;
  __pyx_v_qualarr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":823
 *         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, 823, __pyx_L1_error)
  }
  __pyx_t_12 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L1_error)
  __pyx_v_qualstr = __pyx_t_12;

  /* "HTSeq/_HTSeq.pyx":824
 *         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_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_phred, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 824, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":825
 *         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_9 = __pyx_v_seq_len;
    __pyx_t_13 = __pyx_t_9;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "HTSeq/_HTSeq.pyx":826
 *         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_15 = __pyx_v_i;
      __pyx_t_16 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_16 = 0;
      if (unlikely(__pyx_t_16 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_16);
        __PYX_ERR(0, 826, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qualarr.diminfo[0].strides) = ((__pyx_v_qualstr[__pyx_v_i]) - 33);
    }

    /* "HTSeq/_HTSeq.pyx":824
 *         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":827
 *             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_n_u_solexa, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 827, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":828
 *                 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_9 = __pyx_v_seq_len;
    __pyx_t_13 = __pyx_t_9;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "HTSeq/_HTSeq.pyx":829
 *         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_17 = __pyx_v_i;
      __pyx_t_16 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_16 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_16 = 0;
      if (unlikely(__pyx_t_16 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_16);
        __PYX_ERR(0, 829, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qualarr.diminfo[0].strides) = ((__pyx_v_qualstr[__pyx_v_i]) - 64);
    }

    /* "HTSeq/_HTSeq.pyx":827
 *             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":830
 *             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_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_kp_u_solexa_old, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":831
 *                 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_9 = __pyx_v_seq_len;
    __pyx_t_13 = __pyx_t_9;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "HTSeq/_HTSeq.pyx":833
 *             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_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyFloat_FromDouble((1.0 + (((double)__Pyx_pow_long(10, ((__pyx_v_qualstr[__pyx_v_i]) - 64))) / 10.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "HTSeq/_HTSeq.pyx":832
 *         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_10 = PyNumber_Multiply(__pyx_int_10, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_18 = __Pyx_PyInt_As_npy_uint8(__pyx_t_10); if (unlikely((__pyx_t_18 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_16 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_16 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_16 = 0;
      if (unlikely(__pyx_t_16 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_16);
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qualarr.diminfo[0].strides) = __pyx_t_18;
    }

    /* "HTSeq/_HTSeq.pyx":830
 *             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":835
 *                     math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
 *         else:
 *             raise ValueError, "Illegal quality scale '%s'." % self._qualscale             # <<<<<<<<<<<<<<
 *         self._qualarr = qualarr
 * 
 */
  /*else*/ {
    __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_Illegal_quality_scale_s, __pyx_v_self->_qualscale); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_10, 0, 0);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __PYX_ERR(0, 835, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "HTSeq/_HTSeq.pyx":836
 *         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":815
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  { 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":839
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":840
 *     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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":841
 *         def __get__(self):
 *             if self._qualarr is None:
 *                 self._fill_qual_arr()             # <<<<<<<<<<<<<<
 *             return self._qualarr
 * 
 */
    __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, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":840
 *     property qual:
 *         def __get__(self):
 *             if self._qualarr is None:             # <<<<<<<<<<<<<<
 *                 self._fill_qual_arr()
 *             return self._qualarr
 */
  }

  /* "HTSeq/_HTSeq.pyx":842
 *             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":839
 * 
 *     property qual:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._qualarr is None:
 *                 self._fill_qual_arr()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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":844
 *             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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":845
 * 
 *         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_ptype_5numpy_ndarray); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newvalue, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __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_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __pyx_t_3 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":846
 *         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_Raise(__pyx_builtin_TypeError, __pyx_kp_u_qual_can_only_be_assigned_a_nump, 0, 0);
    __PYX_ERR(0, 846, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":845
 * 
 *         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":847
 *             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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_newvalue, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_v_self->__pyx_base.seq;
  __Pyx_INCREF(__pyx_t_6);
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 847, __pyx_L1_error)
  }
  __pyx_t_7 = PyBytes_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":848
 *                 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_Raise(__pyx_builtin_TypeError, __pyx_kp_u_assignment_to_qual_with_illegal, 0, 0);
    __PYX_ERR(0, 848, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":847
 *             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":849
 *             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":850
 *                 raise TypeError, "assignment to qual with illegal shape"
 *             self._qualarr = newvalue
 *             self._qualstr = b""             # <<<<<<<<<<<<<<
 *             self._qualscale = "none"
 *             self._qualstr_phred = b""
 */
  __Pyx_INCREF(__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_kp_b__12);
  __Pyx_GOTREF(__pyx_v_self->_qualstr);
  __Pyx_DECREF(__pyx_v_self->_qualstr);
  __pyx_v_self->_qualstr = __pyx_kp_b__12;

  /* "HTSeq/_HTSeq.pyx":851
 *             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_n_u_none);
  __Pyx_GIVEREF(__pyx_n_u_none);
  __Pyx_GOTREF(__pyx_v_self->_qualscale);
  __Pyx_DECREF(__pyx_v_self->_qualscale);
  __pyx_v_self->_qualscale = __pyx_n_u_none;

  /* "HTSeq/_HTSeq.pyx":852
 *             self._qualstr = b""
 *             self._qualscale = "none"
 *             self._qualstr_phred = b""             # <<<<<<<<<<<<<<
 *             # Experimentally trying to set qualstr when the array is modified
 *             # directly
 */
  __Pyx_INCREF(__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_kp_b__12);
  __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
  __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
  __pyx_v_self->_qualstr_phred = __pyx_kp_b__12;

  /* "HTSeq/_HTSeq.pyx":855
 *             # Experimentally trying to set qualstr when the array is modified
 *             # directly
 *             tmp = self.qualstr             # <<<<<<<<<<<<<<
 *             self._qualstr = self._qualstr_phred
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_tmp = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":856
 *             # directly
 *             tmp = self.qualstr
 *             self._qualstr = self._qualstr_phred             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_6 = __pyx_v_self->_qualstr_phred;
  __Pyx_INCREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->_qualstr);
  __Pyx_DECREF(__pyx_v_self->_qualstr);
  __pyx_v_self->_qualstr = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":844
 *             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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":858
 *             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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":859
 * 
 *     def __repr__(self):
 *         return "<%s object '%s'>" % (self.__class__.__name__, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_object);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_object);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__5);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __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":858
 *             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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":861
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":862
 * 
 *     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, 862, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->__pyx_base.name, __pyx_kp_u_part, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 862, __pyx_L1_error)
  if ((__pyx_t_1 != 0)) {

    /* "HTSeq/_HTSeq.pyx":863
 *     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":862
 * 
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):             # <<<<<<<<<<<<<<
 *             new_name = self.name
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":865
 *             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_kp_u_part); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __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":866
 *         else:
 *             new_name = self.name + "[part]"
 *         return SequenceWithQualities(             # <<<<<<<<<<<<<<
 *             self.seq[item], new_name, self.qualstr[item])
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":867
 *             new_name = self.name + "[part]"
 *         return SequenceWithQualities(
 *             self.seq[item], new_name, self.qualstr[item])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.seq, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":866
 *         else:
 *             new_name = self.name + "[part]"
 *         return SequenceWithQualities(             # <<<<<<<<<<<<<<
 *             self.seq[item], new_name, self.qualstr[item])
 * 
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_new_name);
  __Pyx_GIVEREF(__pyx_v_new_name);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_new_name);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":861
 *         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_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":870
 * 
 *     @property
 *     def qualstr(self):             # <<<<<<<<<<<<<<
 *         cdef int seqlen
 *         cdef char * qualstr_phred_cstr = self._qualstr_phred
 */

/* 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_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;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  __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":872
 *     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, 872, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr_phred); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L1_error)
  __pyx_v_qualstr_phred_cstr = __pyx_t_1;

  /* "HTSeq/_HTSeq.pyx":875
 *         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) != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":876
 *         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_n_u_noquals, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "HTSeq/_HTSeq.pyx":877
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Quality_string_missing_2, 0, 0);
      __PYX_ERR(0, 877, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":876
 *         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":878
 *             if self._qualscale == "noquals":
 *                 raise ValueError, "Quality string missing"
 *             if self._qualscale == "phred":             # <<<<<<<<<<<<<<
 *                 self._qualstr_phred = self._qualstr
 *             else:
 */
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_n_u_phred, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 878, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":879
 *                 raise ValueError, "Quality string missing"
 *             if self._qualscale == "phred":
 *                 self._qualstr_phred = self._qualstr             # <<<<<<<<<<<<<<
 *             else:
 *                 seqlen = len(self.seq)
 */
      __pyx_t_4 = __pyx_v_self->_qualstr;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
      __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
      __pyx_v_self->_qualstr_phred = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":878
 *             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":881
 *                 self._qualstr_phred = self._qualstr
 *             else:
 *                 seqlen = len(self.seq)             # <<<<<<<<<<<<<<
 *                 # FIXME: is this fixed now?
 *                 self._qualstr_phred = b' ' * seqlen
 */
    /*else*/ {
      __pyx_t_4 = __pyx_v_self->__pyx_base.seq;
      __Pyx_INCREF(__pyx_t_4);
      if (unlikely(__pyx_t_4 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 881, __pyx_L1_error)
      }
      __pyx_t_5 = PyBytes_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 881, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_seqlen = __pyx_t_5;

      /* "HTSeq/_HTSeq.pyx":883
 *                 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_4 = __Pyx_PyInt_From_int(__pyx_v_seqlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyNumber_Multiply(__pyx_kp_b__26, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
      __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
      __pyx_v_self->_qualstr_phred = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":884
 *                 # 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, 884, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr_phred); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
      __pyx_v_qualstr_phred_cstr = __pyx_t_1;

      /* "HTSeq/_HTSeq.pyx":885
 *                 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);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "HTSeq/_HTSeq.pyx":886
 *                 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_6 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 886, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "HTSeq/_HTSeq.pyx":885
 *                 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":887
 *                 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]
 */
      if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 887, __pyx_L1_error)
      __pyx_t_6 = __pyx_v_self->_qualarr;
      __Pyx_INCREF(__pyx_t_6);
      {
        __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_6), &__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, 887, __pyx_L1_error)
      }
      __pyx_v_qual_array = ((PyArrayObject *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":888
 *                     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":889
 *                 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, 889, __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":875
 *         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":890
 *                 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":870
 * 
 *     @property
 *     def qualstr(self):             # <<<<<<<<<<<<<<
 *         cdef int seqlen
 *         cdef char * qualstr_phred_cstr = self._qualstr_phred
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { 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":892
 *         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, PyObject *__pyx_v_fastq_file); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file(PyObject *__pyx_v_self, PyObject *__pyx_v_fastq_file) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_fastq_file (wrapper)", 0);
  __pyx_r = __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));

  /* function exit code */
  __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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("write_to_fastq_file", 0);

  /* "HTSeq/_HTSeq.pyx":893
 * 
 *     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_n_u_descr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 893, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_self->__pyx_base.descr != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":894
 *     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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u__27);
    __pyx_t_7 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__27);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__27);
    __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u__26);
    __pyx_t_7 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__26);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__26);
    __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.descr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u__22);
    __pyx_t_7 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__22);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__22);
    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9);
    __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, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":893
 * 
 *     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":896
 *             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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9);
    __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, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":897
 *         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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 897, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_decode_bytes(__pyx_v_self->__pyx_base.seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_9, __pyx_kp_u__22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __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, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":898
 *             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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u__28) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u__28);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":899
 *         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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fastq_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qualstr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__22); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":892
 *         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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":901
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_convert_to_phred;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fastq_str (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_convert_to_phred,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_convert_to_phred);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_fastq_str") < 0)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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, 901, __pyx_L3_error)
    } else {
      __pyx_v_convert_to_phred = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_fastq_str", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 901, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("get_fastq_str", 0);

  /* "HTSeq/_HTSeq.pyx":902
 * 
 *     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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cStringIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sio = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":903
 *     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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_fastq_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_convert_to_phred); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_sio, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_sio, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_sio);
    __Pyx_GIVEREF(__pyx_v_sio);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_sio);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":904
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sio, __pyx_n_s_getvalue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":901
 *         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_XDECREF(__pyx_t_6);
  __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":906
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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;
  int __pyx_t_6;
  int __pyx_t_7;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_rename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 906, __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":908
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
 *         cdef SequenceWithQualities res
 *         if rename:             # <<<<<<<<<<<<<<
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),
 */
  __pyx_t_6 = (__pyx_v_rename != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":910
 *         if rename:
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 "revcomp_of_" + self.name,
 *                 self._qualstr[::-1],
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.seq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":911
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name,             # <<<<<<<<<<<<<<
 *                 self._qualstr[::-1],
 *                 self._qualscale)
 */
    __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_n_u_revcomp_of, __pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "HTSeq/_HTSeq.pyx":912
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name,
 *                 self._qualstr[::-1],             # <<<<<<<<<<<<<<
 *                 self._qualscale)
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualstr, __pyx_slice__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "HTSeq/_HTSeq.pyx":909
 *         cdef SequenceWithQualities res
 *         if rename:
 *             res = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name,
 */
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->_qualscale);
    __Pyx_GIVEREF(__pyx_v_self->_qualscale);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_qualscale);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_res = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":908
 *     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":915
 *                 self._qualscale)
 *         else:
 *             res = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 self.name,
 */
  /*else*/ {

    /* "HTSeq/_HTSeq.pyx":916
 *         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_3 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_4), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":918
 *                 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_slice__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "HTSeq/_HTSeq.pyx":915
 *                 self._qualscale)
 *         else:
 *             res = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 self.name,
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.name);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.name);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->__pyx_base.name);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->_qualscale);
    __Pyx_GIVEREF(__pyx_v_self->_qualscale);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->_qualscale);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_res = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":920
 *                 self._qualstr[::-1],
 *                 self._qualscale)
 *         if self._qualarr is not None:             # <<<<<<<<<<<<<<
 *             res._qualarr = self._qualarr[::-1]
 *         return res
 */
  __pyx_t_6 = (__pyx_v_self->_qualarr != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":921
 *                 self._qualscale)
 *         if self._qualarr is not None:
 *             res._qualarr = self._qualarr[::-1]             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualarr, __pyx_slice__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_res->_qualarr);
    __Pyx_DECREF(__pyx_v_res->_qualarr);
    __pyx_v_res->_qualarr = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":920
 *                 self._qualstr[::-1],
 *                 self._qualscale)
 *         if self._qualarr is not None:             # <<<<<<<<<<<<<<
 *             res._qualarr = self._qualarr[::-1]
 *         return res
 */
  }

  /* "HTSeq/_HTSeq.pyx":922
 *         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":906
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_rename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_reverse_complement (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rename,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rename);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reverse_complement") < 0)) __PYX_ERR(0, 906, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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, 906, __pyx_L3_error)
    } else {
      __pyx_v_rename = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_reverse_complement", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  __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, 906, __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":924
 *         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, PyObject *__pyx_v_count_array_); /*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;
  int __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;
  Py_ssize_t __pyx_t_13;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_qual_to_count_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_count_array_)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_count_array_));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":927
 *                                          numpy.ndarray count_array_):
 * 
 *         cdef numpy.ndarray[numpy.int_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_int_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, 927, __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":928
 * 
 *         cdef numpy.ndarray[numpy.int_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_5 = (__pyx_v_self->_qualarr == Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":929
 *         cdef numpy.ndarray[numpy.int_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, 929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":928
 * 
 *         cdef numpy.ndarray[numpy.int_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":930
 *         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]
 */
  if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 930, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_self->_qualarr;
  __Pyx_INCREF(__pyx_t_1);
  {
    __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, 930, __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":932
 *         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":933
 * 
 *         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":935
 *         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])) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":936
 * 
 *         if seq_length > numpy.PyArray_DIMS(count_array)[0]:
 *             raise ValueError, "'count_array' too small for sequence."             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.npy_intp i
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_count_array_too_small_for_seque, 0, 0);
    __PYX_ERR(0, 936, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":935
 *         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":940
 *         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":941
 *         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, 941, __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":942
 *         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) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "HTSeq/_HTSeq.pyx":943
 *             q = qual_array[i]
 *             if(q >= qual_size):
 *                 raise ValueError, "Too large quality value encountered."             # <<<<<<<<<<<<<<
 *             count_array[i, q] += 1
 * 
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Too_large_quality_value_encounte, 0, 0);
      __PYX_ERR(0, 943, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":942
 *         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":944
 *             if(q >= qual_size):
 *                 raise ValueError, "Too large quality value encountered."
 *             count_array[i, q] += 1             # <<<<<<<<<<<<<<
 * 
 *         return None
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = __pyx_v_q;
    __pyx_t_11 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_11 = 0;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[1].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
    } else if (unlikely(__pyx_t_13 >= __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, 944, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_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":946
 *             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":924
 *         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, PyObject *__pyx_v_count_array_); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(PyObject *__pyx_v_self, PyObject *__pyx_v_count_array_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_qual_to_count_array (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count_array_), __pyx_ptype_5numpy_ndarray, 1, "count_array_", 0))) __PYX_ERR(0, 925, __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), ((PyArrayObject *)__pyx_v_count_array_));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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;
  __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, 924, __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":948
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  char *__pyx_t_10;
  int __pyx_t_11;
  long __pyx_t_12;
  long __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_left_end_with_quals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_mm_qual); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 948, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 948, __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":950
 *     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, 950, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":951
 *                                                          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, 951, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":953
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
  __pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
  if (__pyx_t_9) {

    /* "HTSeq/_HTSeq.pyx":954
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
 */
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":953
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":956
 *             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":957
 *         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, 957, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->__pyx_base.seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":958
 *             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, 958, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":959
 *         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":962
 *         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_9 = (__pyx_v_self->_qualarr == Py_None);
  __pyx_t_11 = (__pyx_t_9 != 0);
  if (__pyx_t_11) {

    /* "HTSeq/_HTSeq.pyx":963
 *         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, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":962
 *         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":964
 *         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
 */
  if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 964, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_self->_qualarr;
  __Pyx_INCREF(__pyx_t_1);
  {
    __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, 964, __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":965
 *             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_12 = (__pyx_v_minlen + 1);
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "HTSeq/_HTSeq.pyx":966
 *         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":967
 *         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_14 = __pyx_v_i;
    __pyx_t_15 = __pyx_t_14;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "HTSeq/_HTSeq.pyx":968
 *             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_11 = (((__pyx_v_seq_cstr[__pyx_v_j]) != (__pyx_v_pat_cstr[((__pyx_v_patlen - __pyx_v_i) + __pyx_v_j)])) != 0);
      if (__pyx_t_11) {

        /* "HTSeq/_HTSeq.pyx":969
 *             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_17 = __pyx_v_j;
        __pyx_t_18 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_18 = 0;
        if (unlikely(__pyx_t_18 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_18);
          __PYX_ERR(0, 969, __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_17, __pyx_pybuffernd_qual_array.diminfo[0].strides)));

        /* "HTSeq/_HTSeq.pyx":970
 *                 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_11 = ((__pyx_v_sum_mm_qual > __pyx_v_max_mm_qual) != 0);
        if (__pyx_t_11) {

          /* "HTSeq/_HTSeq.pyx":971
 *                     sum_mm_qual += qual_array[j]
 *                     if sum_mm_qual > max_mm_qual:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
 */
          goto __pyx_L8_break;

          /* "HTSeq/_HTSeq.pyx":970
 *                 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":968
 *             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":973
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[match: seqlen]
 * 
 */
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L8_break:;
  }

  /* "HTSeq/_HTSeq.pyx":974
 *             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, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 974, __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":948
 *         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);
  __Pyx_XDECREF(__pyx_t_7);
  { 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  int __pyx_v_max_mm_qual;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trim_left_end_with_quals (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_max_mm_qual,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_mm_qual);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_left_end_with_quals") < 0)) __PYX_ERR(0, 948, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_PyInt_As_int(values[1]); if (unlikely((__pyx_v_max_mm_qual == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L3_error)
    } else {
      __pyx_v_max_mm_qual = ((int)5);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_left_end_with_quals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 948, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 949, __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;
  __pyx_L0:;
  __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;
  __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, 948, __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":976
 *         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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  char *__pyx_t_10;
  int __pyx_t_11;
  long __pyx_t_12;
  long __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  __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 (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
    else {
      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim_right_end_with_quals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_mm_qual); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_pattern), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 976, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_pattern));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_pattern));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 976, __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
      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
      if (unlikely(type_dict_guard != tp_dict_version)) {
        tp_dict_version = obj_dict_version = 0;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":978
 *     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, 978, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":979
 *                                                           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, 979, __pyx_L1_error)
  }
  __pyx_t_8 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":981
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
  __pyx_t_9 = ((__pyx_v_seqlen < __pyx_v_patlen) != 0);
  if (__pyx_t_9) {

    /* "HTSeq/_HTSeq.pyx":982
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
 */
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":981
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":984
 *             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":985
 *         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, 985, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->__pyx_base.seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 985, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":986
 *             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, 986, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":987
 *         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":990
 *         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_9 = (__pyx_v_self->_qualarr == Py_None);
  __pyx_t_11 = (__pyx_t_9 != 0);
  if (__pyx_t_11) {

    /* "HTSeq/_HTSeq.pyx":991
 *         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, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":990
 *         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":992
 *         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
 */
  if (!(likely(((__pyx_v_self->_qualarr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->_qualarr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 992, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_self->_qualarr;
  __Pyx_INCREF(__pyx_t_1);
  {
    __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, 992, __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":993
 *             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_12 = (__pyx_v_minlen + 1);
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "HTSeq/_HTSeq.pyx":994
 *         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":995
 *         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_14 = __pyx_v_i;
    __pyx_t_15 = __pyx_t_14;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "HTSeq/_HTSeq.pyx":996
 *             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_11 = (((__pyx_v_seq_cstr[((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j)]) != (__pyx_v_pat_cstr[__pyx_v_j])) != 0);
      if (__pyx_t_11) {

        /* "HTSeq/_HTSeq.pyx":997
 *             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_17 = ((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j);
        __pyx_t_18 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_18 = 0;
        if (unlikely(__pyx_t_18 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_18);
          __PYX_ERR(0, 997, __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_17, __pyx_pybuffernd_qual_array.diminfo[0].strides)));

        /* "HTSeq/_HTSeq.pyx":998
 *                 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_11 = ((__pyx_v_sum_mm_qual > __pyx_v_max_mm_qual) != 0);
        if (__pyx_t_11) {

          /* "HTSeq/_HTSeq.pyx":999
 *                     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":998
 *                 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":996
 *             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":1001
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[0: seqlen - match]
 * 
 */
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L8_break:;
  }

  /* "HTSeq/_HTSeq.pyx":1002
 *             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, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1002, __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":976
 *         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);
  __Pyx_XDECREF(__pyx_t_7);
  { 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  int __pyx_v_max_mm_qual;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trim_right_end_with_quals (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_max_mm_qual,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_mm_qual);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trim_right_end_with_quals") < 0)) __PYX_ERR(0, 976, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_PyInt_As_int(values[1]); if (unlikely((__pyx_v_max_mm_qual == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
    } else {
      __pyx_v_max_mm_qual = ((int)5);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_right_end_with_quals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 976, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 977, __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;
  __pyx_L0:;
  __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;
  __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, 976, __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":1020
 *     """
 * 
 *     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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read,&__pyx_n_s_iv,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1020, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_read = values[0];
    __pyx_v_iv = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1020, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1021
 * 
 *     def __init__(self, read, iv):
 *         self._read = read             # <<<<<<<<<<<<<<
 *         self.iv = iv
 * 
 */
  if (!(likely(((__pyx_v_read) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_read, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1021, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_read;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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":1022
 *     def __init__(self, read, iv):
 *         self._read = read
 *         self.iv = iv             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  if (!(likely(((__pyx_v_iv) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_iv, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 1022, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_iv;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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":1020
 *     """
 * 
 *     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":1025
 * 
 *     @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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":1026
 *     @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":1025
 * 
 *     @property
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return self._read
 * 
 */

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

/* "HTSeq/_HTSeq.pyx":1028
 *         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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":1030
 *     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_n_s_paired_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __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, 1030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1031
 *         cdef str s
 *         if self.paired_end:
 *             s = "Paired-end read"             # <<<<<<<<<<<<<<
 *         else:
 *             s = "Read"
 */
    __Pyx_INCREF(__pyx_kp_u_Paired_end_read);
    __pyx_v_s = __pyx_kp_u_Paired_end_read;

    /* "HTSeq/_HTSeq.pyx":1030
 *     def __repr__(self):
 *         cdef str s
 *         if self.paired_end:             # <<<<<<<<<<<<<<
 *             s = "Paired-end read"
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1033
 *             s = "Paired-end read"
 *         else:
 *             s = "Read"             # <<<<<<<<<<<<<<
 *         if self.aligned:
 *             return "<%s object: %s '%s' aligned to %s>" % (
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_n_u_Read);
    __pyx_v_s = __pyx_n_u_Read;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1034
 *         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_n_s_aligned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __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, 1034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1035
 *             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);
    __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u__2);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);

    /* "HTSeq/_HTSeq.pyx":1036
 *         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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u_object_3);
    __pyx_t_3 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_object_3);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_object_3);
    __Pyx_INCREF(__pyx_v_s);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_s);
    __Pyx_INCREF(__pyx_kp_u__29);
    __pyx_t_3 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__29);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__29);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u_aligned_to);
    __pyx_t_3 += 13;
    __Pyx_GIVEREF(__pyx_kp_u_aligned_to);
    PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_aligned_to);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->iv)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__17);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__17);
    PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__17);

    /* "HTSeq/_HTSeq.pyx":1035
 *             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_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1034
 *         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":1038
 *                 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);
    __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u__2);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__2);

    /* "HTSeq/_HTSeq.pyx":1039
 *         else:
 *             return "<%s object: %s '%s', not aligned>" % (
 *                 self.__class__.__name__, s, self.read.name)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_object_3);
    __pyx_t_3 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_object_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_object_3);
    __Pyx_INCREF(__pyx_v_s);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_s);
    __Pyx_INCREF(__pyx_kp_u__29);
    __pyx_t_3 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__29);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__29);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_not_aligned);
    __pyx_t_3 += 15;
    __Pyx_GIVEREF(__pyx_kp_u_not_aligned);
    PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u_not_aligned);

    /* "HTSeq/_HTSeq.pyx":1038
 *                 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_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":1028
 *         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_5);
  __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":1042
 * 
 *     @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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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":1043
 *     @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":1042
 * 
 *     @property
 *     def paired_end(self):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "HTSeq/_HTSeq.pyx":1046
 * 
 *     @property
 *     def aligned(self):             # <<<<<<<<<<<<<<
 *         """Returns True unless self.iv is None. The latter indicates that
 *         this record decribes a read for which no alignment was found.
 */

/* 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1050
 *         this record decribes a read for which no alignment was found.
 *         """
 *         return self.iv is not None             # <<<<<<<<<<<<<<
 * 
 * cdef class AlignmentWithSequenceReversal(Alignment):
 */
  __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, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1046
 * 
 *     @property
 *     def aligned(self):             # <<<<<<<<<<<<<<
 *         """Returns True unless self.iv is None. The latter indicates that
 *         this record decribes a read for which no alignment was found.
 */

  /* 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(1, 43, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(1, 44, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __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:
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_read));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_read));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_read));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->iv));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->iv));
  __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:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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:
 *         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:             # <<<<<<<<<<<<<<
 *         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), 0x77bfdf2, None), state
 */
  /*else*/ {
    __pyx_t_2 = (((PyObject *)__pyx_v_self->_read) != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (((PyObject *)__pyx_v_self->iv) != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __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), 0x77bfdf2, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(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), 0x77bfdf2, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Alignment); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_125566450);
    __Pyx_GIVEREF(__pyx_int_125566450);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_125566450);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 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), 0x77bfdf2, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, None), state
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Alignment); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_125566450);
    __Pyx_GIVEREF(__pyx_int_125566450);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_125566450);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 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_6);
  __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), 0x77bfdf2, 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, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_6__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __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;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x77bfdf2, 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_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":1063
 *     """
 * 
 *     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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_as_aligned,&__pyx_n_s_iv,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read_as_aligned)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iv)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1063, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1063, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1063, __pyx_L3_error)
  __pyx_L3_error:;
  __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_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, 1, "read_as_aligned", 0))) __PYX_ERR(0, 1063, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 1063, __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;
  __pyx_L0:;
  __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":1064
 * 
 *     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(__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":1065
 *     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(__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":1066
 *         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(__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":1063
 *     """
 * 
 *     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":1069
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1070
 *     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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1071
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = ((!__pyx_t_1) != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__20, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_4;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":1072
 *             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_3 = ((PyObject *)__pyx_v_self->read_as_aligned);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__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_3);
      __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1071
 *         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":1074
 *                     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_3 = ((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_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__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_3);
      __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1075
 *                 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_3 = __pyx_v_self->read_as_aligned->__pyx_base.name;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __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_3);
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "HTSeq/_HTSeq.pyx":1070
 *     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":1076
 *                     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":1069
 * 
 *     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_3);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(1, 47, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(1, 48, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __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:
 */
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base._read));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_read_as_sequenced));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_read_as_sequenced));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.iv));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->__pyx_base.iv));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->read_as_aligned));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->read_as_aligned));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self->read_as_aligned));
  __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:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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:
 *         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:             # <<<<<<<<<<<<<<
 *         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), 0x1b7eeff, None), state
 */
  /*else*/ {
    __pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base._read) != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (((PyObject *)__pyx_v_self->_read_as_sequenced) != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base.iv) != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (((PyObject *)__pyx_v_self->read_as_aligned) != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __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), 0x1b7eeff, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(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), 0x1b7eeff, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_AlignmentWithSequ); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_28831487);
    __Pyx_GIVEREF(__pyx_int_28831487);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_28831487);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 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), 0x1b7eeff, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, None), state
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_AlignmentWithSequ); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_28831487);
    __Pyx_GIVEREF(__pyx_int_28831487);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_28831487);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 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_6);
  __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), 0x1b7eeff, 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, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __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;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0x1b7eeff, 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_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":1095
 *     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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bowtie_line,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bowtie_line)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_bowtie_line = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1099
 *         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_PyObject_GetAttrStr(__pyx_v_bowtie_line, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u__21) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u__21);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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, 1098, __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_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 7); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 7); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
      for (i=0; i < 8; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1098, __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_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 8) < 0) __PYX_ERR(0, 1098, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1098, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }

  /* "HTSeq/_HTSeq.pyx":1098
 *         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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  __pyx_v_readId = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_strand = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_chrom = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_v_position = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_v_read = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_v_qual = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1099
 *         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_8);
  __Pyx_GOTREF(__pyx_v_self->reserved);
  __Pyx_DECREF(__pyx_v_self->reserved);
  __pyx_v_self->reserved = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_GOTREF(__pyx_v_self->substitutions);
  __Pyx_DECREF(__pyx_v_self->substitutions);
  __pyx_v_self->substitutions = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "HTSeq/_HTSeq.pyx":1100
 *         (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, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_positionint = __pyx_t_12;

  /* "HTSeq/_HTSeq.pyx":1101
 *          self.reserved, self.substitutions) = bowtie_line.split('\t')
 *         positionint = int(position)
 *         AlignmentWithSequenceReversal.__init__(self,             # <<<<<<<<<<<<<<
 *                                                SequenceWithQualities(
 *                                                    read, readId, qual),
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal), __pyx_n_s_init); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "HTSeq/_HTSeq.pyx":1102
 *         positionint = int(position)
 *         AlignmentWithSequenceReversal.__init__(self,
 *                                                SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                                                    read, readId, qual),
 *                                                GenomicInterval(chrom, positionint, positionint + len(read), strand))
 */
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_read);
  __Pyx_GIVEREF(__pyx_v_read);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_read);
  __Pyx_INCREF(__pyx_v_readId);
  __Pyx_GIVEREF(__pyx_v_readId);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_readId);
  __Pyx_INCREF(__pyx_v_qual);
  __Pyx_GIVEREF(__pyx_v_qual);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_qual);
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1104
 *                                                SequenceWithQualities(
 *                                                    read, readId, qual),
 *                                                GenomicInterval(chrom, positionint, positionint + len(read), strand))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_positionint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (unlikely(__pyx_v_read == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1104, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_read); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1104, __pyx_L1_error)
  __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_positionint + __pyx_t_13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_chrom);
  __Pyx_GIVEREF(__pyx_v_chrom);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_strand);
  __Pyx_GIVEREF(__pyx_v_strand);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
  __pyx_t_8 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_7, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_7, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_12, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_12, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_12, __pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1095
 *     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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("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":1092
 *     """
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1092, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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":1093
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1093, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __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:
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
  __Pyx_INCREF(__pyx_v_self->reserved);
  __Pyx_GIVEREF(__pyx_v_self->reserved);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->reserved);
  __Pyx_INCREF(__pyx_v_self->substitutions);
  __Pyx_GIVEREF(__pyx_v_self->substitutions);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->substitutions);
  __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:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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:
 *         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:             # <<<<<<<<<<<<<<
 *         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), 0x482c176, None), state
 */
  /*else*/ {
    __pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read) != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced) != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv) != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned) != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->reserved != ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->substitutions != ((PyObject*)Py_None));
    __pyx_t_2 = (__pyx_t_5 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __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), 0x482c176, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(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), 0x482c176, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_BowtieAlignment); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_75678070);
    __Pyx_GIVEREF(__pyx_int_75678070);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_75678070);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 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), 0x482c176, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, None), state
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_BowtieAlignment); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_75678070);
    __Pyx_GIVEREF(__pyx_int_75678070);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_75678070);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 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_6);
  __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), 0x482c176, 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, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __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;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0x482c176, 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_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":1125
 *     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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_size,&__pyx_n_s_rfrom,&__pyx_n_s_rto,&__pyx_n_s_qfrom,&__pyx_n_s_qto,&__pyx_n_s_chrom,&__pyx_n_s_strand,&__pyx_n_s_check,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 1); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rfrom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 2); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rto)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 3); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qfrom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 4); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qto)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 5); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 6); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 7); __PYX_ERR(0, 1125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_check);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type_ = ((PyObject*)values[0]);
    __pyx_v_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
    __pyx_v_rfrom = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_rfrom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
    __pyx_v_rto = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_rto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
    __pyx_v_qfrom = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_qfrom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L3_error)
    __pyx_v_qto = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_qto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __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, 1126, __pyx_L3_error)
    } else {

      /* "HTSeq/_HTSeq.pyx":1126
 * 
 *     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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 1125, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1126, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1126, __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":1125
 *     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;
  __pyx_L0:;
  __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;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1127
 *     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":1128
 *                  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":1129
 *         self.type = type_
 *         self.size = size
 *         self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)             # <<<<<<<<<<<<<<
 *         self.query_from = qfrom
 *         self.query_to = qto
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rfrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_chrom);
  __Pyx_GIVEREF(__pyx_v_chrom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_strand);
  __Pyx_GIVEREF(__pyx_v_strand);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_strand);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__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_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1130
 *         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":1131
 *         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":1132
 *         self.query_from = qfrom
 *         self.query_to = qto
 *         if check and not self.check():             # <<<<<<<<<<<<<<
 *             raise ValueError, "Inconsistent CIGAR operation."
 * 
 */
  __pyx_t_5 = (__pyx_v_check != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":1133
 *         self.query_to = qto
 *         if check and not self.check():
 *             raise ValueError, "Inconsistent CIGAR operation."             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Inconsistent_CIGAR_operation, 0, 0);
    __PYX_ERR(0, 1133, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1132
 *         self.query_from = qfrom
 *         self.query_to = qto
 *         if check and not self.check():             # <<<<<<<<<<<<<<
 *             raise ValueError, "Inconsistent CIGAR operation."
 * 
 */
  }

  /* "HTSeq/_HTSeq.pyx":1125
 *     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_AddTraceback("HTSeq._HTSeq.CigarOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1135
 *             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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __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;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":1136
 * 
 *     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);
  __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__30);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__30);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__30);

  /* "HTSeq/_HTSeq.pyx":1137
 *     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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__31);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->size, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_base_s);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_base_s);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_base_s);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cigar_operation_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "HTSeq/_HTSeq.pyx":1138
 *         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_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_self->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":1137
 *     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_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_on_ref_iv);
  __pyx_t_2 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_on_ref_iv);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_on_ref_iv);

  /* "HTSeq/_HTSeq.pyx":1139
 *             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_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->ref_iv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_query_iv);
  __pyx_t_2 += 12;
  __Pyx_GIVEREF(__pyx_kp_u_query_iv);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_query_iv);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->query_from, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__4);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->query_to, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__32);
  __pyx_t_2 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__32);
  PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_kp_u__32);

  /* "HTSeq/_HTSeq.pyx":1136
 * 
 *     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_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __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":1135
 *             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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1141
 *             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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check (wrapper)", 0);
  __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_t_5;
  __Pyx_RefNannySetupContext("check", 0);

  /* "HTSeq/_HTSeq.pyx":1142
 * 
 *     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":1143
 *     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_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rlen = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":1144
 *         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_n_u_M, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_kp_u__33, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_5 != 0);
  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_n_u_X, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1145
 *         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_5 = ((__pyx_v_qlen == __pyx_v_self->size) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_rlen == __pyx_v_self->size) != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    __pyx_t_5 = ((!__pyx_t_3) != 0);
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1146
 *         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":1145
 *         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":1144
 *         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":1147
 *             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_n_u_I, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_S, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":1148
 *                 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) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_5 = __pyx_t_3;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_rlen == 0) != 0);
    __pyx_t_5 = __pyx_t_3;
    __pyx_L13_bool_binop_done:;
    __pyx_t_3 = ((!__pyx_t_5) != 0);
    if (__pyx_t_3) {

      /* "HTSeq/_HTSeq.pyx":1149
 *         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":1148
 *                 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":1147
 *             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":1150
 *             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_5 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_D, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1150, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_5 != 0);
  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_n_u_N, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1150, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1151
 *                 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_5 = ((__pyx_v_qlen == 0) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_rlen == __pyx_v_self->size) != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    __pyx_t_5 = ((!__pyx_t_3) != 0);
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1152
 *         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":1151
 *                 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":1150
 *             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":1153
 *             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_n_u_H, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_n_u_P, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":1154
 *                 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) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_5 = __pyx_t_3;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_rlen == 0) != 0);
    __pyx_t_5 = __pyx_t_3;
    __pyx_L23_bool_binop_done:;
    __pyx_t_3 = ((!__pyx_t_5) != 0);
    if (__pyx_t_3) {

      /* "HTSeq/_HTSeq.pyx":1155
 *         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":1154
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':
 *             if not (qlen == 0 and rlen == 0):             # <<<<<<<<<<<<<<
 *                 return False
 *         else:
 */
    }

    /* "HTSeq/_HTSeq.pyx":1153
 *             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":1157
 *                 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":1158
 *         else:
 *             return False
 *         return True             # <<<<<<<<<<<<<<
 * 
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1141
 *             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":1120
 * 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1120, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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":1121
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __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:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1122
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 1122, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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":1123
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->query_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->query_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __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:;
  __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_14CigarOperation_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __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_t_7;
  __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:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->query_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->query_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ref_iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ref_iv));
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->ref_iv));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->type);
  __Pyx_GIVEREF(__pyx_v_self->type);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->type);
  __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:
 *         state += (_dict,)
 */
  __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_5 = (__pyx_v__dict != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 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:
 *         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:             # <<<<<<<<<<<<<<
 *         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), 0xb5bd29c, None), state
 */
  /*else*/ {
    __pyx_t_5 = (((PyObject *)__pyx_v_self->ref_iv) != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->type != ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_7 != 0);
    __pyx_t_6 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_6;
  }
  __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), 0xb5bd29c, None), state
 *     else:
 */
  __pyx_t_6 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_6) {

    /* "(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), 0xb5bd29c, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_CigarOperation); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_190567068);
    __Pyx_GIVEREF(__pyx_int_190567068);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_190567068);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
    __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), 0xb5bd29c, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, None), state
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, 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_n_s_pyx_unpickle_CigarOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_190567068);
    __Pyx_GIVEREF(__pyx_int_190567068);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_190567068);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __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), 0xb5bd29c, 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, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __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;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xb5bd29c, 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_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":1162
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')
 * 
 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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_kp_u__12);
  PyObject *__pyx_v_strand = ((PyObject*)__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;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_15;
  __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":1166
 *     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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re_cigar_codes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_cigar_string) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cigar_string);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1166, __pyx_L1_error)
  __pyx_v_split_cigar = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1167
 *     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, 1167, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_split_cigar, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__12, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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, 1167, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_split_cigar); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1167, __pyx_L1_error)
  __pyx_t_5 = ((__Pyx_mod_Py_ssize_t(__pyx_t_6, 2) != 1) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":1168
 *     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_1 = PyUnicode_Format(__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_v_cigar_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1168, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1167
 *     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":1169
 *     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, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1170
 *         raise ValueError, "Illegal CIGAR string '%s'" % cigar_string
 *     cl = []
 *     for i in range(len(split_cigar) // 2):             # <<<<<<<<<<<<<<
 *         try:
 *             size = int(split_cigar[2 * i])
 */
  if (unlikely(__pyx_v_split_cigar == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1170, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_split_cigar); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1170, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t(__pyx_t_6, 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1170, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1170, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1170, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":1171
 *     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_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "HTSeq/_HTSeq.pyx":1172
 *     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, 1172, __pyx_L8_error)
        }
        __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_split_cigar, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_size = __pyx_t_11;

        /* "HTSeq/_HTSeq.pyx":1171
 *     cl = []
 *     for i in range(len(split_cigar) // 2):
 *         try:             # <<<<<<<<<<<<<<
 *             size = int(split_cigar[2 * i])
 *         except ValueError:
 */
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1173
 *         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_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_11) {
        __Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 1173, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_12);

        /* "HTSeq/_HTSeq.pyx":1174
 *             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_13 = PyUnicode_Format(__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_v_cigar_string); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_13, 0, 0);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(0, 1174, __pyx_L10_except_error)
      }
      goto __pyx_L10_except_error;
      __pyx_L10_except_error:;

      /* "HTSeq/_HTSeq.pyx":1171
 *     cl = []
 *     for i in range(len(split_cigar) // 2):
 *         try:             # <<<<<<<<<<<<<<
 *             size = int(split_cigar[2 * i])
 *         except ValueError:
 */
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L15_try_end:;
    }

    /* "HTSeq/_HTSeq.pyx":1175
 *         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, 1175, __pyx_L1_error)
    }
    __pyx_t_12 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_split_cigar, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_12)->tp_name), 0))) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_code, ((PyObject*)__pyx_t_12));
    __pyx_t_12 = 0;

    /* "HTSeq/_HTSeq.pyx":1176
 *             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_12 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_code);
    __Pyx_GIVEREF(__pyx_v_code);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_code);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_cl, __pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1170
 *         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_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1177
 *         code = split_cigar[2 * i + 1]
 *         cl.append((code, size))
 *     return build_cigar_list(cl, ref_left, chrom, strand)             # <<<<<<<<<<<<<<
 * 
 * cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_15.__pyx_n = 3;
  __pyx_t_15.ref_left = __pyx_v_ref_left;
  __pyx_t_15.chrom = __pyx_v_chrom;
  __pyx_t_15.strand = __pyx_v_strand;
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(__pyx_v_cl, 0, &__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1162
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')
 * 
 * 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cigar_string = 0;
  int __pyx_v_ref_left;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse_cigar (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cigar_string,&__pyx_n_s_ref_left,&__pyx_n_s_chrom,&__pyx_n_s_strand,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject*)__pyx_kp_u__12);
    values[3] = ((PyObject*)__pyx_kp_u__8);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cigar_string)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref_left);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_cigar") < 0)) __PYX_ERR(0, 1162, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cigar_string = ((PyObject*)values[0]);
    if (values[1]) {
      __pyx_v_ref_left = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ref_left == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L3_error)
    } else {
      __pyx_v_ref_left = ((int)0);
    }
    __pyx_v_chrom = ((PyObject*)values[2]);
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse_cigar", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1162, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 1162, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1162, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1162, __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;
  __pyx_L0:;
  __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;
  __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, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __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":1179
 *     return build_cigar_list(cl, ref_left, chrom, strand)
 * 
 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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_kp_u__12);
  PyObject *__pyx_v_strand = ((PyObject*)__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;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __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":1183
 *     cdef int rpos, qpos, size
 *     cdef str code
 *     rpos = ref_left             # <<<<<<<<<<<<<<
 *     qpos = 0
 *     res = []
 */
  __pyx_v_rpos = __pyx_v_ref_left;

  /* "HTSeq/_HTSeq.pyx":1184
 *     cdef str code
 *     rpos = ref_left
 *     qpos = 0             # <<<<<<<<<<<<<<
 *     res = []
 *     for code, size in cigar_pairs:
 */
  __pyx_v_qpos = 0;

  /* "HTSeq/_HTSeq.pyx":1185
 *     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, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1186
 *     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, 1186, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_cigar_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1186, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    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, 1186, __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_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1186, __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, 1186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      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, 1186, __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, 1186, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1186, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __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":1187
 *     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_n_u_M, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_10 != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_9 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_kp_u__33, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
    __pyx_t_10 = (__pyx_t_11 != 0);
    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_n_u_X, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_10 != 0);
    __pyx_t_9 = __pyx_t_11;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1189
 *         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_3 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);

      /* "HTSeq/_HTSeq.pyx":1188
 *     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_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_v_code);
      __Pyx_GIVEREF(__pyx_v_code);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_code);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_v_strand);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_12); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "HTSeq/_HTSeq.pyx":1190
 *             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":1191
 *                 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":1187
 *     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":1192
 *             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_n_u_I, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_9 != 0);
    if (__pyx_t_11) {

      /* "HTSeq/_HTSeq.pyx":1194
 *         elif code == 'I':
 *             res.append(CigarOperation(
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))             # <<<<<<<<<<<<<<
 *             qpos += size
 *         elif code == 'D':
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "HTSeq/_HTSeq.pyx":1193
 *             qpos += size
 *         elif code == 'I':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
 */
      __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_n_u_I);
      __Pyx_GIVEREF(__pyx_n_u_I);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_I);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_strand);
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1193, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":1195
 *             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":1192
 *             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":1196
 *                 '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_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_D, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __pyx_t_9 = (__pyx_t_11 != 0);
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1198
 *         elif code == 'D':
 *             res.append(CigarOperation(
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *             rpos += size
 *         elif code == 'N':
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);

      /* "HTSeq/_HTSeq.pyx":1197
 *             qpos += size
 *         elif code == 'D':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
 */
      __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_n_u_D);
      __Pyx_GIVEREF(__pyx_n_u_D);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_u_D);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_13);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_strand);
      __pyx_t_5 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1197, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "HTSeq/_HTSeq.pyx":1199
 *             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":1196
 *                 '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":1200
 *                 '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_n_u_N, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1200, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_9 != 0);
    if (__pyx_t_11) {

      /* "HTSeq/_HTSeq.pyx":1202
 *         elif code == 'N':
 *             res.append(CigarOperation(
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *             rpos += size
 *         elif code == 'S':
 */
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "HTSeq/_HTSeq.pyx":1201
 *             rpos += size
 *         elif code == 'N':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
 */
      __pyx_t_5 = PyTuple_New(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_n_u_N);
      __Pyx_GIVEREF(__pyx_n_u_N);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_N);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_3);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_v_strand);
      __pyx_t_13 = 0;
      __pyx_t_12 = 0;
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_3); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1201, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1203
 *             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":1200
 *                 '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":1204
 *                 '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_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_S, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1204, __pyx_L1_error)
    __pyx_t_9 = (__pyx_t_11 != 0);
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1206
 *         elif code == 'S':
 *             res.append(CigarOperation(
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))             # <<<<<<<<<<<<<<
 *             qpos += size
 *         elif code == 'H':
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);

      /* "HTSeq/_HTSeq.pyx":1205
 *             rpos += size
 *         elif code == 'S':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
 */
      __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_n_u_S);
      __Pyx_GIVEREF(__pyx_n_u_S);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_u_S);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_v_strand);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_12); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "HTSeq/_HTSeq.pyx":1207
 *             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":1204
 *                 '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":1208
 *                 '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_n_u_H, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_9 != 0);
    if (__pyx_t_11) {

      /* "HTSeq/_HTSeq.pyx":1210
 *         elif code == 'H':
 *             res.append(CigarOperation(
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *         elif code == 'P':
 *             res.append(CigarOperation(
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "HTSeq/_HTSeq.pyx":1209
 *             qpos += size
 *         elif code == 'H':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':
 */
      __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_n_u_H);
      __Pyx_GIVEREF(__pyx_n_u_H);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_H);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_strand);
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1209, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":1208
 *                 '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":1211
 *             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_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_n_u_P, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1211, __pyx_L1_error)
    __pyx_t_9 = (__pyx_t_11 != 0);
    if (likely(__pyx_t_9)) {

      /* "HTSeq/_HTSeq.pyx":1213
 *         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_5 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);

      /* "HTSeq/_HTSeq.pyx":1212
 *                 '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_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_n_u_P);
      __Pyx_GIVEREF(__pyx_n_u_P);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_u_P);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_13);
      __Pyx_INCREF(__pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_strand);
      __pyx_t_5 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1212, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "HTSeq/_HTSeq.pyx":1211
 *             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":1215
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         else:
 *             raise ValueError, "Unknown CIGAR code '%s' encountered." % code             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    /*else*/ {
      __pyx_t_13 = PyUnicode_Format(__pyx_kp_u_Unknown_CIGAR_code_s_encountered, __pyx_v_code); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_13, 0, 0);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __PYX_ERR(0, 1215, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "HTSeq/_HTSeq.pyx":1186
 *     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":1216
 *         else:
 *             raise ValueError, "Unknown CIGAR code '%s' encountered." % code
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef _parse_SAM_optional_field_value(str field):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1179
 *     return build_cigar_list(cl, ref_left, chrom, strand)
 * 
 * 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_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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cigar_pairs = 0;
  int __pyx_v_ref_left;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_cigar_list (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cigar_pairs,&__pyx_n_s_ref_left,&__pyx_n_s_chrom,&__pyx_n_s_strand,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject*)__pyx_kp_u__12);
    values[3] = ((PyObject*)__pyx_kp_u__8);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cigar_pairs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref_left);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_cigar_list") < 0)) __PYX_ERR(0, 1179, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cigar_pairs = ((PyObject*)values[0]);
    if (values[1]) {
      __pyx_v_ref_left = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ref_left == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L3_error)
    } else {
      __pyx_v_ref_left = ((int)0);
    }
    __pyx_v_chrom = ((PyObject*)values[2]);
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_cigar_list", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1179, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 1179, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1179, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1179, __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;
  __pyx_L0:;
  __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;
  __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, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __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":1218
 *     return res
 * 
 * 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;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("_parse_SAM_optional_field_value", 0);

  /* "HTSeq/_HTSeq.pyx":1219
 * 
 * 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, 1219, __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, 1219, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 < 5) != 0);
  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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1219, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_4 != 58) != 0);
  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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1219, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_4 != 58) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":1220
 * 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_5 = PyUnicode_Format(__pyx_kp_u_Malformatted_SAM_optional_field, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1220, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1219
 * 
 * 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":1221
 *     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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 65) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1222
 *         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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1222, __pyx_L1_error)
    __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1221
 *     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":1223
 *     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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 0x69) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1224
 *         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, 1224, __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, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1223
 *     if field[3] == 'A':
 *         return field[5]
 *     elif field[3] == 'i':             # <<<<<<<<<<<<<<
 *         return int(field[5:])
 *     elif field[3] == 'f':
 */
  }

  /* "HTSeq/_HTSeq.pyx":1225
 *     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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 0x66) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1226
 *         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, 1226, __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, 1226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1225
 *     elif field[3] == 'i':
 *         return int(field[5:])
 *     elif field[3] == 'f':             # <<<<<<<<<<<<<<
 *         return float(field[5:])
 *     elif field[3] == 'Z':
 */
  }

  /* "HTSeq/_HTSeq.pyx":1227
 *     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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 90) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1228
 *         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, 1228, __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, 1228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1227
 *     elif field[3] == 'f':
 *         return float(field[5:])
 *     elif field[3] == 'Z':             # <<<<<<<<<<<<<<
 *         return field[5:]
 *     elif field[3] == 'H':
 */
  }

  /* "HTSeq/_HTSeq.pyx":1229
 *     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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 72) != 0);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1230
 *         return field[5:]
 *     elif field[3] == 'H':
 *         return int(field[5:], 16)             # <<<<<<<<<<<<<<
 *     elif field[3] == 'B':
 *         if field[5] == 'f':
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_field == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1230, __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, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_INCREF(__pyx_int_16);
    __Pyx_GIVEREF(__pyx_int_16);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_16);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1229
 *     elif field[3] == 'Z':
 *         return field[5:]
 *     elif field[3] == 'H':             # <<<<<<<<<<<<<<
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':
 */
  }

  /* "HTSeq/_HTSeq.pyx":1231
 *     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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 66) != 0);
  if (likely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":1232
 *         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_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_4 == 0x66) != 0);
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":1233
 *     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_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__pyx_v_field == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1233, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_field, 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = PyUnicode_Split(((PyObject*)__pyx_t_6), __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_8, ((PyObject *)(&PyFloat_Type))};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_8, ((PyObject *)(&PyFloat_Type))};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_8);
        __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
        __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, ((PyObject *)(&PyFloat_Type)));
        __pyx_t_8 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":1232
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':
 *         if field[5] == 'f':             # <<<<<<<<<<<<<<
 *             return numpy.array(field[7:].split(','), float)
 *         else:
 */
    }

    /* "HTSeq/_HTSeq.pyx":1235
 *             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_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__pyx_v_field == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1235, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_PyUnicode_Substring(__pyx_v_field, 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyUnicode_Split(((PyObject*)__pyx_t_7), __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, ((PyObject *)(&PyInt_Type))};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, ((PyObject *)(&PyInt_Type))};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_8);
        __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
        __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, ((PyObject *)(&PyInt_Type)));
        __pyx_t_8 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "HTSeq/_HTSeq.pyx":1231
 *     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":1237
 *             return numpy.array(field[7:].split(','), int)
 *     else:
 *         raise ValueError, "SAM optional field with illegal type letter '%s'" % field[2]             # <<<<<<<<<<<<<<
 * 
 * cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_SAM_optional_field_with_illegal, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_10, 0, 0);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __PYX_ERR(0, 1237, __pyx_L1_error)
  }

  /* "HTSeq/_HTSeq.pyx":1218
 *     return res
 * 
 * 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_8);
  __Pyx_XDECREF(__pyx_t_10);
  __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":1253
 *     """
 * 
 *     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, PyObject *__pyx_v_sf); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment(PyObject *__pyx_v_self, PyObject *__pyx_v_sf) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pysam_AlignedSegment (wrapper)", 0);
  __pyx_r = __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));

  /* function exit code */
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("to_pysam_AlignedSegment", 0);

  /* "HTSeq/_HTSeq.pyx":1254
 * 
 *     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":1255
 *     def to_pysam_AlignedSegment(self, sf):
 *         try:
 *             import pysam             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             sys.stderr.write(
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_pysam, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pysam = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":1254
 * 
 *     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":1256
 *         try:
 *             import pysam
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             sys.stderr.write(
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1256, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "HTSeq/_HTSeq.pyx":1257
 *             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_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_kp_u_Please_Install_PySam_to_use_this) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_u_Please_Install_PySam_to_use_this);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "HTSeq/_HTSeq.pyx":1259
 *             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_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_7);
      __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; 
      __PYX_ERR(0, 1259, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "HTSeq/_HTSeq.pyx":1254
 * 
 *     def to_pysam_AlignedSegment(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
 */
    __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":1261
 *             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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pysam, __pyx_n_s_AlignedSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1262
 * 
 *         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_6 = PyObject_RichCompare(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__19, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __pyx_t_12;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_11) {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_seq); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_seq); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __pyx_t_8;
    __pyx_t_8 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_query_sequence, __pyx_t_7) < 0) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1263
 *         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_8 = PyObject_RichCompare(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), __pyx_n_s_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_kp_u__19, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_11 = __pyx_t_12;
  __pyx_L13_bool_binop_done:;
  if (__pyx_t_11) {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_qual); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_get_reverse_complement); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_qual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_query_qualities, __pyx_t_7) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1264
 *         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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_query_name, __pyx_t_6) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1265
 *         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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_flag, __pyx_t_6) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1266
 *         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_6 = __pyx_v_self->optional_fields;
  __Pyx_INCREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tags, __pyx_t_6) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1267
 *         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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_11) {

    /* "HTSeq/_HTSeq.pyx":1268
 *         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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1268, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "HTSeq/_HTSeq.pyx":1269
 *         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, 1269, __pyx_L18_error)
      }
      __pyx_t_7 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0;
      for (;;) {
        if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1269, __pyx_L18_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_c, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1268
 *         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_n_s_cigar_operation_code_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_c, __pyx_n_s_type_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_c, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
        __pyx_t_9 = 0;
        __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1268, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1269
 *         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_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c); __pyx_8genexpr2__pyx_v_c = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c); __pyx_8genexpr2__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1268
 *         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_n_s_cigartuples, __pyx_t_6) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1270
 *             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_6 = __Pyx_PyInt_From_long(__pyx_v_self->__pyx_base.__pyx_base.iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_reference_start, __pyx_t_6) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1271
 *                              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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_reference_id, __pyx_t_6) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1272
 *             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_6 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_template_length, __pyx_t_6) < 0) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1273
 *             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_6 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mapping_quality, __pyx_t_6) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1267
 *         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":1275
 *             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_n_s_reference_start, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1276
 *         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_n_s_reference_id, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1276, __pyx_L1_error)
  }
  __pyx_L15:;

  /* "HTSeq/_HTSeq.pyx":1277
 *             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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mate_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_11) {

    /* "HTSeq/_HTSeq.pyx":1278
 *             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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->mate_start->__pyx_base.chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->mate_start->__pyx_base.chrom);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_id, __pyx_t_6) < 0) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1279
 *         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_6 = __Pyx_PyInt_From_long(__pyx_v_self->mate_start->__pyx_base.start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_start, __pyx_t_6) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1277
 *             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_L22;
  }

  /* "HTSeq/_HTSeq.pyx":1281
 *             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_n_s_next_reference_id, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1281, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1282
 *         else:
 *             a.next_reference_id = -1
 *             a.next_reference_start = -1             # <<<<<<<<<<<<<<
 *         return a
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_next_reference_start, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1282, __pyx_L1_error)
  }
  __pyx_L22:;

  /* "HTSeq/_HTSeq.pyx":1283
 *             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":1253
 *     """
 * 
 *     def to_pysam_AlignedSegment(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":1285
 *         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, PyObject *__pyx_v_sf); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead(PyObject *__pyx_v_self, PyObject *__pyx_v_sf) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pysam_AlignedRead (wrapper)", 0);
  __pyx_r = __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));

  /* function exit code */
  __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  __Pyx_RefNannySetupContext("to_pysam_AlignedRead", 0);

  /* "HTSeq/_HTSeq.pyx":1286
 * 
 *     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":1287
 *     def to_pysam_AlignedRead(self, sf):
 *         try:
 *             import pysam             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             sys.stderr.write(
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_pysam, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pysam = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":1286
 * 
 *     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":1288
 *         try:
 *             import pysam
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             sys.stderr.write(
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1288, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "HTSeq/_HTSeq.pyx":1289
 *             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_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_kp_u_Please_Install_PySam_to_use_this) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_u_Please_Install_PySam_to_use_this);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "HTSeq/_HTSeq.pyx":1291
 *             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_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_7);
      __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; 
      __PYX_ERR(0, 1291, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "HTSeq/_HTSeq.pyx":1286
 * 
 *     def to_pysam_AlignedRead(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
 */
    __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":1293
 *             raise
 * 
 *         a = pysam.AlignedRead()             # <<<<<<<<<<<<<<
 *         a.seq = self.read.seq
 *         a.qual = self.read.qualstr
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pysam, __pyx_n_s_AlignedRead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1294
 * 
 *         a = pysam.AlignedRead()
 *         a.seq = self.read.seq             # <<<<<<<<<<<<<<
 *         a.qual = self.read.qualstr
 *         a.qname = self.read.name
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_seq); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_seq, __pyx_t_6) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1295
 *         a = pysam.AlignedRead()
 *         a.seq = self.read.seq
 *         a.qual = self.read.qualstr             # <<<<<<<<<<<<<<
 *         a.qname = self.read.name
 *         a.flag = self.flag
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_qualstr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_qual, __pyx_t_7) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1296
 *         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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_qname, __pyx_t_6) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1297
 *         a.qual = self.read.qualstr
 *         a.qname = self.read.name
 *         a.flag = self.flag             # <<<<<<<<<<<<<<
 *         a.tags = self.optional_fields
 *         if self.aligned:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_flag, __pyx_t_6) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1298
 *         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_6 = __pyx_v_self->optional_fields;
  __Pyx_INCREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tags, __pyx_t_6) < 0) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1299
 *         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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_11) {

    /* "HTSeq/_HTSeq.pyx":1300
 *         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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1300, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "HTSeq/_HTSeq.pyx":1301
 *         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, 1301, __pyx_L14_error)
      }
      __pyx_t_7 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
      for (;;) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1301, __pyx_L14_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_c, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1300
 *         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_n_s_cigar_operation_code_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_c, __pyx_n_s_type_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1300, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1300, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_c, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1300, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
        __pyx_t_9 = 0;
        __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1300, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1301
 *         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_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0;
      goto __pyx_L17_exit_scope;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L17_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1300
 *         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_n_s_cigar, __pyx_t_6) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1302
 *             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_6 = __Pyx_PyInt_From_long(__pyx_v_self->__pyx_base.__pyx_base.iv->start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_pos, __pyx_t_6) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1303
 *                        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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_tid, __pyx_t_6) < 0) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1304
 *             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_6 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_isize, __pyx_t_6) < 0) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1305
 *             a.tid = sf.gettid(self.iv.chrom)
 *             a.isize = self.inferred_insert_size
 *             a.mapq = self.aQual             # <<<<<<<<<<<<<<
 *         else:
 *             a.pos = -1
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mapq, __pyx_t_6) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1299
 *         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":1307
 *             a.mapq = self.aQual
 *         else:
 *             a.pos = -1             # <<<<<<<<<<<<<<
 *             a.tid = -1
 *         if self.mate_aligned:
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_pos, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1308
 *         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_n_s_tid, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1308, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "HTSeq/_HTSeq.pyx":1309
 *             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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mate_aligned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_11) {

    /* "HTSeq/_HTSeq.pyx":1310
 *             a.tid = -1
 *         if self.mate_aligned:
 *             a.mrnm = sf.gettid(self.mate_start.chrom)             # <<<<<<<<<<<<<<
 *             a.mpos = self.mate_start.start
 *         else:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sf, __pyx_n_s_gettid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->mate_start->__pyx_base.chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->mate_start->__pyx_base.chrom);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mrnm, __pyx_t_6) < 0) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1311
 *         if self.mate_aligned:
 *             a.mrnm = sf.gettid(self.mate_start.chrom)
 *             a.mpos = self.mate_start.start             # <<<<<<<<<<<<<<
 *         else:
 *             a.mrnm = -1
 */
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->mate_start->__pyx_base.start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mpos, __pyx_t_6) < 0) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1309
 *             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_L18;
  }

  /* "HTSeq/_HTSeq.pyx":1313
 *             a.mpos = self.mate_start.start
 *         else:
 *             a.mrnm = -1             # <<<<<<<<<<<<<<
 *             a.mpos = -1
 *         return a
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mrnm, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1313, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1314
 *         else:
 *             a.mrnm = -1
 *             a.mpos = -1             # <<<<<<<<<<<<<<
 *         return a
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_mpos, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  }
  __pyx_L18:;

  /* "HTSeq/_HTSeq.pyx":1315
 *             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":1285
 *         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_6);
  __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.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":1318
 * 
 *     @classmethod
 *     def from_pysam_AlignedRead(cls, read, samfile):             # <<<<<<<<<<<<<<
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_read = 0;
  PyObject *__pyx_v_samfile = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pysam_AlignedRead (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read,&__pyx_n_s_samfile,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedRead", 1, 2, 2, 1); __PYX_ERR(0, 1318, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pysam_AlignedRead") < 0)) __PYX_ERR(0, 1318, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_read = values[0];
    __pyx_v_samfile = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedRead", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1318, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  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)(PyObject *);
  int __pyx_t_13;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("from_pysam_AlignedRead", 0);

  /* "HTSeq/_HTSeq.pyx":1319
 *     @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_n_s_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __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, 1319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_kp_u__20);
    __pyx_t_1 = __pyx_kp_u__20;
  } else {
    __Pyx_INCREF(__pyx_kp_u__19);
    __pyx_t_1 = __pyx_kp_u__19;
  }
  __pyx_v_strand = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1320
 *     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_n_s_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __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, 1320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1321
 *         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_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1322
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)             # <<<<<<<<<<<<<<
 *         else:
 *             iv = None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_aend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1320
 *     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":1324
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)
 *         else:
 *             iv = None             # <<<<<<<<<<<<<<
 *         if read.qual != b"*":
 *             seq = SequenceWithQualities(
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1325
 *         else:
 *             iv = None
 *         if read.qual != b"*":             # <<<<<<<<<<<<<<
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, read.qual.encode())
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b__34, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1327
 *         if read.qual != b"*":
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, read.qual.encode())             # <<<<<<<<<<<<<<
 *         else:
 *             seq = SequenceWithQualities(read.query_sequence.encode(
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qual); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1326
 *             iv = None
 *         if read.qual != b"*":
 *             seq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 read.query_sequence.encode(), read.qname, read.qual.encode())
 *         else:
 */
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":1325
 *         else:
 *             iv = None
 *         if read.qual != b"*":             # <<<<<<<<<<<<<<
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, read.qual.encode())
 */
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":1329
 *                 read.query_sequence.encode(), read.qname, read.qual.encode())
 *         else:
 *             seq = SequenceWithQualities(read.query_sequence.encode(             # <<<<<<<<<<<<<<
 *             ), read.qname, read.qual.encode(), "noquals")
 *         a = SAM_Alignment(seq, iv)
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1330
 *         else:
 *             seq = SequenceWithQualities(read.query_sequence.encode(
 *             ), read.qname, read.qual.encode(), "noquals")             # <<<<<<<<<<<<<<
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_qual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":1329
 *                 read.query_sequence.encode(), read.qname, read.qual.encode())
 *         else:
 *             seq = SequenceWithQualities(read.query_sequence.encode(             # <<<<<<<<<<<<<<
 *             ), read.qname, read.qual.encode(), "noquals")
 *         a = SAM_Alignment(seq, iv)
 */
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
    __Pyx_INCREF(__pyx_n_u_noquals);
    __Pyx_GIVEREF(__pyx_n_u_noquals);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_n_u_noquals);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_7);
    __pyx_t_7 = 0;
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":1331
 *             seq = SequenceWithQualities(read.query_sequence.encode(
 *             ), read.qname, read.qual.encode(), "noquals")
 *         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 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(((PyObject *)__pyx_v_seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_seq));
  __Pyx_INCREF(((PyObject *)__pyx_v_iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_iv));
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_a = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1333
 *         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, 1333, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1332
 *             ), read.qname, read.qual.encode(), "noquals")
 *         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, 1332, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "HTSeq/_HTSeq.pyx":1333
 *         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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_cigar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1333, __pyx_L7_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1333, __pyx_L7_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_9(__pyx_t_5);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1333, __pyx_L7_error)
            }
            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, 1333, __pyx_L7_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1333, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1333, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
          index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_2);
          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1333, __pyx_L7_error)
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_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, 1333, __pyx_L7_error)
          __pyx_L11_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_code, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_length, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "HTSeq/_HTSeq.pyx":1332
 *             ), read.qname, read.qual.encode(), "noquals")
 *         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_1, __pyx_n_s_cigar_operation_codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr4__pyx_v_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1332, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
        __Pyx_INCREF(__pyx_8genexpr4__pyx_v_length);
        __Pyx_GIVEREF(__pyx_8genexpr4__pyx_v_length);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_8genexpr4__pyx_v_length);
        __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1332, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_L12_exit_scope;
      __pyx_L7_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_L12_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1333
 *         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_n_s_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_v_chrom)) { __Pyx_RaiseUnboundLocalError("chrom"); __PYX_ERR(0, 1333, __pyx_L1_error) }
    if (!(likely(PyUnicode_CheckExact(__pyx_v_chrom))||((__pyx_v_chrom) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_chrom)->tp_name), 0))) __PYX_ERR(0, 1333, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1332
 *             ), read.qname, read.qual.encode(), "noquals")
 *         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_14.__pyx_n = 3;
    __pyx_t_14.ref_left = __pyx_t_13;
    __pyx_t_14.chrom = ((PyObject*)__pyx_v_chrom);
    __pyx_t_14.strand = __pyx_v_strand;
    __pyx_t_5 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(((PyObject*)__pyx_t_7), 0, &__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {

    /* "HTSeq/_HTSeq.pyx":1333
 *         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, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5;
    __pyx_t_5 = 0;
  }

  /* "HTSeq/_HTSeq.pyx":1332
 *             ), read.qname, read.qual.encode(), "noquals")
 *         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_6);
  __Pyx_GOTREF(__pyx_v_a->cigar);
  __Pyx_DECREF(__pyx_v_a->cigar);
  __pyx_v_a->cigar = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1334
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_isize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->inferred_insert_size = __pyx_t_13;

  /* "HTSeq/_HTSeq.pyx":1335
 *             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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mapq); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->aQual = __pyx_t_13;

  /* "HTSeq/_HTSeq.pyx":1336
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_flag, __pyx_t_6) < 0) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1337
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_proper_pair); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->proper_pair = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1338
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_secondary); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->not_primary_alignment = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1339
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_qcfail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->failed_platform_qc = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1340
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_duplicate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->pcr_or_optical_duplicate = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1341
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_supplementary); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_a->supplementary = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1342
 *         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_kp_u__12);
  __Pyx_GIVEREF(__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_kp_u__12;

  /* "HTSeq/_HTSeq.pyx":1343
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_a->optional_fields);
  __Pyx_DECREF(__pyx_v_a->optional_fields);
  __pyx_v_a->optional_fields = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "HTSeq/_HTSeq.pyx":1344
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_paired); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1346
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_unmapped); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = ((!__pyx_t_3) != 0);
    if (__pyx_t_15) {
    } else {
      __pyx_t_4 = __pyx_t_15;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_t_6, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __pyx_t_15;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1347
 *             # 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_reverse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1347, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_kp_u__20);
        __pyx_t_5 = __pyx_kp_u__20;
      } else {
        __Pyx_INCREF(__pyx_kp_u__19);
        __pyx_t_5 = __pyx_kp_u__19;
      }
      __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":1349
 *                 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "HTSeq/_HTSeq.pyx":1348
 *             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_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_strand);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__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_6);
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":1346
 *         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_L14;
    }

    /* "HTSeq/_HTSeq.pyx":1351
 *                     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(__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_L14:;

    /* "HTSeq/_HTSeq.pyx":1352
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1352, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1353
 *                 a.mate_start = None
 *             if read.is_read1:
 *                 a.pe_which = intern("first")             # <<<<<<<<<<<<<<
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")
 */
      __pyx_t_6 = __Pyx_Intern(__pyx_n_u_first); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1353, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":1352
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 */
      goto __pyx_L17;
    }

    /* "HTSeq/_HTSeq.pyx":1354
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1354, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1355
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")             # <<<<<<<<<<<<<<
 *             else:
 *                 a.pe_which = intern("unknown")
 */
      __pyx_t_6 = __Pyx_Intern(__pyx_n_u_second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1355, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":1354
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
 */
      goto __pyx_L17;
    }

    /* "HTSeq/_HTSeq.pyx":1357
 *                 a.pe_which = intern("second")
 *             else:
 *                 a.pe_which = intern("unknown")             # <<<<<<<<<<<<<<
 *         else:
 *             a.pe_which = intern("not_paired_end")
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_Intern(__pyx_n_u_unknown); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1357, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
    }
    __pyx_L17:;

    /* "HTSeq/_HTSeq.pyx":1344
 *         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_L13;
  }

  /* "HTSeq/_HTSeq.pyx":1359
 *                 a.pe_which = intern("unknown")
 *         else:
 *             a.pe_which = intern("not_paired_end")             # <<<<<<<<<<<<<<
 *         return a
 * 
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_Intern(__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1359, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_v_a->pe_which);
    __Pyx_DECREF(__pyx_v_a->pe_which);
    __pyx_v_a->pe_which = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L13:;

  /* "HTSeq/_HTSeq.pyx":1360
 *         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":1318
 * 
 *     @classmethod
 *     def from_pysam_AlignedRead(cls, read, samfile):             # <<<<<<<<<<<<<<
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 */

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":1363
 * 
 *     @classmethod
 *     def from_pysam_AlignedSegment(cls, read, samfile):             # <<<<<<<<<<<<<<
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_read = 0;
  PyObject *__pyx_v_samfile = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pysam_AlignedSegment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read,&__pyx_n_s_samfile,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedSegment", 1, 2, 2, 1); __PYX_ERR(0, 1363, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pysam_AlignedSegment") < 0)) __PYX_ERR(0, 1363, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_read = values[0];
    __pyx_v_samfile = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedSegment", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1363, __pyx_L3_error)
  __pyx_L3_error:;
  __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 */
  __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;
  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;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("from_pysam_AlignedSegment", 0);

  /* "HTSeq/_HTSeq.pyx":1364
 *     @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_n_s_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __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, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_kp_u__20);
    __pyx_t_1 = __pyx_kp_u__20;
  } else {
    __Pyx_INCREF(__pyx_kp_u__19);
    __pyx_t_1 = __pyx_kp_u__19;
  }
  __pyx_v_strand = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1365
 *     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_n_s_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __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, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1366
 *         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_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1367
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,             # <<<<<<<<<<<<<<
 *                                  read.reference_end, strand)
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_reference_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "HTSeq/_HTSeq.pyx":1368
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,
 *                                  read.reference_end, strand)             # <<<<<<<<<<<<<<
 *         else:
 *             iv = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_reference_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":1367
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,             # <<<<<<<<<<<<<<
 *                                  read.reference_end, strand)
 *         else:
 */
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_strand);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1365
 *     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":1370
 *                                  read.reference_end, strand)
 *         else:
 *             iv = None             # <<<<<<<<<<<<<<
 *         seq = SequenceWithQualities(
 *             read.query_sequence.encode(), read.query_name, b'', 'noquals')
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1372
 *             iv = None
 *         seq = SequenceWithQualities(
 *             read.query_sequence.encode(), read.query_name, b'', 'noquals')             # <<<<<<<<<<<<<<
 *         if read.query_qualities != None:
 *             seq.qual = numpy.array(read.query_qualities)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "HTSeq/_HTSeq.pyx":1371
 *         else:
 *             iv = None
 *         seq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *             read.query_sequence.encode(), read.query_name, b'', 'noquals')
 *         if read.query_qualities != None:
 */
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_INCREF(__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_kp_b__12);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_b__12);
  __Pyx_INCREF(__pyx_n_u_noquals);
  __Pyx_GIVEREF(__pyx_n_u_noquals);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_n_u_noquals);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1373
 *         seq = SequenceWithQualities(
 *             read.query_sequence.encode(), read.query_name, b'', 'noquals')
 *         if read.query_qualities != None:             # <<<<<<<<<<<<<<
 *             seq.qual = numpy.array(read.query_qualities)
 *         a = SAM_Alignment(seq, iv)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_qualities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1374
 *             read.query_sequence.encode(), read.query_name, b'', 'noquals')
 *         if read.query_qualities != None:
 *             seq.qual = numpy.array(read.query_qualities)             # <<<<<<<<<<<<<<
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_query_qualities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_seq), __pyx_n_s_qual, __pyx_t_5) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":1373
 *         seq = SequenceWithQualities(
 *             read.query_sequence.encode(), read.query_name, b'', 'noquals')
 *         if read.query_qualities != None:             # <<<<<<<<<<<<<<
 *             seq.qual = numpy.array(read.query_qualities)
 *         a = SAM_Alignment(seq, iv)
 */
  }

  /* "HTSeq/_HTSeq.pyx":1375
 *         if read.query_qualities != None:
 *             seq.qual = numpy.array(read.query_qualities)
 *         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 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_seq));
  __Pyx_INCREF(((PyObject *)__pyx_v_iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_iv));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_a = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1377
 *         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, 1377, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1376
 *             seq.qual = numpy.array(read.query_qualities)
 *         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, 1376, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "HTSeq/_HTSeq.pyx":1377
 *         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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_cigartuples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1377, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1377, __pyx_L7_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1377, __pyx_L7_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_8(__pyx_t_6);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1377, __pyx_L7_error)
            }
            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, 1377, __pyx_L7_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1377, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1377, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1377, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
          index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1377, __pyx_L7_error)
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_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, 1377, __pyx_L7_error)
          __pyx_L11_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_10);
        __pyx_t_10 = 0;

        /* "HTSeq/_HTSeq.pyx":1376
 *             seq.qual = numpy.array(read.query_qualities)
 *         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_1, __pyx_n_s_cigar_operation_codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr5__pyx_v_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1376, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
        __Pyx_INCREF(__pyx_8genexpr5__pyx_v_length);
        __Pyx_GIVEREF(__pyx_8genexpr5__pyx_v_length);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_8genexpr5__pyx_v_length);
        __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1376, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_L12_exit_scope;
      __pyx_L7_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_L12_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1377
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_reference_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_v_chrom)) { __Pyx_RaiseUnboundLocalError("chrom"); __PYX_ERR(0, 1377, __pyx_L1_error) }
    if (!(likely(PyUnicode_CheckExact(__pyx_v_chrom))||((__pyx_v_chrom) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_chrom)->tp_name), 0))) __PYX_ERR(0, 1377, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1376
 *             seq.qual = numpy.array(read.query_qualities)
 *         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_14.__pyx_n = 3;
    __pyx_t_14.ref_left = __pyx_t_13;
    __pyx_t_14.chrom = ((PyObject*)__pyx_v_chrom);
    __pyx_t_14.strand = __pyx_v_strand;
    __pyx_t_6 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(((PyObject*)__pyx_t_5), 0, &__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {

    /* "HTSeq/_HTSeq.pyx":1377
 *         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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __pyx_t_6;
    __pyx_t_6 = 0;
  }

  /* "HTSeq/_HTSeq.pyx":1376
 *             seq.qual = numpy.array(read.query_qualities)
 *         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_2);
  __Pyx_GOTREF(__pyx_v_a->cigar);
  __Pyx_DECREF(__pyx_v_a->cigar);
  __pyx_v_a->cigar = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1378
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_template_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->inferred_insert_size = __pyx_t_13;

  /* "HTSeq/_HTSeq.pyx":1379
 *             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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mapping_quality); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->aQual = __pyx_t_13;

  /* "HTSeq/_HTSeq.pyx":1380
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_flag, __pyx_t_2) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1381
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_proper_pair); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->proper_pair = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1382
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_secondary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->not_primary_alignment = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1383
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_qcfail); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->failed_platform_qc = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1384
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_duplicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->pcr_or_optical_duplicate = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1385
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_supplementary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_a->supplementary = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1386
 *         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_kp_u__12);
  __Pyx_GIVEREF(__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_kp_u__12;

  /* "HTSeq/_HTSeq.pyx":1387
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_tags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_a->optional_fields);
  __Pyx_DECREF(__pyx_v_a->optional_fields);
  __pyx_v_a->optional_fields = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1388
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_paired); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1390
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_unmapped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __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, 1390, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = ((!__pyx_t_3) != 0);
    if (__pyx_t_15) {
    } else {
      __pyx_t_4 = __pyx_t_15;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_t_2, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1390, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __pyx_t_15;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1391
 *             # 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mate_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1391, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1391, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_kp_u__20);
        __pyx_t_6 = __pyx_kp_u__20;
      } else {
        __Pyx_INCREF(__pyx_kp_u__19);
        __pyx_t_6 = __pyx_kp_u__19;
      }
      __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":1392
 *             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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_samfile, __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "HTSeq/_HTSeq.pyx":1393
 *                 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_mrnm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_next_reference_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "HTSeq/_HTSeq.pyx":1392
 *             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_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_strand);
      __pyx_t_6 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__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_2);
      __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":1390
 *         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_L14;
    }

    /* "HTSeq/_HTSeq.pyx":1395
 *                     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(__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_L14:;

    /* "HTSeq/_HTSeq.pyx":1396
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1396, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1397
 *                 a.mate_start = None
 *             if read.is_read1:
 *                 a.pe_which = intern("first")             # <<<<<<<<<<<<<<
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")
 */
      __pyx_t_2 = __Pyx_Intern(__pyx_n_u_first); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":1396
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 */
      goto __pyx_L17;
    }

    /* "HTSeq/_HTSeq.pyx":1398
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_n_s_is_read2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1398, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1399
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")             # <<<<<<<<<<<<<<
 *             else:
 *                 a.pe_which = intern("unknown")
 */
      __pyx_t_2 = __Pyx_Intern(__pyx_n_u_second); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1399, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":1398
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
 */
      goto __pyx_L17;
    }

    /* "HTSeq/_HTSeq.pyx":1401
 *                 a.pe_which = intern("second")
 *             else:
 *                 a.pe_which = intern("unknown")             # <<<<<<<<<<<<<<
 *         else:
 *             a.pe_which = intern("not_paired_end")
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_Intern(__pyx_n_u_unknown); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1401, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L17:;

    /* "HTSeq/_HTSeq.pyx":1388
 *         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_L13;
  }

  /* "HTSeq/_HTSeq.pyx":1403
 *                 a.pe_which = intern("unknown")
 *         else:
 *             a.pe_which = intern("not_paired_end")             # <<<<<<<<<<<<<<
 *         return a
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_Intern(__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_a->pe_which);
    __Pyx_DECREF(__pyx_v_a->pe_which);
    __pyx_v_a->pe_which = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L13:;

  /* "HTSeq/_HTSeq.pyx":1404
 *         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":1363
 * 
 *     @classmethod
 *     def from_pysam_AlignedSegment(cls, read, samfile):             # <<<<<<<<<<<<<<
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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((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":1407
 * 
 *     @classmethod
 *     def from_SAM_line(cls, line):             # <<<<<<<<<<<<<<
 *         cdef str qname, flag, rname, pos, mapq, cigar,
 *         cdef str mrnm, mpos, isize, seq, qual
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line(PyObject *__pyx_v_cls, PyObject *__pyx_v_line); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line(PyObject *__pyx_v_cls, PyObject *__pyx_v_line) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_SAM_line (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_line));

  /* function exit code */
  __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;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  int __pyx_t_17;
  int __pyx_t_18;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar __pyx_t_19;
  __Pyx_RefNannySetupContext("from_SAM_line", 0);

  /* "HTSeq/_HTSeq.pyx":1416
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u__21) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__21);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_fields = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1417
 * 
 *         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_5 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1417, __pyx_L1_error)
  __pyx_t_6 = ((__pyx_t_5 < 10) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":1418
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_SAM_line_does_not_contain_at_lea, 0, 0);
    __PYX_ERR(0, 1418, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1417
 * 
 *         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":1420
 *             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_slice__35, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __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, 1419, __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_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 7); 
      __pyx_t_12 = PyTuple_GET_ITEM(sequence, 8); 
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 9); 
      __pyx_t_14 = PyTuple_GET_ITEM(sequence, 10); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 7); 
      __pyx_t_12 = PyList_GET_ITEM(sequence, 8); 
      __pyx_t_13 = PyList_GET_ITEM(sequence, 9); 
      __pyx_t_14 = PyList_GET_ITEM(sequence, 10); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_t_14);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[11] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
      for (i=0; i < 11; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1419, __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_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
    __pyx_t_15 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
    for (index=0; index < 11; index++) {
      PyObject* item = __pyx_t_16(__pyx_t_15); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 11) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
    __pyx_t_16 = NULL;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_16 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1419, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }

  /* "HTSeq/_HTSeq.pyx":1419
 *         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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_10)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_12)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_13)->tp_name), 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1419, __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_7);
  __pyx_t_7 = 0;
  __pyx_v_mapq = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_v_cigar = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_v_mrnm = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_v_mpos = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_v_isize = ((PyObject*)__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_v_seq = ((PyObject*)__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_v_qual = ((PyObject*)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "HTSeq/_HTSeq.pyx":1421
 *         (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_slice__36, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1421, __pyx_L1_error)
  __pyx_v_optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1423
 *         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, 1423, __pyx_L1_error)
  }
  __pyx_t_5 = PyUnicode_Count(__pyx_v_seq, __pyx_kp_u__33, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1423, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":1424
 * 
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Sequence_in_SAM_file_contains_wh, 0, 0);
    __PYX_ERR(0, 1424, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1423
 *         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":1425
 *         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, 1425, __pyx_L1_error)
  }
  __pyx_t_5 = PyUnicode_Count(__pyx_v_seq, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1425, __pyx_L1_error)
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_14, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":1426
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Sequence_in_SAM_file_contains_wh_2, 0, 0);
    __PYX_ERR(0, 1426, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1425
 *         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":1427
 *         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, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_flagint = __pyx_t_17;

  /* "HTSeq/_HTSeq.pyx":1429
 *         flagint = int(flag)
 * 
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"             # <<<<<<<<<<<<<<
 *             iv = None
 *             cigarlist = None
 */
  __pyx_t_6 = ((__pyx_v_flagint & 0x0004) != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":1430
 * 
 *         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":1431
 *         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":1429
 *         flagint = int(flag)
 * 
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"             # <<<<<<<<<<<<<<
 *             iv = None
 *             cigarlist = None
 */
    goto __pyx_L8;
  }

  /* "HTSeq/_HTSeq.pyx":1433
 *             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_6 = (__Pyx_PyUnicode_Equals(__pyx_v_rname, __pyx_kp_u__34, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1433, __pyx_L1_error)
    __pyx_t_18 = (__pyx_t_6 != 0);
    if (unlikely(__pyx_t_18)) {

      /* "HTSeq/_HTSeq.pyx":1434
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Malformed_SAM_line_RNAME_althoug, 0, 0);
      __PYX_ERR(0, 1434, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":1433
 *             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":1436
 *                 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, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_posint = __pyx_t_17;

    /* "HTSeq/_HTSeq.pyx":1437
 *             # 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_18 = ((__pyx_v_flagint & 0x0010) != 0);
    if (__pyx_t_18) {

      /* "HTSeq/_HTSeq.pyx":1438
 *             posint = int(pos) - 1
 *             if flagint & 0x0010:      # flag "strand of the query"
 *                 strand = "-"             # <<<<<<<<<<<<<<
 *             else:
 *                 strand = "+"
 */
      __Pyx_INCREF(__pyx_kp_u__20);
      __pyx_v_strand = __pyx_kp_u__20;

      /* "HTSeq/_HTSeq.pyx":1437
 *             # 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":1440
 *                 strand = "-"
 *             else:
 *                 strand = "+"             # <<<<<<<<<<<<<<
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)
 *             iv = GenomicInterval(
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_v_strand = __pyx_kp_u__19;
    }
    __pyx_L10:;

    /* "HTSeq/_HTSeq.pyx":1441
 *             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_14 = __pyx_f_5HTSeq_6_HTSeq_parse_cigar(__pyx_v_cigar, 0, &__pyx_t_19); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_v_cigarlist = ((PyObject*)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "HTSeq/_HTSeq.pyx":1443
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)
 *             iv = GenomicInterval(
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)             # <<<<<<<<<<<<<<
 * 
 *         if qual != "*":
 */
    __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_posint); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1443, __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, 1443, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cigarlist, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ref_iv); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "HTSeq/_HTSeq.pyx":1442
 *                 strand = "+"
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)
 *             iv = GenomicInterval(             # <<<<<<<<<<<<<<
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)
 * 
 */
    __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_v_rname);
    __Pyx_GIVEREF(__pyx_v_rname);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_rname);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_v_strand);
    __pyx_t_14 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval), __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L8:;

  /* "HTSeq/_HTSeq.pyx":1445
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)
 * 
 *         if qual != "*":             # <<<<<<<<<<<<<<
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, qual.upper().encode())
 */
  __pyx_t_18 = (__Pyx_PyUnicode_Equals(__pyx_v_qual, __pyx_kp_u__34, Py_NE)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1445, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_18 != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":1447
 *         if qual != "*":
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, qual.upper().encode())             # <<<<<<<<<<<<<<
 *         else:
 *             swq = SequenceWithQualities(
 */
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_seq, __pyx_n_s_upper); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    __pyx_t_13 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_qual, __pyx_n_s_upper); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_13 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "HTSeq/_HTSeq.pyx":1446
 * 
 *         if qual != "*":
 *             swq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 seq.upper().encode(), qname, qual.upper().encode())
 *         else:
 */
    __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_qname);
    __Pyx_GIVEREF(__pyx_v_qname);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_qname);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_14);
    __pyx_t_1 = 0;
    __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_12, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_v_swq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "HTSeq/_HTSeq.pyx":1445
 *                 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":1449
 *                 seq.upper().encode(), qname, qual.upper().encode())
 *         else:
 *             swq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 seq.upper().encode(), qname, b"", "noquals")
 * 
 */
  /*else*/ {

    /* "HTSeq/_HTSeq.pyx":1450
 *         else:
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, b"", "noquals")             # <<<<<<<<<<<<<<
 * 
 *         alnmt = SAM_Alignment(swq, iv)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_seq, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_14 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1449
 *                 seq.upper().encode(), qname, qual.upper().encode())
 *         else:
 *             swq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 seq.upper().encode(), qname, b"", "noquals")
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
    __Pyx_INCREF(__pyx_v_qname);
    __Pyx_GIVEREF(__pyx_v_qname);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_qname);
    __Pyx_INCREF(__pyx_kp_b__12);
    __Pyx_GIVEREF(__pyx_kp_b__12);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_b__12);
    __Pyx_INCREF(__pyx_n_u_noquals);
    __Pyx_GIVEREF(__pyx_n_u_noquals);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_noquals);
    __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities), __pyx_t_1, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_swq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_14);
    __pyx_t_14 = 0;
  }
  __pyx_L11:;

  /* "HTSeq/_HTSeq.pyx":1452
 *                 seq.upper().encode(), qname, b"", "noquals")
 * 
 *         alnmt = SAM_Alignment(swq, iv)             # <<<<<<<<<<<<<<
 *         alnmt.flag = flagint
 *         alnmt.cigar = cigarlist
 */
  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(((PyObject *)__pyx_v_swq));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_swq));
  PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_swq));
  __Pyx_INCREF(((PyObject *)__pyx_v_iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_iv));
  PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_v_iv));
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_v_alnmt = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1453
 * 
 *         alnmt = SAM_Alignment(swq, iv)
 *         alnmt.flag = flagint             # <<<<<<<<<<<<<<
 *         alnmt.cigar = cigarlist
 *         alnmt.optional_fields = [
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flagint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_alnmt), __pyx_n_s_flag, __pyx_t_1) < 0) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1454
 *         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":1455
 *         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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L14_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "HTSeq/_HTSeq.pyx":1456
 *         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, 1456, __pyx_L14_error)
    }
    __pyx_t_14 = __pyx_v_optional_fields; __Pyx_INCREF(__pyx_t_14); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_14)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_5); __Pyx_INCREF(__pyx_t_12); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1456, __pyx_L14_error)
      #else
      __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1456, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_12);
      #endif
      __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_slice__37, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1456, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (!(likely(PyUnicode_CheckExact(__pyx_8genexpr6__pyx_v_field))||((__pyx_8genexpr6__pyx_v_field) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_8genexpr6__pyx_v_field)->tp_name), 0))) __PYX_ERR(0, 1456, __pyx_L14_error)
      __pyx_t_13 = __pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(((PyObject*)__pyx_8genexpr6__pyx_v_field)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1456, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1456, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1455, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field); __pyx_8genexpr6__pyx_v_field = 0;
    goto __pyx_L17_exit_scope;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field); __pyx_8genexpr6__pyx_v_field = 0;
    goto __pyx_L1_error;
    __pyx_L17_exit_scope:;
  } /* exit inner scope */

  /* "HTSeq/_HTSeq.pyx":1455
 *         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_1);
  __Pyx_GOTREF(__pyx_v_alnmt->optional_fields);
  __Pyx_DECREF(__pyx_v_alnmt->optional_fields);
  __pyx_v_alnmt->optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1457
 *         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_1 = __Pyx_PyNumber_Int(__pyx_v_mapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_alnmt->aQual = __pyx_t_17;

  /* "HTSeq/_HTSeq.pyx":1458
 *             (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_1 = __Pyx_PyNumber_Int(__pyx_v_isize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_alnmt->inferred_insert_size = __pyx_t_17;

  /* "HTSeq/_HTSeq.pyx":1459
 *         alnmt.aQual = int(mapq)
 *         alnmt.inferred_insert_size = int(isize)
 *         alnmt.original_sam_line = line             # <<<<<<<<<<<<<<
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_line))||((__pyx_v_line) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_line)->tp_name), 0))) __PYX_ERR(0, 1459, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_line;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __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_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1461
 *         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_6 = ((__pyx_v_flagint & 0x0001) != 0);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":1462
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
 *             if flagint & 0x0008:      # flag "mate is unmapped"             # <<<<<<<<<<<<<<
 *                 alnmt.mate_start = None
 *             else:
 */
    __pyx_t_6 = ((__pyx_v_flagint & 0x0008) != 0);
    if (__pyx_t_6) {

      /* "HTSeq/_HTSeq.pyx":1463
 *         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(__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":1462
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
 *             if flagint & 0x0008:      # flag "mate is unmapped"             # <<<<<<<<<<<<<<
 *                 alnmt.mate_start = None
 *             else:
 */
      goto __pyx_L19;
    }

    /* "HTSeq/_HTSeq.pyx":1465
 *                 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_6 = (__Pyx_PyUnicode_Equals(__pyx_v_mrnm, __pyx_kp_u__34, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1465, __pyx_L1_error)
      __pyx_t_18 = (__pyx_t_6 != 0);
      if (unlikely(__pyx_t_18)) {

        /* "HTSeq/_HTSeq.pyx":1466
 *             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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Malformed_SAM_line_MRNM_although, 0, 0);
        __PYX_ERR(0, 1466, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":1465
 *                 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":1467
 *                 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_1 = __Pyx_PyNumber_Int(__pyx_v_mpos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_v_posint = __pyx_t_17;

      /* "HTSeq/_HTSeq.pyx":1468
 *                     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_18 = ((__pyx_v_flagint & 0x0020) != 0);
      if (__pyx_t_18) {

        /* "HTSeq/_HTSeq.pyx":1469
 *                 posint = int(mpos) - 1
 *                 if flagint & 0x0020:   # flag "strand of the mate"
 *                     strand = "-"             # <<<<<<<<<<<<<<
 *                 else:
 *                     strand = "+"
 */
        __Pyx_INCREF(__pyx_kp_u__20);
        __Pyx_XDECREF_SET(__pyx_v_strand, __pyx_kp_u__20);

        /* "HTSeq/_HTSeq.pyx":1468
 *                     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_L21;
      }

      /* "HTSeq/_HTSeq.pyx":1471
 *                     strand = "-"
 *                 else:
 *                     strand = "+"             # <<<<<<<<<<<<<<
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
 *                 if alnmt.mate_start.chrom == "=":
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_kp_u__19);
        __Pyx_XDECREF_SET(__pyx_v_strand, __pyx_kp_u__19);
      }
      __pyx_L21:;

      /* "HTSeq/_HTSeq.pyx":1472
 *                 else:
 *                     strand = "+"
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)             # <<<<<<<<<<<<<<
 *                 if alnmt.mate_start.chrom == "=":
 *                     if alnmt.iv is not None:
 */
      __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_posint); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_mrnm);
      __Pyx_GIVEREF(__pyx_v_mrnm);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mrnm);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_14);
      __Pyx_INCREF(__pyx_v_strand);
      __Pyx_GIVEREF(__pyx_v_strand);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_strand);
      __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_t_1, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_14);
      __Pyx_GOTREF(__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_14);
      __pyx_t_14 = 0;

      /* "HTSeq/_HTSeq.pyx":1473
 *                     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_18 = (__Pyx_PyUnicode_Equals(__pyx_v_alnmt->mate_start->__pyx_base.chrom, __pyx_kp_u__33, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1473, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_18 != 0);
      if (__pyx_t_6) {

        /* "HTSeq/_HTSeq.pyx":1474
 *                 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_6 = (((PyObject *)__pyx_v_alnmt->__pyx_base.__pyx_base.iv) != Py_None);
        __pyx_t_18 = (__pyx_t_6 != 0);
        if (__pyx_t_18) {

          /* "HTSeq/_HTSeq.pyx":1475
 *                 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_14 = __pyx_v_alnmt->__pyx_base.__pyx_base.iv->chrom;
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_14);
          __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_14);
          __pyx_t_14 = 0;

          /* "HTSeq/_HTSeq.pyx":1474
 *                 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":1473
 *                     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_L19:;

    /* "HTSeq/_HTSeq.pyx":1476
 *                     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_18 = ((__pyx_v_flagint & 0x0040) != 0);
    if (__pyx_t_18) {

      /* "HTSeq/_HTSeq.pyx":1477
 *                         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_14 = __Pyx_Intern(__pyx_n_u_first); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1477, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_14);
      __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
      __Pyx_DECREF(__pyx_v_alnmt->pe_which);
      __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
      __pyx_t_14 = 0;

      /* "HTSeq/_HTSeq.pyx":1476
 *                     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_L24;
    }

    /* "HTSeq/_HTSeq.pyx":1478
 *             if flagint & 0x0040:
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:             # <<<<<<<<<<<<<<
 *                 alnmt.pe_which = intern("second")
 *             else:
 */
    __pyx_t_18 = ((__pyx_v_flagint & 0x0080) != 0);
    if (__pyx_t_18) {

      /* "HTSeq/_HTSeq.pyx":1479
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:
 *                 alnmt.pe_which = intern("second")             # <<<<<<<<<<<<<<
 *             else:
 *                 alnmt.pe_which = intern("unknown")
 */
      __pyx_t_14 = __Pyx_Intern(__pyx_n_u_second); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1479, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_14);
      __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
      __Pyx_DECREF(__pyx_v_alnmt->pe_which);
      __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
      __pyx_t_14 = 0;

      /* "HTSeq/_HTSeq.pyx":1478
 *             if flagint & 0x0040:
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:             # <<<<<<<<<<<<<<
 *                 alnmt.pe_which = intern("second")
 *             else:
 */
      goto __pyx_L24;
    }

    /* "HTSeq/_HTSeq.pyx":1481
 *                 alnmt.pe_which = intern("second")
 *             else:
 *                 alnmt.pe_which = intern("unknown")             # <<<<<<<<<<<<<<
 *         else:
 *             alnmt.mate_start = None
 */
    /*else*/ {
      __pyx_t_14 = __Pyx_Intern(__pyx_n_u_unknown); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_14);
      __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
      __Pyx_DECREF(__pyx_v_alnmt->pe_which);
      __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
      __pyx_t_14 = 0;
    }
    __pyx_L24:;

    /* "HTSeq/_HTSeq.pyx":1461
 *         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_L18;
  }

  /* "HTSeq/_HTSeq.pyx":1483
 *                 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(__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":1484
 *         else:
 *             alnmt.mate_start = None
 *             alnmt.pe_which = intern("not_paired_end")             # <<<<<<<<<<<<<<
 * 
 *         alnmt.proper_pair = flagint & 0x0002 > 0
 */
    __pyx_t_14 = __Pyx_Intern(__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_14)->tp_name), 0))) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_14);
    __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
    __Pyx_DECREF(__pyx_v_alnmt->pe_which);
    __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_14);
    __pyx_t_14 = 0;
  }
  __pyx_L18:;

  /* "HTSeq/_HTSeq.pyx":1486
 *             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":1487
 * 
 *         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":1488
 *         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":1489
 *         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":1490
 *         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":1492
 *         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":1407
 * 
 *     @classmethod
 *     def from_SAM_line(cls, line):             # <<<<<<<<<<<<<<
 *         cdef str qname, flag, rname, pos, mapq, cigar,
 *         cdef str mrnm, mpos, isize, seq, qual
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("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":1495
 * 
 *     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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1496
 *     property flag:
 *         def __get__(self):
 *             return self._flag             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1495
 * 
 *     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":1498
 *             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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":1499
 * 
 *         def __set__(self, value):
 *             self._flag = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1499, __pyx_L1_error)
  __pyx_v_self->_flag = __pyx_t_1;

  /* "HTSeq/_HTSeq.pyx":1498
 *             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:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1502
 * 
 *     @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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1503
 *     @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_n_u_not_paired_end, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1502
 * 
 *     @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":1506
 * 
 *     @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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1507
 *     @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, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1506
 * 
 *     @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":1509
 *         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, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sam_line (wrapper)", 0);
  __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;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("get_sam_line", 0);

  /* "HTSeq/_HTSeq.pyx":1510
 * 
 *     def get_sam_line(self):
 *         cdef str cigar = ""             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval query_start, mate_start
 *         cdef CigarOperation cop
 */
  __Pyx_INCREF(__pyx_kp_u__12);
  __pyx_v_cigar = __pyx_kp_u__12;

  /* "HTSeq/_HTSeq.pyx":1514
 *         cdef CigarOperation cop
 * 
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             query_start = self.iv
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_aligned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __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, 1514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1515
 * 
 *         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":1514
 *         cdef CigarOperation cop
 * 
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             query_start = self.iv
 *         else:
 */
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1517
 *             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_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __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":1519
 *             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);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1520
 * 
 *         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":1519
 *             query_start = GenomicPosition("*", -1)
 * 
 *         if self.mate_start is not None:             # <<<<<<<<<<<<<<
 *             mate_start = self.mate_start
 *         else:
 */
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":1522
 *             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_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __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":1524
 *             mate_start = GenomicPosition("*", -1)
 * 
 *         if self.cigar is not None:             # <<<<<<<<<<<<<<
 *             for cop in self.cigar:
 *                 cigar += str(cop.size) + cop.type
 */
  __pyx_t_3 = (__pyx_v_self->cigar != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1525
 * 
 *         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, 1525, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1525, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5HTSeq_6_HTSeq_CigarOperation))))) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_cop, ((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":1526
 *         if self.cigar is not None:
 *             for cop in self.cigar:
 *                 cigar += str(cop.size) + cop.type             # <<<<<<<<<<<<<<
 *         else:
 *             cigar = "*"
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cop->size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_6, __pyx_v_cop->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_v_cigar, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_cigar, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":1525
 * 
 *         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":1524
 *             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":1528
 *                 cigar += str(cop.size) + cop.type
 *         else:
 *             cigar = "*"             # <<<<<<<<<<<<<<
 * 
 *         return '\t'.join(
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_u__34);
    __Pyx_DECREF_SET(__pyx_v_cigar, __pyx_kp_u__34);
  }
  __pyx_L5:;

  /* "HTSeq/_HTSeq.pyx":1530
 *             cigar = "*"
 * 
 *         return '\t'.join(             # <<<<<<<<<<<<<<
 *                 (self.read.name,
 *                  str(self.flag),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":1531
 * 
 *         return '\t'.join(
 *                 (self.read.name,             # <<<<<<<<<<<<<<
 *                  str(self.flag),
 *                  query_start.chrom,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1532
 *         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_n_s_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1534
 *                  str(self.flag),
 *                  query_start.chrom,
 *                  str(query_start.start + 1),             # <<<<<<<<<<<<<<
 *                  str(self.aQual),
 *                  cigar,
 */
  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_query_start->start + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1535
 *                  query_start.chrom,
 *                  str(query_start.start + 1),
 *                  str(self.aQual),             # <<<<<<<<<<<<<<
 *                  cigar,
 *                  mate_start.chrom,
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1538
 *                  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_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "HTSeq/_HTSeq.pyx":1539
 *                  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_9 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "HTSeq/_HTSeq.pyx":1540
 *                  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, 1540, __pyx_L1_error)
  }
  __pyx_t_9 = __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_9)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "HTSeq/_HTSeq.pyx":1541
 *                  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_n_s_qualstr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_decode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
    }
  }
  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "HTSeq/_HTSeq.pyx":1542
 *                  self.read_as_aligned.seq.decode(),
 *                  self.read_as_aligned.qualstr.decode(),
 *                  '\t'.join(self.raw_optional_fields())))             # <<<<<<<<<<<<<<
 * 
 *     def optional_field(SAM_Alignment self, str tag):
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raw_optional_fields); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyUnicode_Join(__pyx_kp_u__21, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "HTSeq/_HTSeq.pyx":1531
 * 
 *         return '\t'.join(
 *                 (self.read.name,             # <<<<<<<<<<<<<<
 *                  str(self.flag),
 *                  query_start.chrom,
 */
  __pyx_t_13 = PyTuple_New(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_query_start->chrom);
  __Pyx_GIVEREF(__pyx_v_query_start->chrom);
  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_query_start->chrom);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_cigar);
  __Pyx_GIVEREF(__pyx_v_cigar);
  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_v_cigar);
  __Pyx_INCREF(__pyx_v_mate_start->chrom);
  __Pyx_GIVEREF(__pyx_v_mate_start->chrom);
  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_v_mate_start->chrom);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_12);
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_1 = 0;
  __pyx_t_10 = 0;
  __pyx_t_9 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;

  /* "HTSeq/_HTSeq.pyx":1530
 *             cigar = "*"
 * 
 *         return '\t'.join(             # <<<<<<<<<<<<<<
 *                 (self.read.name,
 *                  str(self.flag),
 */
  __pyx_t_12 = PyUnicode_Join(__pyx_kp_u__21, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_r = __pyx_t_12;
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1509
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_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":1544
 *                  '\t'.join(self.raw_optional_fields())))
 * 
 *     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_13optional_field(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13optional_field(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("optional_field (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), (&PyUnicode_Type), 1, "tag", 1))) __PYX_ERR(0, 1544, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12optional_field(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject*)__pyx_v_tag));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12optional_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;
  __Pyx_RefNannySetupContext("optional_field", 0);

  /* "HTSeq/_HTSeq.pyx":1545
 * 
 *     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, 1545, __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, 1545, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1545, __pyx_L5_error)
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __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, 1545, __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, 1545, __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_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p); __pyx_8genexpr7__pyx_v_p = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1546
 *     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 = PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1546, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_3 == 1) != 0);
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":1547
 *         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_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1547, __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":1546
 *     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":1549
 *             return res[0][1]
 *         else:
 *             if len(res) == 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError, "SAM optional field tag %s not found" % tag
 *             else:
 */
  /*else*/ {
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1549, __pyx_L1_error)
    __pyx_t_5 = ((__pyx_t_3 == 0) != 0);
    if (unlikely(__pyx_t_5)) {

      /* "HTSeq/_HTSeq.pyx":1550
 *         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_2 = PyUnicode_Format(__pyx_kp_u_SAM_optional_field_tag_s_not_fou, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_builtin_KeyError, __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1550, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":1549
 *             return res[0][1]
 *         else:
 *             if len(res) == 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError, "SAM optional field tag %s not found" % tag
 *             else:
 */
    }

    /* "HTSeq/_HTSeq.pyx":1552
 *                 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_2 = PyUnicode_Format(__pyx_kp_u_SAM_optional_field_tag_s_not_uni, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1552, __pyx_L1_error)
    }
  }

  /* "HTSeq/_HTSeq.pyx":1544
 *                  '\t'.join(self.raw_optional_fields())))
 * 
 *     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":1554
 *                 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_15raw_optional_fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15raw_optional_fields(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("raw_optional_fields (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14raw_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_14raw_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;
  __Pyx_RefNannySetupContext("raw_optional_fields", 0);

  /* "HTSeq/_HTSeq.pyx":1555
 * 
 *     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, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1556
 *     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, 1556, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1556, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":1557
 *         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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1557, __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, 1557, __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, 1557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1558
 *         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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __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, 1558, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = ((__pyx_t_6 == 1) != 0);
      if (__pyx_t_5) {

        /* "HTSeq/_HTSeq.pyx":1559
 *             if op[1].__class__ == str:
 *                 if len(op[1]) == 1:
 *                     tc = "A"             # <<<<<<<<<<<<<<
 *                 else:
 *                     tc = "Z"
 */
        __Pyx_INCREF(__pyx_n_u_A);
        __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_A);

        /* "HTSeq/_HTSeq.pyx":1558
 *         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":1561
 *                     tc = "A"
 *                 else:
 *                     tc = "Z"             # <<<<<<<<<<<<<<
 *             elif op[1].__class__ == int:
 *                 tc = "i"
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_n_u_Z);
        __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_Z);
      }
      __pyx_L6:;

      /* "HTSeq/_HTSeq.pyx":1557
 *         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":1562
 *                 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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __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 *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __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, 1562, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1563
 *                     tc = "Z"
 *             elif op[1].__class__ == int:
 *                 tc = "i"             # <<<<<<<<<<<<<<
 *             elif op[1].__class__ == float:
 *                 tc = "j"
 */
      __Pyx_INCREF(__pyx_n_u_i);
      __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_i);

      /* "HTSeq/_HTSeq.pyx":1562
 *                 else:
 *                     tc = "Z"
 *             elif op[1].__class__ == int:             # <<<<<<<<<<<<<<
 *                 tc = "i"
 *             elif op[1].__class__ == float:
 */
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":1564
 *             elif op[1].__class__ == int:
 *                 tc = "i"
 *             elif op[1].__class__ == float:             # <<<<<<<<<<<<<<
 *                 tc = "j"
 *             else:
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1564, __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, 1564, __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, 1564, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1565
 *                 tc = "i"
 *             elif op[1].__class__ == float:
 *                 tc = "j"             # <<<<<<<<<<<<<<
 *             else:
 *                 tc = "H"
 */
      __Pyx_INCREF(__pyx_n_u_j);
      __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_j);

      /* "HTSeq/_HTSeq.pyx":1564
 *             elif op[1].__class__ == int:
 *                 tc = "i"
 *             elif op[1].__class__ == float:             # <<<<<<<<<<<<<<
 *                 tc = "j"
 *             else:
 */
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":1567
 *                 tc = "j"
 *             else:
 *                 tc = "H"             # <<<<<<<<<<<<<<
 *             res.append(":".join([op[0], tc, str(op[1])]))
 *         return res
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_n_u_H);
      __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_n_u_H);
    }
    __pyx_L5:;

    /* "HTSeq/_HTSeq.pyx":1568
 *             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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1568, __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, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_tc);
    __Pyx_GIVEREF(__pyx_v_tc);
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_tc);
    __Pyx_GIVEREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__10, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1568, __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, 1568, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1556
 *     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":1569
 *                 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":1554
 *                 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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 51, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition))))) __PYX_ERR(1, 53, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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(__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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 54, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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;
  __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(1, 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 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:;
  __Pyx_RefNannyFinishContext();
  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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __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;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 63, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __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_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16__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_16__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_t_12;
  __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:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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(2, 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(2, 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(2, 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(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(17); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __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));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->cigar);
  __Pyx_GIVEREF(__pyx_v_self->cigar);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_self->cigar);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
  PyTuple_SET_ITEM(__pyx_t_9, 7, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->mate_start));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->mate_start));
  PyTuple_SET_ITEM(__pyx_t_9, 8, ((PyObject *)__pyx_v_self->mate_start));
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 9, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->optional_fields);
  __Pyx_GIVEREF(__pyx_v_self->optional_fields);
  PyTuple_SET_ITEM(__pyx_t_9, 10, __pyx_v_self->optional_fields);
  __Pyx_INCREF(__pyx_v_self->original_sam_line);
  __Pyx_GIVEREF(__pyx_v_self->original_sam_line);
  PyTuple_SET_ITEM(__pyx_t_9, 11, __pyx_v_self->original_sam_line);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 12, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->pe_which);
  __Pyx_GIVEREF(__pyx_v_self->pe_which);
  PyTuple_SET_ITEM(__pyx_t_9, 13, __pyx_v_self->pe_which);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_9, 14, __pyx_t_7);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
  PyTuple_SET_ITEM(__pyx_t_9, 15, ((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned));
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 16, __pyx_t_8);
  __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:
 *         state += (_dict,)
 */
  __pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 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:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_10 = (__pyx_v__dict != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict);
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 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:
 *         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:             # <<<<<<<<<<<<<<
 *         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), 0xf6933f3, None), state
 */
  /*else*/ {
    __pyx_t_10 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read) != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced) != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->cigar != ((PyObject*)Py_None));
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv) != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->optional_fields != ((PyObject*)Py_None));
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->original_sam_line != ((PyObject*)Py_None));
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->pe_which != ((PyObject*)Py_None));
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned) != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    __pyx_t_11 = __pyx_t_12;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_11;
  }
  __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), 0xf6933f3, None), state
 *     else:
 */
  __pyx_t_11 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_11) {

    /* "(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), 0xf6933f3, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_SAM_Alignment); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_258552819);
    __Pyx_GIVEREF(__pyx_int_258552819);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_258552819);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
    __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), 0xf6933f3, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, None), state
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, 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_n_s_pyx_unpickle_SAM_Alignment); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 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))));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_258552819);
    __Pyx_GIVEREF(__pyx_int_258552819);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_258552819);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
    __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), 0xf6933f3, 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_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__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;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0xf6933f3, 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_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":1576
 * ###########################
 * 
 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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_kp_b__39);
  PyObject *__pyx_v_quote = ((PyObject*)__pyx_kp_b__40);
  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;
  char __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __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":1577
 * 
 * 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, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1578
 * 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":1579
 *     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":1580
 *     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":1581
 *     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, 1581, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L1_error)
  __pyx_v_s_c = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":1582
 *     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:
 */
  if (unlikely(__pyx_v_split == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1582, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyBytes_GetItemInt(__pyx_v_split, 0, 1); if (unlikely(__pyx_t_3 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L1_error)
  __pyx_v_split_c = __pyx_t_3;

  /* "HTSeq/_HTSeq.pyx":1583
 *     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"
 */
  if (unlikely(__pyx_v_quote == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1583, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyBytes_GetItemInt(__pyx_v_quote, 0, 1); if (unlikely(__pyx_t_3 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
  __pyx_v_quote_c = __pyx_t_3;

  /* "HTSeq/_HTSeq.pyx":1584
 *     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, 1584, __pyx_L1_error)
  }
  __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_split); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1584, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 != 1) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "HTSeq/_HTSeq.pyx":1585
 *     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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_split_must_be_length_1, 0, 0);
    __PYX_ERR(0, 1585, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1584
 *     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":1586
 *     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, 1586, __pyx_L1_error)
  }
  __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_quote); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1586, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 != 1) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "HTSeq/_HTSeq.pyx":1587
 *         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_Raise(__pyx_builtin_ValueError, __pyx_kp_u_quote_must_be_length_1, 0, 0);
    __PYX_ERR(0, 1587, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1586
 *     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":1588
 *     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) != 0);
    if (!__pyx_t_5) break;

    /* "HTSeq/_HTSeq.pyx":1589
 *         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) != 0);
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1590
 *     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 != 0));

      /* "HTSeq/_HTSeq.pyx":1589
 *         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":1591
 *         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_6 = ((!(__pyx_v_in_quote != 0)) != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_6 = (((__pyx_v_s_c[__pyx_v_i]) == __pyx_v_split_c) != 0);
    __pyx_t_5 = __pyx_t_6;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":1592
 *             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, 1592, __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, 1592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1592, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1593
 *         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":1591
 *         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":1594
 *             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":1595
 *             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, 1595, __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, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1596
 *         i += 1
 *     l.append(s[begin_token:])
 *     if in_quote:             # <<<<<<<<<<<<<<
 *         raise ValueError, "unmatched quote"
 *     return l
 */
  __pyx_t_5 = (__pyx_v_in_quote != 0);
  if (unlikely(__pyx_t_5)) {

    /* "HTSeq/_HTSeq.pyx":1597
 *     l.append(s[begin_token:])
 *     if in_quote:
 *         raise ValueError, "unmatched quote"             # <<<<<<<<<<<<<<
 *     return l
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_unmatched_quote, 0, 0);
    __PYX_ERR(0, 1597, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1596
 *         i += 1
 *     l.append(s[begin_token:])
 *     if in_quote:             # <<<<<<<<<<<<<<
 *         raise ValueError, "unmatched quote"
 *     return l
 */
  }

  /* "HTSeq/_HTSeq.pyx":1598
 *     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":1576
 * ###########################
 * 
 * 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_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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_v_split = 0;
  PyObject *__pyx_v_quote = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("quotesafe_split (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s_3,&__pyx_n_s_split,&__pyx_n_s_quote,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_kp_b__39);
    values[2] = ((PyObject*)__pyx_kp_b__40);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s_3)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_split);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quote);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "quotesafe_split") < 0)) __PYX_ERR(0, 1576, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_s = ((PyObject*)values[0]);
    __pyx_v_split = ((PyObject*)values[1]);
    __pyx_v_quote = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("quotesafe_split", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1576, __pyx_L3_error)
  __pyx_L3_error:;
  __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, 1576, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split), (&PyBytes_Type), 1, "split", 1))) __PYX_ERR(0, 1576, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quote), (&PyBytes_Type), 1, "quote", 1))) __PYX_ERR(0, 1576, __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;
  __pyx_L0:;
  __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;
  __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, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __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)":1
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment = {"__pyx_unpickle_Alignment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Alignment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Alignment") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_Alignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_16__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_PickleError = 0;
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Alignment", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x77bfdf2:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x77bfdf2) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x77bfdf2:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
 *     __pyx_result = Alignment.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x77bfdf2:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x77bfdf2:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
 *     __pyx_result = Alignment.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_Alignment), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
 *     __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_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(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, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __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)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77bfdf2 = (_read, iv))" % __pyx_checksum)
 *     __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, tuple __pyx_state):
 *     __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)":1
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

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;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Alignment__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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, tuple __pyx_state):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 2) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, tuple __pyx_state):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  }

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_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)":1
 * def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal = {"__pyx_unpickle_AlignmentWithSequenceReversal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_AlignmentWithSequenceReversal") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_AlignmentWithSequenceReversal(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_18__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_PickleError = 0;
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x1b7eeff:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x1b7eeff) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x1b7eeff:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x1b7eeff:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x1b, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x1b7eeff:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
 *     __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_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(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, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __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)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1b7eeff = (_read, _read_as_sequenced, iv, read_as_aligned))" % __pyx_checksum)
 *     __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, tuple __pyx_state):
 *     __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)":1
 * def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 */

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;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
 *     __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]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 4) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __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]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[4])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  }

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_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)":1
 * def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment = {"__pyx_unpickle_BowtieAlignment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BowtieAlignment") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_BowtieAlignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_20__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_PickleError = 0;
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x482c176:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x482c176) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x482c176:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x482c176:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x48, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x482c176:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
 *     __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_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(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, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __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)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x482c176 = (_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions))" % __pyx_checksum)
 *     __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, tuple __pyx_state):
 *     __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)":1
 * def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 */

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;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
 *     __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]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[6])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[6])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 6) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __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]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[6])
 */
  }

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_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)":1
 * def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation = {"__pyx_unpickle_CigarOperation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CigarOperation") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_CigarOperation(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_22__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_PickleError = 0;
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb5bd29c:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb5bd29c) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb5bd29c:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
 *     __pyx_result = CigarOperation.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xb5bd29c:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = CigarOperation.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb5bd29c:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
 *     __pyx_result = CigarOperation.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
 *     __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_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(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, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __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)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb5bd29c = (query_from, query_to, ref_iv, size, type))" % __pyx_checksum)
 *     __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, tuple __pyx_state):
 *     __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)":1
 * def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
 */

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_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
 *     __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]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[5])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->query_from = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->query_to = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->size = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[5])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 > 5) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __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]
 *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[5])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[5])
 */
  }

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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)":1
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment = {"__pyx_unpickle_SAM_Alignment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SAM_Alignment") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __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 */
  __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_PickleError = 0;
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf6933f3:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf6933f3) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf6933f3:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xf6933f3:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf6933f3:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)
 *     __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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)
 *     __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_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(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, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __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)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf6933f3 = (_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_checksum)
 *     __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, tuple __pyx_state):
 *     __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)":1
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

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;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __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, tuple __pyx_state):
 *     __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]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_flag = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->aQual = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->failed_platform_qc = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->inferred_insert_size = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->not_primary_alignment = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->pcr_or_optical_duplicate = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->proper_pair = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__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;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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(2, 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, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 > 17) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __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]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, tuple __pyx_state):
 *     __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]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  }

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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;
}

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fulfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyArray_Descr *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  if (__pyx_v_info == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
 * 
 *             cdef int i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *             cdef int i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *             ndim = PyArray_NDIM(self)
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *             ndim = PyArray_NDIM(self)
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (unlikely(__pyx_t_1)) {

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __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(3, 272, __pyx_L1_error)

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *             ndim = PyArray_NDIM(self)
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (unlikely(__pyx_t_1)) {

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __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(3, 276, __pyx_L1_error)

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L9;
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L9:;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = <dtype>PyArray_DESCR(self)
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
  __pyx_t_3 = ((PyObject *)__pyx_t_7);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
 *             cdef int offset
 * 
 *             info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not PyDataType_HASFIELDS(descr):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
 *             info.obj = self
 * 
 *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
 * 
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L15_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_L15_next_or:;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L14_bool_binop_done:;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (unlikely(__pyx_t_1)) {

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __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(3, 306, __pyx_L1_error)

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = ((char *)"b");
      break;
      case NPY_UBYTE:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      __pyx_v_f = ((char *)"B");
      break;
      case NPY_SHORT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      __pyx_v_f = ((char *)"h");
      break;
      case NPY_USHORT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      __pyx_v_f = ((char *)"H");
      break;
      case NPY_INT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      __pyx_v_f = ((char *)"i");
      break;
      case NPY_UINT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      __pyx_v_f = ((char *)"I");
      break;
      case NPY_LONG:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      __pyx_v_f = ((char *)"l");
      break;
      case NPY_ULONG:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      __pyx_v_f = ((char *)"L");
      break;
      case NPY_LONGLONG:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      __pyx_v_f = ((char *)"q");
      break;
      case NPY_ULONGLONG:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      __pyx_v_f = ((char *)"Q");
      break;
      case NPY_FLOAT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      __pyx_v_f = ((char *)"f");
      break;
      case NPY_DOUBLE:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      __pyx_v_f = ((char *)"d");
      break;
      case NPY_LONGDOUBLE:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      __pyx_v_f = ((char *)"g");
      break;
      case NPY_CFLOAT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      __pyx_v_f = ((char *)"Zf");
      break;
      case NPY_CDOUBLE:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      __pyx_v_f = ((char *)"Zd");
      break;
      case NPY_CLONGDOUBLE:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      __pyx_v_f = ((char *)"Zg");
      break;
      case NPY_OBJECT:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_v_f = ((char *)"O");
      break;
      default:

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(3, 325, __pyx_L1_error)
      break;
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
 *             info.obj = self
 * 
 *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
 *                 return
 *             else:
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
 *             else:
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 332, __pyx_L1_error)
    __pyx_v_f = __pyx_t_9;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fulfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

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

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 PyObject_Free(info.strides)
 */
    PyObject_Free(__pyx_v_info->format);

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    PyObject_Free(__pyx_v_info->strides);

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 */

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * ctypedef npy_cdouble     complex_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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
 * 
 * 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(3, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
 * 
 * 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(3, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
 * 
 * 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(3, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
 * 
 * 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(3, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
 * 
 * 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(3, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *     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;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
 * 
 * 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) != 0);
  if (__pyx_t_1) {

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

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

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

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

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *         return ()
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __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;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
 *     cdef dtype child
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 851, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 852, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 852, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(3, 853, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __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(3, 856, __pyx_L1_error)

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (unlikely(__pyx_t_6)) {

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __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(3, 860, __pyx_L1_error)

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 870, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 0x78;

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (unlikely(__pyx_t_6)) {

        /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(3, 880, __pyx_L1_error)

        /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 884, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 885, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 886, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 890, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 893, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 894, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 895, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x66;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 897, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x64;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 898, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x67;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (likely(__pyx_t_6)) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(3, 901, __pyx_L1_error)
      }
      __pyx_L15:;

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 906, __pyx_L1_error)
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *         return ()
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     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) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_array_base", 0);

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

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));

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

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

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

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

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

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
 * 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) != 0);
  if (__pyx_t_1) {

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

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

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

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

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

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _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;
  __Pyx_RefNannySetupContext("import_array", 0);

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

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
 * cdef inline int import_array() except -1:
 *     try:
 *         _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(3, 1036, __pyx_L3_error)

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

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
 *     try:
 *         _import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    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(3, 1037, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __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(3, 1038, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _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_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
 *         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;
  __Pyx_RefNannySetupContext("import_umath", 0);

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

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
 * 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(3, 1042, __pyx_L3_error)

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

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    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(3, 1043, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __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(3, 1044, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

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

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
 *         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_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
 *         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;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

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

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
 * 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(3, 1048, __pyx_L3_error)

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

    /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    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(3, 1049, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __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(3, 1050, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

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

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
 *         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_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
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;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  Py_CLEAR(p->chrom);
  Py_CLEAR(p->_strand);
  (*Py_TYPE(o)->tp_free)(o);
}

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)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__, METH_NOARGS, 0},
  {"__copy__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__, METH_NOARGS, 0},
  {"is_contained_in", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in},
  {"contains", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_16contains},
  {"overlaps", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps},
  {"range", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_20range},
  {"range_d", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_22range_d},
  {"extend_to_include", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include, METH_O, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include},
  {"copy", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicInterval[] = {
  {(char *)"strand", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_strand, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_strand, (char *)0, 0},
  {(char *)"length", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_length, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_length, (char *)"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},
  {(char *)"start_d", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d, (char *)"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},
  {(char *)"end_d", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d, 0, (char *)0, 0},
  {(char *)"start_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_as_pos, 0, (char *)0, 0},
  {(char *)"end_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_as_pos, 0, (char *)0, 0},
  {(char *)"start_d_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d_as_pos, 0, (char *)0, 0},
  {(char *)"end_d_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d_as_pos, 0, (char *)0, 0},
  {(char *)"chrom", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom, (char *)0, 0},
  {(char *)"start", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start, (char *)0, 0},
  {(char *)"end", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_end, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __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*/
  "A GenomicInterval specifies an interval (i.e., a range of \n    consecutive positions) on a reference genome.\n\n    A GenomicInterval object has the following slots, some of which \n    are calculated from the other:\n\n       chrom: The name of a sequence (i.e., chromosome, contig, or \n          the like). \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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__, METH_NOARGS, 0},
  {"copy", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicPosition[] = {
  {(char *)"pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_pos, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicPosition_pos, (char *)"As GenomicPosition is a subclass of GenomicInterval, 'pos' is actually\n        just an alias for 'start_d'.\n        ", 0},
  {(char *)"end", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_end, 0, (char *)0, 0},
  {(char *)"length", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_length, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __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*/
  "A GenomicPosition specifies the position of a nucleotide or\n    base pair on a reference genome.\n\n    It has the following slots:\n       chrom: The name of a sequence (i.e., chromosome, contig, or \n          the like). \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 slots.\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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  Py_CLEAR(p->seq);
  Py_CLEAR(p->name);
  Py_CLEAR(p->descr);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_Sequence(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  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[] = {
  {"get_reverse_complement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement, METH_VARARGS|METH_KEYWORDS, 0},
  {"__getstate__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__, METH_NOARGS, 0},
  {"__setstate__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__, METH_O, 0},
  {"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__, METH_NOARGS, 0},
  {"write_to_fasta_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file},
  {"add_bases_to_count_array", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array, METH_O, 0},
  {"trim_left_end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end, METH_VARARGS|METH_KEYWORDS, 0},
  {"trim_right_end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_Sequence[] = {
  {(char *)"seq", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_seq, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_seq, (char *)0, 0},
  {(char *)"name", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_name, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_name, (char *)0, 0},
  {(char *)"descr", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_descr, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_descr, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __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*/
  "A Sequence, typically of DNA, with a name.\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_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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    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);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __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;
  e = ((likely(__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) ? ((__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_traverse) ? __pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities)); 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 (likely(__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) { if (__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_clear) __pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_clear(o); } else __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 = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  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)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file, METH_O, 0},
  {"get_fastq_str", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_reverse_complement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement, METH_VARARGS|METH_KEYWORDS, 0},
  {"add_qual_to_count_array", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array, METH_O, 0},
  {"trim_left_end_with_quals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals, METH_VARARGS|METH_KEYWORDS, 0},
  {"trim_right_end_with_quals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_SequenceWithQualities[] = {
  {(char *)"qual", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual, __pyx_setprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual, (char *)0, 0},
  {(char *)"qualstr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qualstr, 0, (char *)0, 0},
  {(char *)"_qualstr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr, 0, (char *)0, 0},
  {(char *)"_qualstr_phred", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr_phred, 0, (char *)0, 0},
  {(char *)"_qualscale", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualscale, 0, (char *)0, 0},
  {(char *)"_qualarr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualarr, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_SequenceWithQualities = {
  #if CYTHON_COMPILING_IN_PYPY
  __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
  __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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __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
  __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*/
  "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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_read);
  Py_CLEAR(p->iv);
  (*Py_TYPE(o)->tp_free)(o);
}

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;
  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)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_Alignment[] = {
  {(char *)"read", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_read, 0, (char *)0, 0},
  {(char *)"paired_end", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_paired_end, 0, (char *)0, 0},
  {(char *)"aligned", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_aligned, 0, (char *)"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},
  {(char *)"_read", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment__read, __pyx_setprop_5HTSeq_6_HTSeq_9Alignment__read, (char *)0, 0},
  {(char *)"iv", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_iv, __pyx_setprop_5HTSeq_6_HTSeq_9Alignment_iv, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __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*/
  "Alignment base type:\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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    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)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal[] = {
  {(char *)"read", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read, 0, (char *)0, 0},
  {(char *)"read_as_aligned", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned, __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned, (char *)0, 0},
  {(char *)"_read_as_sequenced", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced, __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __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*/
  "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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    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)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment, METH_O, 0},
  {"to_pysam_AlignedRead", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead, METH_O, 0},
  {"from_pysam_AlignedRead", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead, METH_VARARGS|METH_KEYWORDS, 0},
  {"from_pysam_AlignedSegment", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment, METH_VARARGS|METH_KEYWORDS, 0},
  {"from_SAM_line", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line, METH_O, 0},
  {"get_sam_line", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line, METH_NOARGS, 0},
  {"optional_field", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13optional_field, METH_O, 0},
  {"raw_optional_fields", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15raw_optional_fields, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_19__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_SAM_Alignment[] = {
  {(char *)"flag", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag, (char *)0, 0},
  {(char *)"paired_end", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_paired_end, 0, (char *)0, 0},
  {(char *)"mate_aligned", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_aligned, 0, (char *)0, 0},
  {(char *)"cigar", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar, (char *)0, 0},
  {(char *)"aQual", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual, (char *)0, 0},
  {(char *)"mate_start", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start, (char *)0, 0},
  {(char *)"pe_which", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which, (char *)0, 0},
  {(char *)"inferred_insert_size", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size, (char *)0, 0},
  {(char *)"proper_pair", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair, (char *)0, 0},
  {(char *)"not_primary_alignment", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment, (char *)0, 0},
  {(char *)"failed_platform_qc", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc, (char *)0, 0},
  {(char *)"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, (char *)0, 0},
  {(char *)"supplementary", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary, (char *)0, 0},
  {(char *)"original_sam_line", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_original_sam_line, 0, (char *)0, 0},
  {(char *)"optional_fields", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __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*/
  "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*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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);
  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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->array);
  Py_CLEAR(p->iv);
  Py_CLEAR(p->_storage);
  (*Py_TYPE(o)->tp_free)(o);
}

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;
  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 = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  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_7__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_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 PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_ChromVector[] = {
  {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create, METH_VARARGS|METH_KEYWORDS, 0},
  {"_create_view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view, METH_VARARGS|METH_KEYWORDS, 0},
  {"values", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13values, METH_NOARGS, 0},
  {"steps", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15steps, METH_NOARGS, 0},
  {"apply", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17apply, METH_O, 0},
  {"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__reduce__, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_ChromVector[] = {
  {(char *)"array", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_array, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_array, (char *)0, 0},
  {(char *)"iv", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_iv, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_iv, (char *)0, 0},
  {(char *)"offset", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_offset, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_offset, (char *)0, 0},
  {(char *)"is_vector_of_sets", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets, (char *)0, 0},
  {(char *)"_storage", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector__storage, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector__storage, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ChromVector = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__iadd__, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  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*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

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_5__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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19__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*/
  0, /*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_11__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*/
  0, /*tp_dictoffset*/
  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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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->storage = ((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_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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->chrom_vectors);
  Py_CLEAR(p->typecode);
  Py_CLEAR(p->storage);
  Py_CLEAR(p->memmap_dir);
  (*Py_TYPE(o)->tp_free)(o);
}

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;
  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 = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  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 {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_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 {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

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 PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicArray[] = {
  {"add_chrom", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom, METH_VARARGS|METH_KEYWORDS, 0},
  {"__reduce__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__, METH_NOARGS, 0},
  {"write_bedgraph_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11write_bedgraph_file, METH_VARARGS|METH_KEYWORDS, 0},
  {"steps", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13steps, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicArray[] = {
  {(char *)"chrom_vectors", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors, (char *)0, 0},
  {(char *)"stranded", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_stranded, 0, (char *)0, 0},
  {(char *)"typecode", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_typecode, 0, (char *)0, 0},
  {(char *)"auto_add_chroms", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms, (char *)0, 0},
  {(char *)"storage", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_storage, 0, (char *)0, 0},
  {(char *)"memmap_dir", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_memmap_dir, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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*/
  0, /*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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  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*/
  0, /*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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    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)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_BowtieAlignment[] = {
  {(char *)"reserved", __pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved, __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved, (char *)0, 0},
  {(char *)"substitutions", __pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions, __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __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*/
  "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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type);
  Py_CLEAR(p->ref_iv);
  (*Py_TYPE(o)->tp_free)(o);
}

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;
  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)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_CigarOperation[] = {
  {(char *)"type", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_type, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_type, (char *)0, 0},
  {(char *)"size", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_size, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_size, (char *)0, 0},
  {(char *)"ref_iv", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv, (char *)0, 0},
  {(char *)"query_from", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_from, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_from, (char *)0, 0},
  {(char *)"query_to", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_to, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_to, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __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*/
  0, /*tp_dictoffset*/
  __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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[8];
static int __pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = 0;

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_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__)))) {
    o = (PyObject*)__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[--__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__];
    memset(o, 0, sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    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;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__)))) {
    __pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__++] = ((struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

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

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_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  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*/
  0, /*tp_dictoffset*/
  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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"reverse_complement", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement, METH_O, __pyx_doc_5HTSeq_6_HTSeq_8reverse_complement},
  {"parse_cigar", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar, METH_VARARGS|METH_KEYWORDS, 0},
  {"build_cigar_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list, METH_VARARGS|METH_KEYWORDS, 0},
  {"quotesafe_split", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#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},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "_HTSeq",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#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

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_u_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 1, 0, 1},
  {&__pyx_n_b_ACGTacgt, __pyx_k_ACGTacgt, sizeof(__pyx_k_ACGTacgt), 0, 0, 0, 1},
  {&__pyx_n_s_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 0, 1, 1},
  {&__pyx_n_s_AlignedSegment, __pyx_k_AlignedSegment, sizeof(__pyx_k_AlignedSegment), 0, 0, 1, 1},
  {&__pyx_n_s_Alignment, __pyx_k_Alignment, sizeof(__pyx_k_Alignment), 0, 0, 1, 1},
  {&__pyx_n_s_AlignmentWithSequenceReversal, __pyx_k_AlignmentWithSequenceReversal, sizeof(__pyx_k_AlignmentWithSequenceReversal), 0, 0, 1, 1},
  {&__pyx_kp_u_Automatic_adding_of_chromosomes, __pyx_k_Automatic_adding_of_chromosomes, sizeof(__pyx_k_Automatic_adding_of_chromosomes), 0, 1, 0, 0},
  {&__pyx_n_s_BowtieAlignment, __pyx_k_BowtieAlignment, sizeof(__pyx_k_BowtieAlignment), 0, 0, 1, 1},
  {&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1},
  {&__pyx_kp_u_Cannot_assign_to_zero_length_int, __pyx_k_Cannot_assign_to_zero_length_int, sizeof(__pyx_k_Cannot_assign_to_zero_length_int), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_extend_an_interval_to_inc, __pyx_k_Cannot_extend_an_interval_to_inc, sizeof(__pyx_k_Cannot_extend_an_interval_to_inc), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_extend_an_interval_to_inc_2, __pyx_k_Cannot_extend_an_interval_to_inc_2, sizeof(__pyx_k_Cannot_extend_an_interval_to_inc_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_extend_an_interval_to_inc_3, __pyx_k_Cannot_extend_an_interval_to_inc_3, sizeof(__pyx_k_Cannot_extend_an_interval_to_inc_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_subset_to_zero_length_int, __pyx_k_Cannot_subset_to_zero_length_int, sizeof(__pyx_k_Cannot_subset_to_zero_length_int), 0, 1, 0, 0},
  {&__pyx_n_s_ChromVector, __pyx_k_ChromVector, sizeof(__pyx_k_ChromVector), 0, 0, 1, 1},
  {&__pyx_n_s_ChromVector_steps, __pyx_k_ChromVector_steps, sizeof(__pyx_k_ChromVector_steps), 0, 0, 1, 1},
  {&__pyx_n_s_ChromVector_unpickle, __pyx_k_ChromVector_unpickle, sizeof(__pyx_k_ChromVector_unpickle), 0, 0, 1, 1},
  {&__pyx_kp_u_Chromosome_name_mismatch, __pyx_k_Chromosome_name_mismatch, sizeof(__pyx_k_Chromosome_name_mismatch), 0, 1, 0, 0},
  {&__pyx_n_s_CigarOperation, __pyx_k_CigarOperation, sizeof(__pyx_k_CigarOperation), 0, 0, 1, 1},
  {&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_n_u_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 1, 0, 1},
  {&__pyx_n_s_GenomicArray, __pyx_k_GenomicArray, sizeof(__pyx_k_GenomicArray), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicArray_steps, __pyx_k_GenomicArray_steps, sizeof(__pyx_k_GenomicArray_steps), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicArray_unpickle, __pyx_k_GenomicArray_unpickle, sizeof(__pyx_k_GenomicArray_unpickle), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicInterval, __pyx_k_GenomicInterval, sizeof(__pyx_k_GenomicInterval), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicInterval_from_directional, __pyx_k_GenomicInterval_from_directional, sizeof(__pyx_k_GenomicInterval_from_directional), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicInterval_range, __pyx_k_GenomicInterval_range, sizeof(__pyx_k_GenomicInterval_range), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicInterval_ranged, __pyx_k_GenomicInterval_ranged, sizeof(__pyx_k_GenomicInterval_ranged), 0, 0, 1, 1},
  {&__pyx_n_s_GenomicPosition, __pyx_k_GenomicPosition, sizeof(__pyx_k_GenomicPosition), 0, 0, 1, 1},
  {&__pyx_n_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 1},
  {&__pyx_n_s_HTSeq, __pyx_k_HTSeq, sizeof(__pyx_k_HTSeq), 0, 0, 1, 1},
  {&__pyx_n_s_HTSeq__HTSeq, __pyx_k_HTSeq__HTSeq, sizeof(__pyx_k_HTSeq__HTSeq), 0, 0, 1, 1},
  {&__pyx_n_s_HTSeq_internal, __pyx_k_HTSeq_internal, sizeof(__pyx_k_HTSeq_internal), 0, 0, 1, 1},
  {&__pyx_n_u_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 1, 0, 1},
  {&__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_k_Illegal_CIGAR_string_s, sizeof(__pyx_k_Illegal_CIGAR_string_s), 0, 1, 0, 0},
  {&__pyx_kp_u_Illegal_base_letter_encountered, __pyx_k_Illegal_base_letter_encountered, sizeof(__pyx_k_Illegal_base_letter_encountered), 0, 1, 0, 0},
  {&__pyx_kp_u_Illegal_index_type, __pyx_k_Illegal_index_type, sizeof(__pyx_k_Illegal_index_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Illegal_index_type_2, __pyx_k_Illegal_index_type_2, sizeof(__pyx_k_Illegal_index_type_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Illegal_quality_scale_s, __pyx_k_Illegal_quality_scale_s, sizeof(__pyx_k_Illegal_quality_scale_s), 0, 1, 0, 0},
  {&__pyx_kp_u_Illegal_storage_mode, __pyx_k_Illegal_storage_mode, sizeof(__pyx_k_Illegal_storage_mode), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x1b, __pyx_k_Incompatible_checksums_s_vs_0x1b, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x1b), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x48, __pyx_k_Incompatible_checksums_s_vs_0x48, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x48), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb5, __pyx_k_Incompatible_checksums_s_vs_0xb5, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb5), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf6, __pyx_k_Incompatible_checksums_s_vs_0xf6, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf6), 0, 0, 1, 0},
  {&__pyx_kp_u_Inconsistent_CIGAR_operation, __pyx_k_Inconsistent_CIGAR_operation, sizeof(__pyx_k_Inconsistent_CIGAR_operation), 0, 1, 0, 0},
  {&__pyx_kp_u_Indefinite_length_chromosomes_ca, __pyx_k_Indefinite_length_chromosomes_ca, sizeof(__pyx_k_Indefinite_length_chromosomes_ca), 0, 1, 0, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_u_Inf, __pyx_k_Inf, sizeof(__pyx_k_Inf), 0, 1, 0, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 1},
  {&__pyx_kp_u_MIDNSHP_X, __pyx_k_MIDNSHP_X, sizeof(__pyx_k_MIDNSHP_X), 0, 1, 0, 0},
  {&__pyx_kp_u_Malformatted_SAM_optional_field, __pyx_k_Malformatted_SAM_optional_field, sizeof(__pyx_k_Malformatted_SAM_optional_field), 0, 1, 0, 0},
  {&__pyx_kp_u_Malformed_SAM_line_MRNM_although, __pyx_k_Malformed_SAM_line_MRNM_although, sizeof(__pyx_k_Malformed_SAM_line_MRNM_although), 0, 1, 0, 0},
  {&__pyx_kp_u_Malformed_SAM_line_RNAME_althoug, __pyx_k_Malformed_SAM_line_RNAME_althoug, sizeof(__pyx_k_Malformed_SAM_line_RNAME_althoug), 0, 1, 0, 0},
  {&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_kp_u_Non_stranded_index_used_for_stra, __pyx_k_Non_stranded_index_used_for_stra, sizeof(__pyx_k_Non_stranded_index_used_for_stra), 0, 1, 0, 0},
  {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_u_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 1, 0, 1},
  {&__pyx_n_u_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 1, 0, 1},
  {&__pyx_kp_u_Paired_end_read, __pyx_k_Paired_end_read, sizeof(__pyx_k_Paired_end_read), 0, 1, 0, 0},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_u_Please_Install_PySam_to_use_this, __pyx_k_Please_Install_PySam_to_use_this, sizeof(__pyx_k_Please_Install_PySam_to_use_this), 0, 1, 0, 0},
  {&__pyx_kp_u_Quality_string_has_not_the_same, __pyx_k_Quality_string_has_not_the_same, sizeof(__pyx_k_Quality_string_has_not_the_same), 0, 1, 0, 0},
  {&__pyx_kp_u_Quality_string_missing, __pyx_k_Quality_string_missing, sizeof(__pyx_k_Quality_string_missing), 0, 1, 0, 0},
  {&__pyx_kp_u_Quality_string_missing_2, __pyx_k_Quality_string_missing_2, sizeof(__pyx_k_Quality_string_missing_2), 0, 1, 0, 0},
  {&__pyx_n_u_Read, __pyx_k_Read, sizeof(__pyx_k_Read), 0, 1, 0, 1},
  {&__pyx_kp_u_Required_assignment_signature_no, __pyx_k_Required_assignment_signature_no, sizeof(__pyx_k_Required_assignment_signature_no), 0, 1, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_u_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 1, 0, 1},
  {&__pyx_n_s_SAM_Alignment, __pyx_k_SAM_Alignment, sizeof(__pyx_k_SAM_Alignment), 0, 0, 1, 1},
  {&__pyx_kp_u_SAM_line_does_not_contain_at_lea, __pyx_k_SAM_line_does_not_contain_at_lea, sizeof(__pyx_k_SAM_line_does_not_contain_at_lea), 0, 1, 0, 0},
  {&__pyx_kp_u_SAM_optional_field_tag_s_not_fou, __pyx_k_SAM_optional_field_tag_s_not_fou, sizeof(__pyx_k_SAM_optional_field_tag_s_not_fou), 0, 1, 0, 0},
  {&__pyx_kp_u_SAM_optional_field_tag_s_not_uni, __pyx_k_SAM_optional_field_tag_s_not_uni, sizeof(__pyx_k_SAM_optional_field_tag_s_not_uni), 0, 1, 0, 0},
  {&__pyx_kp_u_SAM_optional_field_with_illegal, __pyx_k_SAM_optional_field_with_illegal, sizeof(__pyx_k_SAM_optional_field_with_illegal), 0, 1, 0, 0},
  {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
  {&__pyx_n_s_SequenceWithQualities, __pyx_k_SequenceWithQualities, sizeof(__pyx_k_SequenceWithQualities), 0, 0, 1, 1},
  {&__pyx_kp_u_Sequence_in_SAM_file_contains_wh, __pyx_k_Sequence_in_SAM_file_contains_wh, sizeof(__pyx_k_Sequence_in_SAM_file_contains_wh), 0, 1, 0, 0},
  {&__pyx_kp_u_Sequence_in_SAM_file_contains_wh_2, __pyx_k_Sequence_in_SAM_file_contains_wh_2, sizeof(__pyx_k_Sequence_in_SAM_file_contains_wh_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Start_of_interval_is_after_its_e, __pyx_k_Start_of_interval_is_after_its_e, sizeof(__pyx_k_Start_of_interval_is_after_its_e), 0, 1, 0, 0},
  {&__pyx_n_s_StepVector, __pyx_k_StepVector, sizeof(__pyx_k_StepVector), 0, 0, 1, 1},
  {&__pyx_kp_u_Strand_mismatch, __pyx_k_Strand_mismatch, sizeof(__pyx_k_Strand_mismatch), 0, 1, 0, 0},
  {&__pyx_kp_u_Strand_must_be_or, __pyx_k_Strand_must_be_or, sizeof(__pyx_k_Strand_must_be_or), 0, 1, 0, 0},
  {&__pyx_kp_u_Strand_must_be_specified_for_str, __pyx_k_Strand_must_be_specified_for_str, sizeof(__pyx_k_Strand_must_be_specified_for_str), 0, 1, 0, 0},
  {&__pyx_kp_u_Strand_specified_in_unstranded_G, __pyx_k_Strand_specified_in_unstranded_G, sizeof(__pyx_k_Strand_specified_in_unstranded_G), 0, 1, 0, 0},
  {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
  {&__pyx_n_u_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 1, 0, 1},
  {&__pyx_n_b_TGCAtgca, __pyx_k_TGCAtgca, sizeof(__pyx_k_TGCAtgca), 0, 0, 0, 1},
  {&__pyx_kp_u_Too_large_quality_value_encounte, __pyx_k_Too_large_quality_value_encounte, sizeof(__pyx_k_Too_large_quality_value_encounte), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_u_Unknown_CIGAR_code_s_encountered, __pyx_k_Unknown_CIGAR_code_s_encountered, sizeof(__pyx_k_Unknown_CIGAR_code_s_encountered), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_u_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 1, 0, 1},
  {&__pyx_n_u_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 1, 0, 1},
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
  {&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0},
  {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
  {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
  {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
  {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
  {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0},
  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
  {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0},
  {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0},
  {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
  {&__pyx_kp_u__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 1, 0, 0},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
  {&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
  {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
  {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0},
  {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
  {&__pyx_kp_b__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_kp_b__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 0, 0},
  {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
  {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
  {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_bases_to_count_array, __pyx_k_add_bases_to_count_array, sizeof(__pyx_k_add_bases_to_count_array), 0, 0, 1, 1},
  {&__pyx_n_s_add_chrom, __pyx_k_add_chrom, sizeof(__pyx_k_add_chrom), 0, 0, 1, 1},
  {&__pyx_n_s_add_qual_to_count_array, __pyx_k_add_qual_to_count_array, sizeof(__pyx_k_add_qual_to_count_array), 0, 0, 1, 1},
  {&__pyx_n_s_addval, __pyx_k_addval, sizeof(__pyx_k_addval), 0, 0, 1, 1},
  {&__pyx_n_s_aend, __pyx_k_aend, sizeof(__pyx_k_aend), 0, 0, 1, 1},
  {&__pyx_n_s_aligned, __pyx_k_aligned, sizeof(__pyx_k_aligned), 0, 0, 1, 1},
  {&__pyx_kp_u_aligned_to, __pyx_k_aligned_to, sizeof(__pyx_k_aligned_to), 0, 1, 0, 0},
  {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_kp_u_assignment_to_qual_with_illegal, __pyx_k_assignment_to_qual_with_illegal, sizeof(__pyx_k_assignment_to_qual_with_illegal), 0, 1, 0, 0},
  {&__pyx_n_u_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 1, 0, 1},
  {&__pyx_kp_u_base_s, __pyx_k_base_s, sizeof(__pyx_k_base_s), 0, 1, 0, 0},
  {&__pyx_n_s_base_to_column, __pyx_k_base_to_column, sizeof(__pyx_k_base_to_column), 0, 0, 1, 1},
  {&__pyx_n_s_bowtie_line, __pyx_k_bowtie_line, sizeof(__pyx_k_bowtie_line), 0, 0, 1, 1},
  {&__pyx_n_s_cStringIO, __pyx_k_cStringIO, sizeof(__pyx_k_cStringIO), 0, 0, 1, 1},
  {&__pyx_n_s_characters_per_line, __pyx_k_characters_per_line, sizeof(__pyx_k_characters_per_line), 0, 0, 1, 1},
  {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1},
  {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
  {&__pyx_n_s_chrom_vectors, __pyx_k_chrom_vectors, sizeof(__pyx_k_chrom_vectors), 0, 0, 1, 1},
  {&__pyx_n_s_chroms, __pyx_k_chroms, sizeof(__pyx_k_chroms), 0, 0, 1, 1},
  {&__pyx_kp_u_chroms_must_be_a_list_or_a_dict, __pyx_k_chroms_must_be_a_list_or_a_dict, sizeof(__pyx_k_chroms_must_be_a_list_or_a_dict), 0, 1, 0, 0},
  {&__pyx_n_s_cigar, __pyx_k_cigar, sizeof(__pyx_k_cigar), 0, 0, 1, 1},
  {&__pyx_n_s_cigar_operation_code_dict, __pyx_k_cigar_operation_code_dict, sizeof(__pyx_k_cigar_operation_code_dict), 0, 0, 1, 1},
  {&__pyx_n_s_cigar_operation_codes, __pyx_k_cigar_operation_codes, sizeof(__pyx_k_cigar_operation_codes), 0, 0, 1, 1},
  {&__pyx_n_s_cigar_operation_names, __pyx_k_cigar_operation_names, sizeof(__pyx_k_cigar_operation_names), 0, 0, 1, 1},
  {&__pyx_n_s_cigar_pairs, __pyx_k_cigar_pairs, sizeof(__pyx_k_cigar_pairs), 0, 0, 1, 1},
  {&__pyx_n_s_cigar_string, __pyx_k_cigar_string, sizeof(__pyx_k_cigar_string), 0, 0, 1, 1},
  {&__pyx_n_s_cigartuples, __pyx_k_cigartuples, sizeof(__pyx_k_cigartuples), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
  {&__pyx_n_s_convert_to_phred, __pyx_k_convert_to_phred, sizeof(__pyx_k_convert_to_phred), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_kp_u_count_array_has_too_few_columns, __pyx_k_count_array_has_too_few_columns, sizeof(__pyx_k_count_array_has_too_few_columns), 0, 1, 0, 0},
  {&__pyx_kp_u_count_array_too_small_for_seque, __pyx_k_count_array_too_small_for_seque, sizeof(__pyx_k_count_array_too_small_for_seque), 0, 1, 0, 0},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_s_create_view, __pyx_k_create_view, sizeof(__pyx_k_create_view), 0, 0, 1, 1},
  {&__pyx_n_s_csv, __pyx_k_csv, sizeof(__pyx_k_csv), 0, 0, 1, 1},
  {&__pyx_n_s_cv, __pyx_k_cv, sizeof(__pyx_k_cv), 0, 0, 1, 1},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_u_deleted, __pyx_k_deleted, sizeof(__pyx_k_deleted), 0, 1, 0, 1},
  {&__pyx_n_u_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 1, 0, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_end_d, __pyx_k_end_d, sizeof(__pyx_k_end_d), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_extend_to_include, __pyx_k_extend_to_include, sizeof(__pyx_k_extend_to_include), 0, 0, 1, 1},
  {&__pyx_n_u_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 0, 1},
  {&__pyx_n_s_fasta_file, __pyx_k_fasta_file, sizeof(__pyx_k_fasta_file), 0, 0, 1, 1},
  {&__pyx_n_s_file_or_filename, __pyx_k_file_or_filename, sizeof(__pyx_k_file_or_filename), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_u_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 1, 0, 1},
  {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1},
  {&__pyx_n_s_from_SAM_line, __pyx_k_from_SAM_line, sizeof(__pyx_k_from_SAM_line), 0, 0, 1, 1},
  {&__pyx_n_s_from_pysam_AlignedRead, __pyx_k_from_pysam_AlignedRead, sizeof(__pyx_k_from_pysam_AlignedRead), 0, 0, 1, 1},
  {&__pyx_n_s_from_pysam_AlignedSegment, __pyx_k_from_pysam_AlignedSegment, sizeof(__pyx_k_from_pysam_AlignedSegment), 0, 0, 1, 1},
  {&__pyx_n_s_ga, __pyx_k_ga, sizeof(__pyx_k_ga), 0, 0, 1, 1},
  {&__pyx_n_s_get_reverse_complement, __pyx_k_get_reverse_complement, sizeof(__pyx_k_get_reverse_complement), 0, 0, 1, 1},
  {&__pyx_n_s_getrname, __pyx_k_getrname, sizeof(__pyx_k_getrname), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_gettid, __pyx_k_gettid, sizeof(__pyx_k_gettid), 0, 0, 1, 1},
  {&__pyx_n_s_getvalue, __pyx_k_getvalue, sizeof(__pyx_k_getvalue), 0, 0, 1, 1},
  {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1},
  {&__pyx_kp_u_hard_clipped, __pyx_k_hard_clipped, sizeof(__pyx_k_hard_clipped), 0, 1, 0, 0},
  {&__pyx_n_u_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 1, 0, 1},
  {&__pyx_n_s_iadd, __pyx_k_iadd, sizeof(__pyx_k_iadd), 0, 0, 1, 1},
  {&__pyx_n_s_iadd___locals_addval, __pyx_k_iadd___locals_addval, sizeof(__pyx_k_iadd___locals_addval), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_u_inserted, __pyx_k_inserted, sizeof(__pyx_k_inserted), 0, 1, 0, 1},
  {&__pyx_n_s_is_contained_in, __pyx_k_is_contained_in, sizeof(__pyx_k_is_contained_in), 0, 0, 1, 1},
  {&__pyx_n_s_is_duplicate, __pyx_k_is_duplicate, sizeof(__pyx_k_is_duplicate), 0, 0, 1, 1},
  {&__pyx_n_s_is_paired, __pyx_k_is_paired, sizeof(__pyx_k_is_paired), 0, 0, 1, 1},
  {&__pyx_n_s_is_proper_pair, __pyx_k_is_proper_pair, sizeof(__pyx_k_is_proper_pair), 0, 0, 1, 1},
  {&__pyx_n_s_is_qcfail, __pyx_k_is_qcfail, sizeof(__pyx_k_is_qcfail), 0, 0, 1, 1},
  {&__pyx_n_s_is_read1, __pyx_k_is_read1, sizeof(__pyx_k_is_read1), 0, 0, 1, 1},
  {&__pyx_n_s_is_read2, __pyx_k_is_read2, sizeof(__pyx_k_is_read2), 0, 0, 1, 1},
  {&__pyx_n_s_is_reverse, __pyx_k_is_reverse, sizeof(__pyx_k_is_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_is_secondary, __pyx_k_is_secondary, sizeof(__pyx_k_is_secondary), 0, 0, 1, 1},
  {&__pyx_n_s_is_supplementary, __pyx_k_is_supplementary, sizeof(__pyx_k_is_supplementary), 0, 0, 1, 1},
  {&__pyx_n_s_is_unmapped, __pyx_k_is_unmapped, sizeof(__pyx_k_is_unmapped), 0, 0, 1, 1},
  {&__pyx_n_s_is_vector_of_sets, __pyx_k_is_vector_of_sets, sizeof(__pyx_k_is_vector_of_sets), 0, 0, 1, 1},
  {&__pyx_n_s_isize, __pyx_k_isize, sizeof(__pyx_k_isize), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_iv, __pyx_k_iv, sizeof(__pyx_k_iv), 0, 0, 1, 1},
  {&__pyx_n_u_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 1, 0, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_kp_u_length_2, __pyx_k_length_2, sizeof(__pyx_k_length_2), 0, 1, 0, 0},
  {&__pyx_n_s_log10, __pyx_k_log10, sizeof(__pyx_k_log10), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_translation_table_for_comp, __pyx_k_make_translation_table_for_comp, sizeof(__pyx_k_make_translation_table_for_comp), 0, 0, 1, 1},
  {&__pyx_n_s_maketrans, __pyx_k_maketrans, sizeof(__pyx_k_maketrans), 0, 0, 1, 1},
  {&__pyx_n_s_mapping_quality, __pyx_k_mapping_quality, sizeof(__pyx_k_mapping_quality), 0, 0, 1, 1},
  {&__pyx_n_s_mapq, __pyx_k_mapq, sizeof(__pyx_k_mapq), 0, 0, 1, 1},
  {&__pyx_n_u_matched, __pyx_k_matched, sizeof(__pyx_k_matched), 0, 1, 0, 1},
  {&__pyx_n_s_mate_aligned, __pyx_k_mate_aligned, sizeof(__pyx_k_mate_aligned), 0, 0, 1, 1},
  {&__pyx_n_s_mate_is_reverse, __pyx_k_mate_is_reverse, sizeof(__pyx_k_mate_is_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_mate_is_unmapped, __pyx_k_mate_is_unmapped, sizeof(__pyx_k_mate_is_unmapped), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_max_mm_qual, __pyx_k_max_mm_qual, sizeof(__pyx_k_max_mm_qual), 0, 0, 1, 1},
  {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1},
  {&__pyx_n_s_memmap, __pyx_k_memmap, sizeof(__pyx_k_memmap), 0, 0, 1, 1},
  {&__pyx_n_u_memmap, __pyx_k_memmap, sizeof(__pyx_k_memmap), 0, 1, 0, 1},
  {&__pyx_n_s_memmap_dir, __pyx_k_memmap_dir, sizeof(__pyx_k_memmap_dir), 0, 0, 1, 1},
  {&__pyx_n_s_mismatch_prop, __pyx_k_mismatch_prop, sizeof(__pyx_k_mismatch_prop), 0, 0, 1, 1},
  {&__pyx_n_u_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 1, 0, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_mpos, __pyx_k_mpos, sizeof(__pyx_k_mpos), 0, 0, 1, 1},
  {&__pyx_n_s_mrnm, __pyx_k_mrnm, sizeof(__pyx_k_mrnm), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
  {&__pyx_n_u_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 1, 0, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_next_reference_id, __pyx_k_next_reference_id, sizeof(__pyx_k_next_reference_id), 0, 0, 1, 1},
  {&__pyx_n_s_next_reference_start, __pyx_k_next_reference_start, sizeof(__pyx_k_next_reference_start), 0, 0, 1, 1},
  {&__pyx_kp_u_nmm, __pyx_k_nmm, sizeof(__pyx_k_nmm), 0, 1, 0, 0},
  {&__pyx_n_u_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 1, 0, 1},
  {&__pyx_n_u_noquals, __pyx_k_noquals, sizeof(__pyx_k_noquals), 0, 1, 0, 1},
  {&__pyx_kp_u_not_aligned, __pyx_k_not_aligned, sizeof(__pyx_k_not_aligned), 0, 1, 0, 0},
  {&__pyx_n_u_not_paired_end, __pyx_k_not_paired_end, sizeof(__pyx_k_not_paired_end), 0, 1, 0, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
  {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
  {&__pyx_kp_u_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 1, 0, 0},
  {&__pyx_kp_u_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 1, 0, 0},
  {&__pyx_kp_u_object_3, __pyx_k_object_3, sizeof(__pyx_k_object_3), 0, 1, 0, 0},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_kp_u_on_ref_iv, __pyx_k_on_ref_iv, sizeof(__pyx_k_on_ref_iv), 0, 1, 0, 0},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_overlaps, __pyx_k_overlaps, sizeof(__pyx_k_overlaps), 0, 0, 1, 1},
  {&__pyx_n_u_padded, __pyx_k_padded, sizeof(__pyx_k_padded), 0, 1, 0, 1},
  {&__pyx_n_s_paired_end, __pyx_k_paired_end, sizeof(__pyx_k_paired_end), 0, 0, 1, 1},
  {&__pyx_kp_u_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 1, 0, 0},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pattern, __pyx_k_pattern, sizeof(__pyx_k_pattern), 0, 0, 1, 1},
  {&__pyx_n_u_phred, __pyx_k_phred, sizeof(__pyx_k_phred), 0, 1, 0, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_pysam, __pyx_k_pysam, sizeof(__pyx_k_pysam), 0, 0, 1, 1},
  {&__pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_k_python3_src_HTSeq__HTSeq_pyx, sizeof(__pyx_k_python3_src_HTSeq__HTSeq_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Alignment, __pyx_k_pyx_unpickle_Alignment, sizeof(__pyx_k_pyx_unpickle_Alignment), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_AlignmentWithSequ, __pyx_k_pyx_unpickle_AlignmentWithSequ, sizeof(__pyx_k_pyx_unpickle_AlignmentWithSequ), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_BowtieAlignment, __pyx_k_pyx_unpickle_BowtieAlignment, sizeof(__pyx_k_pyx_unpickle_BowtieAlignment), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_CigarOperation, __pyx_k_pyx_unpickle_CigarOperation, sizeof(__pyx_k_pyx_unpickle_CigarOperation), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_SAM_Alignment, __pyx_k_pyx_unpickle_SAM_Alignment, sizeof(__pyx_k_pyx_unpickle_SAM_Alignment), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qfrom, __pyx_k_qfrom, sizeof(__pyx_k_qfrom), 0, 0, 1, 1},
  {&__pyx_n_s_qname, __pyx_k_qname, sizeof(__pyx_k_qname), 0, 0, 1, 1},
  {&__pyx_n_s_qto, __pyx_k_qto, sizeof(__pyx_k_qto), 0, 0, 1, 1},
  {&__pyx_n_s_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 0, 1, 1},
  {&__pyx_kp_u_qual_can_only_be_assigned_a_nump, __pyx_k_qual_can_only_be_assigned_a_nump, sizeof(__pyx_k_qual_can_only_be_assigned_a_nump), 0, 1, 0, 0},
  {&__pyx_n_s_qualscale, __pyx_k_qualscale, sizeof(__pyx_k_qualscale), 0, 0, 1, 1},
  {&__pyx_n_s_qualstr, __pyx_k_qualstr, sizeof(__pyx_k_qualstr), 0, 0, 1, 1},
  {&__pyx_kp_u_query_iv, __pyx_k_query_iv, sizeof(__pyx_k_query_iv), 0, 1, 0, 0},
  {&__pyx_n_s_query_name, __pyx_k_query_name, sizeof(__pyx_k_query_name), 0, 0, 1, 1},
  {&__pyx_n_s_query_qualities, __pyx_k_query_qualities, sizeof(__pyx_k_query_qualities), 0, 0, 1, 1},
  {&__pyx_n_s_query_sequence, __pyx_k_query_sequence, sizeof(__pyx_k_query_sequence), 0, 0, 1, 1},
  {&__pyx_n_s_quote, __pyx_k_quote, sizeof(__pyx_k_quote), 0, 0, 1, 1},
  {&__pyx_kp_u_quote_must_be_length_1, __pyx_k_quote_must_be_length_1, sizeof(__pyx_k_quote_must_be_length_1), 0, 1, 0, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_raw_optional_fields, __pyx_k_raw_optional_fields, sizeof(__pyx_k_raw_optional_fields), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_re_cigar_codes, __pyx_k_re_cigar_codes, sizeof(__pyx_k_re_cigar_codes), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_read_as_aligned, __pyx_k_read_as_aligned, sizeof(__pyx_k_read_as_aligned), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_ref_iv, __pyx_k_ref_iv, sizeof(__pyx_k_ref_iv), 0, 0, 1, 1},
  {&__pyx_n_s_ref_left, __pyx_k_ref_left, sizeof(__pyx_k_ref_left), 0, 0, 1, 1},
  {&__pyx_n_s_reference_end, __pyx_k_reference_end, sizeof(__pyx_k_reference_end), 0, 0, 1, 1},
  {&__pyx_n_s_reference_id, __pyx_k_reference_id, sizeof(__pyx_k_reference_id), 0, 0, 1, 1},
  {&__pyx_n_s_reference_start, __pyx_k_reference_start, sizeof(__pyx_k_reference_start), 0, 0, 1, 1},
  {&__pyx_n_s_rename, __pyx_k_rename, sizeof(__pyx_k_rename), 0, 0, 1, 1},
  {&__pyx_n_u_revcomp_of, __pyx_k_revcomp_of, sizeof(__pyx_k_revcomp_of), 0, 1, 0, 1},
  {&__pyx_n_s_rfrom, __pyx_k_rfrom, sizeof(__pyx_k_rfrom), 0, 0, 1, 1},
  {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1},
  {&__pyx_n_s_rto, __pyx_k_rto, sizeof(__pyx_k_rto), 0, 0, 1, 1},
  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
  {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
  {&__pyx_n_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 1},
  {&__pyx_n_s_samfile, __pyx_k_samfile, sizeof(__pyx_k_samfile), 0, 0, 1, 1},
  {&__pyx_n_s_se, __pyx_k_se, sizeof(__pyx_k_se), 0, 0, 1, 1},
  {&__pyx_n_u_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 1, 0, 1},
  {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1},
  {&__pyx_n_u_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 1, 0, 1},
  {&__pyx_kp_u_seq_and_qualstr_do_not_have_the, __pyx_k_seq_and_qualstr_do_not_have_the, sizeof(__pyx_k_seq_and_qualstr_do_not_have_the), 0, 1, 0, 0},
  {&__pyx_kp_u_sequence_matched, __pyx_k_sequence_matched, sizeof(__pyx_k_sequence_matched), 0, 1, 0, 0},
  {&__pyx_kp_u_sequence_mismatched, __pyx_k_sequence_mismatched, sizeof(__pyx_k_sequence_mismatched), 0, 1, 0, 0},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_u_skipped, __pyx_k_skipped, sizeof(__pyx_k_skipped), 0, 1, 0, 1},
  {&__pyx_kp_u_soft_clipped, __pyx_k_soft_clipped, sizeof(__pyx_k_soft_clipped), 0, 1, 0, 0},
  {&__pyx_n_u_solexa, __pyx_k_solexa, sizeof(__pyx_k_solexa), 0, 1, 0, 1},
  {&__pyx_kp_u_solexa_old, __pyx_k_solexa_old, sizeof(__pyx_k_solexa_old), 0, 1, 0, 0},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_kp_u_split_must_be_length_1, __pyx_k_split_must_be_length_1, sizeof(__pyx_k_split_must_be_length_1), 0, 1, 0, 0},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_start_d, __pyx_k_start_d, sizeof(__pyx_k_start_d), 0, 0, 1, 1},
  {&__pyx_n_s_start_index, __pyx_k_start_index, sizeof(__pyx_k_start_index), 0, 0, 1, 1},
  {&__pyx_kp_u_start_is_larger_than_end, __pyx_k_start_is_larger_than_end, sizeof(__pyx_k_start_is_larger_than_end), 0, 1, 0, 0},
  {&__pyx_kp_u_start_too_small, __pyx_k_start_too_small, sizeof(__pyx_k_start_too_small), 0, 1, 0, 0},
  {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_u_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 1, 0, 1},
  {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_kp_u_stop_too_large, __pyx_k_stop_too_large, sizeof(__pyx_k_stop_too_large), 0, 1, 0, 0},
  {&__pyx_n_s_storage, __pyx_k_storage, sizeof(__pyx_k_storage), 0, 0, 1, 1},
  {&__pyx_n_s_storage_2, __pyx_k_storage_2, sizeof(__pyx_k_storage_2), 0, 0, 1, 1},
  {&__pyx_n_s_strand, __pyx_k_strand, sizeof(__pyx_k_strand), 0, 0, 1, 1},
  {&__pyx_kp_u_strand_2, __pyx_k_strand_2, sizeof(__pyx_k_strand_2), 0, 1, 0, 0},
  {&__pyx_kp_u_strand_3, __pyx_k_strand_3, sizeof(__pyx_k_strand_3), 0, 1, 0, 0},
  {&__pyx_n_s_stranded, __pyx_k_stranded, sizeof(__pyx_k_stranded), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_tags, __pyx_k_tags, sizeof(__pyx_k_tags), 0, 0, 1, 1},
  {&__pyx_n_s_template_length, __pyx_k_template_length, sizeof(__pyx_k_template_length), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 0, 1, 1},
  {&__pyx_n_s_track_options, __pyx_k_track_options, sizeof(__pyx_k_track_options), 0, 0, 1, 1},
  {&__pyx_kp_u_track_type_bedGraph, __pyx_k_track_type_bedGraph, sizeof(__pyx_k_track_type_bedGraph), 0, 1, 0, 0},
  {&__pyx_kp_u_track_type_bedGraph_s, __pyx_k_track_type_bedGraph_s, sizeof(__pyx_k_track_type_bedGraph_s), 0, 1, 0, 0},
  {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1},
  {&__pyx_n_s_trim_left_end, __pyx_k_trim_left_end, sizeof(__pyx_k_trim_left_end), 0, 0, 1, 1},
  {&__pyx_n_s_trim_left_end_with_quals, __pyx_k_trim_left_end_with_quals, sizeof(__pyx_k_trim_left_end_with_quals), 0, 0, 1, 1},
  {&__pyx_n_s_trim_right_end, __pyx_k_trim_right_end, sizeof(__pyx_k_trim_right_end), 0, 0, 1, 1},
  {&__pyx_n_s_trim_right_end_with_quals, __pyx_k_trim_right_end_with_quals, sizeof(__pyx_k_trim_right_end_with_quals), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1},
  {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_u_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 0, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_kp_u_unmatched_quote, __pyx_k_unmatched_quote, sizeof(__pyx_k_unmatched_quote), 0, 1, 0, 0},
  {&__pyx_n_u_unnamed, __pyx_k_unnamed, sizeof(__pyx_k_unnamed), 0, 1, 0, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1},
  {&__pyx_kp_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 0},
  {&__pyx_n_u_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 1, 0, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_u_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 1, 0, 1},
  {&__pyx_n_s_write_to_fastq_file, __pyx_k_write_to_fastq_file, sizeof(__pyx_k_write_to_fastq_file), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 67, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 166, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 240, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 352, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 433, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 597, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1241, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 1256, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 856, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "HTSeq/_HTSeq.pyx":335
 *             else:
 *                 ncv.array = numpy.empty(shape=(iv.length, ), dtype=typecode)
 *                 ncv.array[:] = None             # <<<<<<<<<<<<<<
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(shape=(iv.length, ), dtype=typecode,
 */
  __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__13);
  __Pyx_GIVEREF(__pyx_slice__13);

  /* "HTSeq/_HTSeq.pyx":447
 *                        self.offset].__iadd__(value)
 *         else:
 *             def addval(x):             # <<<<<<<<<<<<<<
 *                 y = x.copy()
 *                 y.add(value)
 */
  __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_addval, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 447, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":627
 * 
 * def _make_translation_table_for_complementation():
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')             # <<<<<<<<<<<<<<
 * 
 * cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()
 */
  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_b_ACGTacgt, __pyx_n_b_TGCAtgca); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "HTSeq/_HTSeq.pyx":635
 *     work with extended IUPAC nucleotide letters or RNA."""
 * 
 *     return seq[::-1].translate(_translation_table_for_complementation)             # <<<<<<<<<<<<<<
 * 
 * base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}
 */
  __pyx_slice__24 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__24);
  __Pyx_GIVEREF(__pyx_slice__24);

  /* "HTSeq/_HTSeq.pyx":1420
 *             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_slice__35 = PySlice_New(__pyx_int_0, __pyx_int_11, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__35);
  __Pyx_GIVEREF(__pyx_slice__35);

  /* "HTSeq/_HTSeq.pyx":1421
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
 *          seq, qual) = fields[0:11]
 *         optional_fields = fields[11:]             # <<<<<<<<<<<<<<
 * 
 *         if seq.count("=") > 0:
 */
  __pyx_slice__36 = PySlice_New(__pyx_int_11, Py_None, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__36);
  __Pyx_GIVEREF(__pyx_slice__36);

  /* "HTSeq/_HTSeq.pyx":1456
 *         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_slice__37 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__37);
  __Pyx_GIVEREF(__pyx_slice__37);

  /* "HTSeq/_HTSeq.pyx":1517
 *             query_start = self.iv
 *         else:
 *             query_start = GenomicPosition("*", -1)             # <<<<<<<<<<<<<<
 * 
 *         if self.mate_start is not None:
 */
  __pyx_tuple__38 = PyTuple_Pack(2, __pyx_kp_u__34, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(3, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "HTSeq/_HTSeq.pyx":253
 * 
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):             # <<<<<<<<<<<<<<
 *     strand = intern(strand)
 *     if strand.se is not strand_minus:
 */
  __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_chrom, __pyx_n_s_start_d, __pyx_n_s_length, __pyx_n_s_strand); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_GenomicInterval_from_directional, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 253, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":477
 * 
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):             # <<<<<<<<<<<<<<
 *     cv = ChromVector()
 *     cv.array = array
 */
  __pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_array, __pyx_n_s_iv, __pyx_n_s_offset, __pyx_n_s_is_vector_of_sets, __pyx_n_s_storage_2, __pyx_n_s_cv); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_ChromVector_unpickle, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 477, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":615
 * 
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):             # <<<<<<<<<<<<<<
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors
 */
  __pyx_tuple__52 = PyTuple_Pack(4, __pyx_n_s_stranded, __pyx_n_s_typecode, __pyx_n_s_chrom_vectors, __pyx_n_s_ga); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_GenomicArray_unpickle, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 615, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":626
 * 
 * 
 * def _make_translation_table_for_complementation():             # <<<<<<<<<<<<<<
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
 * 
 */
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_python3_src_HTSeq__HTSeq_pyx, __pyx_n_s_make_translation_table_for_comp, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 626, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":1160
 *         return True
 * 
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')             # <<<<<<<<<<<<<<
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_MIDNSHP_X); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Alignment, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_AlignmentWithSequ, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BowtieAlignment, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CigarOperation, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SAM_Alignment, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_28831487 = PyInt_FromLong(28831487L); if (unlikely(!__pyx_int_28831487)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_75678070 = PyInt_FromLong(75678070L); if (unlikely(!__pyx_int_75678070)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_125566450 = PyInt_FromLong(125566450L); if (unlikely(!__pyx_int_125566450)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_190567068 = PyInt_FromLong(190567068L); if (unlikely(!__pyx_int_190567068)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_258552819 = PyInt_FromLong(258552819L); if (unlikely(!__pyx_int_258552819)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __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(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __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 (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_GenomicInterval.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 29, __pyx_L1_error)
    if (Py_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_type_5HTSeq_6_HTSeq_GenomicInterval.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GenomicInterval, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval = &__pyx_type_5HTSeq_6_HTSeq_GenomicInterval;
  __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;
  __pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_GenomicPosition) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_5HTSeq_6_HTSeq_GenomicPosition.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GenomicPosition, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicPosition) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition = &__pyx_type_5HTSeq_6_HTSeq_GenomicPosition;
  __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 (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_Sequence) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_Sequence.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_Sequence.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_Sequence.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_Sequence.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_5HTSeq_6_HTSeq_Sequence.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_Sequence) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sequence, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_Sequence) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_Sequence = &__pyx_type_5HTSeq_6_HTSeq_Sequence;
  __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;
  __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_Sequence;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 789, __pyx_L1_error)
    if (Py_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_type_5HTSeq_6_HTSeq_SequenceWithQualities.tp_dict, __pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SequenceWithQualities, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities = &__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_Alignment) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_Alignment.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_Alignment.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_Alignment.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_Alignment.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Alignment, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_Alignment) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_Alignment) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_Alignment = &__pyx_type_5HTSeq_6_HTSeq_Alignment;
  __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_Alignment;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AlignmentWithSequenceReversal, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = &__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SAM_Alignment, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment = &__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_ChromVector) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_ChromVector.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChromVector, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_ChromVector) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_ChromVector = &__pyx_type_5HTSeq_6_HTSeq_ChromVector;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_GenomicArray) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_GenomicArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GenomicArray, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_GenomicArray) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_GenomicArray = &__pyx_type_5HTSeq_6_HTSeq_GenomicArray;
  __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_base = __pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BowtieAlignment, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment = &__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq_CigarOperation) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq_CigarOperation.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CigarOperation, (PyObject *)&__pyx_type_5HTSeq_6_HTSeq_CigarOperation) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5HTSeq_6_HTSeq_CigarOperation) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
  __pyx_ptype_5HTSeq_6_HTSeq_CigarOperation = &__pyx_type_5HTSeq_6_HTSeq_CigarOperation;
  if (PyType_Ready(&__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
  __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_dictoffset && __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = &__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__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(3, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __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(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_HTSeq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_HTSeq(void)
#else
__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);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
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, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    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
#endif
{
  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;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  __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;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #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("__Pyx_PyMODINIT_FUNC PyInit__HTSeq(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_HTSeq", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_HTSeq___HTSeq) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    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)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "HTSeq/_HTSeq.pyx":1
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import math
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2
 * import sys
 * import os             # <<<<<<<<<<<<<<
 * import math
 * import re
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":3
 * import sys
 * import os
 * import math             # <<<<<<<<<<<<<<
 * import re
 * import csv
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":4
 * import os
 * import math
 * import re             # <<<<<<<<<<<<<<
 * import csv
 * import gzip
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":5
 * import math
 * import re
 * import csv             # <<<<<<<<<<<<<<
 * import gzip
 * import itertools
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_csv, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_csv, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":6
 * import re
 * import csv
 * import gzip             # <<<<<<<<<<<<<<
 * import itertools
 * import collections
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gzip, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gzip, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":7
 * import csv
 * import gzip
 * import itertools             # <<<<<<<<<<<<<<
 * import collections
 * try:
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":8
 * import gzip
 * import itertools
 * import collections             # <<<<<<<<<<<<<<
 * try:
 *     import cStringIO
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":9
 * import itertools
 * import collections
 * try:             # <<<<<<<<<<<<<<
 *     import cStringIO
 * except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "HTSeq/_HTSeq.pyx":10
 * import collections
 * try:
 *     import cStringIO             # <<<<<<<<<<<<<<
 * except:
 *     pass
 */
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_cStringIO, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_cStringIO, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":9
 * import itertools
 * import collections
 * try:             # <<<<<<<<<<<<<<
 *     import cStringIO
 * except:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 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_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    __pyx_L7_try_end:;
  }

  /* "HTSeq/_HTSeq.pyx":13
 * except:
 *     pass
 * import warnings             # <<<<<<<<<<<<<<
 * import numpy
 * cimport numpy
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":14
 *     pass
 * import warnings
 * import numpy             # <<<<<<<<<<<<<<
 * cimport numpy
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":17
 * cimport numpy
 * 
 * from HTSeq import StepVector             # <<<<<<<<<<<<<<
 * from HTSeq import _HTSeq_internal
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_StepVector);
  __Pyx_GIVEREF(__pyx_n_s_StepVector);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StepVector);
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_HTSeq, __pyx_t_1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_StepVector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_StepVector, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":18
 * 
 * from HTSeq import StepVector
 * from HTSeq import _HTSeq_internal             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_HTSeq_internal);
  __Pyx_GIVEREF(__pyx_n_s_HTSeq_internal);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_HTSeq_internal);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_HTSeq, __pyx_t_5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HTSeq_internal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HTSeq_internal, __pyx_t_5) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":25
 * ###########################
 * 
 * cdef str strand_plus = intern("+")             # <<<<<<<<<<<<<<
 * cdef str strand_minus = intern("-")
 * cdef str strand_nostrand = intern(".")
 */
  __pyx_t_1 = __Pyx_Intern(__pyx_kp_u__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 25, __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_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":26
 * 
 * cdef str strand_plus = intern("+")
 * cdef str strand_minus = intern("-")             # <<<<<<<<<<<<<<
 * cdef str strand_nostrand = intern(".")
 * 
 */
  __pyx_t_1 = __Pyx_Intern(__pyx_kp_u__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 26, __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_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":27
 * cdef str strand_plus = intern("+")
 * cdef str strand_minus = intern("-")
 * cdef str strand_nostrand = intern(".")             # <<<<<<<<<<<<<<
 * 
 * cdef class GenomicInterval:
 */
  __pyx_t_1 = __Pyx_Intern(__pyx_kp_u__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 27, __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_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":57
 * 
 *     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_k_ = __pyx_v_5HTSeq_6_HTSeq_strand_nostrand;
  __Pyx_GIVEREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);

  /* "HTSeq/_HTSeq.pyx":253
 * 
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):             # <<<<<<<<<<<<<<
 *     strand = intern(strand)
 *     if strand.se is not strand_minus:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_1GenomicInterval_from_directional, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GenomicInterval_from_directional, __pyx_t_1) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":327
 * 
 *     @classmethod
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):             # <<<<<<<<<<<<<<
 *         ncv = cls()
 *         ncv.iv = iv
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "HTSeq/_HTSeq.pyx":326
 *     cdef public str _storage
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         ncv = cls()
 */
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_dict, __pyx_n_s_create, __pyx_t_5) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);

  /* "HTSeq/_HTSeq.pyx":350
 * 
 *     @classmethod
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         if iv.length == 0:
 *             raise IndexError, "Cannot subset to zero-length interval."
 */
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_n_s_create_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "HTSeq/_HTSeq.pyx":349
 *         return ncv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_dict, __pyx_n_s_create_view, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);

  /* "HTSeq/_HTSeq.pyx":477
 * 
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):             # <<<<<<<<<<<<<<
 *     cv = ChromVector()
 *     cv.array = array
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_3_ChromVector_unpickle, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ChromVector_unpickle, __pyx_t_1) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":563
 *             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_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_k__18 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":615
 * 
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):             # <<<<<<<<<<<<<<
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_5_GenomicArray_unpickle, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GenomicArray_unpickle, __pyx_t_5) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":626
 * 
 * 
 * def _make_translation_table_for_complementation():             # <<<<<<<<<<<<<<
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
 * 
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_translation_table_for_comp, __pyx_t_5) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":629
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
 * 
 * cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()             # <<<<<<<<<<<<<<
 * 
 * cpdef bytes reverse_complement(bytes seq):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_make_translation_table_for_comp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 629, __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_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":637
 *     return seq[::-1].translate(_translation_table_for_complementation)
 * 
 * base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}             # <<<<<<<<<<<<<<
 * 
 * cdef class Sequence(object):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_A, __pyx_int_0) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_C, __pyx_int_1) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_G, __pyx_int_2) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_T, __pyx_int_3) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_N, __pyx_int_4) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_base_to_column, __pyx_t_1) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1108
 * 
 * cigar_operation_names = {
 *     'M': 'matched',             # <<<<<<<<<<<<<<
 *     'I': 'inserted',
 *     'D': 'deleted',
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_M, __pyx_n_u_matched) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_I, __pyx_n_u_inserted) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_D, __pyx_n_u_deleted) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_N, __pyx_n_u_skipped) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_S, __pyx_kp_u_soft_clipped) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_H, __pyx_kp_u_hard_clipped) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_P, __pyx_n_u_padded) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u__33, __pyx_kp_u_sequence_matched) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_X, __pyx_kp_u_sequence_mismatched) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cigar_operation_names, __pyx_t_1) < 0) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1160
 *         return True
 * 
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')             # <<<<<<<<<<<<<<
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_cigar_codes, __pyx_t_1) < 0) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1239
 *         raise ValueError, "SAM optional field with illegal type letter '%s'" % field[2]
 * 
 * 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_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_u_M);
  __Pyx_GIVEREF(__pyx_n_u_M);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_M);
  __Pyx_INCREF(__pyx_n_u_I);
  __Pyx_GIVEREF(__pyx_n_u_I);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_I);
  __Pyx_INCREF(__pyx_n_u_D);
  __Pyx_GIVEREF(__pyx_n_u_D);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_D);
  __Pyx_INCREF(__pyx_n_u_N);
  __Pyx_GIVEREF(__pyx_n_u_N);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_N);
  __Pyx_INCREF(__pyx_n_u_S);
  __Pyx_GIVEREF(__pyx_n_u_S);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_S);
  __Pyx_INCREF(__pyx_n_u_H);
  __Pyx_GIVEREF(__pyx_n_u_H);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_H);
  __Pyx_INCREF(__pyx_n_u_P);
  __Pyx_GIVEREF(__pyx_n_u_P);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_P);
  __Pyx_INCREF(__pyx_kp_u__33);
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__33);
  __Pyx_INCREF(__pyx_n_u_X);
  __Pyx_GIVEREF(__pyx_n_u_X);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_u_X);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cigar_operation_codes, __pyx_t_1) < 0) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1240
 * 
 * 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)])
 * 
 */
  { /* enter inner scope */

    /* "HTSeq/_HTSeq.pyx":1241
 * 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)])             # <<<<<<<<<<<<<<
 * 
 * cdef class SAM_Alignment(AlignmentWithSequenceReversal):
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_5 = __pyx_int_0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cigar_operation_codes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1241, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1241, __pyx_L10_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1241, __pyx_L10_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1241, __pyx_L10_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1241, __pyx_L10_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5);
      __pyx_t_5 = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      __Pyx_INCREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1241, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_L13_exit_scope;
    __pyx_L10_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_L13_exit_scope:;
  } /* exit inner scope */

  /* "HTSeq/_HTSeq.pyx":1240
 * 
 * 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_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cigar_operation_code_dict, __pyx_t_5) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":1318
 * 
 *     @classmethod
 *     def from_pysam_AlignedRead(cls, read, samfile):             # <<<<<<<<<<<<<<
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 */
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_n_s_from_pysam_AlignedRead); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "HTSeq/_HTSeq.pyx":1317
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dict, __pyx_n_s_from_pysam_AlignedRead, __pyx_t_1) < 0) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);

  /* "HTSeq/_HTSeq.pyx":1363
 * 
 *     @classmethod
 *     def from_pysam_AlignedSegment(cls, read, samfile):             # <<<<<<<<<<<<<<
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_n_s_from_pysam_AlignedSegment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "HTSeq/_HTSeq.pyx":1362
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
 */
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dict, __pyx_n_s_from_pysam_AlignedSegment, __pyx_t_5) < 0) __PYX_ERR(0, 1363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);

  /* "HTSeq/_HTSeq.pyx":1407
 * 
 *     @classmethod
 *     def from_SAM_line(cls, line):             # <<<<<<<<<<<<<<
 *         cdef str qname, flag, rname, pos, mapq, cigar,
 *         cdef str mrnm, mpos, isize, seq, qual
 */
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_n_s_from_SAM_line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "HTSeq/_HTSeq.pyx":1406
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_SAM_line(cls, line):
 *         cdef str qname, flag, rname, pos, mapq, cigar,
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dict, __pyx_n_s_from_SAM_line, __pyx_t_1) < 0) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_17__pyx_unpickle_Alignment, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Alignment, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_19__pyx_unpickle_AlignmentWithSequenceReversal, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_AlignmentWithSequ, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_21__pyx_unpickle_BowtieAlignment, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BowtieAlignment, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(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, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __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]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_23__pyx_unpickle_CigarOperation, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CigarOperation, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment, NULL, __pyx_n_s_HTSeq__HTSeq); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SAM_Alignment, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import math
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../../../usr/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init HTSeq._HTSeq", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } 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;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

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

/* PyObjectGetAttrStr */
#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);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

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

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* Intern */
static PyObject* __Pyx_Intern(PyObject* s) {
    if (!(likely(PyString_CheckExact(s)))) {
        PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(s)->tp_name);
        return 0;
    }
    Py_INCREF(s);
    #if PY_MAJOR_VERSION >= 3
    PyUnicode_InternInPlace(&s);
    #else
    PyString_InternInPlace(&s);
    #endif
    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);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    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);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *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

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
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 CYTHON_COMPILING_IN_PYPY
        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);
#else
        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);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" 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 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" 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

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    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) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *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_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* CIntToDigits */
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 */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, 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;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    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
    {
        uval = NULL;
        PyObject *sign = NULL, *padding = 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;
                    PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    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 = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned short    uint16_t;
        #else
           typedef unsigned __int16  uint16_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
static CYTHON_INLINE PyObject* __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;
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    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;
            *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (long) (remaining / (10*10));
            dpos -= 2;
            *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
            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));
    if (last_one_off) {
        assert(*dpos == '0');
        dpos++;
    }
    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);
}

/* 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_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__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* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    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;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || 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
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    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_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 */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    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 PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            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));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            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_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* 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) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    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 = PyInt_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 = PyInt_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;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        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));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!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,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if 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)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else 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)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* 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) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    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 = PyInt_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 = PyInt_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;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *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;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    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 = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = 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, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    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 PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    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);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_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)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_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*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = 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;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        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);
            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;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    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);
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    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);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            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 NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyObjectGetMethod */
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
    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 PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #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 (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    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;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    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;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = 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_COMPILING_IN_PYPY
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 = Py_TYPE(iter)->tp_iternext;
    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 */
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;
#elif PY_MAJOR_VERSION >= 3
        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);
}
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_COMPILING_IN_PYPY
    if (source_is_dict) {
        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);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } 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;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } 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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* decode_c_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;
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* CIntToPyUnicode */
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned short    uint16_t;
        #else
           typedef unsigned __int16  uint16_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
static CYTHON_INLINE PyObject* __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;
    const Py_ssize_t neg_one = (Py_ssize_t) ((Py_ssize_t) 0 - (Py_ssize_t) 1), const_zero = (Py_ssize_t) 0;
    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;
            *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
            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;
            *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
            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));
    if (last_one_off) {
        assert(*dpos == '0');
        dpos++;
    }
    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);
}

/* 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 = PyTuple_GET_SIZE(substrings);
    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 = 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);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } 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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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]));
                        break;
#ifdef HAVE_LONG_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]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* IsLittleEndian */
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 */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __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 '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 "unparseable 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 '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);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    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;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int 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);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    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;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int 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);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    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 '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 {
    __Pyx_StructField* field = ctx->head->field;
    __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 {
    __Pyx_StructField* field = ctx->head->field;
    __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 PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    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 NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
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 '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->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)) 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;
  __Pyx_ReleaseBuffer(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,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  buf->buf = NULL;
  if (unlikely(__Pyx_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((unsigned)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);
}

/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* PyErrExceptionMatches */
  #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);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    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) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetAttr3 */
  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;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* CIntToPyUnicode */
  #ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned short    uint16_t;
        #else
           typedef unsigned __int16  uint16_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
static CYTHON_INLINE PyObject* __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;
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    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;
            *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
            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));
    if (last_one_off) {
        assert(*dpos == '0');
        dpos++;
    }
    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);
}

/* None */
  static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* None */
  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* GetTopmostException */
  #if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == 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
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    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

/* 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, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    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 PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    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;
        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;
    }
    #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);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* GetItemIntUnicode */
  static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
                                                           int wraparound, int boundscheck) {
    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 (wraparound & unlikely(i < 0)) i += length;
        if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) {
            return __Pyx_PyUnicode_READ_CHAR(ustring, i);
        } else {
            PyErr_SetString(PyExc_IndexError, "string index out of range");
            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 (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
    length = __Pyx_PyUnicode_GET_LENGTH(text);
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    length = stop - start;
    if (length <= 0)
        return PyUnicode_FromUnicode(NULL, 0);
#if CYTHON_PEP393_ENABLED
    return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
        PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
#else
    return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start);
#endif
}

/* Import */
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* PyIntCompare */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        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));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* bytes_index */
  static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds) {
    if (index < 0)
        index += PyBytes_GET_SIZE(bytes);
    if (check_bounds) {
        Py_ssize_t size = PyBytes_GET_SIZE(bytes);
        if (unlikely(!__Pyx_is_valid_index(index, size))) {
            PyErr_SetString(PyExc_IndexError, "string index out of range");
            return (char) -1;
        }
    }
    return PyBytes_AS_STRING(bytes)[index];
}

/* ImportFrom */
  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->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);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObject_GenericGetAttrNoDict */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_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_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#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
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#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;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < 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);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != 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);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 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_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (__Pyx_CyFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* GetNameInClass */
  static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* CLineInTraceback */
  #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
  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 PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    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) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __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);
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

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

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
    if ((0)) {}
        else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
    view->obj = NULL;
    Py_DECREF(obj);
}
#endif


  /* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* None */
  static CYTHON_INLINE long __Pyx_pow_long(long b, long e) {
    long t = b;
    switch (e) {
        case 3:
            t *= b;
        CYTHON_FALLTHROUGH;
        case 2:
            t *= b;
        CYTHON_FALLTHROUGH;
        case 1:
            return t;
        case 0:
            return 1;
    }
    #if 1
    if (unlikely(e<0)) return 0;
    #endif
    t = 1;
    while (likely(e)) {
        t *= (b * (e&1)) | ((~e)&1);
        b *= b;
        e >>= 1;
    }
    return t;
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* Declarations */
  #if CYTHON_CCOMPLEX
  #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
#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 = 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 = 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:
                        z = __Pyx_c_prod_float(a, a);
                        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) {
                    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, -1);
                }
            } 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
  #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
#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 = 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 = 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:
                        z = __Pyx_c_prod_double(a, a);
                        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) {
                    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, -1);
                }
            } 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

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                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
            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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                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
            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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        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;
}

/* CIntFromPy */
  static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
    const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Py_intptr_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Py_intptr_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            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 (Py_intptr_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Py_intptr_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(Py_intptr_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Py_intptr_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Py_intptr_t) -1;
        }
    } else {
        Py_intptr_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Py_intptr_t) -1;
        val = __Pyx_PyInt_As_Py_intptr_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Py_intptr_t");
    return (Py_intptr_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Py_intptr_t");
    return (Py_intptr_t) -1;
}

/* CIntFromPy */
  static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
    const npy_uint8 neg_one = (npy_uint8) ((npy_uint8) 0 - (npy_uint8) 1), const_zero = (npy_uint8) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_uint8) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (npy_uint8) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_uint8) 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, digits[0])
                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
            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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_uint8) 0;
                case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint8,  digit, +digits[0])
                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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_uint8 val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (npy_uint8) -1;
        }
    } else {
        npy_uint8 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (npy_uint8) -1;
        val = __Pyx_PyInt_As_npy_uint8(tmp);
        Py_DECREF(tmp);
        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;
}

/* CIntFromPy */
  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
    const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
                            return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
                            return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, 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(char) >= 4 * PyLong_SHIFT) {
                            return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            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 (char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, 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(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, 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(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (char) -1;
        }
    } else {
        char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyInt_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to char");
    return (char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to char");
    return (char) -1;
}

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        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);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
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);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        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

/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
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_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#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_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        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_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  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 PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      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 = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
