/* Generated by Cython 0.12.1.beta0 on Sat Jan 30 15:10:19 2010 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyString_Type                PyUnicode_Type
  #define PyString_CheckExact          PyUnicode_CheckExact
#else
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_CheckExact           PyString_CheckExact
#endif

#if PY_MAJOR_VERSION >= 3
  #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 __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 PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#else
  #define _USE_MATH_DEFINES
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#define __PYX_HAVE_API__acora___acora
#include "stdio.h"

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #else
    #define CYTHON_INLINE 
  #endif
#endif

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


/* Type Conversion Predeclarations */

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_FromString          PyString_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyString_AsString
#else
#define __Pyx_PyBytes_FromString          PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyBytes_AsString
#endif

#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
#define T_PYSSIZET T_INT
#elif !defined(T_LONGLONG)
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
#else
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
#endif
#endif


#if !defined(T_ULONGLONG)
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
#else
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
#endif
#if !defined(T_LONGLONG)
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
#else
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
#endif

#define __Pyx_T_FLOATING(x) \
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))

#if !defined(T_SIZET)
#if !defined(T_ULONGLONG)
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
#else
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
#endif
#endif

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char **__pyx_f;


/* Type declarations */

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":25
 * DEF FILE_BUFFER_SIZE = 32 * 1024
 * 
 * ctypedef struct _AcoraUnicodeNodeStruct:             # <<<<<<<<<<<<<<
 *     Py_UNICODE* characters
 *     _AcoraUnicodeNodeStruct** targets
 */

struct ___pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct {
  Py_UNICODE *characters;
  struct ___pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct **targets;
  PyObject **matches;
  int char_count;
};

typedef struct ___pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct;

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":31
 *     int char_count
 * 
 * ctypedef struct _AcoraBytesNodeStruct:             # <<<<<<<<<<<<<<
 *     char* characters
 *     _AcoraBytesNodeStruct** targets
 */

struct ___pyx_t_5acora_6_acora__AcoraBytesNodeStruct {
  char *characters;
  struct ___pyx_t_5acora_6_acora__AcoraBytesNodeStruct **targets;
  PyObject **matches;
  int char_count;
};

typedef struct ___pyx_t_5acora_6_acora__AcoraBytesNodeStruct __pyx_t_5acora_6_acora__AcoraBytesNodeStruct;

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":134
 * # unicode data handling
 * 
 * cdef class UnicodeAcora:             # <<<<<<<<<<<<<<
 *     """Acora search engine for unicode data.
 *     """
 */

struct __pyx_obj_5acora_6_acora_UnicodeAcora {
  PyObject_HEAD
  struct __pyx_vtabstruct_5acora_6_acora_UnicodeAcora *__pyx_vtab;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *start_node;
  Py_ssize_t node_count;
  int has_large_nodes;
  PyObject *_pyrefs;
};

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":189
 *         return list(self.finditer(data))
 * 
 * cdef class _UnicodeAcoraIter:             # <<<<<<<<<<<<<<
 *     cdef _AcoraUnicodeNodeStruct* current_node
 *     cdef _AcoraUnicodeNodeStruct* start_node
 */

struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter {
  PyObject_HEAD
  struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter *__pyx_vtab;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *current_node;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *start_node;
  Py_ssize_t match_index;
  PyObject *data;
  struct __pyx_obj_5acora_6_acora_UnicodeAcora *acora;
  Py_UNICODE *data_char;
  Py_UNICODE *data_end;
};

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":444
 * # file data handling
 * 
 * cdef class _FileAcoraIter:             # <<<<<<<<<<<<<<
 *     cdef _AcoraBytesNodeStruct* current_node
 *     cdef _AcoraBytesNodeStruct* start_node
 */

struct __pyx_obj_5acora_6_acora__FileAcoraIter {
  PyObject_HEAD
  struct __pyx_vtabstruct_5acora_6_acora__FileAcoraIter *__pyx_vtab;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *current_node;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *start_node;
  Py_ssize_t match_index;
  Py_ssize_t read_size;
  Py_ssize_t buffer_offset_count;
  PyObject *buffer;
  char *c_buffer_pos;
  char *c_buffer_end;
  PyObject *f;
  int close_file;
  int c_file;
  struct __pyx_obj_5acora_6_acora_BytesAcora *acora;
};

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":368
 *         return list(self.filefind(f))
 * 
 * cdef class _BytesAcoraIter:             # <<<<<<<<<<<<<<
 *     cdef _AcoraBytesNodeStruct* current_node
 *     cdef _AcoraBytesNodeStruct* start_node
 */

struct __pyx_obj_5acora_6_acora__BytesAcoraIter {
  PyObject_HEAD
  struct __pyx_vtabstruct_5acora_6_acora__BytesAcoraIter *__pyx_vtab;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *current_node;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *start_node;
  Py_ssize_t match_index;
  PyObject *data;
  struct __pyx_obj_5acora_6_acora_BytesAcora *acora;
  char *data_char;
  char *data_end;
  char *data_start;
};

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":313
 * # bytes data handling
 * 
 * cdef class BytesAcora:             # <<<<<<<<<<<<<<
 *     """Acora search engine for byte data.
 *     """
 */

struct __pyx_obj_5acora_6_acora_BytesAcora {
  PyObject_HEAD
  struct __pyx_vtabstruct_5acora_6_acora_BytesAcora *__pyx_vtab;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *start_node;
  Py_ssize_t node_count;
  PyObject *_pyrefs;
};

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":253
 *                              ) - PyUnicode_GET_SIZE(match))
 * 
 * cdef class _BisectUnicodeAcoraIter(_UnicodeAcoraIter):             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         cdef Py_UNICODE* data_char = self.data_char
 */

struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter {
  struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter __pyx_base;
};


/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":189
 *         return list(self.finditer(data))
 * 
 * cdef class _UnicodeAcoraIter:             # <<<<<<<<<<<<<<
 *     cdef _AcoraUnicodeNodeStruct* current_node
 *     cdef _AcoraUnicodeNodeStruct* start_node
 */

struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter {
  PyObject *(*_build_next_match)(struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *);
};
static struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter *__pyx_vtabptr_5acora_6_acora__UnicodeAcoraIter;


/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":313
 * # bytes data handling
 * 
 * cdef class BytesAcora:             # <<<<<<<<<<<<<<
 *     """Acora search engine for byte data.
 *     """
 */

struct __pyx_vtabstruct_5acora_6_acora_BytesAcora {
  PyObject *(*finditer)(struct __pyx_obj_5acora_6_acora_BytesAcora *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5acora_6_acora_BytesAcora *__pyx_vtabptr_5acora_6_acora_BytesAcora;


/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":444
 * # file data handling
 * 
 * cdef class _FileAcoraIter:             # <<<<<<<<<<<<<<
 *     cdef _AcoraBytesNodeStruct* current_node
 *     cdef _AcoraBytesNodeStruct* start_node
 */

struct __pyx_vtabstruct_5acora_6_acora__FileAcoraIter {
  PyObject *(*_build_next_match)(struct __pyx_obj_5acora_6_acora__FileAcoraIter *);
};
static struct __pyx_vtabstruct_5acora_6_acora__FileAcoraIter *__pyx_vtabptr_5acora_6_acora__FileAcoraIter;


/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":253
 *                              ) - PyUnicode_GET_SIZE(match))
 * 
 * cdef class _BisectUnicodeAcoraIter(_UnicodeAcoraIter):             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         cdef Py_UNICODE* data_char = self.data_char
 */

struct __pyx_vtabstruct_5acora_6_acora__BisectUnicodeAcoraIter {
  struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter __pyx_base;
};
static struct __pyx_vtabstruct_5acora_6_acora__BisectUnicodeAcoraIter *__pyx_vtabptr_5acora_6_acora__BisectUnicodeAcoraIter;


/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":368
 *         return list(self.filefind(f))
 * 
 * cdef class _BytesAcoraIter:             # <<<<<<<<<<<<<<
 *     cdef _AcoraBytesNodeStruct* current_node
 *     cdef _AcoraBytesNodeStruct* start_node
 */

struct __pyx_vtabstruct_5acora_6_acora__BytesAcoraIter {
  PyObject *(*_build_next_match)(struct __pyx_obj_5acora_6_acora__BytesAcoraIter *);
};
static struct __pyx_vtabstruct_5acora_6_acora__BytesAcoraIter *__pyx_vtabptr_5acora_6_acora__BytesAcoraIter;


/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":134
 * # unicode data handling
 * 
 * cdef class UnicodeAcora:             # <<<<<<<<<<<<<<
 *     """Acora search engine for unicode data.
 *     """
 */

struct __pyx_vtabstruct_5acora_6_acora_UnicodeAcora {
  PyObject *(*finditer)(struct __pyx_obj_5acora_6_acora_UnicodeAcora *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5acora_6_acora_UnicodeAcora *__pyx_vtabptr_5acora_6_acora_UnicodeAcora;

#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) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
  end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #define __Pyx_RefNannySetupContext(name)
  #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_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);

static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/

static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (PyList_Append(L, x) < 0) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*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); /*proto*/

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

static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

#ifndef __PYX_FORCE_INIT_THREADS
  #if PY_VERSION_HEX < 0x02040200
    #define __PYX_FORCE_INIT_THREADS 1
  #else
    #define __PYX_FORCE_INIT_THREADS 0
  #endif
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from stdio */

/* Module declarations from python_ref */

/* Module declarations from python_exc */

/* Module declarations from python_mem */

/* Module declarations from python_version */

/* Module declarations from python_unicode */

/* Module declarations from acora._acora */

static PyTypeObject *__pyx_ptype_5acora_6_acora_UnicodeAcora = 0;
static PyTypeObject *__pyx_ptype_5acora_6_acora__UnicodeAcoraIter = 0;
static PyTypeObject *__pyx_ptype_5acora_6_acora__BisectUnicodeAcoraIter = 0;
static PyTypeObject *__pyx_ptype_5acora_6_acora_BytesAcora = 0;
static PyTypeObject *__pyx_ptype_5acora_6_acora__BytesAcoraIter = 0;
static PyTypeObject *__pyx_ptype_5acora_6_acora__FileAcoraIter = 0;
static PyObject *__pyx_f_5acora_6_acora__init_unicode_node(__pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *, PyObject *, PyObject *, __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_5acora_6_acora__init_bytes_node(__pyx_t_5acora_6_acora__AcoraBytesNodeStruct *, PyObject *, PyObject *, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5acora_6_acora__intern(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_5acora_6_acora_group_transitions_by_state(PyObject *); /*proto*/
static int __pyx_f_5acora_6_acora__bisect(Py_UNICODE, Py_UNICODE *, int); /*proto*/
static int __pyx_f_5acora_6_acora__search_in_bytes(__pyx_t_5acora_6_acora__AcoraBytesNodeStruct *, char *, char **, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct **); /*proto*/
static int __pyx_f_5acora_6_acora__find_next_match_in_cfile(int, char *, size_t, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *, char **, char **, Py_ssize_t *, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct **, int *); /*proto*/
#define __Pyx_MODULE_NAME "acora._acora"
int __pyx_module_is_main_acora___acora = 0;

/* Implementation of acora._acora */
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_IOError;
static char __pyx_k_1[] = "";
static char __pyx_k_2[] = "\000";
static char __pyx_k_3[] = "A fast C implementation of the Acora search engine.\n\nThere are two main classes, UnicodeAcora and BytesAcora, that handle\nbyte data and unicode data respectively.\n";
static char __pyx_k_4[] = "UnicodeAcora.finditer (line 176)";
static char __pyx_k_5[] = "UnicodeAcora.findall (line 184)";
static char __pyx_k__f[] = "f";
static char __pyx_k__rb[] = "rb";
static char __pyx_k__zip[] = "zip";
static char __pyx_k__data[] = "data";
static char __pyx_k__join[] = "join";
static char __pyx_k__open[] = "open";
static char __pyx_k__read[] = "read";
static char __pyx_k__acora[] = "acora";
static char __pyx_k__close[] = "close";
static char __pyx_k__items[] = "items";
static char __pyx_k__range[] = "range";
static char __pyx_k__buffer[] = "buffer";
static char __pyx_k__c_file[] = "c_file";
static char __pyx_k__fileno[] = "fileno";
static char __pyx_k__sorted[] = "sorted";
static char __pyx_k__IOError[] = "IOError";
static char __pyx_k____all__[] = "__all__";
static char __pyx_k___pyrefs[] = "_pyrefs";
static char __pyx_k__findall[] = "findall";
static char __pyx_k__matches[] = "matches";
static char __pyx_k__targets[] = "targets";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__data_end[] = "data_end";
static char __pyx_k__filefind[] = "filefind";
static char __pyx_k__finditer[] = "finditer";
static char __pyx_k__data_char[] = "data_char";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__read_size[] = "read_size";
static char __pyx_k__BytesAcora[] = "BytesAcora";
static char __pyx_k__char_count[] = "char_count";
static char __pyx_k__characters[] = "characters";
static char __pyx_k__close_file[] = "close_file";
static char __pyx_k__data_start[] = "data_start";
static char __pyx_k__node_count[] = "node_count";
static char __pyx_k__python_exc[] = "python_exc";
static char __pyx_k__start_node[] = "start_node";
static char __pyx_k__buffer_size[] = "buffer_size";
static char __pyx_k__match_index[] = "match_index";
static char __pyx_k__start_state[] = "start_state";
static char __pyx_k__transitions[] = "transitions";
static char __pyx_k__UnicodeAcora[] = "UnicodeAcora";
static char __pyx_k__c_buffer_end[] = "c_buffer_end";
static char __pyx_k__c_buffer_pos[] = "c_buffer_pos";
static char __pyx_k__current_node[] = "current_node";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__PyMem_NoMemory[] = "PyMem_NoMemory";
static char __pyx_k__has_large_nodes[] = "has_large_nodes";
static char __pyx_k___build_next_match[] = "_build_next_match";
static char __pyx_k__buffer_offset_count[] = "buffer_offset_count";
static PyObject *__pyx_kp_b_1;
static PyObject *__pyx_kp_u_1;
static PyObject *__pyx_kp_b_2;
static PyObject *__pyx_kp_u_4;
static PyObject *__pyx_kp_u_5;
static PyObject *__pyx_n_s__BytesAcora;
static PyObject *__pyx_n_s__IOError;
static PyObject *__pyx_n_s__PyMem_NoMemory;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__UnicodeAcora;
static PyObject *__pyx_n_s____all__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___build_next_match;
static PyObject *__pyx_n_s___pyrefs;
static PyObject *__pyx_n_s__acora;
static PyObject *__pyx_n_s__buffer;
static PyObject *__pyx_n_s__buffer_offset_count;
static PyObject *__pyx_n_s__buffer_size;
static PyObject *__pyx_n_s__c_buffer_end;
static PyObject *__pyx_n_s__c_buffer_pos;
static PyObject *__pyx_n_s__c_file;
static PyObject *__pyx_n_s__char_count;
static PyObject *__pyx_n_s__characters;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__close_file;
static PyObject *__pyx_n_s__current_node;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__data_char;
static PyObject *__pyx_n_s__data_end;
static PyObject *__pyx_n_s__data_start;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__f;
static PyObject *__pyx_n_s__filefind;
static PyObject *__pyx_n_s__fileno;
static PyObject *__pyx_n_s__findall;
static PyObject *__pyx_n_s__finditer;
static PyObject *__pyx_n_s__has_large_nodes;
static PyObject *__pyx_n_s__items;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__match_index;
static PyObject *__pyx_n_s__matches;
static PyObject *__pyx_n_s__node_count;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__python_exc;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rb;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__read_size;
static PyObject *__pyx_n_s__sorted;
static PyObject *__pyx_n_s__start_node;
static PyObject *__pyx_n_s__start_state;
static PyObject *__pyx_n_s__targets;
static PyObject *__pyx_n_s__transitions;
static PyObject *__pyx_n_s__zip;

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":37
 *     int char_count
 * 
 * cdef _init_unicode_node(_AcoraUnicodeNodeStruct* c_node, state,             # <<<<<<<<<<<<<<
 *                         list state_transitions,
 *                         _AcoraUnicodeNodeStruct* all_nodes,
 */

static  PyObject *__pyx_f_5acora_6_acora__init_unicode_node(__pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_c_node, PyObject *__pyx_v_state, PyObject *__pyx_v_state_transitions, __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_all_nodes, PyObject *__pyx_v_node_offsets, PyObject *__pyx_v_pyrefs) {
  size_t __pyx_v_targets_mem_size;
  size_t __pyx_v_mem_size;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_characters;
  PyObject *__pyx_v_targets;
  PyObject *__pyx_v_target;
  PyObject *__pyx_v_matches;
  PyObject *__pyx_v_match;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  __Pyx_RefNannySetupContext("_init_unicode_node");
  __Pyx_INCREF(__pyx_v_state);
  __Pyx_INCREF(__pyx_v_state_transitions);
  __Pyx_INCREF(__pyx_v_node_offsets);
  __Pyx_INCREF(__pyx_v_pyrefs);
  __pyx_v_characters = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_targets = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matches = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_match = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":44
 *     cdef Py_ssize_t i
 * 
 *     state_transitions.sort() # sort by characters             # <<<<<<<<<<<<<<
 *     characters, targets = list(zip(*state_transitions))
 *     characters = _intern(pyrefs, u''.join(characters))
 */
  if (unlikely(__pyx_v_state_transitions == Py_None)) {
    PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'sort'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_Sort(((PyObject *)__pyx_v_state_transitions)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":45
 * 
 *     state_transitions.sort() # sort by characters
 *     characters, targets = list(zip(*state_transitions))             # <<<<<<<<<<<<<<
 *     characters = _intern(pyrefs, u''.join(characters))
 * 
 */
  __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_state_transitions)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
    PyObject* tuple = __pyx_t_3;
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_characters);
    __pyx_v_characters = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_targets);
    __pyx_v_targets = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_characters);
    __pyx_v_characters = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_targets);
    __pyx_v_targets = __pyx_t_4;
    __pyx_t_4 = 0;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":46
 *     state_transitions.sort() # sort by characters
 *     characters, targets = list(zip(*state_transitions))
 *     characters = _intern(pyrefs, u''.join(characters))             # <<<<<<<<<<<<<<
 * 
 *     c_node.characters = PyUnicode_AS_UNICODE(characters)
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_u_1), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_characters);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_characters);
  __Pyx_GIVEREF(__pyx_v_characters);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __pyx_f_5acora_6_acora__intern(__pyx_v_pyrefs, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_characters);
  __pyx_v_characters = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":48
 *     characters = _intern(pyrefs, u''.join(characters))
 * 
 *     c_node.characters = PyUnicode_AS_UNICODE(characters)             # <<<<<<<<<<<<<<
 *     c_node.char_count = PyUnicode_GET_SIZE(characters)
 * 
 */
  __pyx_v_c_node->characters = PyUnicode_AS_UNICODE(__pyx_v_characters);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":49
 * 
 *     c_node.characters = PyUnicode_AS_UNICODE(characters)
 *     c_node.char_count = PyUnicode_GET_SIZE(characters)             # <<<<<<<<<<<<<<
 * 
 *     # use a single malloc for targets and match-string pointers
 */
  __pyx_v_c_node->char_count = PyUnicode_GET_SIZE(__pyx_v_characters);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":52
 * 
 *     # use a single malloc for targets and match-string pointers
 *     mem_size = targets_mem_size = sizeof(_AcoraUnicodeNodeStruct**) * len(targets)             # <<<<<<<<<<<<<<
 *     if state.matches is not None and len(state.matches) > 0:
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_targets); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((sizeof(__pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct **)) * __pyx_t_6);
  __pyx_v_mem_size = __pyx_t_7;
  __pyx_v_targets_mem_size = __pyx_t_7;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":53
 *     # use a single malloc for targets and match-string pointers
 *     mem_size = targets_mem_size = sizeof(_AcoraUnicodeNodeStruct**) * len(targets)
 *     if state.matches is not None and len(state.matches) > 0:             # <<<<<<<<<<<<<<
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 *     c_node.targets = <_AcoraUnicodeNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = (__pyx_t_6 > 0);
    __pyx_t_10 = __pyx_t_9;
  } else {
    __pyx_t_10 = __pyx_t_8;
  }
  if (__pyx_t_10) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":54
 *     mem_size = targets_mem_size = sizeof(_AcoraUnicodeNodeStruct**) * len(targets)
 *     if state.matches is not None and len(state.matches) > 0:
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated             # <<<<<<<<<<<<<<
 *     c_node.targets = <_AcoraUnicodeNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 *     if c_node.targets is NULL:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_mem_size += ((sizeof(PyObject *)) * (__pyx_t_6 + 1));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":55
 *     if state.matches is not None and len(state.matches) > 0:
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 *     c_node.targets = <_AcoraUnicodeNodeStruct**> python_mem.PyMem_Malloc(mem_size)             # <<<<<<<<<<<<<<
 *     if c_node.targets is NULL:
 *         python_exc.PyErr_NoMemory()
 */
  __pyx_v_c_node->targets = ((__pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct **)PyMem_Malloc(__pyx_v_mem_size));

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":56
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 *     c_node.targets = <_AcoraUnicodeNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 *     if c_node.targets is NULL:             # <<<<<<<<<<<<<<
 *         python_exc.PyErr_NoMemory()
 * 
 */
  __pyx_t_10 = (__pyx_v_c_node->targets == NULL);
  if (__pyx_t_10) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":57
 *     c_node.targets = <_AcoraUnicodeNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 *     if c_node.targets is NULL:
 *         python_exc.PyErr_NoMemory()             # <<<<<<<<<<<<<<
 * 
 *     for i, target in enumerate(targets):
 */
    __pyx_t_11 = PyErr_NoMemory(); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":59
 *         python_exc.PyErr_NoMemory()
 * 
 *     for i, target in enumerate(targets):             # <<<<<<<<<<<<<<
 *         c_node.targets[i] = all_nodes + <size_t>node_offsets[target]
 * 
 */
  __pyx_t_6 = 0;
  if (PyList_CheckExact(__pyx_v_targets) || PyTuple_CheckExact(__pyx_v_targets)) {
    __pyx_t_12 = 0; __pyx_t_4 = __pyx_v_targets; __Pyx_INCREF(__pyx_t_4);
  } else {
    __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_targets); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_4))) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
    } else {
      __pyx_t_2 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_2) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_v_target);
    __pyx_v_target = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_i = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":60
 * 
 *     for i, target in enumerate(targets):
 *         c_node.targets[i] = all_nodes + <size_t>node_offsets[target]             # <<<<<<<<<<<<<<
 * 
 *     if mem_size == targets_mem_size:
 */
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_node_offsets), __pyx_v_target); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_c_node->targets[__pyx_v_i]) = (__pyx_v_all_nodes + ((size_t)__pyx_t_7));
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":62
 *         c_node.targets[i] = all_nodes + <size_t>node_offsets[target]
 * 
 *     if mem_size == targets_mem_size:             # <<<<<<<<<<<<<<
 *         c_node.matches = NULL
 *     else:
 */
  __pyx_t_10 = (__pyx_v_mem_size == __pyx_v_targets_mem_size);
  if (__pyx_t_10) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":63
 * 
 *     if mem_size == targets_mem_size:
 *         c_node.matches = NULL             # <<<<<<<<<<<<<<
 *     else:
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))
 */
    __pyx_v_c_node->matches = NULL;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":65
 *         c_node.matches = NULL
 *     else:
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))             # <<<<<<<<<<<<<<
 *         matches = _intern(pyrefs, tuple(state.matches))
 *         i = 0
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_targets); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_c_node->matches = ((PyObject **)(__pyx_v_c_node->targets + __pyx_t_6));

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":66
 *     else:
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))
 *         matches = _intern(pyrefs, tuple(state.matches))             # <<<<<<<<<<<<<<
 *         i = 0
 *         for match in matches:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_5acora_6_acora__intern(__pyx_v_pyrefs, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_matches);
    __pyx_v_matches = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":67
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))
 *         matches = _intern(pyrefs, tuple(state.matches))
 *         i = 0             # <<<<<<<<<<<<<<
 *         for match in matches:
 *             c_node.matches[i] = <PyObject*>match
 */
    __pyx_v_i = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":68
 *         matches = _intern(pyrefs, tuple(state.matches))
 *         i = 0
 *         for match in matches:             # <<<<<<<<<<<<<<
 *             c_node.matches[i] = <PyObject*>match
 *             i += 1
 */
    if (PyList_CheckExact(__pyx_v_matches) || PyTuple_CheckExact(__pyx_v_matches)) {
      __pyx_t_6 = 0; __pyx_t_2 = __pyx_v_matches; __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_matches); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
      } else {
        __pyx_t_4 = PyIter_Next(__pyx_t_2);
        if (!__pyx_t_4) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_v_match);
      __pyx_v_match = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":69
 *         i = 0
 *         for match in matches:
 *             c_node.matches[i] = <PyObject*>match             # <<<<<<<<<<<<<<
 *             i += 1
 *         c_node.matches[i] = NULL
 */
      (__pyx_v_c_node->matches[__pyx_v_i]) = ((PyObject *)__pyx_v_match);

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":70
 *         for match in matches:
 *             c_node.matches[i] = <PyObject*>match
 *             i += 1             # <<<<<<<<<<<<<<
 *         c_node.matches[i] = NULL
 * 
 */
      __pyx_v_i += 1;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":71
 *             c_node.matches[i] = <PyObject*>match
 *             i += 1
 *         c_node.matches[i] = NULL             # <<<<<<<<<<<<<<
 * 
 * cdef _init_bytes_node(_AcoraBytesNodeStruct* c_node, state,
 */
    (__pyx_v_c_node->matches[__pyx_v_i]) = NULL;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("acora._acora._init_unicode_node");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_characters);
  __Pyx_DECREF(__pyx_v_targets);
  __Pyx_DECREF(__pyx_v_target);
  __Pyx_DECREF(__pyx_v_matches);
  __Pyx_DECREF(__pyx_v_match);
  __Pyx_DECREF(__pyx_v_state);
  __Pyx_DECREF(__pyx_v_state_transitions);
  __Pyx_DECREF(__pyx_v_node_offsets);
  __Pyx_DECREF(__pyx_v_pyrefs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":73
 *         c_node.matches[i] = NULL
 * 
 * cdef _init_bytes_node(_AcoraBytesNodeStruct* c_node, state,             # <<<<<<<<<<<<<<
 *                       list state_transitions,
 *                       _AcoraBytesNodeStruct* all_nodes,
 */

static  PyObject *__pyx_f_5acora_6_acora__init_bytes_node(__pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_c_node, PyObject *__pyx_v_state, PyObject *__pyx_v_state_transitions, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_all_nodes, PyObject *__pyx_v_node_offsets, PyObject *__pyx_v_pyrefs) {
  size_t __pyx_v_targets_mem_size;
  size_t __pyx_v_mem_size;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_characters;
  PyObject *__pyx_v_targets;
  PyObject *__pyx_v_target;
  PyObject *__pyx_v_matches;
  PyObject *__pyx_v_match;
  PyObject *__pyx_r = NULL;
  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;
  char *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("_init_bytes_node");
  __Pyx_INCREF(__pyx_v_state);
  __Pyx_INCREF(__pyx_v_state_transitions);
  __Pyx_INCREF(__pyx_v_node_offsets);
  __Pyx_INCREF(__pyx_v_pyrefs);
  __pyx_v_characters = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_targets = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matches = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_match = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":80
 *     cdef Py_ssize_t i
 * 
 *     state_transitions.sort() # sort by characters             # <<<<<<<<<<<<<<
 *     characters, targets = list(zip(*state_transitions))
 *     if PY_MAJOR_VERSION >= 3:
 */
  if (unlikely(__pyx_v_state_transitions == Py_None)) {
    PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'sort'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_Sort(((PyObject *)__pyx_v_state_transitions)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":81
 * 
 *     state_transitions.sort() # sort by characters
 *     characters, targets = list(zip(*state_transitions))             # <<<<<<<<<<<<<<
 *     if PY_MAJOR_VERSION >= 3:
 *         characters = bytes(characters) # items are integers, not byte strings
 */
  __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_state_transitions)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
    PyObject* tuple = __pyx_t_3;
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_characters);
    __pyx_v_characters = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_targets);
    __pyx_v_targets = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_characters);
    __pyx_v_characters = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_targets);
    __pyx_v_targets = __pyx_t_4;
    __pyx_t_4 = 0;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":82
 *     state_transitions.sort() # sort by characters
 *     characters, targets = list(zip(*state_transitions))
 *     if PY_MAJOR_VERSION >= 3:             # <<<<<<<<<<<<<<
 *         characters = bytes(characters) # items are integers, not byte strings
 *     else:
 */
  __pyx_t_6 = (PY_MAJOR_VERSION >= 3);
  if (__pyx_t_6) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":83
 *     characters, targets = list(zip(*state_transitions))
 *     if PY_MAJOR_VERSION >= 3:
 *         characters = bytes(characters) # items are integers, not byte strings             # <<<<<<<<<<<<<<
 *     else:
 *         characters = b''.join(characters)
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_characters);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_characters);
    __Pyx_GIVEREF(__pyx_v_characters);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyBytes_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_characters);
    __pyx_v_characters = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":85
 *         characters = bytes(characters) # items are integers, not byte strings
 *     else:
 *         characters = b''.join(characters)             # <<<<<<<<<<<<<<
 *     characters = _intern(pyrefs, characters)
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_b_1), __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_characters);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_characters);
    __Pyx_GIVEREF(__pyx_v_characters);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_characters);
    __pyx_v_characters = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":86
 *     else:
 *         characters = b''.join(characters)
 *     characters = _intern(pyrefs, characters)             # <<<<<<<<<<<<<<
 * 
 *     c_node.characters = characters
 */
  __pyx_t_2 = __pyx_f_5acora_6_acora__intern(__pyx_v_pyrefs, __pyx_v_characters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_characters);
  __pyx_v_characters = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":88
 *     characters = _intern(pyrefs, characters)
 * 
 *     c_node.characters = characters             # <<<<<<<<<<<<<<
 *     c_node.char_count = len(characters)
 * 
 */
  __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_v_characters); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_node->characters = __pyx_t_7;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":89
 * 
 *     c_node.characters = characters
 *     c_node.char_count = len(characters)             # <<<<<<<<<<<<<<
 * 
 *     # use a single malloc for targets and match-string pointers
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_characters); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_node->char_count = __pyx_t_8;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":92
 * 
 *     # use a single malloc for targets and match-string pointers
 *     mem_size = targets_mem_size = sizeof(_AcoraBytesNodeStruct**) * len(targets)             # <<<<<<<<<<<<<<
 *     if state.matches is not None and len(state.matches) > 0:
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_targets); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((sizeof(__pyx_t_5acora_6_acora__AcoraBytesNodeStruct **)) * __pyx_t_8);
  __pyx_v_mem_size = __pyx_t_9;
  __pyx_v_targets_mem_size = __pyx_t_9;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":93
 *     # use a single malloc for targets and match-string pointers
 *     mem_size = targets_mem_size = sizeof(_AcoraBytesNodeStruct**) * len(targets)
 *     if state.matches is not None and len(state.matches) > 0:             # <<<<<<<<<<<<<<
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 *     c_node.targets = <_AcoraBytesNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = (__pyx_t_8 > 0);
    __pyx_t_11 = __pyx_t_10;
  } else {
    __pyx_t_11 = __pyx_t_6;
  }
  if (__pyx_t_11) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":94
 *     mem_size = targets_mem_size = sizeof(_AcoraBytesNodeStruct**) * len(targets)
 *     if state.matches is not None and len(state.matches) > 0:
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated             # <<<<<<<<<<<<<<
 *     c_node.targets = <_AcoraBytesNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 *     if c_node.targets is NULL:
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_mem_size += ((sizeof(PyObject *)) * (__pyx_t_8 + 1));
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":95
 *     if state.matches is not None and len(state.matches) > 0:
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 *     c_node.targets = <_AcoraBytesNodeStruct**> python_mem.PyMem_Malloc(mem_size)             # <<<<<<<<<<<<<<
 *     if c_node.targets is NULL:
 *         python_exc.PyErr_NoMemory()
 */
  __pyx_v_c_node->targets = ((__pyx_t_5acora_6_acora__AcoraBytesNodeStruct **)PyMem_Malloc(__pyx_v_mem_size));

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":96
 *         mem_size += sizeof(PyObject*) * (len(state.matches) + 1) # NULL terminated
 *     c_node.targets = <_AcoraBytesNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 *     if c_node.targets is NULL:             # <<<<<<<<<<<<<<
 *         python_exc.PyErr_NoMemory()
 * 
 */
  __pyx_t_11 = (__pyx_v_c_node->targets == NULL);
  if (__pyx_t_11) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":97
 *     c_node.targets = <_AcoraBytesNodeStruct**> python_mem.PyMem_Malloc(mem_size)
 *     if c_node.targets is NULL:
 *         python_exc.PyErr_NoMemory()             # <<<<<<<<<<<<<<
 * 
 *     for i, target in enumerate(targets):
 */
    __pyx_t_12 = PyErr_NoMemory(); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":99
 *         python_exc.PyErr_NoMemory()
 * 
 *     for i, target in enumerate(targets):             # <<<<<<<<<<<<<<
 *         c_node.targets[i] = all_nodes + <size_t>node_offsets[target]
 * 
 */
  __pyx_t_8 = 0;
  if (PyList_CheckExact(__pyx_v_targets) || PyTuple_CheckExact(__pyx_v_targets)) {
    __pyx_t_13 = 0; __pyx_t_2 = __pyx_v_targets; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_targets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_v_target);
    __pyx_v_target = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_i = __pyx_t_8;
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":100
 * 
 *     for i, target in enumerate(targets):
 *         c_node.targets[i] = all_nodes + <size_t>node_offsets[target]             # <<<<<<<<<<<<<<
 * 
 *     if mem_size == targets_mem_size:
 */
    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_node_offsets), __pyx_v_target); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_c_node->targets[__pyx_v_i]) = (__pyx_v_all_nodes + ((size_t)__pyx_t_9));
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":102
 *         c_node.targets[i] = all_nodes + <size_t>node_offsets[target]
 * 
 *     if mem_size == targets_mem_size:             # <<<<<<<<<<<<<<
 *         c_node.matches = NULL
 *     else:
 */
  __pyx_t_11 = (__pyx_v_mem_size == __pyx_v_targets_mem_size);
  if (__pyx_t_11) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":103
 * 
 *     if mem_size == targets_mem_size:
 *         c_node.matches = NULL             # <<<<<<<<<<<<<<
 *     else:
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))
 */
    __pyx_v_c_node->matches = NULL;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":105
 *         c_node.matches = NULL
 *     else:
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))             # <<<<<<<<<<<<<<
 *         matches = _intern(pyrefs, tuple(state.matches))
 *         i = 0
 */
    __pyx_t_8 = PyObject_Length(__pyx_v_targets); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_c_node->matches = ((PyObject **)(__pyx_v_c_node->targets + __pyx_t_8));

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":106
 *     else:
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))
 *         matches = _intern(pyrefs, tuple(state.matches))             # <<<<<<<<<<<<<<
 *         i = 0
 *         for match in matches:
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s__matches); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_5acora_6_acora__intern(__pyx_v_pyrefs, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_matches);
    __pyx_v_matches = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":107
 *         c_node.matches = <PyObject**> (c_node.targets + len(targets))
 *         matches = _intern(pyrefs, tuple(state.matches))
 *         i = 0             # <<<<<<<<<<<<<<
 *         for match in matches:
 *             c_node.matches[i] = <PyObject*>match
 */
    __pyx_v_i = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":108
 *         matches = _intern(pyrefs, tuple(state.matches))
 *         i = 0
 *         for match in matches:             # <<<<<<<<<<<<<<
 *             c_node.matches[i] = <PyObject*>match
 *             i += 1
 */
    if (PyList_CheckExact(__pyx_v_matches) || PyTuple_CheckExact(__pyx_v_matches)) {
      __pyx_t_8 = 0; __pyx_t_3 = __pyx_v_matches; __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matches); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
      } else {
        __pyx_t_2 = PyIter_Next(__pyx_t_3);
        if (!__pyx_t_2) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_v_match);
      __pyx_v_match = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":109
 *         i = 0
 *         for match in matches:
 *             c_node.matches[i] = <PyObject*>match             # <<<<<<<<<<<<<<
 *             i += 1
 *         c_node.matches[i] = NULL
 */
      (__pyx_v_c_node->matches[__pyx_v_i]) = ((PyObject *)__pyx_v_match);

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":110
 *         for match in matches:
 *             c_node.matches[i] = <PyObject*>match
 *             i += 1             # <<<<<<<<<<<<<<
 *         c_node.matches[i] = NULL
 * 
 */
      __pyx_v_i += 1;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":111
 *             c_node.matches[i] = <PyObject*>match
 *             i += 1
 *         c_node.matches[i] = NULL             # <<<<<<<<<<<<<<
 * 
 * cdef inline _intern(dict d, obj):
 */
    (__pyx_v_c_node->matches[__pyx_v_i]) = NULL;
  }
  __pyx_L8:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("acora._acora._init_bytes_node");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_characters);
  __Pyx_DECREF(__pyx_v_targets);
  __Pyx_DECREF(__pyx_v_target);
  __Pyx_DECREF(__pyx_v_matches);
  __Pyx_DECREF(__pyx_v_match);
  __Pyx_DECREF(__pyx_v_state);
  __Pyx_DECREF(__pyx_v_state_transitions);
  __Pyx_DECREF(__pyx_v_node_offsets);
  __Pyx_DECREF(__pyx_v_pyrefs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":113
 *         c_node.matches[i] = NULL
 * 
 * cdef inline _intern(dict d, obj):             # <<<<<<<<<<<<<<
 *     if obj in d:
 *         return d[obj]
 */

static CYTHON_INLINE PyObject *__pyx_f_5acora_6_acora__intern(PyObject *__pyx_v_d, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_intern");
  __Pyx_INCREF(__pyx_v_d);
  __Pyx_INCREF(__pyx_v_obj);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":114
 * 
 * cdef inline _intern(dict d, obj):
 *     if obj in d:             # <<<<<<<<<<<<<<
 *         return d[obj]
 *     d[obj] = obj
 */
  if (unlikely(((PyObject *)__pyx_v_d) == Py_None)) {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  } else {
    __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_d), __pyx_v_obj))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":115
 * cdef inline _intern(dict d, obj):
 *     if obj in d:
 *         return d[obj]             # <<<<<<<<<<<<<<
 *     d[obj] = obj
 *     return obj
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_d), __pyx_v_obj); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":116
 *     if obj in d:
 *         return d[obj]
 *     d[obj] = obj             # <<<<<<<<<<<<<<
 *     return obj
 * 
 */
  if (PyDict_SetItem(((PyObject *)__pyx_v_d), __pyx_v_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":117
 *         return d[obj]
 *     d[obj] = obj
 *     return obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("acora._acora._intern");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_d);
  __Pyx_DECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":120
 * 
 * 
 * cdef dict group_transitions_by_state(dict transitions):             # <<<<<<<<<<<<<<
 *     # sort transitions by state ID (0 is start state) and transition character
 *     cdef list transition_list = sorted(transitions.items())
 */

static  PyObject *__pyx_f_5acora_6_acora_group_transitions_by_state(PyObject *__pyx_v_transitions) {
  PyObject *__pyx_v_transition_list = 0;
  PyObject *__pyx_v_transitions_by_state;
  PyObject *__pyx_v_state;
  PyObject *__pyx_v_character;
  PyObject *__pyx_v_target;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("group_transitions_by_state");
  __Pyx_INCREF(__pyx_v_transitions);
  __pyx_v_transitions_by_state = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_state = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_character = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":122
 * cdef dict group_transitions_by_state(dict transitions):
 *     # sort transitions by state ID (0 is start state) and transition character
 *     cdef list transition_list = sorted(transitions.items())             # <<<<<<<<<<<<<<
 *     transitions_by_state = {}
 *     for (state, character), target in transition_list:
 */
  __pyx_t_1 = PyDict_Items(((PyObject *)__pyx_v_transitions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_transition_list = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":123
 *     # sort transitions by state ID (0 is start state) and transition character
 *     cdef list transition_list = sorted(transitions.items())
 *     transitions_by_state = {}             # <<<<<<<<<<<<<<
 *     for (state, character), target in transition_list:
 *         if state in transitions_by_state:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_transitions_by_state);
  __pyx_v_transitions_by_state = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":124
 *     cdef list transition_list = sorted(transitions.items())
 *     transitions_by_state = {}
 *     for (state, character), target in transition_list:             # <<<<<<<<<<<<<<
 *         if state in transitions_by_state:
 *             transitions_by_state[state].append((character, target))
 */
  if (likely(((PyObject *)__pyx_v_transition_list) != Py_None)) {
    __pyx_t_3 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_transition_list); __Pyx_INCREF(__pyx_t_1);
  } else {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
      PyObject* tuple = __pyx_t_2;
      __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
        PyObject* tuple = __pyx_t_4;
        __pyx_t_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_v_state);
        __pyx_v_state = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_character);
        __pyx_v_character = __pyx_t_7;
        __pyx_t_7 = 0;
      } else {
        __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_EndUnpack(__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_v_state);
        __pyx_v_state = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_character);
        __pyx_v_character = __pyx_t_7;
        __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_v_target);
      __pyx_v_target = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
        PyObject* tuple = __pyx_t_4;
        __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7);
        __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_v_state);
        __pyx_v_state = __pyx_t_7;
        __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_v_character);
        __pyx_v_character = __pyx_t_6;
        __pyx_t_6 = 0;
      } else {
        __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_EndUnpack(__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_v_state);
        __pyx_v_state = __pyx_t_7;
        __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_v_character);
        __pyx_v_character = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_v_target);
      __pyx_v_target = __pyx_t_5;
      __pyx_t_5 = 0;
    }

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":125
 *     transitions_by_state = {}
 *     for (state, character), target in transition_list:
 *         if state in transitions_by_state:             # <<<<<<<<<<<<<<
 *             transitions_by_state[state].append((character, target))
 *         else:
 */
    __pyx_t_9 = ((PySequence_Contains(__pyx_v_transitions_by_state, __pyx_v_state))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":126
 *     for (state, character), target in transition_list:
 *         if state in transitions_by_state:
 *             transitions_by_state[state].append((character, target))             # <<<<<<<<<<<<<<
 *         else:
 *             transitions_by_state[state] = [(character, target)]
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_transitions_by_state, __pyx_v_state); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_character);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_character);
      __Pyx_GIVEREF(__pyx_v_character);
      __Pyx_INCREF(__pyx_v_target);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_target);
      __Pyx_GIVEREF(__pyx_v_target);
      __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":128
 *             transitions_by_state[state].append((character, target))
 *         else:
 *             transitions_by_state[state] = [(character, target)]             # <<<<<<<<<<<<<<
 *     return transitions_by_state
 * 
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_character);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_character);
      __Pyx_GIVEREF(__pyx_v_character);
      __Pyx_INCREF(__pyx_v_target);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_target);
      __Pyx_GIVEREF(__pyx_v_target);
      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      if (PyObject_SetItem(__pyx_v_transitions_by_state, __pyx_v_state, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":129
 *         else:
 *             transitions_by_state[state] = [(character, target)]
 *     return transitions_by_state             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (!(likely(PyDict_CheckExact(__pyx_v_transitions_by_state))||((__pyx_v_transitions_by_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_transitions_by_state)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_transitions_by_state);
  __pyx_r = ((PyObject *)__pyx_v_transitions_by_state);
  goto __pyx_L0;

  __pyx_r = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("acora._acora.group_transitions_by_state");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_transition_list);
  __Pyx_DECREF(__pyx_v_transitions_by_state);
  __Pyx_DECREF(__pyx_v_state);
  __Pyx_DECREF(__pyx_v_character);
  __Pyx_DECREF(__pyx_v_target);
  __Pyx_DECREF(__pyx_v_transitions);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":142
 *     cdef tuple _pyrefs
 * 
 *     def __cinit__(self, start_state, dict transitions):             # <<<<<<<<<<<<<<
 *         cdef _AcoraUnicodeNodeStruct* c_nodes
 *         cdef Py_ssize_t i
 */

static int __pyx_pf_5acora_6_acora_12UnicodeAcora___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5acora_6_acora_12UnicodeAcora___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_state = 0;
  PyObject *__pyx_v_transitions = 0;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_c_nodes;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_transitions_by_state = 0;
  PyObject *__pyx_v_node_offsets;
  PyObject *__pyx_v_pyrefs;
  PyObject *__pyx_v_state;
  PyObject *__pyx_v_state_transitions;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  void *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  void *__pyx_t_10;
  Py_ssize_t __pyx_t_11;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_state,&__pyx_n_s__transitions,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_state);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__transitions);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_start_state = values[0];
    __pyx_v_transitions = ((PyObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_start_state = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_transitions = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("acora._acora.UnicodeAcora.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_start_state);
  __Pyx_INCREF(__pyx_v_transitions);
  __pyx_v_node_offsets = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_pyrefs = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_state = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_state_transitions = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_transitions), &PyDict_Type, 1, "transitions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":145
 *         cdef _AcoraUnicodeNodeStruct* c_nodes
 *         cdef Py_ssize_t i
 *         self.start_node = NULL             # <<<<<<<<<<<<<<
 *         cdef dict transitions_by_state = group_transitions_by_state(transitions)
 * 
 */
  ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->start_node = NULL;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":146
 *         cdef Py_ssize_t i
 *         self.start_node = NULL
 *         cdef dict transitions_by_state = group_transitions_by_state(transitions)             # <<<<<<<<<<<<<<
 * 
 *         self.node_count = len(transitions_by_state)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_5acora_6_acora_group_transitions_by_state(__pyx_v_transitions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_transitions_by_state = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":148
 *         cdef dict transitions_by_state = group_transitions_by_state(transitions)
 * 
 *         self.node_count = len(transitions_by_state)             # <<<<<<<<<<<<<<
 *         c_nodes = self.start_node = <_AcoraUnicodeNodeStruct*> python_mem.PyMem_Malloc(
 *             sizeof(_AcoraUnicodeNodeStruct) * self.node_count)
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_transitions_by_state)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->node_count = __pyx_t_2;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":150
 *         self.node_count = len(transitions_by_state)
 *         c_nodes = self.start_node = <_AcoraUnicodeNodeStruct*> python_mem.PyMem_Malloc(
 *             sizeof(_AcoraUnicodeNodeStruct) * self.node_count)             # <<<<<<<<<<<<<<
 *         if c_nodes is NULL:
 *             python_exc.PyMem_NoMemory()
 */
  __pyx_t_3 = ((__pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *)PyMem_Malloc(((sizeof(__pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct)) * ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->node_count)));
  __pyx_v_c_nodes = __pyx_t_3;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":149
 * 
 *         self.node_count = len(transitions_by_state)
 *         c_nodes = self.start_node = <_AcoraUnicodeNodeStruct*> python_mem.PyMem_Malloc(             # <<<<<<<<<<<<<<
 *             sizeof(_AcoraUnicodeNodeStruct) * self.node_count)
 *         if c_nodes is NULL:
 */
  ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->start_node = __pyx_t_3;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":151
 *         c_nodes = self.start_node = <_AcoraUnicodeNodeStruct*> python_mem.PyMem_Malloc(
 *             sizeof(_AcoraUnicodeNodeStruct) * self.node_count)
 *         if c_nodes is NULL:             # <<<<<<<<<<<<<<
 *             python_exc.PyMem_NoMemory()
 * 
 */
  __pyx_t_4 = (__pyx_v_c_nodes == NULL);
  if (__pyx_t_4) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":152
 *             sizeof(_AcoraUnicodeNodeStruct) * self.node_count)
 *         if c_nodes is NULL:
 *             python_exc.PyMem_NoMemory()             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.node_count):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_exc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__PyMem_NoMemory); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":154
 *             python_exc.PyMem_NoMemory()
 * 
 *         for i in range(self.node_count):             # <<<<<<<<<<<<<<
 *             # required by __dealloc__ in case of subsequent errors
 *             c_nodes[i].targets = NULL
 */
  __pyx_t_2 = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->node_count;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":156
 *         for i in range(self.node_count):
 *             # required by __dealloc__ in case of subsequent errors
 *             c_nodes[i].targets = NULL             # <<<<<<<<<<<<<<
 * 
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])
 */
    (__pyx_v_c_nodes[__pyx_v_i]).targets = NULL;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":158
 *             c_nodes[i].targets = NULL
 * 
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])             # <<<<<<<<<<<<<<
 *         pyrefs = {} # used to keep Python references alive (and intern them)
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_v_transitions_by_state));
  __Pyx_XDECREF(__pyx_t_5);
  __pyx_t_5 = ((PyObject *)__pyx_v_transitions_by_state);
  __pyx_t_6 = 0;
  while (1) {
    if (!PyDict_Next(__pyx_t_5, (&__pyx_t_6), ((PyObject **)(&__pyx_t_7)), NULL)) break;
    __Pyx_INCREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(__pyx_v_state);
    __pyx_v_state = ((PyObject *)__pyx_t_7);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);
    __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_v_state, (PyObject*)__pyx_t_8); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_node_offsets);
  __pyx_v_node_offsets = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":159
 * 
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])
 *         pyrefs = {} # used to keep Python references alive (and intern them)             # <<<<<<<<<<<<<<
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 *             if len(state_transitions) >= MIN_TRANSITIONS_TO_BISECT:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_pyrefs);
  __pyx_v_pyrefs = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":160
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])
 *         pyrefs = {} # used to keep Python references alive (and intern them)
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):             # <<<<<<<<<<<<<<
 *             if len(state_transitions) >= MIN_TRANSITIONS_TO_BISECT:
 *                 self.has_large_nodes = True
 */
  __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_v_transitions_by_state));
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = ((PyObject *)__pyx_v_transitions_by_state);
  __pyx_t_6 = 0;
  while (1) {
    if (!PyDict_Next(__pyx_t_1, (&__pyx_t_6), ((PyObject **)(&__pyx_t_7)), ((PyObject **)(&__pyx_t_10)))) break;
    __Pyx_INCREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(__pyx_v_state);
    __pyx_v_state = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(((PyObject *)__pyx_t_10));
    __Pyx_DECREF(__pyx_v_state_transitions);
    __pyx_v_state_transitions = ((PyObject *)__pyx_t_10);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":161
 *         pyrefs = {} # used to keep Python references alive (and intern them)
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 *             if len(state_transitions) >= MIN_TRANSITIONS_TO_BISECT:             # <<<<<<<<<<<<<<
 *                 self.has_large_nodes = True
 *             _init_unicode_node(&c_nodes[i], state, state_transitions,
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_state_transitions); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = (__pyx_t_11 >= 20);
    if (__pyx_t_4) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":162
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 *             if len(state_transitions) >= MIN_TRANSITIONS_TO_BISECT:
 *                 self.has_large_nodes = True             # <<<<<<<<<<<<<<
 *             _init_unicode_node(&c_nodes[i], state, state_transitions,
 *                                c_nodes, node_offsets, pyrefs)
 */
      ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->has_large_nodes = 1;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":163
 *             if len(state_transitions) >= MIN_TRANSITIONS_TO_BISECT:
 *                 self.has_large_nodes = True
 *             _init_unicode_node(&c_nodes[i], state, state_transitions,             # <<<<<<<<<<<<<<
 *                                c_nodes, node_offsets, pyrefs)
 * 
 */
    if (!(likely(PyList_CheckExact(__pyx_v_state_transitions))||((__pyx_v_state_transitions) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_state_transitions)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":164
 *                 self.has_large_nodes = True
 *             _init_unicode_node(&c_nodes[i], state, state_transitions,
 *                                c_nodes, node_offsets, pyrefs)             # <<<<<<<<<<<<<<
 * 
 *         self._pyrefs = tuple(pyrefs)
 */
    if (!(likely(PyDict_CheckExact(__pyx_v_node_offsets))||((__pyx_v_node_offsets) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_node_offsets)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyDict_CheckExact(__pyx_v_pyrefs))||((__pyx_v_pyrefs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_pyrefs)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_f_5acora_6_acora__init_unicode_node((&(__pyx_v_c_nodes[__pyx_v_i])), __pyx_v_state, ((PyObject *)__pyx_v_state_transitions), __pyx_v_c_nodes, ((PyObject *)__pyx_v_node_offsets), ((PyObject *)__pyx_v_pyrefs)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":166
 *                                c_nodes, node_offsets, pyrefs)
 * 
 *         self._pyrefs = tuple(pyrefs)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_pyrefs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pyrefs);
  __Pyx_GIVEREF(__pyx_v_pyrefs);
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->_pyrefs);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->_pyrefs));
  ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->_pyrefs = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("acora._acora.UnicodeAcora.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_transitions_by_state);
  __Pyx_DECREF(__pyx_v_node_offsets);
  __Pyx_DECREF(__pyx_v_pyrefs);
  __Pyx_DECREF(__pyx_v_state);
  __Pyx_DECREF(__pyx_v_state_transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_start_state);
  __Pyx_DECREF(__pyx_v_transitions);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":168
 *         self._pyrefs = tuple(pyrefs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         if self.start_node is not NULL:
 */

static void __pyx_pf_5acora_6_acora_12UnicodeAcora___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5acora_6_acora_12UnicodeAcora___dealloc__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__dealloc__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":170
 *     def __dealloc__(self):
 *         cdef Py_ssize_t i
 *         if self.start_node is not NULL:             # <<<<<<<<<<<<<<
 *             for i in range(self.node_count):
 *                 if self.start_node[i].targets is not NULL:
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->start_node != NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":171
 *         cdef Py_ssize_t i
 *         if self.start_node is not NULL:
 *             for i in range(self.node_count):             # <<<<<<<<<<<<<<
 *                 if self.start_node[i].targets is not NULL:
 *                     python_mem.PyMem_Free(self.start_node[i].targets)
 */
    __pyx_t_2 = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->node_count;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":172
 *         if self.start_node is not NULL:
 *             for i in range(self.node_count):
 *                 if self.start_node[i].targets is not NULL:             # <<<<<<<<<<<<<<
 *                     python_mem.PyMem_Free(self.start_node[i].targets)
 *             python_mem.PyMem_Free(self.start_node)
 */
      __pyx_t_1 = ((((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->start_node[__pyx_v_i]).targets != NULL);
      if (__pyx_t_1) {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":173
 *             for i in range(self.node_count):
 *                 if self.start_node[i].targets is not NULL:
 *                     python_mem.PyMem_Free(self.start_node[i].targets)             # <<<<<<<<<<<<<<
 *             python_mem.PyMem_Free(self.start_node)
 * 
 */
        PyMem_Free((((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->start_node[__pyx_v_i]).targets);
        goto __pyx_L8;
      }
      __pyx_L8:;
    }

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":174
 *                 if self.start_node[i].targets is not NULL:
 *                     python_mem.PyMem_Free(self.start_node[i].targets)
 *             python_mem.PyMem_Free(self.start_node)             # <<<<<<<<<<<<<<
 * 
 *     cpdef finditer(self, unicode data):
 */
    PyMem_Free(((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->start_node);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":176
 *             python_mem.PyMem_Free(self.start_node)
 * 
 *     cpdef finditer(self, unicode data):             # <<<<<<<<<<<<<<
 *         """Iterate over all occurrences of any keyword in the string.
 *         """
 */

static PyObject *__pyx_pf_5acora_6_acora_12UnicodeAcora_finditer(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static  PyObject *__pyx_f_5acora_6_acora_12UnicodeAcora_finditer(struct __pyx_obj_5acora_6_acora_UnicodeAcora *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("finditer");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_data);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__finditer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5acora_6_acora_12UnicodeAcora_finditer)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_data));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_data));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":179
 *         """Iterate over all occurrences of any keyword in the string.
 *         """
 *         if self.has_large_nodes:             # <<<<<<<<<<<<<<
 *             return _BisectUnicodeAcoraIter(self, data)
 *         else:
 */
  __pyx_t_4 = __pyx_v_self->has_large_nodes;
  if (__pyx_t_4) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":180
 *         """
 *         if self.has_large_nodes:
 *             return _BisectUnicodeAcoraIter(self, data)             # <<<<<<<<<<<<<<
 *         else:
 *             return _UnicodeAcoraIter(self, data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_data));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_data));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5acora_6_acora__BisectUnicodeAcoraIter)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __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;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":182
 *             return _BisectUnicodeAcoraIter(self, data)
 *         else:
 *             return _UnicodeAcoraIter(self, data)             # <<<<<<<<<<<<<<
 * 
 *     def findall(self, unicode data):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_data));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_data));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5acora_6_acora__UnicodeAcoraIter)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __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;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("acora._acora.UnicodeAcora.finditer");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":176
 *             python_mem.PyMem_Free(self.start_node)
 * 
 *     cpdef finditer(self, unicode data):             # <<<<<<<<<<<<<<
 *         """Iterate over all occurrences of any keyword in the string.
 *         """
 */

static PyObject *__pyx_pf_5acora_6_acora_12UnicodeAcora_finditer(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_5acora_6_acora_12UnicodeAcora_finditer[] = "UnicodeAcora.finditer(self, unicode data)\nIterate over all occurrences of any keyword in the string.\n        ";
static PyObject *__pyx_pf_5acora_6_acora_12UnicodeAcora_finditer(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("finditer");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), &PyUnicode_Type, 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5acora_6_acora_UnicodeAcora *)((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->__pyx_vtab)->finditer(((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self), __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("acora._acora.UnicodeAcora.finditer");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":184
 *             return _UnicodeAcoraIter(self, data)
 * 
 *     def findall(self, unicode data):             # <<<<<<<<<<<<<<
 *         """Build a list of all occurrences of any keyword in the string.
 *         """
 */

static PyObject *__pyx_pf_5acora_6_acora_12UnicodeAcora_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_5acora_6_acora_12UnicodeAcora_findall[] = "UnicodeAcora.findall(self, unicode data)\nBuild a list of all occurrences of any keyword in the string.\n        ";
static PyObject *__pyx_pf_5acora_6_acora_12UnicodeAcora_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("findall");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), &PyUnicode_Type, 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":187
 *         """Build a list of all occurrences of any keyword in the string.
 *         """
 *         return list(self.finditer(data))             # <<<<<<<<<<<<<<
 * 
 * cdef class _UnicodeAcoraIter:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5acora_6_acora_UnicodeAcora *)((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self)->__pyx_vtab)->finditer(((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)__pyx_v_self), __pyx_v_data, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("acora._acora.UnicodeAcora.findall");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":198
 *     cdef Py_UNICODE* data_end
 * 
 *     def __cinit__(self, UnicodeAcora acora, unicode data):             # <<<<<<<<<<<<<<
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora
 */

static int __pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5acora_6_acora_UnicodeAcora *__pyx_v_acora = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__acora,&__pyx_n_s__data,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__acora);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_acora = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)values[0]);
    __pyx_v_data = ((PyObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_acora = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_data = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("acora._acora._UnicodeAcoraIter.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_acora), __pyx_ptype_5acora_6_acora_UnicodeAcora, 1, "acora", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), &PyUnicode_Type, 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":199
 * 
 *     def __cinit__(self, UnicodeAcora acora, unicode data):
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL             # <<<<<<<<<<<<<<
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  __pyx_t_1 = (__pyx_v_acora->start_node != NULL);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_acora->start_node->matches == NULL);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":200
 *     def __cinit__(self, UnicodeAcora acora, unicode data):
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora             # <<<<<<<<<<<<<<
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_acora));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_acora));
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->acora);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->acora));
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->acora = __pyx_v_acora;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":201
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node             # <<<<<<<<<<<<<<
 *         self.match_index = 0
 *         self.data = data
 */
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->start_node = __pyx_v_acora->start_node;
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->current_node = __pyx_v_acora->start_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":202
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0             # <<<<<<<<<<<<<<
 *         self.data = data
 *         self.data_char = PyUnicode_AS_UNICODE(data)
 */
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->match_index = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":203
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0
 *         self.data = data             # <<<<<<<<<<<<<<
 *         self.data_char = PyUnicode_AS_UNICODE(data)
 *         self.data_end = self.data_char + PyUnicode_GET_SIZE(data)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data));
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data = __pyx_v_data;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":204
 *         self.match_index = 0
 *         self.data = data
 *         self.data_char = PyUnicode_AS_UNICODE(data)             # <<<<<<<<<<<<<<
 *         self.data_end = self.data_char + PyUnicode_GET_SIZE(data)
 * 
 */
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data_char = PyUnicode_AS_UNICODE(((PyObject *)__pyx_v_data));

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":205
 *         self.data = data
 *         self.data_char = PyUnicode_AS_UNICODE(data)
 *         self.data_end = self.data_char + PyUnicode_GET_SIZE(data)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data_end = (((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data_char + PyUnicode_GET_SIZE(((PyObject *)__pyx_v_data)));

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("acora._acora._UnicodeAcoraIter.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":207
 *         self.data_end = self.data_char + PyUnicode_GET_SIZE(data)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":208
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":210
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_UNICODE* data_char = self.data_char
 *         cdef Py_UNICODE* data_end = self.data_end
 */

static PyObject *__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___next__(PyObject *__pyx_v_self) {
  Py_UNICODE *__pyx_v_data_char;
  Py_UNICODE *__pyx_v_data_end;
  Py_UNICODE *__pyx_v_test_chars;
  Py_UNICODE __pyx_v_current_char;
  int __pyx_v_i;
  int __pyx_v_found;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_start_node;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_current_node;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__next__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":211
 * 
 *     def __next__(self):
 *         cdef Py_UNICODE* data_char = self.data_char             # <<<<<<<<<<<<<<
 *         cdef Py_UNICODE* data_end = self.data_end
 *         cdef Py_UNICODE* test_chars
 */
  __pyx_v_data_char = ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data_char;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":212
 *     def __next__(self):
 *         cdef Py_UNICODE* data_char = self.data_char
 *         cdef Py_UNICODE* data_end = self.data_end             # <<<<<<<<<<<<<<
 *         cdef Py_UNICODE* test_chars
 *         cdef Py_UNICODE current_char
 */
  __pyx_v_data_end = ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data_end;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":215
 *         cdef Py_UNICODE* test_chars
 *         cdef Py_UNICODE current_char
 *         cdef int i, found = 0             # <<<<<<<<<<<<<<
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 */
  __pyx_v_found = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":216
 *         cdef Py_UNICODE current_char
 *         cdef int i, found = 0
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node             # <<<<<<<<<<<<<<
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 *         if current_node.matches is not NULL:
 */
  __pyx_v_start_node = ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->start_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":217
 *         cdef int i, found = 0
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node             # <<<<<<<<<<<<<<
 *         if current_node.matches is not NULL:
 *             if current_node.matches[self.match_index] is not NULL:
 */
  __pyx_v_current_node = ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->current_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":218
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 *         if current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *             if current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 */
  __pyx_t_1 = (__pyx_v_current_node->matches != NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":219
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 *         if current_node.matches is not NULL:
 *             if current_node.matches[self.match_index] is not NULL:             # <<<<<<<<<<<<<<
 *                 return self._build_next_match()
 *             self.match_index = 0
 */
    __pyx_t_1 = ((__pyx_v_current_node->matches[((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->match_index]) != NULL);
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":220
 *         if current_node.matches is not NULL:
 *             if current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()             # <<<<<<<<<<<<<<
 *             self.match_index = 0
 *         with nogil:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter *)((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->__pyx_vtab)->_build_next_match(((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":221
 *             if current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 *             self.match_index = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             while data_char < data_end:
 */
    ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->match_index = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":222
 *                 return self._build_next_match()
 *             self.match_index = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while data_char < data_end:
 *                 current_char = data_char[0]
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":223
 *             self.match_index = 0
 *         with nogil:
 *             while data_char < data_end:             # <<<<<<<<<<<<<<
 *                 current_char = data_char[0]
 *                 data_char += 1
 */
      while (1) {
        __pyx_t_1 = (__pyx_v_data_char < __pyx_v_data_end);
        if (!__pyx_t_1) break;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":224
 *         with nogil:
 *             while data_char < data_end:
 *                 current_char = data_char[0]             # <<<<<<<<<<<<<<
 *                 data_char += 1
 *                 test_chars = current_node.characters
 */
        __pyx_v_current_char = (__pyx_v_data_char[0]);

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":225
 *             while data_char < data_end:
 *                 current_char = data_char[0]
 *                 data_char += 1             # <<<<<<<<<<<<<<
 *                 test_chars = current_node.characters
 *                 if current_char < test_chars[0] \
 */
        __pyx_v_data_char += 1;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":226
 *                 current_char = data_char[0]
 *                 data_char += 1
 *                 test_chars = current_node.characters             # <<<<<<<<<<<<<<
 *                 if current_char < test_chars[0] \
 *                         or current_char > test_chars[current_node.char_count-1]:
 */
        __pyx_v_test_chars = __pyx_v_current_node->characters;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":227
 *                 data_char += 1
 *                 test_chars = current_node.characters
 *                 if current_char < test_chars[0] \             # <<<<<<<<<<<<<<
 *                         or current_char > test_chars[current_node.char_count-1]:
 *                     current_node = start_node
 */
        __pyx_t_1 = (__pyx_v_current_char < (__pyx_v_test_chars[0]));
        if (!__pyx_t_1) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":228
 *                 test_chars = current_node.characters
 *                 if current_char < test_chars[0] \
 *                         or current_char > test_chars[current_node.char_count-1]:             # <<<<<<<<<<<<<<
 *                     current_node = start_node
 *                 else:
 */
          __pyx_t_3 = (__pyx_v_current_char > (__pyx_v_test_chars[(__pyx_v_current_node->char_count - 1)]));
          __pyx_t_4 = __pyx_t_3;
        } else {
          __pyx_t_4 = __pyx_t_1;
        }
        if (__pyx_t_4) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":229
 *                 if current_char < test_chars[0] \
 *                         or current_char > test_chars[current_node.char_count-1]:
 *                     current_node = start_node             # <<<<<<<<<<<<<<
 *                 else:
 *                     for i in range(current_node.char_count):
 */
          __pyx_v_current_node = __pyx_v_start_node;
          goto __pyx_L12;
        }
        /*else*/ {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":231
 *                     current_node = start_node
 *                 else:
 *                     for i in range(current_node.char_count):             # <<<<<<<<<<<<<<
 *                         if current_char == test_chars[i]:
 *                             current_node = current_node.targets[i]
 */
          __pyx_t_5 = __pyx_v_current_node->char_count;
          for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
            __pyx_v_i = __pyx_t_6;

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":232
 *                 else:
 *                     for i in range(current_node.char_count):
 *                         if current_char == test_chars[i]:             # <<<<<<<<<<<<<<
 *                             current_node = current_node.targets[i]
 *                             break
 */
            __pyx_t_4 = (__pyx_v_current_char == (__pyx_v_test_chars[__pyx_v_i]));
            if (__pyx_t_4) {

              /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":233
 *                     for i in range(current_node.char_count):
 *                         if current_char == test_chars[i]:
 *                             current_node = current_node.targets[i]             # <<<<<<<<<<<<<<
 *                             break
 *                     else:
 */
              __pyx_v_current_node = (__pyx_v_current_node->targets[__pyx_v_i]);

              /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":234
 *                         if current_char == test_chars[i]:
 *                             current_node = current_node.targets[i]
 *                             break             # <<<<<<<<<<<<<<
 *                     else:
 *                         current_node = start_node
 */
              goto __pyx_L14_break;
              goto __pyx_L15;
            }
            __pyx_L15:;
          }
          /*else*/ {

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":236
 *                             break
 *                     else:
 *                         current_node = start_node             # <<<<<<<<<<<<<<
 *                     if current_node.matches is not NULL:
 *                         found = 1
 */
            __pyx_v_current_node = __pyx_v_start_node;
          }
          __pyx_L14_break:;

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":237
 *                     else:
 *                         current_node = start_node
 *                     if current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *                         found = 1
 *                         break
 */
          __pyx_t_4 = (__pyx_v_current_node->matches != NULL);
          if (__pyx_t_4) {

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":238
 *                         current_node = start_node
 *                     if current_node.matches is not NULL:
 *                         found = 1             # <<<<<<<<<<<<<<
 *                         break
 *         self.data_char = data_char
 */
            __pyx_v_found = 1;

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":239
 *                     if current_node.matches is not NULL:
 *                         found = 1
 *                         break             # <<<<<<<<<<<<<<
 *         self.data_char = data_char
 *         self.current_node = current_node
 */
            goto __pyx_L11_break;
            goto __pyx_L16;
          }
          __pyx_L16:;
        }
        __pyx_L12:;
      }
      __pyx_L11_break:;
    }
    /*finally:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":222
 *                 return self._build_next_match()
 *             self.match_index = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while data_char < data_end:
 *                 current_char = data_char[0]
 */
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":240
 *                         found = 1
 *                         break
 *         self.data_char = data_char             # <<<<<<<<<<<<<<
 *         self.current_node = current_node
 *         if found:
 */
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->data_char = __pyx_v_data_char;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":241
 *                         break
 *         self.data_char = data_char
 *         self.current_node = current_node             # <<<<<<<<<<<<<<
 *         if found:
 *             return self._build_next_match()
 */
  ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->current_node = __pyx_v_current_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":242
 *         self.data_char = data_char
 *         self.current_node = current_node
 *         if found:             # <<<<<<<<<<<<<<
 *             return self._build_next_match()
 *         raise StopIteration
 */
  __pyx_t_5 = __pyx_v_found;
  if (__pyx_t_5) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":243
 *         self.current_node = current_node
 *         if found:
 *             return self._build_next_match()             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter *)((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)->__pyx_vtab)->_build_next_match(((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":244
 *         if found:
 *             return self._build_next_match()
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef _build_next_match(self):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("acora._acora._UnicodeAcoraIter.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":246
 *         raise StopIteration
 * 
 *     cdef _build_next_match(self):             # <<<<<<<<<<<<<<
 *         match = <unicode> self.current_node.matches[self.match_index]
 *         self.match_index += 1
 */

static  PyObject *__pyx_f_5acora_6_acora_17_UnicodeAcoraIter__build_next_match(struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *__pyx_v_self) {
  PyObject *__pyx_v_match;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_build_next_match");
  __pyx_v_match = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":247
 * 
 *     cdef _build_next_match(self):
 *         match = <unicode> self.current_node.matches[self.match_index]             # <<<<<<<<<<<<<<
 *         self.match_index += 1
 *         return (match,
 */
  __pyx_t_1 = (__pyx_v_self->current_node->matches[__pyx_v_self->match_index]);
  __Pyx_INCREF(((PyObject *)((PyObject *)__pyx_t_1)));
  __Pyx_DECREF(__pyx_v_match);
  __pyx_v_match = ((PyObject *)__pyx_t_1);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":248
 *     cdef _build_next_match(self):
 *         match = <unicode> self.current_node.matches[self.match_index]
 *         self.match_index += 1             # <<<<<<<<<<<<<<
 *         return (match,
 *                 <Py_ssize_t>(self.data_char - PyUnicode_AS_UNICODE(self.data)
 */
  __pyx_v_self->match_index += 1;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":249
 *         match = <unicode> self.current_node.matches[self.match_index]
 *         self.match_index += 1
 *         return (match,             # <<<<<<<<<<<<<<
 *                 <Py_ssize_t>(self.data_char - PyUnicode_AS_UNICODE(self.data)
 *                              ) - PyUnicode_GET_SIZE(match))
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":251
 *         return (match,
 *                 <Py_ssize_t>(self.data_char - PyUnicode_AS_UNICODE(self.data)
 *                              ) - PyUnicode_GET_SIZE(match))             # <<<<<<<<<<<<<<
 * 
 * cdef class _BisectUnicodeAcoraIter(_UnicodeAcoraIter):
 */
  __pyx_t_2 = PyInt_FromSsize_t((((Py_ssize_t)(__pyx_v_self->data_char - PyUnicode_AS_UNICODE(((PyObject *)__pyx_v_self->data)))) - PyUnicode_GET_SIZE(__pyx_v_match))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match);
  __Pyx_GIVEREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("acora._acora._UnicodeAcoraIter._build_next_match");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":254
 * 
 * cdef class _BisectUnicodeAcoraIter(_UnicodeAcoraIter):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_UNICODE* data_char = self.data_char
 *         cdef Py_UNICODE* data_end = self.data_end
 */

static PyObject *__pyx_pf_5acora_6_acora_23_BisectUnicodeAcoraIter___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_23_BisectUnicodeAcoraIter___next__(PyObject *__pyx_v_self) {
  Py_UNICODE *__pyx_v_data_char;
  Py_UNICODE *__pyx_v_data_end;
  Py_UNICODE *__pyx_v_test_chars;
  Py_UNICODE __pyx_v_current_char;
  int __pyx_v_i;
  int __pyx_v_found;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_start_node;
  __pyx_t_5acora_6_acora__AcoraUnicodeNodeStruct *__pyx_v_current_node;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__next__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":255
 * cdef class _BisectUnicodeAcoraIter(_UnicodeAcoraIter):
 *     def __next__(self):
 *         cdef Py_UNICODE* data_char = self.data_char             # <<<<<<<<<<<<<<
 *         cdef Py_UNICODE* data_end = self.data_end
 *         cdef Py_UNICODE* test_chars
 */
  __pyx_v_data_char = ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.data_char;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":256
 *     def __next__(self):
 *         cdef Py_UNICODE* data_char = self.data_char
 *         cdef Py_UNICODE* data_end = self.data_end             # <<<<<<<<<<<<<<
 *         cdef Py_UNICODE* test_chars
 *         cdef Py_UNICODE current_char
 */
  __pyx_v_data_end = ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.data_end;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":259
 *         cdef Py_UNICODE* test_chars
 *         cdef Py_UNICODE current_char
 *         cdef int i, found = 0             # <<<<<<<<<<<<<<
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 */
  __pyx_v_found = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":260
 *         cdef Py_UNICODE current_char
 *         cdef int i, found = 0
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node             # <<<<<<<<<<<<<<
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 *         if current_node.matches is not NULL:
 */
  __pyx_v_start_node = ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.start_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":261
 *         cdef int i, found = 0
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node             # <<<<<<<<<<<<<<
 *         if current_node.matches is not NULL:
 *             if current_node.matches[self.match_index] is not NULL:
 */
  __pyx_v_current_node = ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.current_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":262
 *         cdef _AcoraUnicodeNodeStruct* start_node = self.start_node
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 *         if current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *             if current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 */
  __pyx_t_1 = (__pyx_v_current_node->matches != NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":263
 *         cdef _AcoraUnicodeNodeStruct* current_node = self.current_node
 *         if current_node.matches is not NULL:
 *             if current_node.matches[self.match_index] is not NULL:             # <<<<<<<<<<<<<<
 *                 return self._build_next_match()
 *             self.match_index = 0
 */
    __pyx_t_1 = ((__pyx_v_current_node->matches[((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.match_index]) != NULL);
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":264
 *         if current_node.matches is not NULL:
 *             if current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()             # <<<<<<<<<<<<<<
 *             self.match_index = 0
 *         with nogil:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__BisectUnicodeAcoraIter *)((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._build_next_match(((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":265
 *             if current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 *             self.match_index = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             while data_char < data_end:
 */
    ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.match_index = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":266
 *                 return self._build_next_match()
 *             self.match_index = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while data_char < data_end:
 *                 current_char = data_char[0]
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":267
 *             self.match_index = 0
 *         with nogil:
 *             while data_char < data_end:             # <<<<<<<<<<<<<<
 *                 current_char = data_char[0]
 *                 data_char += 1
 */
      while (1) {
        __pyx_t_1 = (__pyx_v_data_char < __pyx_v_data_end);
        if (!__pyx_t_1) break;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":268
 *         with nogil:
 *             while data_char < data_end:
 *                 current_char = data_char[0]             # <<<<<<<<<<<<<<
 *                 data_char += 1
 *                 test_chars = current_node.characters
 */
        __pyx_v_current_char = (__pyx_v_data_char[0]);

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":269
 *             while data_char < data_end:
 *                 current_char = data_char[0]
 *                 data_char += 1             # <<<<<<<<<<<<<<
 *                 test_chars = current_node.characters
 *                 if current_char < test_chars[0] \
 */
        __pyx_v_data_char += 1;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":270
 *                 current_char = data_char[0]
 *                 data_char += 1
 *                 test_chars = current_node.characters             # <<<<<<<<<<<<<<
 *                 if current_char < test_chars[0] \
 *                         or current_char > test_chars[current_node.char_count-1]:
 */
        __pyx_v_test_chars = __pyx_v_current_node->characters;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":271
 *                 data_char += 1
 *                 test_chars = current_node.characters
 *                 if current_char < test_chars[0] \             # <<<<<<<<<<<<<<
 *                         or current_char > test_chars[current_node.char_count-1]:
 *                     current_node = start_node
 */
        __pyx_t_1 = (__pyx_v_current_char < (__pyx_v_test_chars[0]));
        if (!__pyx_t_1) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":272
 *                 test_chars = current_node.characters
 *                 if current_char < test_chars[0] \
 *                         or current_char > test_chars[current_node.char_count-1]:             # <<<<<<<<<<<<<<
 *                     current_node = start_node
 *                 elif current_node.char_count >= MIN_TRANSITIONS_TO_BISECT:
 */
          __pyx_t_3 = (__pyx_v_current_char > (__pyx_v_test_chars[(__pyx_v_current_node->char_count - 1)]));
          __pyx_t_4 = __pyx_t_3;
        } else {
          __pyx_t_4 = __pyx_t_1;
        }
        if (__pyx_t_4) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":273
 *                 if current_char < test_chars[0] \
 *                         or current_char > test_chars[current_node.char_count-1]:
 *                     current_node = start_node             # <<<<<<<<<<<<<<
 *                 elif current_node.char_count >= MIN_TRANSITIONS_TO_BISECT:
 *                     i = _bisect(current_char, current_node.characters, current_node.char_count)
 */
          __pyx_v_current_node = __pyx_v_start_node;
          goto __pyx_L12;
        }

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":274
 *                         or current_char > test_chars[current_node.char_count-1]:
 *                     current_node = start_node
 *                 elif current_node.char_count >= MIN_TRANSITIONS_TO_BISECT:             # <<<<<<<<<<<<<<
 *                     i = _bisect(current_char, current_node.characters, current_node.char_count)
 *                     if i >= 0:
 */
        __pyx_t_4 = (__pyx_v_current_node->char_count >= 20);
        if (__pyx_t_4) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":275
 *                     current_node = start_node
 *                 elif current_node.char_count >= MIN_TRANSITIONS_TO_BISECT:
 *                     i = _bisect(current_char, current_node.characters, current_node.char_count)             # <<<<<<<<<<<<<<
 *                     if i >= 0:
 *                         current_node = current_node.targets[i]
 */
          __pyx_v_i = __pyx_f_5acora_6_acora__bisect(__pyx_v_current_char, __pyx_v_current_node->characters, __pyx_v_current_node->char_count);

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":276
 *                 elif current_node.char_count >= MIN_TRANSITIONS_TO_BISECT:
 *                     i = _bisect(current_char, current_node.characters, current_node.char_count)
 *                     if i >= 0:             # <<<<<<<<<<<<<<
 *                         current_node = current_node.targets[i]
 *                     else:
 */
          __pyx_t_4 = (__pyx_v_i >= 0);
          if (__pyx_t_4) {

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":277
 *                     i = _bisect(current_char, current_node.characters, current_node.char_count)
 *                     if i >= 0:
 *                         current_node = current_node.targets[i]             # <<<<<<<<<<<<<<
 *                     else:
 *                         current_node = start_node
 */
            __pyx_v_current_node = (__pyx_v_current_node->targets[__pyx_v_i]);
            goto __pyx_L13;
          }
          /*else*/ {

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":279
 *                         current_node = current_node.targets[i]
 *                     else:
 *                         current_node = start_node             # <<<<<<<<<<<<<<
 *                 else:
 *                     for i in range(current_node.char_count):
 */
            __pyx_v_current_node = __pyx_v_start_node;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        /*else*/ {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":281
 *                         current_node = start_node
 *                 else:
 *                     for i in range(current_node.char_count):             # <<<<<<<<<<<<<<
 *                         if current_char == test_chars[i]:
 *                             current_node = current_node.targets[i]
 */
          __pyx_t_5 = __pyx_v_current_node->char_count;
          for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
            __pyx_v_i = __pyx_t_6;

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":282
 *                 else:
 *                     for i in range(current_node.char_count):
 *                         if current_char == test_chars[i]:             # <<<<<<<<<<<<<<
 *                             current_node = current_node.targets[i]
 *                             break
 */
            __pyx_t_4 = (__pyx_v_current_char == (__pyx_v_test_chars[__pyx_v_i]));
            if (__pyx_t_4) {

              /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":283
 *                     for i in range(current_node.char_count):
 *                         if current_char == test_chars[i]:
 *                             current_node = current_node.targets[i]             # <<<<<<<<<<<<<<
 *                             break
 *                     else:
 */
              __pyx_v_current_node = (__pyx_v_current_node->targets[__pyx_v_i]);

              /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":284
 *                         if current_char == test_chars[i]:
 *                             current_node = current_node.targets[i]
 *                             break             # <<<<<<<<<<<<<<
 *                     else:
 *                         current_node = start_node
 */
              goto __pyx_L15_break;
              goto __pyx_L16;
            }
            __pyx_L16:;
          }
          /*else*/ {

            /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":286
 *                             break
 *                     else:
 *                         current_node = start_node             # <<<<<<<<<<<<<<
 *                 if current_node.matches is not NULL:
 *                     found = 1
 */
            __pyx_v_current_node = __pyx_v_start_node;
          }
          __pyx_L15_break:;
        }
        __pyx_L12:;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":287
 *                     else:
 *                         current_node = start_node
 *                 if current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *                     found = 1
 *                     break
 */
        __pyx_t_4 = (__pyx_v_current_node->matches != NULL);
        if (__pyx_t_4) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":288
 *                         current_node = start_node
 *                 if current_node.matches is not NULL:
 *                     found = 1             # <<<<<<<<<<<<<<
 *                     break
 *         self.data_char = data_char
 */
          __pyx_v_found = 1;

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":289
 *                 if current_node.matches is not NULL:
 *                     found = 1
 *                     break             # <<<<<<<<<<<<<<
 *         self.data_char = data_char
 *         self.current_node = current_node
 */
          goto __pyx_L11_break;
          goto __pyx_L17;
        }
        __pyx_L17:;
      }
      __pyx_L11_break:;
    }
    /*finally:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":266
 *                 return self._build_next_match()
 *             self.match_index = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while data_char < data_end:
 *                 current_char = data_char[0]
 */
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":290
 *                     found = 1
 *                     break
 *         self.data_char = data_char             # <<<<<<<<<<<<<<
 *         self.current_node = current_node
 *         if found:
 */
  ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.data_char = __pyx_v_data_char;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":291
 *                     break
 *         self.data_char = data_char
 *         self.current_node = current_node             # <<<<<<<<<<<<<<
 *         if found:
 *             return self._build_next_match()
 */
  ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.current_node = __pyx_v_current_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":292
 *         self.data_char = data_char
 *         self.current_node = current_node
 *         if found:             # <<<<<<<<<<<<<<
 *             return self._build_next_match()
 *         raise StopIteration
 */
  __pyx_t_5 = __pyx_v_found;
  if (__pyx_t_5) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":293
 *         self.current_node = current_node
 *         if found:
 *             return self._build_next_match()             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__BisectUnicodeAcoraIter *)((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._build_next_match(((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L18;
  }
  __pyx_L18:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":294
 *         if found:
 *             return self._build_next_match()
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 * cdef int _bisect(Py_UNICODE current_char, Py_UNICODE* characters, int char_count) nogil:
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("acora._acora._BisectUnicodeAcoraIter.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":296
 *         raise StopIteration
 * 
 * cdef int _bisect(Py_UNICODE current_char, Py_UNICODE* characters, int char_count) nogil:             # <<<<<<<<<<<<<<
 *     cdef int start = 0, stop = char_count-1, mid = char_count // 2
 *     while start < stop:
 */

static  int __pyx_f_5acora_6_acora__bisect(Py_UNICODE __pyx_v_current_char, Py_UNICODE *__pyx_v_characters, int __pyx_v_char_count) {
  int __pyx_v_start;
  int __pyx_v_stop;
  int __pyx_v_mid;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":297
 * 
 * cdef int _bisect(Py_UNICODE current_char, Py_UNICODE* characters, int char_count) nogil:
 *     cdef int start = 0, stop = char_count-1, mid = char_count // 2             # <<<<<<<<<<<<<<
 *     while start < stop:
 *         if current_char > characters[mid]:
 */
  __pyx_v_start = 0;
  __pyx_v_stop = (__pyx_v_char_count - 1);
  __pyx_v_mid = __Pyx_div_long(__pyx_v_char_count, 2);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":298
 * cdef int _bisect(Py_UNICODE current_char, Py_UNICODE* characters, int char_count) nogil:
 *     cdef int start = 0, stop = char_count-1, mid = char_count // 2
 *     while start < stop:             # <<<<<<<<<<<<<<
 *         if current_char > characters[mid]:
 *             start = mid + 1
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_start < __pyx_v_stop);
    if (!__pyx_t_1) break;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":299
 *     cdef int start = 0, stop = char_count-1, mid = char_count // 2
 *     while start < stop:
 *         if current_char > characters[mid]:             # <<<<<<<<<<<<<<
 *             start = mid + 1
 *         elif current_char < characters[mid]:
 */
    __pyx_t_1 = (__pyx_v_current_char > (__pyx_v_characters[__pyx_v_mid]));
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":300
 *     while start < stop:
 *         if current_char > characters[mid]:
 *             start = mid + 1             # <<<<<<<<<<<<<<
 *         elif current_char < characters[mid]:
 *             stop = mid - 1
 */
      __pyx_v_start = (__pyx_v_mid + 1);
      goto __pyx_L5;
    }

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":301
 *         if current_char > characters[mid]:
 *             start = mid + 1
 *         elif current_char < characters[mid]:             # <<<<<<<<<<<<<<
 *             stop = mid - 1
 *         else:
 */
    __pyx_t_1 = (__pyx_v_current_char < (__pyx_v_characters[__pyx_v_mid]));
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":302
 *             start = mid + 1
 *         elif current_char < characters[mid]:
 *             stop = mid - 1             # <<<<<<<<<<<<<<
 *         else:
 *             return mid
 */
      __pyx_v_stop = (__pyx_v_mid - 1);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":304
 *             stop = mid - 1
 *         else:
 *             return mid             # <<<<<<<<<<<<<<
 *         mid = (start+stop) // 2
 *     if start == stop and current_char == characters[start]:
 */
      __pyx_r = __pyx_v_mid;
      goto __pyx_L0;
    }
    __pyx_L5:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":305
 *         else:
 *             return mid
 *         mid = (start+stop) // 2             # <<<<<<<<<<<<<<
 *     if start == stop and current_char == characters[start]:
 *         return start
 */
    __pyx_v_mid = __Pyx_div_long((__pyx_v_start + __pyx_v_stop), 2);
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":306
 *             return mid
 *         mid = (start+stop) // 2
 *     if start == stop and current_char == characters[start]:             # <<<<<<<<<<<<<<
 *         return start
 *     return -1
 */
  __pyx_t_1 = (__pyx_v_start == __pyx_v_stop);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_current_char == (__pyx_v_characters[__pyx_v_start]));
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":307
 *         mid = (start+stop) // 2
 *     if start == stop and current_char == characters[start]:
 *         return start             # <<<<<<<<<<<<<<
 *     return -1
 * 
 */
    __pyx_r = __pyx_v_start;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":308
 *     if start == stop and current_char == characters[start]:
 *         return start
 *     return -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = -1;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":320
 *     cdef tuple _pyrefs
 * 
 *     def __cinit__(self, start_state, dict transitions):             # <<<<<<<<<<<<<<
 *         cdef _AcoraBytesNodeStruct* c_nodes
 *         cdef Py_ssize_t i
 */

static int __pyx_pf_5acora_6_acora_10BytesAcora___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5acora_6_acora_10BytesAcora___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_state = 0;
  PyObject *__pyx_v_transitions = 0;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_c_nodes;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_transitions_by_state = 0;
  PyObject *__pyx_v_node_offsets;
  PyObject *__pyx_v_pyrefs;
  PyObject *__pyx_v_state;
  PyObject *__pyx_v_state_transitions;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  void *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  void *__pyx_t_10;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_state,&__pyx_n_s__transitions,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_state);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__transitions);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_start_state = values[0];
    __pyx_v_transitions = ((PyObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_start_state = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_transitions = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("acora._acora.BytesAcora.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_start_state);
  __Pyx_INCREF(__pyx_v_transitions);
  __pyx_v_node_offsets = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_pyrefs = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_state = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_state_transitions = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_transitions), &PyDict_Type, 1, "transitions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":323
 *         cdef _AcoraBytesNodeStruct* c_nodes
 *         cdef Py_ssize_t i
 *         self.start_node = NULL             # <<<<<<<<<<<<<<
 *         cdef dict transitions_by_state = group_transitions_by_state(transitions)
 * 
 */
  ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->start_node = NULL;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":324
 *         cdef Py_ssize_t i
 *         self.start_node = NULL
 *         cdef dict transitions_by_state = group_transitions_by_state(transitions)             # <<<<<<<<<<<<<<
 * 
 *         self.node_count = len(transitions_by_state)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_5acora_6_acora_group_transitions_by_state(__pyx_v_transitions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_transitions_by_state = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":326
 *         cdef dict transitions_by_state = group_transitions_by_state(transitions)
 * 
 *         self.node_count = len(transitions_by_state)             # <<<<<<<<<<<<<<
 *         c_nodes = self.start_node = <_AcoraBytesNodeStruct*> python_mem.PyMem_Malloc(
 *             sizeof(_AcoraBytesNodeStruct) * self.node_count)
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_transitions_by_state)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->node_count = __pyx_t_2;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":328
 *         self.node_count = len(transitions_by_state)
 *         c_nodes = self.start_node = <_AcoraBytesNodeStruct*> python_mem.PyMem_Malloc(
 *             sizeof(_AcoraBytesNodeStruct) * self.node_count)             # <<<<<<<<<<<<<<
 *         if c_nodes is NULL:
 *             python_exc.PyMem_NoMemory()
 */
  __pyx_t_3 = ((__pyx_t_5acora_6_acora__AcoraBytesNodeStruct *)PyMem_Malloc(((sizeof(__pyx_t_5acora_6_acora__AcoraBytesNodeStruct)) * ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->node_count)));
  __pyx_v_c_nodes = __pyx_t_3;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":327
 * 
 *         self.node_count = len(transitions_by_state)
 *         c_nodes = self.start_node = <_AcoraBytesNodeStruct*> python_mem.PyMem_Malloc(             # <<<<<<<<<<<<<<
 *             sizeof(_AcoraBytesNodeStruct) * self.node_count)
 *         if c_nodes is NULL:
 */
  ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->start_node = __pyx_t_3;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":329
 *         c_nodes = self.start_node = <_AcoraBytesNodeStruct*> python_mem.PyMem_Malloc(
 *             sizeof(_AcoraBytesNodeStruct) * self.node_count)
 *         if c_nodes is NULL:             # <<<<<<<<<<<<<<
 *             python_exc.PyMem_NoMemory()
 * 
 */
  __pyx_t_4 = (__pyx_v_c_nodes == NULL);
  if (__pyx_t_4) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":330
 *             sizeof(_AcoraBytesNodeStruct) * self.node_count)
 *         if c_nodes is NULL:
 *             python_exc.PyMem_NoMemory()             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.node_count):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_exc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__PyMem_NoMemory); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":332
 *             python_exc.PyMem_NoMemory()
 * 
 *         for i in range(self.node_count):             # <<<<<<<<<<<<<<
 *             # required by __dealloc__ in case of subsequent errors
 *             c_nodes[i].targets = NULL
 */
  __pyx_t_2 = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->node_count;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":334
 *         for i in range(self.node_count):
 *             # required by __dealloc__ in case of subsequent errors
 *             c_nodes[i].targets = NULL             # <<<<<<<<<<<<<<
 * 
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])
 */
    (__pyx_v_c_nodes[__pyx_v_i]).targets = NULL;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":336
 *             c_nodes[i].targets = NULL
 * 
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])             # <<<<<<<<<<<<<<
 *         pyrefs = {} # used to keep Python references alive (and intern them)
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_v_transitions_by_state));
  __Pyx_XDECREF(__pyx_t_5);
  __pyx_t_5 = ((PyObject *)__pyx_v_transitions_by_state);
  __pyx_t_6 = 0;
  while (1) {
    if (!PyDict_Next(__pyx_t_5, (&__pyx_t_6), ((PyObject **)(&__pyx_t_7)), NULL)) break;
    __Pyx_INCREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(__pyx_v_state);
    __pyx_v_state = ((PyObject *)__pyx_t_7);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);
    __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_v_state, (PyObject*)__pyx_t_8); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_node_offsets);
  __pyx_v_node_offsets = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":337
 * 
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])
 *         pyrefs = {} # used to keep Python references alive (and intern them)             # <<<<<<<<<<<<<<
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 *             _init_bytes_node(&c_nodes[i], state, state_transitions,
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_pyrefs);
  __pyx_v_pyrefs = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":338
 *         node_offsets = dict([ (state, i) for i,state in enumerate(transitions_by_state) ])
 *         pyrefs = {} # used to keep Python references alive (and intern them)
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):             # <<<<<<<<<<<<<<
 *             _init_bytes_node(&c_nodes[i], state, state_transitions,
 *                              c_nodes, node_offsets, pyrefs)
 */
  __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_v_transitions_by_state));
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = ((PyObject *)__pyx_v_transitions_by_state);
  __pyx_t_6 = 0;
  while (1) {
    if (!PyDict_Next(__pyx_t_1, (&__pyx_t_6), ((PyObject **)(&__pyx_t_7)), ((PyObject **)(&__pyx_t_10)))) break;
    __Pyx_INCREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(__pyx_v_state);
    __pyx_v_state = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(((PyObject *)__pyx_t_10));
    __Pyx_DECREF(__pyx_v_state_transitions);
    __pyx_v_state_transitions = ((PyObject *)__pyx_t_10);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":339
 *         pyrefs = {} # used to keep Python references alive (and intern them)
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 *             _init_bytes_node(&c_nodes[i], state, state_transitions,             # <<<<<<<<<<<<<<
 *                              c_nodes, node_offsets, pyrefs)
 * 
 */
    if (!(likely(PyList_CheckExact(__pyx_v_state_transitions))||((__pyx_v_state_transitions) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_state_transitions)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":340
 *         for i, (state, state_transitions) in enumerate(transitions_by_state.iteritems()):
 *             _init_bytes_node(&c_nodes[i], state, state_transitions,
 *                              c_nodes, node_offsets, pyrefs)             # <<<<<<<<<<<<<<
 * 
 *         self._pyrefs = tuple(pyrefs)
 */
    if (!(likely(PyDict_CheckExact(__pyx_v_node_offsets))||((__pyx_v_node_offsets) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_node_offsets)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyDict_CheckExact(__pyx_v_pyrefs))||((__pyx_v_pyrefs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_pyrefs)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_f_5acora_6_acora__init_bytes_node((&(__pyx_v_c_nodes[__pyx_v_i])), __pyx_v_state, ((PyObject *)__pyx_v_state_transitions), __pyx_v_c_nodes, ((PyObject *)__pyx_v_node_offsets), ((PyObject *)__pyx_v_pyrefs)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":342
 *                              c_nodes, node_offsets, pyrefs)
 * 
 *         self._pyrefs = tuple(pyrefs)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_pyrefs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pyrefs);
  __Pyx_GIVEREF(__pyx_v_pyrefs);
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->_pyrefs);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->_pyrefs));
  ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->_pyrefs = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("acora._acora.BytesAcora.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_transitions_by_state);
  __Pyx_DECREF(__pyx_v_node_offsets);
  __Pyx_DECREF(__pyx_v_pyrefs);
  __Pyx_DECREF(__pyx_v_state);
  __Pyx_DECREF(__pyx_v_state_transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_start_state);
  __Pyx_DECREF(__pyx_v_transitions);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":344
 *         self._pyrefs = tuple(pyrefs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         if self.start_node is not NULL:
 */

static void __pyx_pf_5acora_6_acora_10BytesAcora___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5acora_6_acora_10BytesAcora___dealloc__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__dealloc__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":346
 *     def __dealloc__(self):
 *         cdef Py_ssize_t i
 *         if self.start_node is not NULL:             # <<<<<<<<<<<<<<
 *             for i in range(self.node_count):
 *                 if self.start_node[i].targets is not NULL:
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->start_node != NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":347
 *         cdef Py_ssize_t i
 *         if self.start_node is not NULL:
 *             for i in range(self.node_count):             # <<<<<<<<<<<<<<
 *                 if self.start_node[i].targets is not NULL:
 *                     python_mem.PyMem_Free(self.start_node[i].targets)
 */
    __pyx_t_2 = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->node_count;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":348
 *         if self.start_node is not NULL:
 *             for i in range(self.node_count):
 *                 if self.start_node[i].targets is not NULL:             # <<<<<<<<<<<<<<
 *                     python_mem.PyMem_Free(self.start_node[i].targets)
 *             python_mem.PyMem_Free(self.start_node)
 */
      __pyx_t_1 = ((((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->start_node[__pyx_v_i]).targets != NULL);
      if (__pyx_t_1) {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":349
 *             for i in range(self.node_count):
 *                 if self.start_node[i].targets is not NULL:
 *                     python_mem.PyMem_Free(self.start_node[i].targets)             # <<<<<<<<<<<<<<
 *             python_mem.PyMem_Free(self.start_node)
 * 
 */
        PyMem_Free((((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->start_node[__pyx_v_i]).targets);
        goto __pyx_L8;
      }
      __pyx_L8:;
    }

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":350
 *                 if self.start_node[i].targets is not NULL:
 *                     python_mem.PyMem_Free(self.start_node[i].targets)
 *             python_mem.PyMem_Free(self.start_node)             # <<<<<<<<<<<<<<
 * 
 *     cpdef finditer(self, bytes data):
 */
    PyMem_Free(((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->start_node);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":352
 *             python_mem.PyMem_Free(self.start_node)
 * 
 *     cpdef finditer(self, bytes data):             # <<<<<<<<<<<<<<
 *         return _BytesAcoraIter(self, data)
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_finditer(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static  PyObject *__pyx_f_5acora_6_acora_10BytesAcora_finditer(struct __pyx_obj_5acora_6_acora_BytesAcora *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("finditer");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__finditer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5acora_6_acora_10BytesAcora_finditer)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_data));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_data));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":353
 * 
 *     cpdef finditer(self, bytes data):
 *         return _BytesAcoraIter(self, data)             # <<<<<<<<<<<<<<
 * 
 *     def findall(self, bytes data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5acora_6_acora__BytesAcoraIter)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("acora._acora.BytesAcora.finditer");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":352
 *             python_mem.PyMem_Free(self.start_node)
 * 
 *     cpdef finditer(self, bytes data):             # <<<<<<<<<<<<<<
 *         return _BytesAcoraIter(self, data)
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_finditer(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_5acora_6_acora_10BytesAcora_finditer[] = "BytesAcora.finditer(self, bytes data)";
static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_finditer(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("finditer");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), &PyBytes_Type, 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5acora_6_acora_BytesAcora *)((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->__pyx_vtab)->finditer(((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self), __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("acora._acora.BytesAcora.finditer");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":355
 *         return _BytesAcoraIter(self, data)
 * 
 *     def findall(self, bytes data):             # <<<<<<<<<<<<<<
 *         return list(self.finditer(data))
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_5acora_6_acora_10BytesAcora_findall[] = "BytesAcora.findall(self, bytes data)";
static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("findall");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), &PyBytes_Type, 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":356
 * 
 *     def findall(self, bytes data):
 *         return list(self.finditer(data))             # <<<<<<<<<<<<<<
 * 
 *     def filefind(self, f):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5acora_6_acora_BytesAcora *)((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self)->__pyx_vtab)->finditer(((struct __pyx_obj_5acora_6_acora_BytesAcora *)__pyx_v_self), __pyx_v_data, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("acora._acora.BytesAcora.findall");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":358
 *         return list(self.finditer(data))
 * 
 *     def filefind(self, f):             # <<<<<<<<<<<<<<
 *         close_file = False
 *         if not hasattr(f, 'read'):
 */

static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_filefind(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/
static char __pyx_doc_5acora_6_acora_10BytesAcora_filefind[] = "BytesAcora.filefind(self, f)";
static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_filefind(PyObject *__pyx_v_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_v_close_file;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("filefind");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_f);
  __pyx_v_close_file = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":359
 * 
 *     def filefind(self, f):
 *         close_file = False             # <<<<<<<<<<<<<<
 *         if not hasattr(f, 'read'):
 *             f = open(f, 'rb')
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_close_file);
  __pyx_v_close_file = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":360
 *     def filefind(self, f):
 *         close_file = False
 *         if not hasattr(f, 'read'):             # <<<<<<<<<<<<<<
 *             f = open(f, 'rb')
 *             close_file = True
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_f, ((PyObject *)__pyx_n_s__read)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":361
 *         close_file = False
 *         if not hasattr(f, 'read'):
 *             f = open(f, 'rb')             # <<<<<<<<<<<<<<
 *             close_file = True
 *         return _FileAcoraIter(self, f, close_file)
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_f);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f);
    __Pyx_GIVEREF(__pyx_v_f);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__rb));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__rb));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rb));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_f);
    __pyx_v_f = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":362
 *         if not hasattr(f, 'read'):
 *             f = open(f, 'rb')
 *             close_file = True             # <<<<<<<<<<<<<<
 *         return _FileAcoraIter(self, f, close_file)
 * 
 */
    __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v_close_file);
    __pyx_v_close_file = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":363
 *             f = open(f, 'rb')
 *             close_file = True
 *         return _FileAcoraIter(self, f, close_file)             # <<<<<<<<<<<<<<
 * 
 *     def filefindall(self, f):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __Pyx_INCREF(__pyx_v_close_file);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_close_file);
  __Pyx_GIVEREF(__pyx_v_close_file);
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5acora_6_acora__FileAcoraIter)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("acora._acora.BytesAcora.filefind");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_close_file);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":365
 *         return _FileAcoraIter(self, f, close_file)
 * 
 *     def filefindall(self, f):             # <<<<<<<<<<<<<<
 *         return list(self.filefind(f))
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_filefindall(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/
static char __pyx_doc_5acora_6_acora_10BytesAcora_filefindall[] = "BytesAcora.filefindall(self, f)";
static PyObject *__pyx_pf_5acora_6_acora_10BytesAcora_filefindall(PyObject *__pyx_v_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("filefindall");

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":366
 * 
 *     def filefindall(self, f):
 *         return list(self.filefind(f))             # <<<<<<<<<<<<<<
 * 
 * cdef class _BytesAcoraIter:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__filefind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("acora._acora.BytesAcora.filefindall");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":378
 *     cdef char* data_start
 * 
 *     def __cinit__(self, BytesAcora acora, bytes data):             # <<<<<<<<<<<<<<
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora
 */

static int __pyx_pf_5acora_6_acora_15_BytesAcoraIter___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5acora_6_acora_15_BytesAcoraIter___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5acora_6_acora_BytesAcora *__pyx_v_acora = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  char *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__acora,&__pyx_n_s__data,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__acora);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)values[0]);
    __pyx_v_data = ((PyObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_data = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("acora._acora._BytesAcoraIter.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_acora), __pyx_ptype_5acora_6_acora_BytesAcora, 1, "acora", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), &PyBytes_Type, 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":379
 * 
 *     def __cinit__(self, BytesAcora acora, bytes data):
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL             # <<<<<<<<<<<<<<
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  __pyx_t_1 = (__pyx_v_acora->start_node != NULL);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_acora->start_node->matches == NULL);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":380
 *     def __cinit__(self, BytesAcora acora, bytes data):
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora             # <<<<<<<<<<<<<<
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_acora));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_acora));
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->acora);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->acora));
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->acora = __pyx_v_acora;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":381
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node             # <<<<<<<<<<<<<<
 *         self.match_index = 0
 *         self.data_char = self.data_start = self.data = data
 */
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->start_node = __pyx_v_acora->start_node;
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->current_node = __pyx_v_acora->start_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":382
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0             # <<<<<<<<<<<<<<
 *         self.data_char = self.data_start = self.data = data
 *         self.data_end = self.data_char + len(data)
 */
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->match_index = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":383
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0
 *         self.data_char = self.data_start = self.data = data             # <<<<<<<<<<<<<<
 *         self.data_end = self.data_char + len(data)
 * 
 */
  __pyx_t_4 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_data)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_char = __pyx_t_4;
  __pyx_t_4 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_data)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_start = __pyx_t_4;
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data));
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data = __pyx_v_data;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":384
 *         self.match_index = 0
 *         self.data_char = self.data_start = self.data = data
 *         self.data_end = self.data_char + len(data)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_end = (((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_char + __pyx_t_5);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("acora._acora._BytesAcoraIter.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":386
 *         self.data_end = self.data_char + len(data)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_15_BytesAcoraIter___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_15_BytesAcoraIter___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":387
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":389
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef char* data_char = self.data_char
 *         cdef char* data_end = self.data_end
 */

static PyObject *__pyx_pf_5acora_6_acora_15_BytesAcoraIter___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_15_BytesAcoraIter___next__(PyObject *__pyx_v_self) {
  char *__pyx_v_data_char;
  char *__pyx_v_data_end;
  int __pyx_v_found;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__next__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":390
 * 
 *     def __next__(self):
 *         cdef char* data_char = self.data_char             # <<<<<<<<<<<<<<
 *         cdef char* data_end = self.data_end
 *         cdef char* test_chars
 */
  __pyx_v_data_char = ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_char;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":391
 *     def __next__(self):
 *         cdef char* data_char = self.data_char
 *         cdef char* data_end = self.data_end             # <<<<<<<<<<<<<<
 *         cdef char* test_chars
 *         cdef char current_char
 */
  __pyx_v_data_end = ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_end;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":394
 *         cdef char* test_chars
 *         cdef char current_char
 *         cdef int i, found = 0             # <<<<<<<<<<<<<<
 *         if self.current_node.matches is not NULL:
 *             if self.current_node.matches[self.match_index] is not NULL:
 */
  __pyx_v_found = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":395
 *         cdef char current_char
 *         cdef int i, found = 0
 *         if self.current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *             if self.current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->current_node->matches != NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":396
 *         cdef int i, found = 0
 *         if self.current_node.matches is not NULL:
 *             if self.current_node.matches[self.match_index] is not NULL:             # <<<<<<<<<<<<<<
 *                 return self._build_next_match()
 *             self.match_index = 0
 */
    __pyx_t_1 = ((((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->current_node->matches[((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->match_index]) != NULL);
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":397
 *         if self.current_node.matches is not NULL:
 *             if self.current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()             # <<<<<<<<<<<<<<
 *             self.match_index = 0
 *         with nogil:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__BytesAcoraIter *)((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->__pyx_vtab)->_build_next_match(((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":398
 *             if self.current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 *             self.match_index = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             found = _search_in_bytes(self.start_node, data_end,
 */
    ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->match_index = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":399
 *                 return self._build_next_match()
 *             self.match_index = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             found = _search_in_bytes(self.start_node, data_end,
 *                                      &self.data_char, &self.current_node)
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":401
 *         with nogil:
 *             found = _search_in_bytes(self.start_node, data_end,
 *                                      &self.data_char, &self.current_node)             # <<<<<<<<<<<<<<
 *         if found:
 *             return self._build_next_match()
 */
      __pyx_v_found = __pyx_f_5acora_6_acora__search_in_bytes(((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->start_node, __pyx_v_data_end, (&((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->data_char), (&((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->current_node));
    }
    /*finally:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":399
 *                 return self._build_next_match()
 *             self.match_index = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             found = _search_in_bytes(self.start_node, data_end,
 *                                      &self.data_char, &self.current_node)
 */
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":402
 *             found = _search_in_bytes(self.start_node, data_end,
 *                                      &self.data_char, &self.current_node)
 *         if found:             # <<<<<<<<<<<<<<
 *             return self._build_next_match()
 *         raise StopIteration
 */
  __pyx_t_3 = __pyx_v_found;
  if (__pyx_t_3) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":403
 *                                      &self.data_char, &self.current_node)
 *         if found:
 *             return self._build_next_match()             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__BytesAcoraIter *)((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)->__pyx_vtab)->_build_next_match(((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":404
 *         if found:
 *             return self._build_next_match()
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef _build_next_match(self):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("acora._acora._BytesAcoraIter.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":406
 *         raise StopIteration
 * 
 *     cdef _build_next_match(self):             # <<<<<<<<<<<<<<
 *         match = <bytes> self.current_node.matches[self.match_index]
 *         self.match_index += 1
 */

static  PyObject *__pyx_f_5acora_6_acora_15_BytesAcoraIter__build_next_match(struct __pyx_obj_5acora_6_acora__BytesAcoraIter *__pyx_v_self) {
  PyObject *__pyx_v_match;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_build_next_match");
  __pyx_v_match = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":407
 * 
 *     cdef _build_next_match(self):
 *         match = <bytes> self.current_node.matches[self.match_index]             # <<<<<<<<<<<<<<
 *         self.match_index += 1
 *         return (match, <Py_ssize_t>(self.data_char - self.data_start) - len(match))
 */
  __pyx_t_1 = (__pyx_v_self->current_node->matches[__pyx_v_self->match_index]);
  __Pyx_INCREF(((PyObject *)((PyObject *)__pyx_t_1)));
  __Pyx_DECREF(__pyx_v_match);
  __pyx_v_match = ((PyObject *)__pyx_t_1);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":408
 *     cdef _build_next_match(self):
 *         match = <bytes> self.current_node.matches[self.match_index]
 *         self.match_index += 1             # <<<<<<<<<<<<<<
 *         return (match, <Py_ssize_t>(self.data_char - self.data_start) - len(match))
 * 
 */
  __pyx_v_self->match_index += 1;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":409
 *         match = <bytes> self.current_node.matches[self.match_index]
 *         self.match_index += 1
 *         return (match, <Py_ssize_t>(self.data_char - self.data_start) - len(match))             # <<<<<<<<<<<<<<
 * 
 * cdef int _search_in_bytes(_AcoraBytesNodeStruct* start_node,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_Length(__pyx_v_match); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromSsize_t((((Py_ssize_t)(__pyx_v_self->data_char - __pyx_v_self->data_start)) - __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_match);
  __Pyx_GIVEREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("acora._acora._BytesAcoraIter._build_next_match");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":411
 *         return (match, <Py_ssize_t>(self.data_char - self.data_start) - len(match))
 * 
 * cdef int _search_in_bytes(_AcoraBytesNodeStruct* start_node,             # <<<<<<<<<<<<<<
 *                           char* data_end,
 *                           char** _data_char,
 */

static  int __pyx_f_5acora_6_acora__search_in_bytes(__pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_start_node, char *__pyx_v_data_end, char **__pyx_v__data_char, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct **__pyx_v__current_node) {
  char *__pyx_v_data_char;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_current_node;
  char *__pyx_v_test_chars;
  char __pyx_v_current_char;
  int __pyx_v_i;
  int __pyx_v_found;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":415
 *                           char** _data_char,
 *                           _AcoraBytesNodeStruct** _current_node) nogil:
 *     cdef char* data_char = _data_char[0]             # <<<<<<<<<<<<<<
 *     cdef _AcoraBytesNodeStruct* current_node = _current_node[0]
 *     cdef char* test_chars
 */
  __pyx_v_data_char = (__pyx_v__data_char[0]);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":416
 *                           _AcoraBytesNodeStruct** _current_node) nogil:
 *     cdef char* data_char = _data_char[0]
 *     cdef _AcoraBytesNodeStruct* current_node = _current_node[0]             # <<<<<<<<<<<<<<
 *     cdef char* test_chars
 *     cdef char current_char
 */
  __pyx_v_current_node = (__pyx_v__current_node[0]);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":419
 *     cdef char* test_chars
 *     cdef char current_char
 *     cdef int i, found = 0             # <<<<<<<<<<<<<<
 * 
 *     while data_char < data_end:
 */
  __pyx_v_found = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":421
 *     cdef int i, found = 0
 * 
 *     while data_char < data_end:             # <<<<<<<<<<<<<<
 *         current_char = data_char[0]
 *         data_char += 1
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_data_char < __pyx_v_data_end);
    if (!__pyx_t_1) break;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":422
 * 
 *     while data_char < data_end:
 *         current_char = data_char[0]             # <<<<<<<<<<<<<<
 *         data_char += 1
 *         test_chars = current_node.characters
 */
    __pyx_v_current_char = (__pyx_v_data_char[0]);

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":423
 *     while data_char < data_end:
 *         current_char = data_char[0]
 *         data_char += 1             # <<<<<<<<<<<<<<
 *         test_chars = current_node.characters
 *         if current_char < test_chars[0] \
 */
    __pyx_v_data_char += 1;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":424
 *         current_char = data_char[0]
 *         data_char += 1
 *         test_chars = current_node.characters             # <<<<<<<<<<<<<<
 *         if current_char < test_chars[0] \
 *                 or current_char > test_chars[current_node.char_count-1]:
 */
    __pyx_v_test_chars = __pyx_v_current_node->characters;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":425
 *         data_char += 1
 *         test_chars = current_node.characters
 *         if current_char < test_chars[0] \             # <<<<<<<<<<<<<<
 *                 or current_char > test_chars[current_node.char_count-1]:
 *             current_node = start_node
 */
    __pyx_t_1 = (__pyx_v_current_char < (__pyx_v_test_chars[0]));
    if (!__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":426
 *         test_chars = current_node.characters
 *         if current_char < test_chars[0] \
 *                 or current_char > test_chars[current_node.char_count-1]:             # <<<<<<<<<<<<<<
 *             current_node = start_node
 *         else:
 */
      __pyx_t_2 = (__pyx_v_current_char > (__pyx_v_test_chars[(__pyx_v_current_node->char_count - 1)]));
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":427
 *         if current_char < test_chars[0] \
 *                 or current_char > test_chars[current_node.char_count-1]:
 *             current_node = start_node             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(current_node.char_count):
 */
      __pyx_v_current_node = __pyx_v_start_node;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":429
 *             current_node = start_node
 *         else:
 *             for i in range(current_node.char_count):             # <<<<<<<<<<<<<<
 *                 if current_char == test_chars[i]:
 *                     current_node = current_node.targets[i]
 */
      __pyx_t_4 = __pyx_v_current_node->char_count;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":430
 *         else:
 *             for i in range(current_node.char_count):
 *                 if current_char == test_chars[i]:             # <<<<<<<<<<<<<<
 *                     current_node = current_node.targets[i]
 *                     break
 */
        __pyx_t_3 = (__pyx_v_current_char == (__pyx_v_test_chars[__pyx_v_i]));
        if (__pyx_t_3) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":431
 *             for i in range(current_node.char_count):
 *                 if current_char == test_chars[i]:
 *                     current_node = current_node.targets[i]             # <<<<<<<<<<<<<<
 *                     break
 *             else:
 */
          __pyx_v_current_node = (__pyx_v_current_node->targets[__pyx_v_i]);

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":432
 *                 if current_char == test_chars[i]:
 *                     current_node = current_node.targets[i]
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 current_node = start_node
 */
          goto __pyx_L7_break;
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":434
 *                     break
 *             else:
 *                 current_node = start_node             # <<<<<<<<<<<<<<
 *             if current_node.matches is not NULL:
 *                 found = 1
 */
        __pyx_v_current_node = __pyx_v_start_node;
      }
      __pyx_L7_break:;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":435
 *             else:
 *                 current_node = start_node
 *             if current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *                 found = 1
 *                 break
 */
      __pyx_t_3 = (__pyx_v_current_node->matches != NULL);
      if (__pyx_t_3) {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":436
 *                 current_node = start_node
 *             if current_node.matches is not NULL:
 *                 found = 1             # <<<<<<<<<<<<<<
 *                 break
 *     _data_char[0] = data_char
 */
        __pyx_v_found = 1;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":437
 *             if current_node.matches is not NULL:
 *                 found = 1
 *                 break             # <<<<<<<<<<<<<<
 *     _data_char[0] = data_char
 *     _current_node[0] = current_node
 */
        goto __pyx_L4_break;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
    __pyx_L5:;
  }
  __pyx_L4_break:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":438
 *                 found = 1
 *                 break
 *     _data_char[0] = data_char             # <<<<<<<<<<<<<<
 *     _current_node[0] = current_node
 *     return found
 */
  (__pyx_v__data_char[0]) = __pyx_v_data_char;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":439
 *                 break
 *     _data_char[0] = data_char
 *     _current_node[0] = current_node             # <<<<<<<<<<<<<<
 *     return found
 * 
 */
  (__pyx_v__current_node[0]) = __pyx_v_current_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":440
 *     _data_char[0] = data_char
 *     _current_node[0] = current_node
 *     return found             # <<<<<<<<<<<<<<
 * 
 * # file data handling
 */
  __pyx_r = __pyx_v_found;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":456
 *     cdef BytesAcora acora
 * 
 *     def __cinit__(self, BytesAcora acora, f, bint close=False, Py_ssize_t buffer_size=FILE_BUFFER_SIZE):             # <<<<<<<<<<<<<<
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora
 */

static int __pyx_pf_5acora_6_acora_14_FileAcoraIter___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5acora_6_acora_14_FileAcoraIter___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5acora_6_acora_BytesAcora *__pyx_v_acora = 0;
  PyObject *__pyx_v_f = 0;
  int __pyx_v_close;
  Py_ssize_t __pyx_v_buffer_size;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  char *__pyx_t_9;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__acora,&__pyx_n_s__f,&__pyx_n_s__close,&__pyx_n_s__buffer_size,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__acora);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__close);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer_size);
        if (unlikely(value)) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)values[0]);
    __pyx_v_f = values[1];
    if (values[2]) {
      __pyx_v_close = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_close == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_close = ((int)0);
    }
    if (values[3]) {
      __pyx_v_buffer_size = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_buffer_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_buffer_size = ((Py_ssize_t)32768);
    }
  } else {
    __pyx_v_close = ((int)0);
    __pyx_v_buffer_size = ((Py_ssize_t)32768);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4:
      __pyx_v_buffer_size = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_buffer_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  3:
      __pyx_v_close = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_close == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_f = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("acora._acora._FileAcoraIter.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF((PyObject *)__pyx_v_acora);
  __Pyx_INCREF(__pyx_v_f);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_acora), __pyx_ptype_5acora_6_acora_BytesAcora, 1, "acora", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":457
 * 
 *     def __cinit__(self, BytesAcora acora, f, bint close=False, Py_ssize_t buffer_size=FILE_BUFFER_SIZE):
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL             # <<<<<<<<<<<<<<
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  __pyx_t_1 = (__pyx_v_acora->start_node != NULL);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_acora->start_node->matches == NULL);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":458
 *     def __cinit__(self, BytesAcora acora, f, bint close=False, Py_ssize_t buffer_size=FILE_BUFFER_SIZE):
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora             # <<<<<<<<<<<<<<
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_acora));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_acora));
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->acora);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->acora));
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->acora = __pyx_v_acora;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":459
 *         assert acora.start_node is not NULL and acora.start_node.matches is NULL
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node             # <<<<<<<<<<<<<<
 *         self.match_index = 0
 *         self.buffer_offset_count = 0
 */
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->start_node = __pyx_v_acora->start_node;
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->current_node = __pyx_v_acora->start_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":460
 *         self.acora = acora
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0             # <<<<<<<<<<<<<<
 *         self.buffer_offset_count = 0
 *         self.f = f
 */
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->match_index = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":461
 *         self.start_node = self.current_node = acora.start_node
 *         self.match_index = 0
 *         self.buffer_offset_count = 0             # <<<<<<<<<<<<<<
 *         self.f = f
 *         self.close_file = close
 */
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer_offset_count = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":462
 *         self.match_index = 0
 *         self.buffer_offset_count = 0
 *         self.f = f             # <<<<<<<<<<<<<<
 *         self.close_file = close
 *         try:
 */
  __Pyx_INCREF(__pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->f);
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->f = __pyx_v_f;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":463
 *         self.buffer_offset_count = 0
 *         self.f = f
 *         self.close_file = close             # <<<<<<<<<<<<<<
 *         try:
 *             self.c_file = f.fileno()
 */
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->close_file = __pyx_v_close;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":464
 *         self.f = f
 *         self.close_file = close
 *         try:             # <<<<<<<<<<<<<<
 *             self.c_file = f.fileno()
 *         except:
 */
  {
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
    __Pyx_XGOTREF(__pyx_save_exc_type);
    __Pyx_XGOTREF(__pyx_save_exc_value);
    __Pyx_XGOTREF(__pyx_save_exc_tb);
    /*try:*/ {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":465
 *         self.close_file = close
 *         try:
 *             self.c_file = f.fileno()             # <<<<<<<<<<<<<<
 *         except:
 *             # maybe not a C file?
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__fileno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_file = __pyx_t_6;
    }
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L13_try_end;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":466
 *         try:
 *             self.c_file = f.fileno()
 *         except:             # <<<<<<<<<<<<<<
 *             # maybe not a C file?
 *             self.c_file = -1
 */
    /*except:*/ {
      __Pyx_AddTraceback("acora._acora._FileAcoraIter.__cinit__");
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":468
 *         except:
 *             # maybe not a C file?
 *             self.c_file = -1             # <<<<<<<<<<<<<<
 *         self.read_size = buffer_size
 *         if self.c_file == -1:
 */
      ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_file = -1;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_exception_handled;
    }
    __pyx_L8_except_error:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L13_try_end:;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":469
 *             # maybe not a C file?
 *             self.c_file = -1
 *         self.read_size = buffer_size             # <<<<<<<<<<<<<<
 *         if self.c_file == -1:
 *             self.buffer = b''
 */
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->read_size = __pyx_v_buffer_size;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":470
 *             self.c_file = -1
 *         self.read_size = buffer_size
 *         if self.c_file == -1:             # <<<<<<<<<<<<<<
 *             self.buffer = b''
 *         else:
 */
  __pyx_t_3 = (((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_file == -1);
  if (__pyx_t_3) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":471
 *         self.read_size = buffer_size
 *         if self.c_file == -1:
 *             self.buffer = b''             # <<<<<<<<<<<<<<
 *         else:
 *             # use a statically allocated, fixed-size C buffer
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_b_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_b_1));
    __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer));
    ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer = __pyx_kp_b_1;
    goto __pyx_L16;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":474
 *         else:
 *             # use a statically allocated, fixed-size C buffer
 *             self.buffer = b'\0' * buffer_size             # <<<<<<<<<<<<<<
 *         self.c_buffer_pos = self.c_buffer_end = <char*> self.buffer
 * 
 */
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_buffer_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_kp_b_2), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer));
    ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer = ((PyObject *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L16:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":475
 *             # use a statically allocated, fixed-size C buffer
 *             self.buffer = b'\0' * buffer_size
 *         self.c_buffer_pos = self.c_buffer_end = <char*> self.buffer             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_8 = __Pyx_PyBytes_AsString(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((char *)__pyx_t_8);
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos = __pyx_t_9;
  ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_end = __pyx_t_9;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("acora._acora._FileAcoraIter.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF((PyObject *)__pyx_v_acora);
  __Pyx_DECREF(__pyx_v_f);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":477
 *         self.c_buffer_pos = self.c_buffer_end = <char*> self.buffer
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_5acora_6_acora_14_FileAcoraIter___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_14_FileAcoraIter___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":478
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":480
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef bytes buffer
 *         cdef char* c_buffer
 */

static PyObject *__pyx_pf_5acora_6_acora_14_FileAcoraIter___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5acora_6_acora_14_FileAcoraIter___next__(PyObject *__pyx_v_self) {
  char *__pyx_v_c_buffer;
  char *__pyx_v_data_end;
  int __pyx_v_error;
  int __pyx_v_found;
  Py_ssize_t __pyx_v_buffer_size;
  Py_ssize_t __pyx_v_bytes_read;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("__next__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":484
 *         cdef char* c_buffer
 *         cdef char* data_end
 *         cdef int error = 0, found = 0             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t buffer_size, bytes_read = 0
 *         if self.c_buffer_pos is NULL:
 */
  __pyx_v_error = 0;
  __pyx_v_found = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":485
 *         cdef char* data_end
 *         cdef int error = 0, found = 0
 *         cdef Py_ssize_t buffer_size, bytes_read = 0             # <<<<<<<<<<<<<<
 *         if self.c_buffer_pos is NULL:
 *             raise StopIteration
 */
  __pyx_v_bytes_read = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":486
 *         cdef int error = 0, found = 0
 *         cdef Py_ssize_t buffer_size, bytes_read = 0
 *         if self.c_buffer_pos is NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         if self.current_node.matches is not NULL:
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos == NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":487
 *         cdef Py_ssize_t buffer_size, bytes_read = 0
 *         if self.c_buffer_pos is NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         if self.current_node.matches is not NULL:
 *             if self.current_node.matches[self.match_index] is not NULL:
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":488
 *         if self.c_buffer_pos is NULL:
 *             raise StopIteration
 *         if self.current_node.matches is not NULL:             # <<<<<<<<<<<<<<
 *             if self.current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->current_node->matches != NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":489
 *             raise StopIteration
 *         if self.current_node.matches is not NULL:
 *             if self.current_node.matches[self.match_index] is not NULL:             # <<<<<<<<<<<<<<
 *                 return self._build_next_match()
 *             self.match_index = 0
 */
    __pyx_t_1 = ((((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->current_node->matches[((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->match_index]) != NULL);
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":490
 *         if self.current_node.matches is not NULL:
 *             if self.current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()             # <<<<<<<<<<<<<<
 *             self.match_index = 0
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_5acora_6_acora__FileAcoraIter *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->__pyx_vtab)->_build_next_match(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":491
 *             if self.current_node.matches[self.match_index] is not NULL:
 *                 return self._build_next_match()
 *             self.match_index = 0             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = len(self.buffer)
 */
    ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->match_index = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":493
 *             self.match_index = 0
 * 
 *         buffer_size = len(self.buffer)             # <<<<<<<<<<<<<<
 *         c_buffer = <char*> self.buffer
 *         if self.c_file != -1:
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_buffer_size = __pyx_t_3;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":494
 * 
 *         buffer_size = len(self.buffer)
 *         c_buffer = <char*> self.buffer             # <<<<<<<<<<<<<<
 *         if self.c_file != -1:
 *             with nogil:
 */
  __pyx_t_4 = __Pyx_PyBytes_AsString(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_buffer = ((char *)__pyx_t_4);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":495
 *         buffer_size = len(self.buffer)
 *         c_buffer = <char*> self.buffer
 *         if self.c_file != -1:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 found = _find_next_match_in_cfile(
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_file != -1);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":496
 *         c_buffer = <char*> self.buffer
 *         if self.c_file != -1:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 found = _find_next_match_in_cfile(
 *                     self.c_file, c_buffer, buffer_size, self.start_node,
 */
    { PyThreadState *_save;
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":500
 *                     self.c_file, c_buffer, buffer_size, self.start_node,
 *                     &self.c_buffer_pos, &self.c_buffer_end,
 *                     &self.buffer_offset_count, &self.current_node, &error)             # <<<<<<<<<<<<<<
 *             if error:
 *                 python_exc.PyErr_SetFromErrno(IOError)
 */
        __pyx_v_found = __pyx_f_5acora_6_acora__find_next_match_in_cfile(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_file, __pyx_v_c_buffer, __pyx_v_buffer_size, ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->start_node, (&((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos), (&((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_end), (&((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer_offset_count), (&((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->current_node), (&__pyx_v_error));
      }
      /*finally:*/ {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":496
 *         c_buffer = <char*> self.buffer
 *         if self.c_file != -1:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 found = _find_next_match_in_cfile(
 *                     self.c_file, c_buffer, buffer_size, self.start_node,
 */
        Py_BLOCK_THREADS
      }
    }

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":501
 *                     &self.c_buffer_pos, &self.c_buffer_end,
 *                     &self.buffer_offset_count, &self.current_node, &error)
 *             if error:             # <<<<<<<<<<<<<<
 *                 python_exc.PyErr_SetFromErrno(IOError)
 *         else:
 */
    __pyx_t_5 = __pyx_v_error;
    if (__pyx_t_5) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":502
 *                     &self.buffer_offset_count, &self.current_node, &error)
 *             if error:
 *                 python_exc.PyErr_SetFromErrno(IOError)             # <<<<<<<<<<<<<<
 *         else:
 *             data_end = c_buffer + buffer_size
 */
      __pyx_t_6 = PyErr_SetFromErrno(__pyx_builtin_IOError); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":504
 *                 python_exc.PyErr_SetFromErrno(IOError)
 *         else:
 *             data_end = c_buffer + buffer_size             # <<<<<<<<<<<<<<
 *             while not found:
 *                 if self.c_buffer_pos >= data_end:
 */
    __pyx_v_data_end = (__pyx_v_c_buffer + __pyx_v_buffer_size);

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":505
 *         else:
 *             data_end = c_buffer + buffer_size
 *             while not found:             # <<<<<<<<<<<<<<
 *                 if self.c_buffer_pos >= data_end:
 *                     self.buffer_offset_count += buffer_size
 */
    while (1) {
      __pyx_t_1 = (!__pyx_v_found);
      if (!__pyx_t_1) break;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":506
 *             data_end = c_buffer + buffer_size
 *             while not found:
 *                 if self.c_buffer_pos >= data_end:             # <<<<<<<<<<<<<<
 *                     self.buffer_offset_count += buffer_size
 *                     self.buffer = self.f.read(self.read_size)
 */
      __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos >= __pyx_v_data_end);
      if (__pyx_t_1) {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":507
 *             while not found:
 *                 if self.c_buffer_pos >= data_end:
 *                     self.buffer_offset_count += buffer_size             # <<<<<<<<<<<<<<
 *                     self.buffer = self.f.read(self.read_size)
 *                     buffer_size = len(self.buffer)
 */
        ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer_offset_count += __pyx_v_buffer_size;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":508
 *                 if self.c_buffer_pos >= data_end:
 *                     self.buffer_offset_count += buffer_size
 *                     self.buffer = self.f.read(self.read_size)             # <<<<<<<<<<<<<<
 *                     buffer_size = len(self.buffer)
 *                     if buffer_size == 0:
 */
        __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->f, __pyx_n_s__read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyInt_FromSsize_t(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->read_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer);
        __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer));
        ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer = ((PyObject *)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":509
 *                     self.buffer_offset_count += buffer_size
 *                     self.buffer = self.f.read(self.read_size)
 *                     buffer_size = len(self.buffer)             # <<<<<<<<<<<<<<
 *                     if buffer_size == 0:
 *                         self.c_buffer_pos = NULL
 */
        __pyx_t_3 = PyObject_Length(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_buffer_size = __pyx_t_3;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":510
 *                     self.buffer = self.f.read(self.read_size)
 *                     buffer_size = len(self.buffer)
 *                     if buffer_size == 0:             # <<<<<<<<<<<<<<
 *                         self.c_buffer_pos = NULL
 *                         break
 */
        __pyx_t_1 = (__pyx_v_buffer_size == 0);
        if (__pyx_t_1) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":511
 *                     buffer_size = len(self.buffer)
 *                     if buffer_size == 0:
 *                         self.c_buffer_pos = NULL             # <<<<<<<<<<<<<<
 *                         break
 *                     c_buffer = self.c_buffer_pos = <char*> self.buffer
 */
          ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos = NULL;

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":512
 *                     if buffer_size == 0:
 *                         self.c_buffer_pos = NULL
 *                         break             # <<<<<<<<<<<<<<
 *                     c_buffer = self.c_buffer_pos = <char*> self.buffer
 *                     data_end = c_buffer + buffer_size
 */
          goto __pyx_L14_break;
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":513
 *                         self.c_buffer_pos = NULL
 *                         break
 *                     c_buffer = self.c_buffer_pos = <char*> self.buffer             # <<<<<<<<<<<<<<
 *                     data_end = c_buffer + buffer_size
 *                 with nogil:
 */
        __pyx_t_4 = __Pyx_PyBytes_AsString(((PyObject *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->buffer)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = ((char *)__pyx_t_4);
        __pyx_v_c_buffer = __pyx_t_9;
        ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos = __pyx_t_9;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":514
 *                         break
 *                     c_buffer = self.c_buffer_pos = <char*> self.buffer
 *                     data_end = c_buffer + buffer_size             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     found = _search_in_bytes(
 */
        __pyx_v_data_end = (__pyx_v_c_buffer + __pyx_v_buffer_size);
        goto __pyx_L15;
      }
      __pyx_L15:;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":515
 *                     c_buffer = self.c_buffer_pos = <char*> self.buffer
 *                     data_end = c_buffer + buffer_size
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     found = _search_in_bytes(
 *                         self.start_node, data_end,
 */
      { PyThreadState *_save;
        Py_UNBLOCK_THREADS
        /*try:*/ {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":518
 *                     found = _search_in_bytes(
 *                         self.start_node, data_end,
 *                         &self.c_buffer_pos, &self.current_node)             # <<<<<<<<<<<<<<
 *         if self.c_buffer_pos is NULL:
 *             if self.close_file:
 */
          __pyx_v_found = __pyx_f_5acora_6_acora__search_in_bytes(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->start_node, __pyx_v_data_end, (&((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos), (&((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->current_node));
        }
        /*finally:*/ {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":515
 *                     c_buffer = self.c_buffer_pos = <char*> self.buffer
 *                     data_end = c_buffer + buffer_size
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     found = _search_in_bytes(
 *                         self.start_node, data_end,
 */
          Py_BLOCK_THREADS
        }
      }
    }
    __pyx_L14_break:;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":519
 *                         self.start_node, data_end,
 *                         &self.c_buffer_pos, &self.current_node)
 *         if self.c_buffer_pos is NULL:             # <<<<<<<<<<<<<<
 *             if self.close_file:
 *                 self.f.close()
 */
  __pyx_t_1 = (((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->c_buffer_pos == NULL);
  if (__pyx_t_1) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":520
 *                         &self.c_buffer_pos, &self.current_node)
 *         if self.c_buffer_pos is NULL:
 *             if self.close_file:             # <<<<<<<<<<<<<<
 *                 self.f.close()
 *         elif found:
 */
    __pyx_t_1 = ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->close_file;
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":521
 *         if self.c_buffer_pos is NULL:
 *             if self.close_file:
 *                 self.f.close()             # <<<<<<<<<<<<<<
 *         elif found:
 *             return self._build_next_match()
 */
      __pyx_t_7 = PyObject_GetAttr(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->f, __pyx_n_s__close); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L23;
    }
    __pyx_L23:;
    goto __pyx_L22;
  }

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":522
 *             if self.close_file:
 *                 self.f.close()
 *         elif found:             # <<<<<<<<<<<<<<
 *             return self._build_next_match()
 *         raise StopIteration
 */
  __pyx_t_5 = __pyx_v_found;
  if (__pyx_t_5) {

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":523
 *                 self.f.close()
 *         elif found:
 *             return self._build_next_match()             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = ((struct __pyx_vtabstruct_5acora_6_acora__FileAcoraIter *)((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)->__pyx_vtab)->_build_next_match(((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L22;
  }
  __pyx_L22:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":524
 *         elif found:
 *             return self._build_next_match()
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef _build_next_match(self):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("acora._acora._FileAcoraIter.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":526
 *         raise StopIteration
 * 
 *     cdef _build_next_match(self):             # <<<<<<<<<<<<<<
 *         match = <bytes> self.current_node.matches[self.match_index]
 *         self.match_index += 1
 */

static  PyObject *__pyx_f_5acora_6_acora_14_FileAcoraIter__build_next_match(struct __pyx_obj_5acora_6_acora__FileAcoraIter *__pyx_v_self) {
  PyObject *__pyx_v_match;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_build_next_match");
  __pyx_v_match = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":527
 * 
 *     cdef _build_next_match(self):
 *         match = <bytes> self.current_node.matches[self.match_index]             # <<<<<<<<<<<<<<
 *         self.match_index += 1
 *         return (match, self.buffer_offset_count + (
 */
  __pyx_t_1 = (__pyx_v_self->current_node->matches[__pyx_v_self->match_index]);
  __Pyx_INCREF(((PyObject *)((PyObject *)__pyx_t_1)));
  __Pyx_DECREF(__pyx_v_match);
  __pyx_v_match = ((PyObject *)__pyx_t_1);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":528
 *     cdef _build_next_match(self):
 *         match = <bytes> self.current_node.matches[self.match_index]
 *         self.match_index += 1             # <<<<<<<<<<<<<<
 *         return (match, self.buffer_offset_count + (
 *                 self.c_buffer_pos - (<char*> self.buffer)) - len(match))
 */
  __pyx_v_self->match_index += 1;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":529
 *         match = <bytes> self.current_node.matches[self.match_index]
 *         self.match_index += 1
 *         return (match, self.buffer_offset_count + (             # <<<<<<<<<<<<<<
 *                 self.c_buffer_pos - (<char*> self.buffer)) - len(match))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":530
 *         self.match_index += 1
 *         return (match, self.buffer_offset_count + (
 *                 self.c_buffer_pos - (<char*> self.buffer)) - len(match))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_self->buffer)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Length(__pyx_v_match); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyInt_FromSsize_t(((__pyx_v_self->buffer_offset_count + (__pyx_v_self->c_buffer_pos - ((char *)__pyx_t_2))) - __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_match);
  __Pyx_GIVEREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_AddTraceback("acora._acora._FileAcoraIter._build_next_match");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":533
 * 
 * 
 * cdef int _find_next_match_in_cfile(int c_file, char* c_buffer, size_t buffer_size,             # <<<<<<<<<<<<<<
 *                                    _AcoraBytesNodeStruct* start_node,
 *                                    char** _buffer_pos, char** _buffer_end,
 */

static  int __pyx_f_5acora_6_acora__find_next_match_in_cfile(int __pyx_v_c_file, char *__pyx_v_c_buffer, size_t __pyx_v_buffer_size, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_start_node, char **__pyx_v__buffer_pos, char **__pyx_v__buffer_end, Py_ssize_t *__pyx_v__buffer_offset_count, __pyx_t_5acora_6_acora__AcoraBytesNodeStruct **__pyx_v__current_node, int *__pyx_v_error) {
  char *__pyx_v_buffer_pos;
  char *__pyx_v_buffer_end;
  char *__pyx_v_data_end;
  Py_ssize_t __pyx_v_buffer_offset_count;
  __pyx_t_5acora_6_acora__AcoraBytesNodeStruct *__pyx_v_current_node;
  int __pyx_v_found;
  Py_ssize_t __pyx_v_bytes_read;
  int __pyx_r;
  int __pyx_t_1;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":539
 *                                    _AcoraBytesNodeStruct** _current_node,
 *                                    int* error) nogil:
 *     cdef char* buffer_pos = _buffer_pos[0]             # <<<<<<<<<<<<<<
 *     cdef char* buffer_end = _buffer_end[0]
 *     cdef char* data_end = c_buffer + buffer_size
 */
  __pyx_v_buffer_pos = (__pyx_v__buffer_pos[0]);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":540
 *                                    int* error) nogil:
 *     cdef char* buffer_pos = _buffer_pos[0]
 *     cdef char* buffer_end = _buffer_end[0]             # <<<<<<<<<<<<<<
 *     cdef char* data_end = c_buffer + buffer_size
 *     cdef Py_ssize_t buffer_offset_count = _buffer_offset_count[0]
 */
  __pyx_v_buffer_end = (__pyx_v__buffer_end[0]);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":541
 *     cdef char* buffer_pos = _buffer_pos[0]
 *     cdef char* buffer_end = _buffer_end[0]
 *     cdef char* data_end = c_buffer + buffer_size             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t buffer_offset_count = _buffer_offset_count[0]
 *     cdef _AcoraBytesNodeStruct* current_node = _current_node[0]
 */
  __pyx_v_data_end = (__pyx_v_c_buffer + __pyx_v_buffer_size);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":542
 *     cdef char* buffer_end = _buffer_end[0]
 *     cdef char* data_end = c_buffer + buffer_size
 *     cdef Py_ssize_t buffer_offset_count = _buffer_offset_count[0]             # <<<<<<<<<<<<<<
 *     cdef _AcoraBytesNodeStruct* current_node = _current_node[0]
 *     cdef int found = 0
 */
  __pyx_v_buffer_offset_count = (__pyx_v__buffer_offset_count[0]);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":543
 *     cdef char* data_end = c_buffer + buffer_size
 *     cdef Py_ssize_t buffer_offset_count = _buffer_offset_count[0]
 *     cdef _AcoraBytesNodeStruct* current_node = _current_node[0]             # <<<<<<<<<<<<<<
 *     cdef int found = 0
 *     cdef Py_ssize_t bytes_read
 */
  __pyx_v_current_node = (__pyx_v__current_node[0]);

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":544
 *     cdef Py_ssize_t buffer_offset_count = _buffer_offset_count[0]
 *     cdef _AcoraBytesNodeStruct* current_node = _current_node[0]
 *     cdef int found = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t bytes_read
 * 
 */
  __pyx_v_found = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":547
 *     cdef Py_ssize_t bytes_read
 * 
 *     while not found:             # <<<<<<<<<<<<<<
 *         if buffer_pos >= buffer_end:
 *             buffer_offset_count += buffer_end - c_buffer
 */
  while (1) {
    __pyx_t_1 = (!__pyx_v_found);
    if (!__pyx_t_1) break;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":548
 * 
 *     while not found:
 *         if buffer_pos >= buffer_end:             # <<<<<<<<<<<<<<
 *             buffer_offset_count += buffer_end - c_buffer
 *             bytes_read = read(c_file, c_buffer, buffer_size)
 */
    __pyx_t_1 = (__pyx_v_buffer_pos >= __pyx_v_buffer_end);
    if (__pyx_t_1) {

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":549
 *     while not found:
 *         if buffer_pos >= buffer_end:
 *             buffer_offset_count += buffer_end - c_buffer             # <<<<<<<<<<<<<<
 *             bytes_read = read(c_file, c_buffer, buffer_size)
 *             if bytes_read <= 0:
 */
      __pyx_v_buffer_offset_count += (__pyx_v_buffer_end - __pyx_v_c_buffer);

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":550
 *         if buffer_pos >= buffer_end:
 *             buffer_offset_count += buffer_end - c_buffer
 *             bytes_read = read(c_file, c_buffer, buffer_size)             # <<<<<<<<<<<<<<
 *             if bytes_read <= 0:
 *                 if bytes_read < 0:
 */
      __pyx_v_bytes_read = read(__pyx_v_c_file, __pyx_v_c_buffer, __pyx_v_buffer_size);

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":551
 *             buffer_offset_count += buffer_end - c_buffer
 *             bytes_read = read(c_file, c_buffer, buffer_size)
 *             if bytes_read <= 0:             # <<<<<<<<<<<<<<
 *                 if bytes_read < 0:
 *                     error[0] = 1
 */
      __pyx_t_1 = (__pyx_v_bytes_read <= 0);
      if (__pyx_t_1) {

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":552
 *             bytes_read = read(c_file, c_buffer, buffer_size)
 *             if bytes_read <= 0:
 *                 if bytes_read < 0:             # <<<<<<<<<<<<<<
 *                     error[0] = 1
 *                 buffer_pos = NULL
 */
        __pyx_t_1 = (__pyx_v_bytes_read < 0);
        if (__pyx_t_1) {

          /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":553
 *             if bytes_read <= 0:
 *                 if bytes_read < 0:
 *                     error[0] = 1             # <<<<<<<<<<<<<<
 *                 buffer_pos = NULL
 *                 break
 */
          (__pyx_v_error[0]) = 1;
          goto __pyx_L7;
        }
        __pyx_L7:;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":554
 *                 if bytes_read < 0:
 *                     error[0] = 1
 *                 buffer_pos = NULL             # <<<<<<<<<<<<<<
 *                 break
 *             buffer_pos = c_buffer
 */
        __pyx_v_buffer_pos = NULL;

        /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":555
 *                     error[0] = 1
 *                 buffer_pos = NULL
 *                 break             # <<<<<<<<<<<<<<
 *             buffer_pos = c_buffer
 *             buffer_end = c_buffer + bytes_read
 */
        goto __pyx_L4_break;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":556
 *                 buffer_pos = NULL
 *                 break
 *             buffer_pos = c_buffer             # <<<<<<<<<<<<<<
 *             buffer_end = c_buffer + bytes_read
 * 
 */
      __pyx_v_buffer_pos = __pyx_v_c_buffer;

      /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":557
 *                 break
 *             buffer_pos = c_buffer
 *             buffer_end = c_buffer + bytes_read             # <<<<<<<<<<<<<<
 * 
 *         found = _search_in_bytes(
 */
      __pyx_v_buffer_end = (__pyx_v_c_buffer + __pyx_v_bytes_read);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":560
 * 
 *         found = _search_in_bytes(
 *             start_node, buffer_end, &buffer_pos, &current_node)             # <<<<<<<<<<<<<<
 * 
 *     _current_node[0] = current_node
 */
    __pyx_v_found = __pyx_f_5acora_6_acora__search_in_bytes(__pyx_v_start_node, __pyx_v_buffer_end, (&__pyx_v_buffer_pos), (&__pyx_v_current_node));
  }
  __pyx_L4_break:;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":562
 *             start_node, buffer_end, &buffer_pos, &current_node)
 * 
 *     _current_node[0] = current_node             # <<<<<<<<<<<<<<
 *     _buffer_offset_count[0] = buffer_offset_count
 *     _buffer_pos[0] = buffer_pos
 */
  (__pyx_v__current_node[0]) = __pyx_v_current_node;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":563
 * 
 *     _current_node[0] = current_node
 *     _buffer_offset_count[0] = buffer_offset_count             # <<<<<<<<<<<<<<
 *     _buffer_pos[0] = buffer_pos
 *     _buffer_end[0] = buffer_end
 */
  (__pyx_v__buffer_offset_count[0]) = __pyx_v_buffer_offset_count;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":564
 *     _current_node[0] = current_node
 *     _buffer_offset_count[0] = buffer_offset_count
 *     _buffer_pos[0] = buffer_pos             # <<<<<<<<<<<<<<
 *     _buffer_end[0] = buffer_end
 *     return found
 */
  (__pyx_v__buffer_pos[0]) = __pyx_v_buffer_pos;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":565
 *     _buffer_offset_count[0] = buffer_offset_count
 *     _buffer_pos[0] = buffer_pos
 *     _buffer_end[0] = buffer_end             # <<<<<<<<<<<<<<
 *     return found
 */
  (__pyx_v__buffer_end[0]) = __pyx_v_buffer_end;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":566
 *     _buffer_pos[0] = buffer_pos
 *     _buffer_end[0] = buffer_end
 *     return found             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_found;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}
static struct __pyx_vtabstruct_5acora_6_acora_UnicodeAcora __pyx_vtable_5acora_6_acora_UnicodeAcora;

static PyObject *__pyx_tp_new_5acora_6_acora_UnicodeAcora(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5acora_6_acora_UnicodeAcora *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)o);
  p->__pyx_vtab = __pyx_vtabptr_5acora_6_acora_UnicodeAcora;
  p->_pyrefs = ((PyObject *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_5acora_6_acora_12UnicodeAcora___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5acora_6_acora_UnicodeAcora(PyObject *o) {
  struct __pyx_obj_5acora_6_acora_UnicodeAcora *p = (struct __pyx_obj_5acora_6_acora_UnicodeAcora *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5acora_6_acora_12UnicodeAcora___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->_pyrefs));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5acora_6_acora_UnicodeAcora(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5acora_6_acora_UnicodeAcora *p = (struct __pyx_obj_5acora_6_acora_UnicodeAcora *)o;
  if (p->_pyrefs) {
    e = (*v)(p->_pyrefs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5acora_6_acora_UnicodeAcora(PyObject *o) {
  struct __pyx_obj_5acora_6_acora_UnicodeAcora *p = (struct __pyx_obj_5acora_6_acora_UnicodeAcora *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_pyrefs);
  p->_pyrefs = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_5acora_6_acora_UnicodeAcora[] = {
  {__Pyx_NAMESTR("finditer"), (PyCFunction)__pyx_pf_5acora_6_acora_12UnicodeAcora_finditer, METH_O, __Pyx_DOCSTR(__pyx_doc_5acora_6_acora_12UnicodeAcora_finditer)},
  {__Pyx_NAMESTR("findall"), (PyCFunction)__pyx_pf_5acora_6_acora_12UnicodeAcora_findall, METH_O, __Pyx_DOCSTR(__pyx_doc_5acora_6_acora_12UnicodeAcora_findall)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_UnicodeAcora = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  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
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_UnicodeAcora = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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_UnicodeAcora = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_UnicodeAcora = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_5acora_6_acora_UnicodeAcora = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("acora._acora.UnicodeAcora"), /*tp_name*/
  sizeof(struct __pyx_obj_5acora_6_acora_UnicodeAcora), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5acora_6_acora_UnicodeAcora, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_UnicodeAcora, /*tp_as_number*/
  &__pyx_tp_as_sequence_UnicodeAcora, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_UnicodeAcora, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_UnicodeAcora, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Acora search engine for unicode data.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5acora_6_acora_UnicodeAcora, /*tp_traverse*/
  __pyx_tp_clear_5acora_6_acora_UnicodeAcora, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5acora_6_acora_UnicodeAcora, /*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_5acora_6_acora_UnicodeAcora, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter __pyx_vtable_5acora_6_acora__UnicodeAcoraIter;

static PyObject *__pyx_tp_new_5acora_6_acora__UnicodeAcoraIter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)o);
  p->__pyx_vtab = __pyx_vtabptr_5acora_6_acora__UnicodeAcoraIter;
  p->data = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->acora = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5acora_6_acora__UnicodeAcoraIter(PyObject *o) {
  struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *p = (struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)o;
  Py_XDECREF(((PyObject *)p->data));
  Py_XDECREF(((PyObject *)p->acora));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5acora_6_acora__UnicodeAcoraIter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *p = (struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)o;
  if (p->data) {
    e = (*v)(p->data, a); if (e) return e;
  }
  if (p->acora) {
    e = (*v)(((PyObject*)p->acora), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5acora_6_acora__UnicodeAcoraIter(PyObject *o) {
  struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *p = (struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->data);
  p->data = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->acora);
  p->acora = ((struct __pyx_obj_5acora_6_acora_UnicodeAcora *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_5acora_6_acora__UnicodeAcoraIter[] = {
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__UnicodeAcoraIter = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  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
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__UnicodeAcoraIter = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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__UnicodeAcoraIter = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__UnicodeAcoraIter = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_5acora_6_acora__UnicodeAcoraIter = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("acora._acora._UnicodeAcoraIter"), /*tp_name*/
  sizeof(struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5acora_6_acora__UnicodeAcoraIter, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__UnicodeAcoraIter, /*tp_as_number*/
  &__pyx_tp_as_sequence__UnicodeAcoraIter, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__UnicodeAcoraIter, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__UnicodeAcoraIter, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5acora_6_acora__UnicodeAcoraIter, /*tp_traverse*/
  __pyx_tp_clear_5acora_6_acora__UnicodeAcoraIter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___iter__, /*tp_iter*/
  __pyx_pf_5acora_6_acora_17_UnicodeAcoraIter___next__, /*tp_iternext*/
  __pyx_methods_5acora_6_acora__UnicodeAcoraIter, /*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_5acora_6_acora__UnicodeAcoraIter, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5acora_6_acora__BisectUnicodeAcoraIter __pyx_vtable_5acora_6_acora__BisectUnicodeAcoraIter;

static PyObject *__pyx_tp_new_5acora_6_acora__BisectUnicodeAcoraIter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *p;
  PyObject *o = __pyx_tp_new_5acora_6_acora__UnicodeAcoraIter(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5acora_6_acora__UnicodeAcoraIter*)__pyx_vtabptr_5acora_6_acora__BisectUnicodeAcoraIter;
  return o;
}

static struct PyMethodDef __pyx_methods_5acora_6_acora__BisectUnicodeAcoraIter[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5acora_6_acora_23_BisectUnicodeAcoraIter___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BisectUnicodeAcoraIter = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  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
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__BisectUnicodeAcoraIter = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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__BisectUnicodeAcoraIter = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__BisectUnicodeAcoraIter = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_5acora_6_acora__BisectUnicodeAcoraIter = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("acora._acora._BisectUnicodeAcoraIter"), /*tp_name*/
  sizeof(struct __pyx_obj_5acora_6_acora__BisectUnicodeAcoraIter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5acora_6_acora__UnicodeAcoraIter, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__BisectUnicodeAcoraIter, /*tp_as_number*/
  &__pyx_tp_as_sequence__BisectUnicodeAcoraIter, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__BisectUnicodeAcoraIter, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__BisectUnicodeAcoraIter, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5acora_6_acora__UnicodeAcoraIter, /*tp_traverse*/
  __pyx_tp_clear_5acora_6_acora__UnicodeAcoraIter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  __pyx_pf_5acora_6_acora_23_BisectUnicodeAcoraIter___next__, /*tp_iternext*/
  __pyx_methods_5acora_6_acora__BisectUnicodeAcoraIter, /*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_5acora_6_acora__BisectUnicodeAcoraIter, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5acora_6_acora_BytesAcora __pyx_vtable_5acora_6_acora_BytesAcora;

static PyObject *__pyx_tp_new_5acora_6_acora_BytesAcora(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5acora_6_acora_BytesAcora *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)o);
  p->__pyx_vtab = __pyx_vtabptr_5acora_6_acora_BytesAcora;
  p->_pyrefs = ((PyObject *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_5acora_6_acora_10BytesAcora___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5acora_6_acora_BytesAcora(PyObject *o) {
  struct __pyx_obj_5acora_6_acora_BytesAcora *p = (struct __pyx_obj_5acora_6_acora_BytesAcora *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5acora_6_acora_10BytesAcora___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->_pyrefs));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5acora_6_acora_BytesAcora(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5acora_6_acora_BytesAcora *p = (struct __pyx_obj_5acora_6_acora_BytesAcora *)o;
  if (p->_pyrefs) {
    e = (*v)(p->_pyrefs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5acora_6_acora_BytesAcora(PyObject *o) {
  struct __pyx_obj_5acora_6_acora_BytesAcora *p = (struct __pyx_obj_5acora_6_acora_BytesAcora *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_pyrefs);
  p->_pyrefs = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_5acora_6_acora_BytesAcora[] = {
  {__Pyx_NAMESTR("finditer"), (PyCFunction)__pyx_pf_5acora_6_acora_10BytesAcora_finditer, METH_O, __Pyx_DOCSTR(__pyx_doc_5acora_6_acora_10BytesAcora_finditer)},
  {__Pyx_NAMESTR("findall"), (PyCFunction)__pyx_pf_5acora_6_acora_10BytesAcora_findall, METH_O, __Pyx_DOCSTR(__pyx_doc_5acora_6_acora_10BytesAcora_findall)},
  {__Pyx_NAMESTR("filefind"), (PyCFunction)__pyx_pf_5acora_6_acora_10BytesAcora_filefind, METH_O, __Pyx_DOCSTR(__pyx_doc_5acora_6_acora_10BytesAcora_filefind)},
  {__Pyx_NAMESTR("filefindall"), (PyCFunction)__pyx_pf_5acora_6_acora_10BytesAcora_filefindall, METH_O, __Pyx_DOCSTR(__pyx_doc_5acora_6_acora_10BytesAcora_filefindall)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_BytesAcora = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  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
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_BytesAcora = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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_BytesAcora = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_BytesAcora = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_5acora_6_acora_BytesAcora = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("acora._acora.BytesAcora"), /*tp_name*/
  sizeof(struct __pyx_obj_5acora_6_acora_BytesAcora), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5acora_6_acora_BytesAcora, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_BytesAcora, /*tp_as_number*/
  &__pyx_tp_as_sequence_BytesAcora, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_BytesAcora, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_BytesAcora, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Acora search engine for byte data.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5acora_6_acora_BytesAcora, /*tp_traverse*/
  __pyx_tp_clear_5acora_6_acora_BytesAcora, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5acora_6_acora_BytesAcora, /*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_5acora_6_acora_BytesAcora, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5acora_6_acora__BytesAcoraIter __pyx_vtable_5acora_6_acora__BytesAcoraIter;

static PyObject *__pyx_tp_new_5acora_6_acora__BytesAcoraIter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5acora_6_acora__BytesAcoraIter *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)o);
  p->__pyx_vtab = __pyx_vtabptr_5acora_6_acora__BytesAcoraIter;
  p->data = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_5acora_6_acora_15_BytesAcoraIter___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5acora_6_acora__BytesAcoraIter(PyObject *o) {
  struct __pyx_obj_5acora_6_acora__BytesAcoraIter *p = (struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)o;
  Py_XDECREF(((PyObject *)p->data));
  Py_XDECREF(((PyObject *)p->acora));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5acora_6_acora__BytesAcoraIter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5acora_6_acora__BytesAcoraIter *p = (struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)o;
  if (p->data) {
    e = (*v)(p->data, a); if (e) return e;
  }
  if (p->acora) {
    e = (*v)(((PyObject*)p->acora), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5acora_6_acora__BytesAcoraIter(PyObject *o) {
  struct __pyx_obj_5acora_6_acora__BytesAcoraIter *p = (struct __pyx_obj_5acora_6_acora__BytesAcoraIter *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->data);
  p->data = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->acora);
  p->acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_5acora_6_acora__BytesAcoraIter[] = {
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_5acora_6_acora_15_BytesAcoraIter___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5acora_6_acora_15_BytesAcoraIter___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BytesAcoraIter = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  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
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__BytesAcoraIter = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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__BytesAcoraIter = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__BytesAcoraIter = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_5acora_6_acora__BytesAcoraIter = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("acora._acora._BytesAcoraIter"), /*tp_name*/
  sizeof(struct __pyx_obj_5acora_6_acora__BytesAcoraIter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5acora_6_acora__BytesAcoraIter, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__BytesAcoraIter, /*tp_as_number*/
  &__pyx_tp_as_sequence__BytesAcoraIter, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__BytesAcoraIter, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__BytesAcoraIter, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5acora_6_acora__BytesAcoraIter, /*tp_traverse*/
  __pyx_tp_clear_5acora_6_acora__BytesAcoraIter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_5acora_6_acora_15_BytesAcoraIter___iter__, /*tp_iter*/
  __pyx_pf_5acora_6_acora_15_BytesAcoraIter___next__, /*tp_iternext*/
  __pyx_methods_5acora_6_acora__BytesAcoraIter, /*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_5acora_6_acora__BytesAcoraIter, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5acora_6_acora__FileAcoraIter __pyx_vtable_5acora_6_acora__FileAcoraIter;

static PyObject *__pyx_tp_new_5acora_6_acora__FileAcoraIter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5acora_6_acora__FileAcoraIter *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5acora_6_acora__FileAcoraIter *)o);
  p->__pyx_vtab = __pyx_vtabptr_5acora_6_acora__FileAcoraIter;
  p->buffer = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->f = Py_None; Py_INCREF(Py_None);
  p->acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_5acora_6_acora_14_FileAcoraIter___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5acora_6_acora__FileAcoraIter(PyObject *o) {
  struct __pyx_obj_5acora_6_acora__FileAcoraIter *p = (struct __pyx_obj_5acora_6_acora__FileAcoraIter *)o;
  Py_XDECREF(((PyObject *)p->buffer));
  Py_XDECREF(p->f);
  Py_XDECREF(((PyObject *)p->acora));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5acora_6_acora__FileAcoraIter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5acora_6_acora__FileAcoraIter *p = (struct __pyx_obj_5acora_6_acora__FileAcoraIter *)o;
  if (p->buffer) {
    e = (*v)(p->buffer, a); if (e) return e;
  }
  if (p->f) {
    e = (*v)(p->f, a); if (e) return e;
  }
  if (p->acora) {
    e = (*v)(((PyObject*)p->acora), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5acora_6_acora__FileAcoraIter(PyObject *o) {
  struct __pyx_obj_5acora_6_acora__FileAcoraIter *p = (struct __pyx_obj_5acora_6_acora__FileAcoraIter *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->buffer);
  p->buffer = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->f);
  p->f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->acora);
  p->acora = ((struct __pyx_obj_5acora_6_acora_BytesAcora *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_5acora_6_acora__FileAcoraIter[] = {
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_5acora_6_acora_14_FileAcoraIter___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5acora_6_acora_14_FileAcoraIter___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__FileAcoraIter = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  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
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__FileAcoraIter = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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__FileAcoraIter = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__FileAcoraIter = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_5acora_6_acora__FileAcoraIter = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("acora._acora._FileAcoraIter"), /*tp_name*/
  sizeof(struct __pyx_obj_5acora_6_acora__FileAcoraIter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5acora_6_acora__FileAcoraIter, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number__FileAcoraIter, /*tp_as_number*/
  &__pyx_tp_as_sequence__FileAcoraIter, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__FileAcoraIter, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__FileAcoraIter, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5acora_6_acora__FileAcoraIter, /*tp_traverse*/
  __pyx_tp_clear_5acora_6_acora__FileAcoraIter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_5acora_6_acora_14_FileAcoraIter___iter__, /*tp_iter*/
  __pyx_pf_5acora_6_acora_14_FileAcoraIter___next__, /*tp_iternext*/
  __pyx_methods_5acora_6_acora__FileAcoraIter, /*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_5acora_6_acora__FileAcoraIter, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_acora"),
    __Pyx_DOCSTR(__pyx_k_3), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_b_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0, 0},
  {&__pyx_kp_u_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0, 0},
  {&__pyx_kp_b_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0, 0},
  {&__pyx_kp_u_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 1, 0, 0},
  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
  {&__pyx_n_s__BytesAcora, __pyx_k__BytesAcora, sizeof(__pyx_k__BytesAcora), 0, 0, 1, 1},
  {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
  {&__pyx_n_s__PyMem_NoMemory, __pyx_k__PyMem_NoMemory, sizeof(__pyx_k__PyMem_NoMemory), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s__UnicodeAcora, __pyx_k__UnicodeAcora, sizeof(__pyx_k__UnicodeAcora), 0, 0, 1, 1},
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___build_next_match, __pyx_k___build_next_match, sizeof(__pyx_k___build_next_match), 0, 0, 1, 1},
  {&__pyx_n_s___pyrefs, __pyx_k___pyrefs, sizeof(__pyx_k___pyrefs), 0, 0, 1, 1},
  {&__pyx_n_s__acora, __pyx_k__acora, sizeof(__pyx_k__acora), 0, 0, 1, 1},
  {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
  {&__pyx_n_s__buffer_offset_count, __pyx_k__buffer_offset_count, sizeof(__pyx_k__buffer_offset_count), 0, 0, 1, 1},
  {&__pyx_n_s__buffer_size, __pyx_k__buffer_size, sizeof(__pyx_k__buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s__c_buffer_end, __pyx_k__c_buffer_end, sizeof(__pyx_k__c_buffer_end), 0, 0, 1, 1},
  {&__pyx_n_s__c_buffer_pos, __pyx_k__c_buffer_pos, sizeof(__pyx_k__c_buffer_pos), 0, 0, 1, 1},
  {&__pyx_n_s__c_file, __pyx_k__c_file, sizeof(__pyx_k__c_file), 0, 0, 1, 1},
  {&__pyx_n_s__char_count, __pyx_k__char_count, sizeof(__pyx_k__char_count), 0, 0, 1, 1},
  {&__pyx_n_s__characters, __pyx_k__characters, sizeof(__pyx_k__characters), 0, 0, 1, 1},
  {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
  {&__pyx_n_s__close_file, __pyx_k__close_file, sizeof(__pyx_k__close_file), 0, 0, 1, 1},
  {&__pyx_n_s__current_node, __pyx_k__current_node, sizeof(__pyx_k__current_node), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__data_char, __pyx_k__data_char, sizeof(__pyx_k__data_char), 0, 0, 1, 1},
  {&__pyx_n_s__data_end, __pyx_k__data_end, sizeof(__pyx_k__data_end), 0, 0, 1, 1},
  {&__pyx_n_s__data_start, __pyx_k__data_start, sizeof(__pyx_k__data_start), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
  {&__pyx_n_s__filefind, __pyx_k__filefind, sizeof(__pyx_k__filefind), 0, 0, 1, 1},
  {&__pyx_n_s__fileno, __pyx_k__fileno, sizeof(__pyx_k__fileno), 0, 0, 1, 1},
  {&__pyx_n_s__findall, __pyx_k__findall, sizeof(__pyx_k__findall), 0, 0, 1, 1},
  {&__pyx_n_s__finditer, __pyx_k__finditer, sizeof(__pyx_k__finditer), 0, 0, 1, 1},
  {&__pyx_n_s__has_large_nodes, __pyx_k__has_large_nodes, sizeof(__pyx_k__has_large_nodes), 0, 0, 1, 1},
  {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__match_index, __pyx_k__match_index, sizeof(__pyx_k__match_index), 0, 0, 1, 1},
  {&__pyx_n_s__matches, __pyx_k__matches, sizeof(__pyx_k__matches), 0, 0, 1, 1},
  {&__pyx_n_s__node_count, __pyx_k__node_count, sizeof(__pyx_k__node_count), 0, 0, 1, 1},
  {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
  {&__pyx_n_s__python_exc, __pyx_k__python_exc, sizeof(__pyx_k__python_exc), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__rb, __pyx_k__rb, sizeof(__pyx_k__rb), 0, 0, 1, 1},
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
  {&__pyx_n_s__read_size, __pyx_k__read_size, sizeof(__pyx_k__read_size), 0, 0, 1, 1},
  {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1},
  {&__pyx_n_s__start_node, __pyx_k__start_node, sizeof(__pyx_k__start_node), 0, 0, 1, 1},
  {&__pyx_n_s__start_state, __pyx_k__start_state, sizeof(__pyx_k__start_state), 0, 0, 1, 1},
  {&__pyx_n_s__targets, __pyx_k__targets, sizeof(__pyx_k__targets), 0, 0, 1, 1},
  {&__pyx_n_s__transitions, __pyx_k__transitions, sizeof(__pyx_k__transitions), 0, 0, 1, 1},
  {&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_open = __Pyx_GetName(__pyx_b, __pyx_n_s__open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_acora(void); /*proto*/
PyMODINIT_FUNC init_acora(void)
#else
PyMODINIT_FUNC PyInit__acora(void); /*proto*/
PyMODINIT_FUNC PyInit__acora(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __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");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__acora(void)", __LINE__, __FILE__);
  #endif
  __pyx_init_filenames();
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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 PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_acora"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_3), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_acora___acora) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5acora_6_acora_UnicodeAcora = &__pyx_vtable_5acora_6_acora_UnicodeAcora;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_5acora_6_acora_UnicodeAcora.finditer = (PyObject *(*)(struct __pyx_obj_5acora_6_acora_UnicodeAcora *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5acora_6_acora_12UnicodeAcora_finditer;
  #else
  *(void(**)(void))&__pyx_vtable_5acora_6_acora_UnicodeAcora.finditer = (void(*)(void))__pyx_f_5acora_6_acora_12UnicodeAcora_finditer;
  #endif
  if (PyType_Ready(&__pyx_type_5acora_6_acora_UnicodeAcora) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5acora_6_acora_UnicodeAcora.tp_dict, __pyx_vtabptr_5acora_6_acora_UnicodeAcora) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "UnicodeAcora", (PyObject *)&__pyx_type_5acora_6_acora_UnicodeAcora) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5acora_6_acora_UnicodeAcora = &__pyx_type_5acora_6_acora_UnicodeAcora;
  __pyx_vtabptr_5acora_6_acora__UnicodeAcoraIter = &__pyx_vtable_5acora_6_acora__UnicodeAcoraIter;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_5acora_6_acora__UnicodeAcoraIter._build_next_match = (PyObject *(*)(struct __pyx_obj_5acora_6_acora__UnicodeAcoraIter *))__pyx_f_5acora_6_acora_17_UnicodeAcoraIter__build_next_match;
  #else
  *(void(**)(void))&__pyx_vtable_5acora_6_acora__UnicodeAcoraIter._build_next_match = (void(*)(void))__pyx_f_5acora_6_acora_17_UnicodeAcoraIter__build_next_match;
  #endif
  if (PyType_Ready(&__pyx_type_5acora_6_acora__UnicodeAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5acora_6_acora__UnicodeAcoraIter.tp_dict, __pyx_vtabptr_5acora_6_acora__UnicodeAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_UnicodeAcoraIter", (PyObject *)&__pyx_type_5acora_6_acora__UnicodeAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5acora_6_acora__UnicodeAcoraIter = &__pyx_type_5acora_6_acora__UnicodeAcoraIter;
  __pyx_vtabptr_5acora_6_acora__BisectUnicodeAcoraIter = &__pyx_vtable_5acora_6_acora__BisectUnicodeAcoraIter;
  __pyx_vtable_5acora_6_acora__BisectUnicodeAcoraIter.__pyx_base = *__pyx_vtabptr_5acora_6_acora__UnicodeAcoraIter;
  __pyx_type_5acora_6_acora__BisectUnicodeAcoraIter.tp_base = __pyx_ptype_5acora_6_acora__UnicodeAcoraIter;
  if (PyType_Ready(&__pyx_type_5acora_6_acora__BisectUnicodeAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5acora_6_acora__BisectUnicodeAcoraIter.tp_dict, __pyx_vtabptr_5acora_6_acora__BisectUnicodeAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_BisectUnicodeAcoraIter", (PyObject *)&__pyx_type_5acora_6_acora__BisectUnicodeAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5acora_6_acora__BisectUnicodeAcoraIter = &__pyx_type_5acora_6_acora__BisectUnicodeAcoraIter;
  __pyx_vtabptr_5acora_6_acora_BytesAcora = &__pyx_vtable_5acora_6_acora_BytesAcora;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_5acora_6_acora_BytesAcora.finditer = (PyObject *(*)(struct __pyx_obj_5acora_6_acora_BytesAcora *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5acora_6_acora_10BytesAcora_finditer;
  #else
  *(void(**)(void))&__pyx_vtable_5acora_6_acora_BytesAcora.finditer = (void(*)(void))__pyx_f_5acora_6_acora_10BytesAcora_finditer;
  #endif
  if (PyType_Ready(&__pyx_type_5acora_6_acora_BytesAcora) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5acora_6_acora_BytesAcora.tp_dict, __pyx_vtabptr_5acora_6_acora_BytesAcora) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "BytesAcora", (PyObject *)&__pyx_type_5acora_6_acora_BytesAcora) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5acora_6_acora_BytesAcora = &__pyx_type_5acora_6_acora_BytesAcora;
  __pyx_vtabptr_5acora_6_acora__BytesAcoraIter = &__pyx_vtable_5acora_6_acora__BytesAcoraIter;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_5acora_6_acora__BytesAcoraIter._build_next_match = (PyObject *(*)(struct __pyx_obj_5acora_6_acora__BytesAcoraIter *))__pyx_f_5acora_6_acora_15_BytesAcoraIter__build_next_match;
  #else
  *(void(**)(void))&__pyx_vtable_5acora_6_acora__BytesAcoraIter._build_next_match = (void(*)(void))__pyx_f_5acora_6_acora_15_BytesAcoraIter__build_next_match;
  #endif
  if (PyType_Ready(&__pyx_type_5acora_6_acora__BytesAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5acora_6_acora__BytesAcoraIter.tp_dict, __pyx_vtabptr_5acora_6_acora__BytesAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_BytesAcoraIter", (PyObject *)&__pyx_type_5acora_6_acora__BytesAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5acora_6_acora__BytesAcoraIter = &__pyx_type_5acora_6_acora__BytesAcoraIter;
  __pyx_vtabptr_5acora_6_acora__FileAcoraIter = &__pyx_vtable_5acora_6_acora__FileAcoraIter;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_5acora_6_acora__FileAcoraIter._build_next_match = (PyObject *(*)(struct __pyx_obj_5acora_6_acora__FileAcoraIter *))__pyx_f_5acora_6_acora_14_FileAcoraIter__build_next_match;
  #else
  *(void(**)(void))&__pyx_vtable_5acora_6_acora__FileAcoraIter._build_next_match = (void(*)(void))__pyx_f_5acora_6_acora_14_FileAcoraIter__build_next_match;
  #endif
  if (PyType_Ready(&__pyx_type_5acora_6_acora__FileAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5acora_6_acora__FileAcoraIter.tp_dict, __pyx_vtabptr_5acora_6_acora__FileAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_FileAcoraIter", (PyObject *)&__pyx_type_5acora_6_acora__FileAcoraIter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5acora_6_acora__FileAcoraIter = &__pyx_type_5acora_6_acora__FileAcoraIter;
  /*--- Type import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":9
 * """
 * 
 * __all__ = ['BytesAcora', 'UnicodeAcora']             # <<<<<<<<<<<<<<
 * 
 * cimport stdio
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BytesAcora));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__BytesAcora));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BytesAcora));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__UnicodeAcora));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__UnicodeAcora));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__UnicodeAcora));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/sbehnel/source/Python/acora/acora/_acora.pyx":1
 * #cython: embedsignature=True             # <<<<<<<<<<<<<<
 * 
 * """A fast C implementation of the Acora search engine.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__UnicodeAcora); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__finditer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_4), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__UnicodeAcora); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__findall); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_5), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    __Pyx_AddTraceback("init acora._acora");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init acora._acora");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

static const char *__pyx_filenames[] = {
  "_acora.pyx",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
        #if PY_VERSION_HEX < 0x02050000
                 "need more than %d value%s to unpack", (int)index,
        #else
                 "need more than %zd value%s to unpack", index,
        #endif
                 (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) {
    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
}

static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            __Pyx_RaiseNeedMoreValuesError(index);
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_RaiseTooManyValuesError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

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_AS_STRING(kw_name));
        #endif
}

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 *number, *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";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

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;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    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;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}


static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}

static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    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_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            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;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    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)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX < 0x03010000
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#else
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #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_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

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  /* Python 3+ has unicode identifiers */
        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;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if ((x == Py_False) | (x == Py_None)) return 0;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  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 = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
