/* Generated by Cython 0.13pre on Thu Jul 22 23:54:49 2010 */

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

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

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

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#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 PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#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
#endif

#if PY_MAJOR_VERSION >= 3
  #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 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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE_API__re2
#include <string>
#include <map>
#include "stringpiece.h"
#include "re2.h"
#include "_re2macros.h"

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

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__)) 
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__)) 
# else
#   define CYTHON_UNUSED 
# 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 */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) 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);

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/axiak/Documents/pyre2/src/re2.pyx":140
 *         return self._groups[idx]
 * 
 *     cdef _makespan(self, int groupnum=0):             # <<<<<<<<<<<<<<
 *         cdef int start, end
 *         cdef _re2.StringPiece * piece
 */

struct __pyx_opt_args_3re2_5Match__makespan {
  int __pyx_n;
  int groupnum;
};

/* "/home/axiak/Documents/pyre2/src/re2.pyx":195
 * 
 * 
 * cdef class Pattern:             # <<<<<<<<<<<<<<
 *     cdef _re2.RE2 * pattern
 *     cdef int ngroups
 */

struct __pyx_obj_3re2_Pattern {
  PyObject_HEAD
  struct __pyx_vtabstruct_3re2_Pattern *__pyx_vtab;
  re2::RE2 *pattern;
  int ngroups;
  int encoded;
};

/* "/home/axiak/Documents/pyre2/src/re2.pyx":86
 * 
 * 
 * cdef class Match:             # <<<<<<<<<<<<<<
 *     cdef _re2.StringPiece * matches
 *     cdef _re2.const_stringintmap * named_groups
 */

struct __pyx_obj_3re2_Match {
  PyObject_HEAD
  struct __pyx_vtabstruct_3re2_Match *__pyx_vtab;
  re2::StringPiece *matches;
  const std::map<std::string, int> *named_groups;
  int encoded;
  PyObject *_lastgroup;
  int _lastindex;
  int nmatches;
  PyObject *match_string;
  PyObject *_groups;
  PyObject *_named_groups;
};


struct __pyx_vtabstruct_3re2_Match {
  PyObject *(*init_groups)(struct __pyx_obj_3re2_Match *);
  PyObject *(*_makespan)(struct __pyx_obj_3re2_Match *, struct __pyx_opt_args_3re2_5Match__makespan *__pyx_optional_args);
};
static struct __pyx_vtabstruct_3re2_Match *__pyx_vtabptr_3re2_Match;


/* "/home/axiak/Documents/pyre2/src/re2.pyx":195
 * 
 * 
 * cdef class Pattern:             # <<<<<<<<<<<<<<
 *     cdef _re2.RE2 * pattern
 *     cdef int ngroups
 */

struct __pyx_vtabstruct_3re2_Pattern {
  PyObject *(*_search)(struct __pyx_obj_3re2_Pattern *, PyObject *, int, int, RE2::Anchor);
  PyObject *(*_print_pattern)(struct __pyx_obj_3re2_Pattern *);
};
static struct __pyx_vtabstruct_3re2_Pattern *__pyx_vtabptr_3re2_Pattern;

#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 PyObject *__Pyx_GetName(PyObject *dict, PyObject *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 CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*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 PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}


#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
    }
    return r;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/

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

#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 int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*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 int __Pyx_PyInt_AsLongDouble(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 _re2 */

/* Module declarations from python_unicode */

/* Module declarations from re2 */

static PyTypeObject *__pyx_ptype_3re2_Match = 0;
static PyTypeObject *__pyx_ptype_3re2_Pattern = 0;
static int __pyx_v_3re2_current_notification;
static int __pyx_v_3re2__I;
static int __pyx_v_3re2__M;
static int __pyx_v_3re2__S;
static int __pyx_v_3re2__U;
static int __pyx_v_3re2__X;
static CYTHON_INLINE PyObject *__pyx_f_3re2_cpp_to_pystring(std::string); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_3re2_cpp_to_utf8(std::string); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_3re2_char_to_utf8(const char*, int); /*proto*/
static PyObject *__pyx_f_3re2_unicode_to_bytestring(PyObject *, int *); /*proto*/
static CYTHON_INLINE int __pyx_f_3re2_pystring_to_bytestring(PyObject *, char **, int *); /*proto*/
#define __Pyx_MODULE_NAME "re2"
int __pyx_module_is_main_re2 = 0;

/* Implementation of re2 */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_basestring;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_callable;
static PyObject *__pyx_builtin_NotImplementedError;
static char __pyx_k_1[] = "This function expects a valid notification level.";
static char __pyx_k_2[] = "no such group";
static char __pyx_k_3[] = "expected string or buffer";
static char __pyx_k_4[] = "NamedCapturingGroups";
static char __pyx_k_5[] = "\n";
static char __pyx_k_6[] = "So far pyre2 does not support custom replacement counts";
static char __pyx_k_7[] = "";
static char __pyx_k_8[] = "(?";
static char __pyx_k_9[] = ")";
static char __pyx_k_10[] = "first argument must be a string or compiled pattern";
static char __pyx_k_11[] = "WARNING: Using re module. Reason: %s";
static char __pyx_k_12[] = "NumberOfCapturingGroups";
static char __pyx_k_13[] = "\n    Some error has occured in compilation of the regex.\n    ";
static char __pyx_k_14[] = "set_fallback_notification (line 25)";
static char __pyx_k_15[] = "set_fallback_notification";
static char __pyx_k_16[] = "Pattern.search (line 235)";
static char __pyx_k_17[] = "Pattern.match (line 243)";
static char __pyx_k_18[] = "Pattern.findall (line 256)";
static char __pyx_k_19[] = "Pattern.finditer (line 300)";
static char __pyx_k_20[] = "Pattern.split (line 310)";
static char __pyx_k_21[] = "Pattern.sub (line 376)";
static char __pyx_k_22[] = "Pattern.subn (line 384)";
static char __pyx_k_23[] = "Pattern._subn_callback (line 425)";
static char __pyx_k_24[] = "compile (line 491)";
static char __pyx_k_25[] = "search (line 557)";
static char __pyx_k_26[] = "match (line 564)";
static char __pyx_k_27[] = "finditer (line 571)";
static char __pyx_k_28[] = "findall (line 580)";
static char __pyx_k_29[] = "split (line 589)";
static char __pyx_k_30[] = "sub (line 596)";
static char __pyx_k_31[] = "subn (line 607)";
static char __pyx_k__I[] = "I";
static char __pyx_k__M[] = "M";
static char __pyx_k__S[] = "S";
static char __pyx_k__U[] = "U";
static char __pyx_k__X[] = "X";
static char __pyx_k__m[] = "m";
static char __pyx_k__s[] = "s";
static char __pyx_k__ok[] = "ok";
static char __pyx_k__re[] = "re";
static char __pyx_k__end[] = "end";
static char __pyx_k__pos[] = "pos";
static char __pyx_k__sub[] = "sub";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__data[] = "data";
static char __pyx_k__join[] = "join";
static char __pyx_k__repl[] = "repl";
static char __pyx_k__subn[] = "subn";
static char __pyx_k__warn[] = "warn";
static char __pyx_k__Match[] = "Match";
static char __pyx_k__begin[] = "begin";
static char __pyx_k__c_str[] = "c_str";
static char __pyx_k__count[] = "count";
static char __pyx_k__error[] = "error";
static char __pyx_k__first[] = "first";
static char __pyx_k__flags[] = "flags";
static char __pyx_k__flush[] = "flush";
static char __pyx_k__match[] = "match";
static char __pyx_k__range[] = "range";
static char __pyx_k__split[] = "split";
static char __pyx_k__DOTALL[] = "DOTALL";
static char __pyx_k__endpos[] = "endpos";
static char __pyx_k__length[] = "length";
static char __pyx_k__search[] = "search";
static char __pyx_k__second[] = "second";
static char __pyx_k__stdout[] = "stdout";
static char __pyx_k__strict[] = "strict";
static char __pyx_k__string[] = "string";
static char __pyx_k__Pattern[] = "Pattern";
static char __pyx_k__UNICODE[] = "UNICODE";
static char __pyx_k__VERBOSE[] = "VERBOSE";
static char __pyx_k__VERSION[] = "VERSION";
static char __pyx_k___groups[] = "_groups";
static char __pyx_k___search[] = "_search";
static char __pyx_k__compile[] = "compile";
static char __pyx_k__encoded[] = "encoded";
static char __pyx_k__findall[] = "findall";
static char __pyx_k__matches[] = "matches";
static char __pyx_k__ngroups[] = "ngroups";
static char __pyx_k__pattern[] = "pattern";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__callable[] = "callable";
static char __pyx_k__callback[] = "callback";
static char __pyx_k__finditer[] = "finditer";
static char __pyx_k__groupnum[] = "groupnum";
static char __pyx_k__maxsplit[] = "maxsplit";
static char __pyx_k__nmatches[] = "nmatches";
static char __pyx_k__warnings[] = "warnings";
static char __pyx_k__MULTILINE[] = "MULTILINE";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k___makespan[] = "_makespan";
static char __pyx_k__groupdict[] = "groupdict";
static char __pyx_k__IGNORECASE[] = "IGNORECASE";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__RegexError[] = "RegexError";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k___lastgroup[] = "_lastgroup";
static char __pyx_k___lastindex[] = "_lastindex";
static char __pyx_k__basestring[] = "basestring";
static char __pyx_k__error_code[] = "error_code";
static char __pyx_k__VERSION_HEX[] = "VERSION_HEX";
static char __pyx_k__init_groups[] = "init_groups";
static char __pyx_k__match_string[] = "match_string";
static char __pyx_k__named_groups[] = "named_groups";
static char __pyx_k__set_encoding[] = "set_encoding";
static char __pyx_k___named_groups[] = "_named_groups";
static char __pyx_k___subn_callback[] = "_subn_callback";
static char __pyx_k__set_log_errors[] = "set_log_errors";
static char __pyx_k__FALLBACK_QUIETLY[] = "FALLBACK_QUIETLY";
static char __pyx_k__FALLBACK_WARNING[] = "FALLBACK_WARNING";
static char __pyx_k__FALLBACK_EXCEPTION[] = "FALLBACK_EXCEPTION";
static char __pyx_k__set_case_sensitive[] = "set_case_sensitive";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_n_s_12;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_u_14;
static PyObject *__pyx_n_s_15;
static PyObject *__pyx_kp_u_16;
static PyObject *__pyx_kp_u_17;
static PyObject *__pyx_kp_u_18;
static PyObject *__pyx_kp_u_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_u_20;
static PyObject *__pyx_kp_u_21;
static PyObject *__pyx_kp_u_22;
static PyObject *__pyx_kp_u_23;
static PyObject *__pyx_kp_u_24;
static PyObject *__pyx_kp_u_25;
static PyObject *__pyx_kp_u_26;
static PyObject *__pyx_kp_u_27;
static PyObject *__pyx_kp_u_28;
static PyObject *__pyx_kp_u_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_u_30;
static PyObject *__pyx_kp_u_31;
static PyObject *__pyx_n_s_4;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_u_7;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_n_s__DOTALL;
static PyObject *__pyx_n_s__FALLBACK_EXCEPTION;
static PyObject *__pyx_n_s__FALLBACK_QUIETLY;
static PyObject *__pyx_n_s__FALLBACK_WARNING;
static PyObject *__pyx_n_s__I;
static PyObject *__pyx_n_s__IGNORECASE;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__M;
static PyObject *__pyx_n_s__MULTILINE;
static PyObject *__pyx_n_s__Match;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__Pattern;
static PyObject *__pyx_n_s__RegexError;
static PyObject *__pyx_n_s__S;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__U;
static PyObject *__pyx_n_s__UNICODE;
static PyObject *__pyx_n_s__VERBOSE;
static PyObject *__pyx_n_s__VERSION;
static PyObject *__pyx_n_s__VERSION_HEX;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s__X;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___groups;
static PyObject *__pyx_n_s___lastgroup;
static PyObject *__pyx_n_s___lastindex;
static PyObject *__pyx_n_s___makespan;
static PyObject *__pyx_n_s___named_groups;
static PyObject *__pyx_n_s___search;
static PyObject *__pyx_n_s___subn_callback;
static PyObject *__pyx_n_s__basestring;
static PyObject *__pyx_n_s__begin;
static PyObject *__pyx_n_s__c_str;
static PyObject *__pyx_n_s__callable;
static PyObject *__pyx_n_s__callback;
static PyObject *__pyx_n_s__compile;
static PyObject *__pyx_n_s__count;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__encoded;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__endpos;
static PyObject *__pyx_n_s__error;
static PyObject *__pyx_n_s__error_code;
static PyObject *__pyx_n_s__findall;
static PyObject *__pyx_n_s__finditer;
static PyObject *__pyx_n_s__first;
static PyObject *__pyx_n_s__flags;
static PyObject *__pyx_n_s__flush;
static PyObject *__pyx_n_s__groupdict;
static PyObject *__pyx_n_s__groupnum;
static PyObject *__pyx_n_s__init_groups;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__m;
static PyObject *__pyx_n_s__match;
static PyObject *__pyx_n_s__match_string;
static PyObject *__pyx_n_s__matches;
static PyObject *__pyx_n_s__maxsplit;
static PyObject *__pyx_n_s__named_groups;
static PyObject *__pyx_n_s__ngroups;
static PyObject *__pyx_n_s__nmatches;
static PyObject *__pyx_n_s__ok;
static PyObject *__pyx_n_s__pattern;
static PyObject *__pyx_n_s__pos;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__re;
static PyObject *__pyx_n_s__repl;
static PyObject *__pyx_n_s__s;
static PyObject *__pyx_n_s__search;
static PyObject *__pyx_n_s__second;
static PyObject *__pyx_n_s__set_case_sensitive;
static PyObject *__pyx_n_s__set_encoding;
static PyObject *__pyx_n_s__set_log_errors;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__stdout;
static PyObject *__pyx_n_s__string;
static PyObject *__pyx_n_s__sub;
static PyObject *__pyx_n_s__subn;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__warn;
static PyObject *__pyx_n_s__warnings;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_0x000204;

/* "/home/axiak/Documents/pyre2/src/re2.pyx":25
 * cdef int current_notification = FALLBACK_WARNING
 * 
 * def set_fallback_notification(level):             # <<<<<<<<<<<<<<
 *     """
 *     Set the fallback notification to a level; one of:
 */

static PyObject *__pyx_pf_3re2_set_fallback_notification(PyObject *__pyx_self, PyObject *__pyx_v_level); /*proto*/
static char __pyx_doc_3re2_set_fallback_notification[] = "\n    Set the fallback notification to a level; one of:\n        FALLBACK_QUIETLY\n\tFALLBACK_WARNING\n\tFALLBACK_EXCEPTION\n    ";
static PyObject *__pyx_pf_3re2_set_fallback_notification(PyObject *__pyx_self, PyObject *__pyx_v_level) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("set_fallback_notification");
  __pyx_self = __pyx_self;
  __Pyx_INCREF(__pyx_v_level);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":33
 *     """
 *     global current_notification
 *     level = int(level)             # <<<<<<<<<<<<<<
 *     if level < 0 or level > 2:
 *         raise ValueError("This function expects a valid notification level.")
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_level);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_level);
  __Pyx_GIVEREF(__pyx_v_level);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_level);
  __pyx_v_level = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":34
 *     global current_notification
 *     level = int(level)
 *     if level < 0 or level > 2:             # <<<<<<<<<<<<<<
 *         raise ValueError("This function expects a valid notification level.")
 *     current_notification = level
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_level, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_level, __pyx_int_2, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":35
 *     level = int(level)
 *     if level < 0 or level > 2:
 *         raise ValueError("This function expects a valid notification level.")             # <<<<<<<<<<<<<<
 *     current_notification = level
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":36
 *     if level < 0 or level > 2:
 *         raise ValueError("This function expects a valid notification level.")
 *     current_notification = level             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_level); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_3re2_current_notification = __pyx_t_6;

  __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("re2.set_fallback_notification");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_level);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":52
 * import warnings
 * 
 * cdef inline object cpp_to_pystring(_re2.cpp_string input):             # <<<<<<<<<<<<<<
 *     # This function is a quick converter from a std::string object
 *     # to a python string. By taking the slice we go to the right size,
 */

static CYTHON_INLINE PyObject *__pyx_f_3re2_cpp_to_pystring(std::string __pyx_v_input) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cpp_to_pystring");

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":56
 *     # to a python string. By taking the slice we go to the right size,
 *     # despite spurious or missing null characters.
 *     return input.c_str()[:input.length()]             # <<<<<<<<<<<<<<
 * 
 * cdef inline object cpp_to_utf8(_re2.cpp_string input):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_input.c_str() + 0, __pyx_v_input.length() - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__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("re2.cpp_to_pystring");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":58
 *     return input.c_str()[:input.length()]
 * 
 * cdef inline object cpp_to_utf8(_re2.cpp_string input):             # <<<<<<<<<<<<<<
 *     # This function converts a std::string object to a utf8 object.
 *     return python_unicode.PyUnicode_DecodeUTF8(input.c_str(), input.length(), 'strict')
 */

static CYTHON_INLINE PyObject *__pyx_f_3re2_cpp_to_utf8(std::string __pyx_v_input) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cpp_to_utf8");

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":60
 * cdef inline object cpp_to_utf8(_re2.cpp_string input):
 *     # This function converts a std::string object to a utf8 object.
 *     return python_unicode.PyUnicode_DecodeUTF8(input.c_str(), input.length(), 'strict')             # <<<<<<<<<<<<<<
 * 
 * cdef inline object char_to_utf8(_re2.const_char_ptr input, int length):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_input.c_str(), __pyx_v_input.length(), __pyx_k__strict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __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("re2.cpp_to_utf8");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":62
 *     return python_unicode.PyUnicode_DecodeUTF8(input.c_str(), input.length(), 'strict')
 * 
 * cdef inline object char_to_utf8(_re2.const_char_ptr input, int length):             # <<<<<<<<<<<<<<
 *     # This function converts a C string to a utf8 object.
 *     return python_unicode.PyUnicode_DecodeUTF8(input, length, 'strict')
 */

static CYTHON_INLINE PyObject *__pyx_f_3re2_char_to_utf8(const char* __pyx_v_input, int __pyx_v_length) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("char_to_utf8");

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":64
 * cdef inline object char_to_utf8(_re2.const_char_ptr input, int length):
 *     # This function converts a C string to a utf8 object.
 *     return python_unicode.PyUnicode_DecodeUTF8(input, length, 'strict')             # <<<<<<<<<<<<<<
 * 
 * cdef unicode_to_bytestring(object pystring, int * encoded):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_input, __pyx_v_length, __pyx_k__strict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __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("re2.char_to_utf8");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":66
 *     return python_unicode.PyUnicode_DecodeUTF8(input, length, 'strict')
 * 
 * cdef unicode_to_bytestring(object pystring, int * encoded):             # <<<<<<<<<<<<<<
 *     # This function will convert a utf8 string to a bytestring object.
 *     if python_unicode.PyUnicode_Check(pystring):
 */

static  PyObject *__pyx_f_3re2_unicode_to_bytestring(PyObject *__pyx_v_pystring, int *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("unicode_to_bytestring");
  __Pyx_INCREF(__pyx_v_pystring);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":68
 * cdef unicode_to_bytestring(object pystring, int * encoded):
 *     # This function will convert a utf8 string to a bytestring object.
 *     if python_unicode.PyUnicode_Check(pystring):             # <<<<<<<<<<<<<<
 *         pystring = python_unicode.PyUnicode_EncodeUTF8(python_unicode.PyUnicode_AS_UNICODE(pystring),
 *                                                        python_unicode.PyUnicode_GET_SIZE(pystring),
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_pystring);
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":70
 *     if python_unicode.PyUnicode_Check(pystring):
 *         pystring = python_unicode.PyUnicode_EncodeUTF8(python_unicode.PyUnicode_AS_UNICODE(pystring),
 *                                                        python_unicode.PyUnicode_GET_SIZE(pystring),             # <<<<<<<<<<<<<<
 *                                                        "strict")
 *         encoded[0] = 1
 */
    __pyx_t_2 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(__pyx_v_pystring), PyUnicode_GET_SIZE(__pyx_v_pystring), __pyx_k__strict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_pystring);
    __pyx_v_pystring = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":72
 *                                                        python_unicode.PyUnicode_GET_SIZE(pystring),
 *                                                        "strict")
 *         encoded[0] = 1             # <<<<<<<<<<<<<<
 *     else:
 *         encoded[0] = 0
 */
    (__pyx_v_encoded[0]) = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":74
 *         encoded[0] = 1
 *     else:
 *         encoded[0] = 0             # <<<<<<<<<<<<<<
 *     return pystring
 * 
 */
    (__pyx_v_encoded[0]) = 0;
  }
  __pyx_L3:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":75
 *     else:
 *         encoded[0] = 0
 *     return pystring             # <<<<<<<<<<<<<<
 * 
 * cdef inline int pystring_to_bytestring(object pystring, char ** cstring, int * length):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pystring);
  __pyx_r = __pyx_v_pystring;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("re2.unicode_to_bytestring");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_pystring);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":77
 *     return pystring
 * 
 * cdef inline int pystring_to_bytestring(object pystring, char ** cstring, int * length):             # <<<<<<<<<<<<<<
 *     # This function will convert a pystring to a bytesstring, placing
 *     # the char * in cstring, and the length in length.
 */

static CYTHON_INLINE int __pyx_f_3re2_pystring_to_bytestring(PyObject *__pyx_v_pystring, char **__pyx_v_cstring, int *__pyx_v_length) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("pystring_to_bytestring");

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":83
 *     # it will move to utf-8. If utf8 does not work, then it has to be
 *     # a non-supported encoding.
 *     return _re2.PyObject_AsCharBuffer(pystring, <_re2.const_char_ptr*> cstring, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_AsCharBuffer(__pyx_v_pystring, ((const char* *)__pyx_v_cstring), __pyx_v_length);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":98
 *     cdef dict _named_groups
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._lastgroup = -1
 *         self._lastindex = -1
 */

static int __pyx_pf_3re2_5Match___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_3re2_5Match___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":99
 * 
 *     def __init__(self):
 *         self._lastgroup = -1             # <<<<<<<<<<<<<<
 *         self._lastindex = -1
 *         self._groups = None
 */
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_GOTREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
  __Pyx_DECREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
  ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup = __pyx_int_neg_1;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":100
 *     def __init__(self):
 *         self._lastgroup = -1
 *         self._lastindex = -1             # <<<<<<<<<<<<<<
 *         self._groups = None
 * 
 */
  ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastindex = -1;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":101
 *         self._lastgroup = -1
 *         self._lastindex = -1
 *         self._groups = None             # <<<<<<<<<<<<<<
 * 
 *     cdef init_groups(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_groups);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_groups));
  ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_groups = ((PyObject *)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":103
 *         self._groups = None
 * 
 *     cdef init_groups(self):             # <<<<<<<<<<<<<<
 *         cdef list groups = []
 *         cdef int i
 */

static  PyObject *__pyx_f_3re2_5Match_init_groups(struct __pyx_obj_3re2_Match *__pyx_v_self) {
  PyObject *__pyx_v_groups = 0;
  int __pyx_v_i;
  int __pyx_v_cur_encoded;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("init_groups");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":104
 * 
 *     cdef init_groups(self):
 *         cdef list groups = []             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef bint cur_encoded = self.encoded
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_groups = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":106
 *         cdef list groups = []
 *         cdef int i
 *         cdef bint cur_encoded = self.encoded             # <<<<<<<<<<<<<<
 * 
 *         if self._groups is not None:
 */
  __pyx_v_cur_encoded = __pyx_v_self->encoded;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":108
 *         cdef bint cur_encoded = self.encoded
 * 
 *         if self._groups is not None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_2 = (__pyx_v_self->_groups != ((PyObject *)Py_None));
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":109
 * 
 *         if self._groups is not None:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.nmatches):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":111
 *             return
 * 
 *         for i in range(self.nmatches):             # <<<<<<<<<<<<<<
 *             if self.matches[i].data() == NULL:
 *                 groups.append(None)
 */
  __pyx_t_3 = __pyx_v_self->nmatches;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":112
 * 
 *         for i in range(self.nmatches):
 *             if self.matches[i].data() == NULL:             # <<<<<<<<<<<<<<
 *                 groups.append(None)
 *             else:
 */
    __pyx_t_2 = ((__pyx_v_self->matches[__pyx_v_i]).data() == NULL);
    if (__pyx_t_2) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":113
 *         for i in range(self.nmatches):
 *             if self.matches[i].data() == NULL:
 *                 groups.append(None)             # <<<<<<<<<<<<<<
 *             else:
 *                 if cur_encoded:
 */
      if (unlikely(__pyx_v_groups == Py_None)) {
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_groups), Py_None); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":115
 *                 groups.append(None)
 *             else:
 *                 if cur_encoded:             # <<<<<<<<<<<<<<
 *                     groups.append(char_to_utf8(self.matches[i].data(), self.matches[i].length()))
 *                 else:
 */
      if (__pyx_v_cur_encoded) {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":116
 *             else:
 *                 if cur_encoded:
 *                     groups.append(char_to_utf8(self.matches[i].data(), self.matches[i].length()))             # <<<<<<<<<<<<<<
 *                 else:
 *                     groups.append(self.matches[i].data()[:self.matches[i].length()])
 */
        if (unlikely(__pyx_v_groups == Py_None)) {
          PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_1 = __pyx_f_3re2_char_to_utf8((__pyx_v_self->matches[__pyx_v_i]).data(), (__pyx_v_self->matches[__pyx_v_i]).length()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_groups), __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":118
 *                     groups.append(char_to_utf8(self.matches[i].data(), self.matches[i].length()))
 *                 else:
 *                     groups.append(self.matches[i].data()[:self.matches[i].length()])             # <<<<<<<<<<<<<<
 *         self._lastindex = len(groups) - 1
 *         self._groups = tuple(groups)
 */
        if (unlikely(__pyx_v_groups == Py_None)) {
          PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_1 = PyBytes_FromStringAndSize((__pyx_v_self->matches[__pyx_v_i]).data() + 0, (__pyx_v_self->matches[__pyx_v_i]).length() - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_groups), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      }
      __pyx_L7:;
    }
    __pyx_L6:;
  }

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":119
 *                 else:
 *                     groups.append(self.matches[i].data()[:self.matches[i].length()])
 *         self._lastindex = len(groups) - 1             # <<<<<<<<<<<<<<
 *         self._groups = tuple(groups)
 * 
 */
  if (unlikely(__pyx_v_groups == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_v_groups)); 
  __pyx_v_self->_lastindex = (__pyx_t_6 - 1);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":120
 *                     groups.append(self.matches[i].data()[:self.matches[i].length()])
 *         self._lastindex = len(groups) - 1
 *         self._groups = tuple(groups)             # <<<<<<<<<<<<<<
 * 
 *     def groups(self):
 */
  if (unlikely(__pyx_v_groups == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_groups)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_groups);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_groups));
  __pyx_v_self->_groups = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("re2.Match.init_groups");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_groups);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":122
 *         self._groups = tuple(groups)
 * 
 *     def groups(self):             # <<<<<<<<<<<<<<
 *         self.init_groups()
 *         return self._groups[1:]
 */

static PyObject *__pyx_pf_3re2_5Match_groups(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_groups(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("groups");

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":123
 * 
 *     def groups(self):
 *         self.init_groups()             # <<<<<<<<<<<<<<
 *         return self._groups[1:]
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Match *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->__pyx_vtab)->init_groups(((struct __pyx_obj_3re2_Match *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":124
 *     def groups(self):
 *         self.init_groups()
 *         return self._groups[1:]             # <<<<<<<<<<<<<<
 * 
 *     def group(self, groupnum=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PySequence_GetSlice(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_groups), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__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("re2.Match.groups");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":126
 *         return self._groups[1:]
 * 
 *     def group(self, groupnum=0):             # <<<<<<<<<<<<<<
 *         cdef int idx
 * 
 */

static PyObject *__pyx_pf_3re2_5Match_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_groupnum = 0;
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__groupnum,0};
  __Pyx_RefNannySetupContext("group");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__groupnum);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_groupnum = values[0];
  } else {
    __pyx_v_groupnum = ((PyObject *)__pyx_int_0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_groupnum = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Match.group");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_groupnum);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":129
 *         cdef int idx
 * 
 *         self.init_groups()             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(groupnum, basestring):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Match *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->__pyx_vtab)->init_groups(((struct __pyx_obj_3re2_Match *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":131
 *         self.init_groups()
 * 
 *         if isinstance(groupnum, basestring):             # <<<<<<<<<<<<<<
 *             return self.groupdict()[groupnum]
 * 
 */
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_groupnum, __pyx_builtin_basestring); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":132
 * 
 *         if isinstance(groupnum, basestring):
 *             return self.groupdict()[groupnum]             # <<<<<<<<<<<<<<
 * 
 *         idx = groupnum
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__groupdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_v_groupnum); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":134
 *             return self.groupdict()[groupnum]
 * 
 *         idx = groupnum             # <<<<<<<<<<<<<<
 * 
 *         if idx > self.nmatches - 1:
 */
  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_groupnum); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_idx = __pyx_t_4;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":136
 *         idx = groupnum
 * 
 *         if idx > self.nmatches - 1:             # <<<<<<<<<<<<<<
 *             raise IndexError("no such group")
 *         return self._groups[idx]
 */
  __pyx_t_2 = (__pyx_v_idx > (((struct __pyx_obj_3re2_Match *)__pyx_v_self)->nmatches - 1));
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":137
 * 
 *         if idx > self.nmatches - 1:
 *             raise IndexError("no such group")             # <<<<<<<<<<<<<<
 *         return self._groups[idx]
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":138
 *         if idx > self.nmatches - 1:
 *             raise IndexError("no such group")
 *         return self._groups[idx]             # <<<<<<<<<<<<<<
 * 
 *     cdef _makespan(self, int groupnum=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_groups), __pyx_v_idx, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_3);
  __Pyx_AddTraceback("re2.Match.group");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_groupnum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":140
 *         return self._groups[idx]
 * 
 *     cdef _makespan(self, int groupnum=0):             # <<<<<<<<<<<<<<
 *         cdef int start, end
 *         cdef _re2.StringPiece * piece
 */

static  PyObject *__pyx_f_3re2_5Match__makespan(struct __pyx_obj_3re2_Match *__pyx_v_self, struct __pyx_opt_args_3re2_5Match__makespan *__pyx_optional_args) {
  int __pyx_v_groupnum = ((int)0);
  int __pyx_v_start;
  int __pyx_v_end;
  re2::StringPiece *__pyx_v_piece;
  char *__pyx_v_s;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_makespan");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_groupnum = __pyx_optional_args->groupnum;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":143
 *         cdef int start, end
 *         cdef _re2.StringPiece * piece
 *         cdef char * s = self.match_string             # <<<<<<<<<<<<<<
 *         if groupnum > self.nmatches - 1:
 *             raise IndexError("no such group")
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_self->match_string); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_s = __pyx_t_1;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":144
 *         cdef _re2.StringPiece * piece
 *         cdef char * s = self.match_string
 *         if groupnum > self.nmatches - 1:             # <<<<<<<<<<<<<<
 *             raise IndexError("no such group")
 *         piece = &self.matches[groupnum]
 */
  __pyx_t_2 = (__pyx_v_groupnum > (__pyx_v_self->nmatches - 1));
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":145
 *         cdef char * s = self.match_string
 *         if groupnum > self.nmatches - 1:
 *             raise IndexError("no such group")             # <<<<<<<<<<<<<<
 *         piece = &self.matches[groupnum]
 *         if piece.data() == NULL:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":146
 *         if groupnum > self.nmatches - 1:
 *             raise IndexError("no such group")
 *         piece = &self.matches[groupnum]             # <<<<<<<<<<<<<<
 *         if piece.data() == NULL:
 *             return (-1, -1)
 */
  __pyx_v_piece = (&(__pyx_v_self->matches[__pyx_v_groupnum]));

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":147
 *             raise IndexError("no such group")
 *         piece = &self.matches[groupnum]
 *         if piece.data() == NULL:             # <<<<<<<<<<<<<<
 *             return (-1, -1)
 *         start = piece.data() - s
 */
  __pyx_t_2 = (__pyx_v_piece->data() == NULL);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":148
 *         piece = &self.matches[groupnum]
 *         if piece.data() == NULL:
 *             return (-1, -1)             # <<<<<<<<<<<<<<
 *         start = piece.data() - s
 *         end = start + piece.length()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":149
 *         if piece.data() == NULL:
 *             return (-1, -1)
 *         start = piece.data() - s             # <<<<<<<<<<<<<<
 *         end = start + piece.length()
 *         return (start, end)
 */
  __pyx_v_start = (__pyx_v_piece->data() - __pyx_v_s);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":150
 *             return (-1, -1)
 *         start = piece.data() - s
 *         end = start + piece.length()             # <<<<<<<<<<<<<<
 *         return (start, end)
 * 
 */
  __pyx_v_end = (__pyx_v_start + __pyx_v_piece->length());

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":151
 *         start = piece.data() - s
 *         end = start + piece.length()
 *         return (start, end)             # <<<<<<<<<<<<<<
 * 
 *     def groupdict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_3 = 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("re2.Match._makespan");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":153
 *         return (start, end)
 * 
 *     def groupdict(self):             # <<<<<<<<<<<<<<
 *         cdef _re2.stringintmapiterator it
 *         cdef dict result = {}
 */

static PyObject *__pyx_pf_3re2_5Match_groupdict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_groupdict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  std::map<std::string, int>::const_iterator __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("groupdict");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":155
 *     def groupdict(self):
 *         cdef _re2.stringintmapiterator it
 *         cdef dict result = {}             # <<<<<<<<<<<<<<
 * 
 *         self.init_groups()
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":157
 *         cdef dict result = {}
 * 
 *         self.init_groups()             # <<<<<<<<<<<<<<
 * 
 *         if self._named_groups:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Match *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->__pyx_vtab)->init_groups(((struct __pyx_obj_3re2_Match *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":159
 *         self.init_groups()
 * 
 *         if self._named_groups:             # <<<<<<<<<<<<<<
 *             return self._named_groups
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_named_groups)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":160
 * 
 *         if self._named_groups:
 *             return self._named_groups             # <<<<<<<<<<<<<<
 * 
 *         self._named_groups = result
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_named_groups));
    __pyx_r = ((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_named_groups);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":162
 *             return self._named_groups
 * 
 *         self._named_groups = result             # <<<<<<<<<<<<<<
 *         it = self.named_groups.begin()
 *         self._lastgroup = None
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_GOTREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_named_groups);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_named_groups));
  ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_named_groups = __pyx_v_result;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":163
 * 
 *         self._named_groups = result
 *         it = self.named_groups.begin()             # <<<<<<<<<<<<<<
 *         self._lastgroup = None
 *         while it != self.named_groups.end():
 */
  __pyx_v_it = ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->named_groups->begin();

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":164
 *         self._named_groups = result
 *         it = self.named_groups.begin()
 *         self._lastgroup = None             # <<<<<<<<<<<<<<
 *         while it != self.named_groups.end():
 *             result[cpp_to_pystring(deref(it).first)] = self._groups[deref(it).second]
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
  __Pyx_DECREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
  ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup = Py_None;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":165
 *         it = self.named_groups.begin()
 *         self._lastgroup = None
 *         while it != self.named_groups.end():             # <<<<<<<<<<<<<<
 *             result[cpp_to_pystring(deref(it).first)] = self._groups[deref(it).second]
 *             self._lastgroup = cpp_to_pystring(deref(it).first)
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_it != ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->named_groups->end());
    if (!__pyx_t_2) break;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":166
 *         self._lastgroup = None
 *         while it != self.named_groups.end():
 *             result[cpp_to_pystring(deref(it).first)] = self._groups[deref(it).second]             # <<<<<<<<<<<<<<
 *             self._lastgroup = cpp_to_pystring(deref(it).first)
 *             inc(it)
 */
    __pyx_t_3 = (*__pyx_v_it).second;
    __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_groups), __pyx_t_3, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_f_3re2_cpp_to_pystring((*__pyx_v_it).first); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":167
 *         while it != self.named_groups.end():
 *             result[cpp_to_pystring(deref(it).first)] = self._groups[deref(it).second]
 *             self._lastgroup = cpp_to_pystring(deref(it).first)             # <<<<<<<<<<<<<<
 *             inc(it)
 * 
 */
    __pyx_t_1 = __pyx_f_3re2_cpp_to_pystring((*__pyx_v_it).first); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
    __Pyx_DECREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
    ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":168
 *             result[cpp_to_pystring(deref(it).first)] = self._groups[deref(it).second]
 *             self._lastgroup = cpp_to_pystring(deref(it).first)
 *             inc(it)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (++__pyx_v_it);
  }

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":170
 *             inc(it)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def end(self, int groupnum=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  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("re2.Match.groupdict");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":172
 *         return result
 * 
 *     def end(self, int groupnum=0):             # <<<<<<<<<<<<<<
 *         return self._makespan(groupnum)[1]
 * 
 */

static PyObject *__pyx_pf_3re2_5Match_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_groupnum;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3re2_5Match__makespan __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__groupnum,0};
  __Pyx_RefNannySetupContext("end");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__groupnum);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "end") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_groupnum = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_groupnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_groupnum = ((int)0);
    }
  } else {
    __pyx_v_groupnum = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_groupnum = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_groupnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("end", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Match.end");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":173
 * 
 *     def end(self, int groupnum=0):
 *         return self._makespan(groupnum)[1]             # <<<<<<<<<<<<<<
 * 
 *     def start(self, int groupnum=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.groupnum = __pyx_v_groupnum;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Match *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->__pyx_vtab)->_makespan(((struct __pyx_obj_3re2_Match *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __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_3);
  __Pyx_AddTraceback("re2.Match.end");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":175
 *         return self._makespan(groupnum)[1]
 * 
 *     def start(self, int groupnum=0):             # <<<<<<<<<<<<<<
 *         return self._makespan(groupnum)[0]
 * 
 */

static PyObject *__pyx_pf_3re2_5Match_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_groupnum;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3re2_5Match__makespan __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__groupnum,0};
  __Pyx_RefNannySetupContext("start");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__groupnum);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_groupnum = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_groupnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_groupnum = ((int)0);
    }
  } else {
    __pyx_v_groupnum = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_groupnum = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_groupnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Match.start");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":176
 * 
 *     def start(self, int groupnum=0):
 *         return self._makespan(groupnum)[0]             # <<<<<<<<<<<<<<
 * 
 *     def span(self, int groupnum=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.groupnum = __pyx_v_groupnum;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Match *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->__pyx_vtab)->_makespan(((struct __pyx_obj_3re2_Match *)__pyx_v_self), &__pyx_t_2); 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_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__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_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_3);
  __Pyx_AddTraceback("re2.Match.start");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":178
 *         return self._makespan(groupnum)[0]
 * 
 *     def span(self, int groupnum=0):             # <<<<<<<<<<<<<<
 *         return self._makespan(groupnum)
 * 
 */

static PyObject *__pyx_pf_3re2_5Match_span(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_span(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_groupnum;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3re2_5Match__makespan __pyx_t_2;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__groupnum,0};
  __Pyx_RefNannySetupContext("span");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__groupnum);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "span") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_groupnum = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_groupnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_groupnum = ((int)0);
    }
  } else {
    __pyx_v_groupnum = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_groupnum = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_groupnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("span", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Match.span");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":179
 * 
 *     def span(self, int groupnum=0):
 *         return self._makespan(groupnum)             # <<<<<<<<<<<<<<
 * 
 *     property lastindex:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.groupnum = __pyx_v_groupnum;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Match *)((struct __pyx_obj_3re2_Match *)__pyx_v_self)->__pyx_vtab)->_makespan(((struct __pyx_obj_3re2_Match *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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("re2.Match.span");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":182
 * 
 *     property lastindex:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._lastindex < 1:
 *                 return None
 */

static PyObject *__pyx_pf_3re2_5Match_9lastindex___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_9lastindex___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":183
 *     property lastindex:
 *         def __get__(self):
 *             if self._lastindex < 1:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastindex < 1);
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":184
 *         def __get__(self):
 *             if self._lastindex < 1:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._lastindex
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":186
 *                 return None
 *             else:
 *                 return self._lastindex             # <<<<<<<<<<<<<<
 * 
 *     property lastgroup:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastindex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("re2.Match.lastindex.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":189
 * 
 *     property lastgroup:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._lastgroup == -1:
 *                 self.groupdict()
 */

static PyObject *__pyx_pf_3re2_5Match_9lastgroup___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3re2_5Match_9lastgroup___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":190
 *     property lastgroup:
 *         def __get__(self):
 *             if self._lastgroup == -1:             # <<<<<<<<<<<<<<
 *                 self.groupdict()
 *             return self._lastgroup
 */
  __pyx_t_1 = PyObject_RichCompare(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":191
 *         def __get__(self):
 *             if self._lastgroup == -1:
 *                 self.groupdict()             # <<<<<<<<<<<<<<
 *             return self._lastgroup
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__groupdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":192
 *             if self._lastgroup == -1:
 *                 self.groupdict()
 *             return self._lastgroup             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup);
  __pyx_r = ((struct __pyx_obj_3re2_Match *)__pyx_v_self)->_lastgroup;
  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_3);
  __Pyx_AddTraceback("re2.Match.lastgroup.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":200
 *     cdef bint encoded
 * 
 *     cdef _search(self, string, int pos, int endpos, _re2.re2_Anchor anchoring):             # <<<<<<<<<<<<<<
 *         """
 *         Scan through string looking for a match, and return a corresponding
 */

static  PyObject *__pyx_f_3re2_7Pattern__search(struct __pyx_obj_3re2_Pattern *__pyx_v_self, PyObject *__pyx_v_string, int __pyx_v_pos, int __pyx_v_endpos, RE2::Anchor __pyx_v_anchoring) {
  int __pyx_v_size;
  int __pyx_v_result;
  char *__pyx_v_cstring;
  int __pyx_v_encoded;
  re2::StringPiece *__pyx_v_sp;
  re2::StringPiece *__pyx_v_matches;
  struct __pyx_obj_3re2_Match *__pyx_v_m = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_search");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_string);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":208
 *         cdef int result
 *         cdef char * cstring
 *         cdef int encoded = 0             # <<<<<<<<<<<<<<
 *         cdef _re2.StringPiece * sp
 *         cdef _re2.StringPiece * matches = _re2.new_StringPiece_array(self.ngroups + 1)
 */
  __pyx_v_encoded = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":210
 *         cdef int encoded = 0
 *         cdef _re2.StringPiece * sp
 *         cdef _re2.StringPiece * matches = _re2.new_StringPiece_array(self.ngroups + 1)             # <<<<<<<<<<<<<<
 *         cdef Match m = Match()
 * 
 */
  __pyx_v_matches = new_StringPiece_array((__pyx_v_self->ngroups + 1));

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":211
 *         cdef _re2.StringPiece * sp
 *         cdef _re2.StringPiece * matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *         cdef Match m = Match()             # <<<<<<<<<<<<<<
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3re2_Match)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_m = ((struct __pyx_obj_3re2_Match *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":213
 *         cdef Match m = Match()
 * 
 *         string = unicode_to_bytestring(string, &encoded)             # <<<<<<<<<<<<<<
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 */
  __pyx_t_1 = __pyx_f_3re2_unicode_to_bytestring(__pyx_v_string, (&__pyx_v_encoded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_string);
  __pyx_v_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":214
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:             # <<<<<<<<<<<<<<
 *             raise TypeError("expected string or buffer")
 * 
 */
  __pyx_t_2 = (__pyx_f_3re2_pystring_to_bytestring(__pyx_v_string, (&__pyx_v_cstring), (&__pyx_v_size)) == -1);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":215
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")             # <<<<<<<<<<<<<<
 * 
 *         if endpos != -1 and endpos < size:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":217
 *             raise TypeError("expected string or buffer")
 * 
 *         if endpos != -1 and endpos < size:             # <<<<<<<<<<<<<<
 *             size = endpos
 * 
 */
  __pyx_t_2 = (__pyx_v_endpos != -1);
  if (__pyx_t_2) {
    __pyx_t_4 = (__pyx_v_endpos < __pyx_v_size);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_2;
  }
  if (__pyx_t_5) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":218
 * 
 *         if endpos != -1 and endpos < size:
 *             size = endpos             # <<<<<<<<<<<<<<
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 */
    __pyx_v_size = __pyx_v_endpos;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":220
 *             size = endpos
 * 
 *         sp = new _re2.StringPiece(cstring, size)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             result = self.pattern.Match(sp[0], <int>pos, anchoring, matches, self.ngroups + 1)
 */
  __pyx_v_sp = new re2::StringPiece(__pyx_v_cstring, __pyx_v_size);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":221
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.pattern.Match(sp[0], <int>pos, anchoring, matches, self.ngroups + 1)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":222
 *         sp = new _re2.StringPiece(cstring, size)
 *         with nogil:
 *             result = self.pattern.Match(sp[0], <int>pos, anchoring, matches, self.ngroups + 1)             # <<<<<<<<<<<<<<
 * 
 *         del sp
 */
      __pyx_v_result = __pyx_v_self->pattern->Match((__pyx_v_sp[0]), __pyx_v_pos, __pyx_v_anchoring, __pyx_v_matches, (__pyx_v_self->ngroups + 1));
    }
    /*finally:*/ {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":221
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.pattern.Match(sp[0], <int>pos, anchoring, matches, self.ngroups + 1)
 * 
 */
      Py_BLOCK_THREADS
    }
  }

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":224
 *             result = self.pattern.Match(sp[0], <int>pos, anchoring, matches, self.ngroups + 1)
 * 
 *         del sp             # <<<<<<<<<<<<<<
 *         if result == 0:
 *             return None
 */
  delete __pyx_v_sp;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":225
 * 
 *         del sp
 *         if result == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         m.matches = matches
 */
  __pyx_t_5 = (__pyx_v_result == 0);
  if (__pyx_t_5) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":226
 *         del sp
 *         if result == 0:
 *             return None             # <<<<<<<<<<<<<<
 *         m.matches = matches
 *         m.encoded = <bint>(encoded) or self.encoded
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":227
 *         if result == 0:
 *             return None
 *         m.matches = matches             # <<<<<<<<<<<<<<
 *         m.encoded = <bint>(encoded) or self.encoded
 *         m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 */
  __pyx_v_m->matches = __pyx_v_matches;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":228
 *             return None
 *         m.matches = matches
 *         m.encoded = <bint>(encoded) or self.encoded             # <<<<<<<<<<<<<<
 *         m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *         m.nmatches = self.ngroups + 1
 */
  __pyx_t_5 = ((int)__pyx_v_encoded);
  if (!__pyx_t_5) {
    __pyx_t_2 = __pyx_v_self->encoded;
  } else {
    __pyx_t_2 = __pyx_t_5;
  }
  __pyx_v_m->encoded = __pyx_t_2;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":229
 *         m.matches = matches
 *         m.encoded = <bint>(encoded) or self.encoded
 *         m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())             # <<<<<<<<<<<<<<
 *         m.nmatches = self.ngroups + 1
 *         m.match_string = string
 */
  __pyx_v_m->named_groups = addressof(__pyx_v_self->pattern->NamedCapturingGroups());

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":230
 *         m.encoded = <bint>(encoded) or self.encoded
 *         m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *         m.nmatches = self.ngroups + 1             # <<<<<<<<<<<<<<
 *         m.match_string = string
 *         return m
 */
  __pyx_v_m->nmatches = (__pyx_v_self->ngroups + 1);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":231
 *         m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *         m.nmatches = self.ngroups + 1
 *         m.match_string = string             # <<<<<<<<<<<<<<
 *         return m
 * 
 */
  __Pyx_INCREF(__pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  __Pyx_GOTREF(__pyx_v_m->match_string);
  __Pyx_DECREF(__pyx_v_m->match_string);
  __pyx_v_m->match_string = __pyx_v_string;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":232
 *         m.nmatches = self.ngroups + 1
 *         m.match_string = string
 *         return m             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_m));
  __pyx_r = ((PyObject *)__pyx_v_m);
  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_3);
  __Pyx_AddTraceback("re2.Pattern._search");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_m);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":235
 * 
 * 
 *     def search(self, string, int pos=0, int endpos=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Scan through string looking for a match, and return a corresponding
 */

static PyObject *__pyx_pf_3re2_7Pattern_search(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_search[] = "\n        Scan through string looking for a match, and return a corresponding\n        Match instance. Return None if no position in the string matches.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_search(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  int __pyx_v_pos;
  int __pyx_v_endpos;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__pos,&__pyx_n_s__endpos,0};
  __Pyx_RefNannySetupContext("search");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__string);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "search") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_string = values[0];
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_pos = ((int)0);
    }
    if (values[2]) {
      __pyx_v_endpos = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_endpos = ((int)-1);
    }
  } else {
    __pyx_v_pos = ((int)0);
    __pyx_v_endpos = ((int)-1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_endpos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_pos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_string = 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("search", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.search");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":240
 *         Match instance. Return None if no position in the string matches.
 *         """
 *         return self._search(string, pos, endpos, _re2.UNANCHORED)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Pattern *)((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->__pyx_vtab)->_search(((struct __pyx_obj_3re2_Pattern *)__pyx_v_self), __pyx_v_string, __pyx_v_pos, __pyx_v_endpos, RE2::UNANCHORED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __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("re2.Pattern.search");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":243
 * 
 * 
 *     def match(self, string, int pos=0, int endpos=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Matches zero or more characters at the beginning of the string.
 */

static PyObject *__pyx_pf_3re2_7Pattern_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_match[] = "\n        Matches zero or more characters at the beginning of the string.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  int __pyx_v_pos;
  int __pyx_v_endpos;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__pos,&__pyx_n_s__endpos,0};
  __Pyx_RefNannySetupContext("match");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__string);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_string = values[0];
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_pos = ((int)0);
    }
    if (values[2]) {
      __pyx_v_endpos = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_endpos = ((int)-1);
    }
  } else {
    __pyx_v_pos = ((int)0);
    __pyx_v_endpos = ((int)-1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_endpos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_pos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_string = 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("match", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.match");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":247
 *         Matches zero or more characters at the beginning of the string.
 *         """
 *         return self._search(string, pos, endpos, _re2.ANCHOR_START)             # <<<<<<<<<<<<<<
 * 
 *     cdef _print_pattern(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_3re2_Pattern *)((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->__pyx_vtab)->_search(((struct __pyx_obj_3re2_Pattern *)__pyx_v_self), __pyx_v_string, __pyx_v_pos, __pyx_v_endpos, RE2::ANCHOR_START); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __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("re2.Pattern.match");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":249
 *         return self._search(string, pos, endpos, _re2.ANCHOR_START)
 * 
 *     cdef _print_pattern(self):             # <<<<<<<<<<<<<<
 *         cdef _re2.cpp_string * s
 *         s = <_re2.cpp_string *>_re2.addressofs(self.pattern.pattern())
 */

static  PyObject *__pyx_f_3re2_7Pattern__print_pattern(struct __pyx_obj_3re2_Pattern *__pyx_v_self) {
  std::string *__pyx_v_s;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_print_pattern");

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":251
 *     cdef _print_pattern(self):
 *         cdef _re2.cpp_string * s
 *         s = <_re2.cpp_string *>_re2.addressofs(self.pattern.pattern())             # <<<<<<<<<<<<<<
 *         print cpp_to_pystring(s[0]) + "\n"
 *         sys.stdout.flush()
 */
  __pyx_v_s = ((std::string *)addressofs(__pyx_v_self->pattern->pattern()));

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":252
 *         cdef _re2.cpp_string * s
 *         s = <_re2.cpp_string *>_re2.addressofs(self.pattern.pattern())
 *         print cpp_to_pystring(s[0]) + "\n"             # <<<<<<<<<<<<<<
 *         sys.stdout.flush()
 * 
 */
  __pyx_t_1 = __pyx_f_3re2_cpp_to_pystring((__pyx_v_s[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":253
 *         s = <_re2.cpp_string *>_re2.addressofs(self.pattern.pattern())
 *         print cpp_to_pystring(s[0]) + "\n"
 *         sys.stdout.flush()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stdout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __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("re2.Pattern._print_pattern");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":256
 * 
 * 
 *     def findall(self, object string, int pos=0, int endpos=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list over all non-overlapping matches for the
 */

static PyObject *__pyx_pf_3re2_7Pattern_findall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_findall[] = "\n        Return a list over all non-overlapping matches for the\n        RE pattern in string. For each match, the iterator returns a\n        match object.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_findall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  int __pyx_v_pos;
  int __pyx_v_endpos;
  int __pyx_v_size;
  int __pyx_v_result;
  char *__pyx_v_cstring;
  re2::StringPiece *__pyx_v_sp;
  re2::StringPiece *__pyx_v_matches;
  struct __pyx_obj_3re2_Match *__pyx_v_m;
  PyObject *__pyx_v_resultlist = 0;
  int __pyx_v_encoded;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__pos,&__pyx_n_s__endpos,0};
  __Pyx_RefNannySetupContext("findall");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__string);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "findall") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_string = values[0];
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_pos = ((int)0);
    }
    if (values[2]) {
      __pyx_v_endpos = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_endpos = ((int)-1);
    }
  } else {
    __pyx_v_pos = ((int)0);
    __pyx_v_endpos = ((int)-1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_endpos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_pos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_string = 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("findall", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.findall");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_string);
  __pyx_v_m = ((struct __pyx_obj_3re2_Match *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":268
 *         cdef _re2.StringPiece * matches
 *         cdef Match m
 *         cdef list resultlist = []             # <<<<<<<<<<<<<<
 *         cdef int encoded = 0
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_resultlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":269
 *         cdef Match m
 *         cdef list resultlist = []
 *         cdef int encoded = 0             # <<<<<<<<<<<<<<
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 */
  __pyx_v_encoded = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":271
 *         cdef int encoded = 0
 * 
 *         string = unicode_to_bytestring(string, &encoded)             # <<<<<<<<<<<<<<
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 */
  __pyx_t_1 = __pyx_f_3re2_unicode_to_bytestring(__pyx_v_string, (&__pyx_v_encoded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_string);
  __pyx_v_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":272
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:             # <<<<<<<<<<<<<<
 *             raise TypeError("expected string or buffer")
 *         encoded = <bint>encoded or self.encoded
 */
  __pyx_t_2 = (__pyx_f_3re2_pystring_to_bytestring(__pyx_v_string, (&__pyx_v_cstring), (&__pyx_v_size)) == -1);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":273
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")             # <<<<<<<<<<<<<<
 *         encoded = <bint>encoded or self.encoded
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":274
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 *         encoded = <bint>encoded or self.encoded             # <<<<<<<<<<<<<<
 * 
 *         if endpos != -1 and endpos < size:
 */
  __pyx_t_2 = ((int)__pyx_v_encoded);
  if (!__pyx_t_2) {
    __pyx_t_4 = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->encoded;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_encoded = __pyx_t_4;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":276
 *         encoded = <bint>encoded or self.encoded
 * 
 *         if endpos != -1 and endpos < size:             # <<<<<<<<<<<<<<
 *             size = endpos
 * 
 */
  __pyx_t_4 = (__pyx_v_endpos != -1);
  if (__pyx_t_4) {
    __pyx_t_2 = (__pyx_v_endpos < __pyx_v_size);
    __pyx_t_5 = __pyx_t_2;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  if (__pyx_t_5) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":277
 * 
 *         if endpos != -1 and endpos < size:
 *             size = endpos             # <<<<<<<<<<<<<<
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 */
    __pyx_v_size = __pyx_v_endpos;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":279
 *             size = endpos
 * 
 *         sp = new _re2.StringPiece(cstring, size)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_v_sp = new re2::StringPiece(__pyx_v_cstring, __pyx_v_size);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":281
 *         sp = new _re2.StringPiece(cstring, size)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 */
  while (1) {
    if (!1) break;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":282
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 */
    { PyThreadState *_save;
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":283
 *         while True:
 *             with nogil:
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)             # <<<<<<<<<<<<<<
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 *             if result == 0:
 */
        __pyx_v_matches = new_StringPiece_array((((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups + 1));

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":284
 *             with nogil:
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)             # <<<<<<<<<<<<<<
 *             if result == 0:
 *                 break
 */
        __pyx_v_result = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern->Match((__pyx_v_sp[0]), __pyx_v_pos, RE2::UNANCHORED, __pyx_v_matches, (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups + 1));
      }
      /*finally:*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":282
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 */
        Py_BLOCK_THREADS
      }
    }

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":285
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 break
 *             # offset the pos to move to the next point
 */
    __pyx_t_5 = (__pyx_v_result == 0);
    if (__pyx_t_5) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":286
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 *             if result == 0:
 *                 break             # <<<<<<<<<<<<<<
 *             # offset the pos to move to the next point
 *             pos = matches[0].data() - cstring + matches[0].length()
 */
      goto __pyx_L9_break;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":288
 *                 break
 *             # offset the pos to move to the next point
 *             pos = matches[0].data() - cstring + matches[0].length()             # <<<<<<<<<<<<<<
 *             m = Match()
 *             m.encoded = encoded
 */
    __pyx_v_pos = (((__pyx_v_matches[0]).data() - __pyx_v_cstring) + (__pyx_v_matches[0]).length());

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":289
 *             # offset the pos to move to the next point
 *             pos = matches[0].data() - cstring + matches[0].length()
 *             m = Match()             # <<<<<<<<<<<<<<
 *             m.encoded = encoded
 *             m.matches = matches
 */
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3re2_Match)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_v_m));
    __pyx_v_m = ((struct __pyx_obj_3re2_Match *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":290
 *             pos = matches[0].data() - cstring + matches[0].length()
 *             m = Match()
 *             m.encoded = encoded             # <<<<<<<<<<<<<<
 *             m.matches = matches
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 */
    __pyx_v_m->encoded = __pyx_v_encoded;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":291
 *             m = Match()
 *             m.encoded = encoded
 *             m.matches = matches             # <<<<<<<<<<<<<<
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *             m.nmatches = self.ngroups + 1
 */
    __pyx_v_m->matches = __pyx_v_matches;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":292
 *             m.encoded = encoded
 *             m.matches = matches
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())             # <<<<<<<<<<<<<<
 *             m.nmatches = self.ngroups + 1
 *             m.match_string = string
 */
    __pyx_v_m->named_groups = addressof(((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern->NamedCapturingGroups());

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":293
 *             m.matches = matches
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *             m.nmatches = self.ngroups + 1             # <<<<<<<<<<<<<<
 *             m.match_string = string
 *             m.init_groups()
 */
    __pyx_v_m->nmatches = (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups + 1);

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":294
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *             m.nmatches = self.ngroups + 1
 *             m.match_string = string             # <<<<<<<<<<<<<<
 *             m.init_groups()
 *             resultlist.append(m)
 */
    __Pyx_INCREF(__pyx_v_string);
    __Pyx_GIVEREF(__pyx_v_string);
    __Pyx_GOTREF(__pyx_v_m->match_string);
    __Pyx_DECREF(__pyx_v_m->match_string);
    __pyx_v_m->match_string = __pyx_v_string;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":295
 *             m.nmatches = self.ngroups + 1
 *             m.match_string = string
 *             m.init_groups()             # <<<<<<<<<<<<<<
 *             resultlist.append(m)
 *         del sp
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3re2_Match *)__pyx_v_m->__pyx_vtab)->init_groups(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":296
 *             m.match_string = string
 *             m.init_groups()
 *             resultlist.append(m)             # <<<<<<<<<<<<<<
 *         del sp
 *         return resultlist
 */
    if (unlikely(__pyx_v_resultlist == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_resultlist), ((PyObject *)__pyx_v_m)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L9_break:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":297
 *             m.init_groups()
 *             resultlist.append(m)
 *         del sp             # <<<<<<<<<<<<<<
 *         return resultlist
 * 
 */
  delete __pyx_v_sp;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":298
 *             resultlist.append(m)
 *         del sp
 *         return resultlist             # <<<<<<<<<<<<<<
 * 
 *     def finditer(self, object string, int pos=0, int endpos=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_resultlist));
  __pyx_r = ((PyObject *)__pyx_v_resultlist);
  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_3);
  __Pyx_AddTraceback("re2.Pattern.findall");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_resultlist);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":300
 *         return resultlist
 * 
 *     def finditer(self, object string, int pos=0, int endpos=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list over all non-overlapping matches for the
 */

static PyObject *__pyx_pf_3re2_7Pattern_finditer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_finditer[] = "\n        Return a list over all non-overlapping matches for the\n        RE pattern in string. For each match, the iterator returns a\n        match object.\n        NOTE: In re2 THIS IS A SYNONYM FOR findall!\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_finditer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  int __pyx_v_pos;
  int __pyx_v_endpos;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__pos,&__pyx_n_s__endpos,0};
  __Pyx_RefNannySetupContext("finditer");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__string);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "finditer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_string = values[0];
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_pos = ((int)0);
    }
    if (values[2]) {
      __pyx_v_endpos = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_endpos = ((int)-1);
    }
  } else {
    __pyx_v_pos = ((int)0);
    __pyx_v_endpos = ((int)-1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_endpos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_pos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_string = 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("finditer", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.finditer");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":307
 *         NOTE: In re2 THIS IS A SYNONYM FOR findall!
 *         """
 *         return self.findall(string, pos, endpos)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__findall); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_endpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __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_4); __pyx_t_4 = 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("re2.Pattern.finditer");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":310
 * 
 * 
 *     def split(self, string, int maxsplit=0):             # <<<<<<<<<<<<<<
 *         """
 *         split(string[, maxsplit = 0]) --> list
 */

static PyObject *__pyx_pf_3re2_7Pattern_split(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_split[] = "\n        split(string[, maxsplit = 0]) --> list\n        Split a string by the occurances of the pattern.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_split(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  int __pyx_v_maxsplit;
  int __pyx_v_size;
  int __pyx_v_num_groups;
  int __pyx_v_result;
  int __pyx_v_endpos;
  int __pyx_v_pos;
  int __pyx_v_num_split;
  char *__pyx_v_cstring;
  re2::StringPiece *__pyx_v_sp;
  re2::StringPiece *__pyx_v_matches;
  PyObject *__pyx_v_resultlist = 0;
  int __pyx_v_encoded;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__maxsplit,0};
  __Pyx_RefNannySetupContext("split");
  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__string);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxsplit);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "split") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_string = values[0];
    if (values[1]) {
      __pyx_v_maxsplit = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_maxsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_maxsplit = ((int)0);
    }
  } else {
    __pyx_v_maxsplit = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_maxsplit = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_maxsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_string = 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("split", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.split");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_string);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":316
 *         """
 *         cdef int size
 *         cdef int num_groups = 1             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef int endpos
 */
  __pyx_v_num_groups = 1;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":319
 *         cdef int result
 *         cdef int endpos
 *         cdef int pos = 0             # <<<<<<<<<<<<<<
 *         cdef int num_split = 0
 *         cdef char * cstring
 */
  __pyx_v_pos = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":320
 *         cdef int endpos
 *         cdef int pos = 0
 *         cdef int num_split = 0             # <<<<<<<<<<<<<<
 *         cdef char * cstring
 *         cdef _re2.StringPiece * sp
 */
  __pyx_v_num_split = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":325
 *         cdef _re2.StringPiece * matches
 *         cdef Match m
 *         cdef list resultlist = []             # <<<<<<<<<<<<<<
 *         cdef int encoded = 0
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_resultlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":326
 *         cdef Match m
 *         cdef list resultlist = []
 *         cdef int encoded = 0             # <<<<<<<<<<<<<<
 * 
 *         if maxsplit < 0:
 */
  __pyx_v_encoded = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":328
 *         cdef int encoded = 0
 * 
 *         if maxsplit < 0:             # <<<<<<<<<<<<<<
 *             maxsplit = 0
 * 
 */
  __pyx_t_2 = (__pyx_v_maxsplit < 0);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":329
 * 
 *         if maxsplit < 0:
 *             maxsplit = 0             # <<<<<<<<<<<<<<
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 */
    __pyx_v_maxsplit = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":331
 *             maxsplit = 0
 * 
 *         string = unicode_to_bytestring(string, &encoded)             # <<<<<<<<<<<<<<
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 */
  __pyx_t_1 = __pyx_f_3re2_unicode_to_bytestring(__pyx_v_string, (&__pyx_v_encoded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_string);
  __pyx_v_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":332
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:             # <<<<<<<<<<<<<<
 *             raise TypeError("expected string or buffer")
 * 
 */
  __pyx_t_2 = (__pyx_f_3re2_pystring_to_bytestring(__pyx_v_string, (&__pyx_v_cstring), (&__pyx_v_size)) == -1);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":333
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")             # <<<<<<<<<<<<<<
 * 
 *         encoded = <bint>encoded or self.encoded
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":335
 *             raise TypeError("expected string or buffer")
 * 
 *         encoded = <bint>encoded or self.encoded             # <<<<<<<<<<<<<<
 * 
 *         if self.ngroups > 0:
 */
  __pyx_t_2 = ((int)__pyx_v_encoded);
  if (!__pyx_t_2) {
    __pyx_t_4 = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->encoded;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_encoded = __pyx_t_4;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":337
 *         encoded = <bint>encoded or self.encoded
 * 
 *         if self.ngroups > 0:             # <<<<<<<<<<<<<<
 *             matches = _re2.new_StringPiece_array(2)
 *             num_groups = 2
 */
  __pyx_t_4 = (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups > 0);
  if (__pyx_t_4) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":338
 * 
 *         if self.ngroups > 0:
 *             matches = _re2.new_StringPiece_array(2)             # <<<<<<<<<<<<<<
 *             num_groups = 2
 *         else:
 */
    __pyx_v_matches = new_StringPiece_array(2);

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":339
 *         if self.ngroups > 0:
 *             matches = _re2.new_StringPiece_array(2)
 *             num_groups = 2             # <<<<<<<<<<<<<<
 *         else:
 *             matches = _re2.new_StringPiece_array(1)
 */
    __pyx_v_num_groups = 2;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":341
 *             num_groups = 2
 *         else:
 *             matches = _re2.new_StringPiece_array(1)             # <<<<<<<<<<<<<<
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 */
    __pyx_v_matches = new_StringPiece_array(1);
  }
  __pyx_L8:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":343
 *             matches = _re2.new_StringPiece_array(1)
 * 
 *         sp = new _re2.StringPiece(cstring, size)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_v_sp = new re2::StringPiece(__pyx_v_cstring, __pyx_v_size);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":345
 *         sp = new _re2.StringPiece(cstring, size)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, num_groups)
 */
  while (1) {
    if (!1) break;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":346
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, num_groups)
 *             if result == 0:
 */
    { PyThreadState *_save;
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":347
 *         while True:
 *             with nogil:
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, num_groups)             # <<<<<<<<<<<<<<
 *             if result == 0:
 *                 break
 */
        __pyx_v_result = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern->Match((__pyx_v_sp[0]), __pyx_v_pos, RE2::UNANCHORED, __pyx_v_matches, __pyx_v_num_groups);
      }
      /*finally:*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":346
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, num_groups)
 *             if result == 0:
 */
        Py_BLOCK_THREADS
      }
    }

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":348
 *             with nogil:
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, num_groups)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_4 = (__pyx_v_result == 0);
    if (__pyx_t_4) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":349
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, num_groups)
 *             if result == 0:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             endpos = matches[0].data() - cstring
 */
      goto __pyx_L10_break;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":351
 *                 break
 * 
 *             endpos = matches[0].data() - cstring             # <<<<<<<<<<<<<<
 *             if encoded:
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))
 */
    __pyx_v_endpos = ((__pyx_v_matches[0]).data() - __pyx_v_cstring);

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":352
 * 
 *             endpos = matches[0].data() - cstring
 *             if encoded:             # <<<<<<<<<<<<<<
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))
 *             else:
 */
    if (__pyx_v_encoded) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":353
 *             endpos = matches[0].data() - cstring
 *             if encoded:
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))             # <<<<<<<<<<<<<<
 *             else:
 *                 resultlist.append(sp.data()[pos:endpos])
 */
      if (unlikely(__pyx_v_resultlist == Py_None)) {
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_3 = __pyx_f_3re2_char_to_utf8((&(__pyx_v_sp->data()[__pyx_v_pos])), (__pyx_v_endpos - __pyx_v_pos)); 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_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L17;
    }
    /*else*/ {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":355
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))
 *             else:
 *                 resultlist.append(sp.data()[pos:endpos])             # <<<<<<<<<<<<<<
 *             # offset the pos to move to the next point
 *             pos = endpos + matches[0].length()
 */
      if (unlikely(__pyx_v_resultlist == Py_None)) {
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_sp->data() + __pyx_v_pos, __pyx_v_endpos - __pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    }
    __pyx_L17:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":357
 *                 resultlist.append(sp.data()[pos:endpos])
 *             # offset the pos to move to the next point
 *             pos = endpos + matches[0].length()             # <<<<<<<<<<<<<<
 *             if num_groups == 2:
 *                 if encoded:
 */
    __pyx_v_pos = (__pyx_v_endpos + (__pyx_v_matches[0]).length());

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":358
 *             # offset the pos to move to the next point
 *             pos = endpos + matches[0].length()
 *             if num_groups == 2:             # <<<<<<<<<<<<<<
 *                 if encoded:
 *                     resultlist.append(char_to_utf8(matches[1].data(), matches[1].length()))
 */
    __pyx_t_4 = (__pyx_v_num_groups == 2);
    if (__pyx_t_4) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":359
 *             pos = endpos + matches[0].length()
 *             if num_groups == 2:
 *                 if encoded:             # <<<<<<<<<<<<<<
 *                     resultlist.append(char_to_utf8(matches[1].data(), matches[1].length()))
 *                 else:
 */
      if (__pyx_v_encoded) {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":360
 *             if num_groups == 2:
 *                 if encoded:
 *                     resultlist.append(char_to_utf8(matches[1].data(), matches[1].length()))             # <<<<<<<<<<<<<<
 *                 else:
 *                     resultlist.append(matches[1].data()[:matches[1].length()])
 */
        if (unlikely(__pyx_v_resultlist == Py_None)) {
          PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_3 = __pyx_f_3re2_char_to_utf8((__pyx_v_matches[1]).data(), (__pyx_v_matches[1]).length()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":362
 *                     resultlist.append(char_to_utf8(matches[1].data(), matches[1].length()))
 *                 else:
 *                     resultlist.append(matches[1].data()[:matches[1].length()])             # <<<<<<<<<<<<<<
 * 
 *             num_split += 1
 */
        if (unlikely(__pyx_v_resultlist == Py_None)) {
          PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_3 = PyBytes_FromStringAndSize((__pyx_v_matches[1]).data() + 0, (__pyx_v_matches[1]).length() - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      }
      __pyx_L19:;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":364
 *                     resultlist.append(matches[1].data()[:matches[1].length()])
 * 
 *             num_split += 1             # <<<<<<<<<<<<<<
 *             if maxsplit and num_split >= maxsplit:
 *                 break
 */
    __pyx_v_num_split += 1;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":365
 * 
 *             num_split += 1
 *             if maxsplit and num_split >= maxsplit:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    if (__pyx_v_maxsplit) {
      __pyx_t_4 = (__pyx_v_num_split >= __pyx_v_maxsplit);
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_v_maxsplit;
    }
    if (__pyx_t_2) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":366
 *             num_split += 1
 *             if maxsplit and num_split >= maxsplit:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if encoded:
 */
      goto __pyx_L10_break;
      goto __pyx_L20;
    }
    __pyx_L20:;
  }
  __pyx_L10_break:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":368
 *                 break
 * 
 *         if encoded:             # <<<<<<<<<<<<<<
 *             resultlist.append(char_to_utf8(&sp.data()[pos], sp.length() - pos))
 *         else:
 */
  if (__pyx_v_encoded) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":369
 * 
 *         if encoded:
 *             resultlist.append(char_to_utf8(&sp.data()[pos], sp.length() - pos))             # <<<<<<<<<<<<<<
 *         else:
 *             resultlist.append(sp.data()[pos:])
 */
    if (unlikely(__pyx_v_resultlist == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = __pyx_f_3re2_char_to_utf8((&(__pyx_v_sp->data()[__pyx_v_pos])), (__pyx_v_sp->length() - __pyx_v_pos)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L21;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":371
 *             resultlist.append(char_to_utf8(&sp.data()[pos], sp.length() - pos))
 *         else:
 *             resultlist.append(sp.data()[pos:])             # <<<<<<<<<<<<<<
 *         del matches
 *         del sp
 */
    if (unlikely(__pyx_v_resultlist == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = PyBytes_FromString(__pyx_v_sp->data() + __pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  }
  __pyx_L21:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":372
 *         else:
 *             resultlist.append(sp.data()[pos:])
 *         del matches             # <<<<<<<<<<<<<<
 *         del sp
 *         return resultlist
 */
  delete __pyx_v_matches;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":373
 *             resultlist.append(sp.data()[pos:])
 *         del matches
 *         del sp             # <<<<<<<<<<<<<<
 *         return resultlist
 * 
 */
  delete __pyx_v_sp;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":374
 *         del matches
 *         del sp
 *         return resultlist             # <<<<<<<<<<<<<<
 * 
 *     def sub(self, repl, string, int count=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_resultlist));
  __pyx_r = ((PyObject *)__pyx_v_resultlist);
  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_3);
  __Pyx_AddTraceback("re2.Pattern.split");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_resultlist);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":376
 *         return resultlist
 * 
 *     def sub(self, repl, string, int count=0):             # <<<<<<<<<<<<<<
 *         """
 *         sub(repl, string[, count = 0]) --> newstring
 */

static PyObject *__pyx_pf_3re2_7Pattern_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_sub[] = "\n        sub(repl, string[, count = 0]) --> newstring\n        Return the string obtained by replacing the leftmost non-overlapping\n        occurrences of pattern in string by the replacement repl.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_repl = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_count;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__repl,&__pyx_n_s__string,&__pyx_n_s__count,0};
  __Pyx_RefNannySetupContext("sub");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__repl);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("sub", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_repl = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_count = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_count = ((int)0);
    }
  } else {
    __pyx_v_count = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_count = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_repl = 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("sub", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.sub");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":382
 *         occurrences of pattern in string by the replacement repl.
 *         """
 *         return self.subn(repl, string, count)[0]             # <<<<<<<<<<<<<<
 * 
 *     def subn(self, repl, string, int count=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__subn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_repl);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_repl);
  __Pyx_GIVEREF(__pyx_v_repl);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __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("re2.Pattern.sub");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":384
 *         return self.subn(repl, string, count)[0]
 * 
 *     def subn(self, repl, string, int count=0):             # <<<<<<<<<<<<<<
 *         """
 *         subn(repl, string[, count = 0]) --> (newstring, number of subs)
 */

static PyObject *__pyx_pf_3re2_7Pattern_subn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern_subn[] = "\n        subn(repl, string[, count = 0]) --> (newstring, number of subs)\n        Return the tuple (new_string, number_of_subs_made) found by replacing\n        the leftmost non-overlapping occurrences of pattern with the\n        replacement repl.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern_subn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_repl = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_count;
  int __pyx_v_size;
  char *__pyx_v_cstring;
  re2::StringPiece *__pyx_v_sp;
  std::string *__pyx_v_input_str;
  PyObject *__pyx_v_total_replacements = 0;
  int __pyx_v_encoded;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  char *__pyx_t_6;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__repl,&__pyx_n_s__string,&__pyx_n_s__count,0};
  __Pyx_RefNannySetupContext("subn");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__repl);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("subn", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "subn") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_repl = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_count = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_count = ((int)0);
    }
  } else {
    __pyx_v_count = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_count = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_repl = 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("subn", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern.subn");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_repl);
  __Pyx_INCREF(__pyx_v_string);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":395
 *         cdef _re2.StringPiece * sp
 *         cdef _re2.cpp_string * input_str
 *         cdef total_replacements = 0             # <<<<<<<<<<<<<<
 *         cdef int encoded = 0
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_total_replacements = __pyx_int_0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":396
 *         cdef _re2.cpp_string * input_str
 *         cdef total_replacements = 0
 *         cdef int encoded = 0             # <<<<<<<<<<<<<<
 * 
 *         if callable(repl):
 */
  __pyx_v_encoded = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":398
 *         cdef int encoded = 0
 * 
 *         if callable(repl):             # <<<<<<<<<<<<<<
 *             # This is a callback, so let's use the custom function
 *             return self._subn_callback(repl, string, count)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_repl);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_repl);
  __Pyx_GIVEREF(__pyx_v_repl);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_callable, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":400
 *         if callable(repl):
 *             # This is a callback, so let's use the custom function
 *             return self._subn_callback(repl, string, count)             # <<<<<<<<<<<<<<
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___subn_callback); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyInt_FromLong(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_repl);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_repl);
    __Pyx_GIVEREF(__pyx_v_repl);
    __Pyx_INCREF(__pyx_v_string);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_string);
    __Pyx_GIVEREF(__pyx_v_string);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":402
 *             return self._subn_callback(repl, string, count)
 * 
 *         string = unicode_to_bytestring(string, &encoded)             # <<<<<<<<<<<<<<
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 */
  __pyx_t_1 = __pyx_f_3re2_unicode_to_bytestring(__pyx_v_string, (&__pyx_v_encoded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_string);
  __pyx_v_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":403
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:             # <<<<<<<<<<<<<<
 *             raise TypeError("expected string or buffer")
 *         encoded = <bint>encoded or self.encoded
 */
  __pyx_t_3 = (__pyx_f_3re2_pystring_to_bytestring(__pyx_v_string, (&__pyx_v_cstring), (&__pyx_v_size)) == -1);
  if (__pyx_t_3) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":404
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")             # <<<<<<<<<<<<<<
 *         encoded = <bint>encoded or self.encoded
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":405
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 *         encoded = <bint>encoded or self.encoded             # <<<<<<<<<<<<<<
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 */
  __pyx_t_3 = ((int)__pyx_v_encoded);
  if (!__pyx_t_3) {
    __pyx_t_5 = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->encoded;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  __pyx_v_encoded = __pyx_t_5;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":407
 *         encoded = <bint>encoded or self.encoded
 * 
 *         sp = new _re2.StringPiece(cstring, size)             # <<<<<<<<<<<<<<
 *         input_str = new _re2.cpp_string(string)
 *         if not count:
 */
  __pyx_v_sp = new re2::StringPiece(__pyx_v_cstring, __pyx_v_size);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":408
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 *         input_str = new _re2.cpp_string(string)             # <<<<<<<<<<<<<<
 *         if not count:
 *             total_replacements = _re2.pattern_GlobalReplace(input_str,
 */
  __pyx_t_6 = PyBytes_AsString(__pyx_v_string); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_input_str = new std::string(__pyx_t_6);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":409
 *         sp = new _re2.StringPiece(cstring, size)
 *         input_str = new _re2.cpp_string(string)
 *         if not count:             # <<<<<<<<<<<<<<
 *             total_replacements = _re2.pattern_GlobalReplace(input_str,
 *                                                             self.pattern[0],
 */
  __pyx_t_5 = (!__pyx_v_count);
  if (__pyx_t_5) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":412
 *             total_replacements = _re2.pattern_GlobalReplace(input_str,
 *                                                             self.pattern[0],
 *                                                             sp[0])             # <<<<<<<<<<<<<<
 *         elif count == 1:
 *             total_replacements = _re2.pattern_Replace(input_str,
 */
    __pyx_t_4 = PyInt_FromLong(pattern_GlobalReplace(__pyx_v_input_str, (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern[0]), (__pyx_v_sp[0]))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v_total_replacements);
    __pyx_v_total_replacements = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":413
 *                                                             self.pattern[0],
 *                                                             sp[0])
 *         elif count == 1:             # <<<<<<<<<<<<<<
 *             total_replacements = _re2.pattern_Replace(input_str,
 *                                                       self.pattern[0],
 */
  __pyx_t_5 = (__pyx_v_count == 1);
  if (__pyx_t_5) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":416
 *             total_replacements = _re2.pattern_Replace(input_str,
 *                                                       self.pattern[0],
 *                                                       sp[0])             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError("So far pyre2 does not support custom replacement counts")
 */
    __pyx_t_4 = PyInt_FromLong(pattern_Replace(__pyx_v_input_str, (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern[0]), (__pyx_v_sp[0]))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v_total_replacements);
    __pyx_v_total_replacements = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":418
 *                                                       sp[0])
 *         else:
 *             raise NotImplementedError("So far pyre2 does not support custom replacement counts")             # <<<<<<<<<<<<<<
 * 
 *         if encoded:
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
    __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L8:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":420
 *             raise NotImplementedError("So far pyre2 does not support custom replacement counts")
 * 
 *         if encoded:             # <<<<<<<<<<<<<<
 *             return (cpp_to_utf8(input_str[0]), total_replacements)
 *         else:
 */
  if (__pyx_v_encoded) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":421
 * 
 *         if encoded:
 *             return (cpp_to_utf8(input_str[0]), total_replacements)             # <<<<<<<<<<<<<<
 *         else:
 *             return (cpp_to_pystring(input_str[0]), total_replacements)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_3re2_cpp_to_utf8((__pyx_v_input_str[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_total_replacements);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_total_replacements);
    __Pyx_GIVEREF(__pyx_v_total_replacements);
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":423
 *             return (cpp_to_utf8(input_str[0]), total_replacements)
 *         else:
 *             return (cpp_to_pystring(input_str[0]), total_replacements)             # <<<<<<<<<<<<<<
 * 
 *     def _subn_callback(self, callback, string, int count=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_3re2_cpp_to_pystring((__pyx_v_input_str[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_total_replacements);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_total_replacements);
    __Pyx_GIVEREF(__pyx_v_total_replacements);
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __pyx_L9:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("re2.Pattern.subn");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_total_replacements);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_repl);
  __Pyx_DECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":425
 *             return (cpp_to_pystring(input_str[0]), total_replacements)
 * 
 *     def _subn_callback(self, callback, string, int count=0):             # <<<<<<<<<<<<<<
 *         """
 *         This function is probably the hardest to implement correctly.
 */

static PyObject *__pyx_pf_3re2_7Pattern__subn_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_7Pattern__subn_callback[] = "\n        This function is probably the hardest to implement correctly.\n        This is my first attempt, but if anybody has a better solution, please help out.\n        ";
static PyObject *__pyx_pf_3re2_7Pattern__subn_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_count;
  int __pyx_v_size;
  int __pyx_v_result;
  int __pyx_v_endpos;
  int __pyx_v_pos;
  int __pyx_v_encoded;
  int __pyx_v_num_repl;
  char *__pyx_v_cstring;
  re2::StringPiece *__pyx_v_sp;
  re2::StringPiece *__pyx_v_matches;
  struct __pyx_obj_3re2_Match *__pyx_v_m;
  PyObject *__pyx_v_resultlist = 0;
  long __pyx_v_maxsplit;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__callback,&__pyx_n_s__string,&__pyx_n_s__count,0};
  __Pyx_RefNannySetupContext("_subn_callback");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__callback);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("_subn_callback", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_subn_callback") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_callback = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_count = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_count = ((int)0);
    }
  } else {
    __pyx_v_count = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_count = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_callback = 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("_subn_callback", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.Pattern._subn_callback");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_INCREF(__pyx_v_string);
  __pyx_v_m = ((struct __pyx_obj_3re2_Match *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":433
 *         cdef int result
 *         cdef int endpos
 *         cdef int pos = 0             # <<<<<<<<<<<<<<
 *         cdef int encoded = 0
 *         cdef int num_repl = 0
 */
  __pyx_v_pos = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":434
 *         cdef int endpos
 *         cdef int pos = 0
 *         cdef int encoded = 0             # <<<<<<<<<<<<<<
 *         cdef int num_repl = 0
 *         cdef char * cstring
 */
  __pyx_v_encoded = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":435
 *         cdef int pos = 0
 *         cdef int encoded = 0
 *         cdef int num_repl = 0             # <<<<<<<<<<<<<<
 *         cdef char * cstring
 *         cdef _re2.StringPiece * sp
 */
  __pyx_v_num_repl = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":440
 *         cdef _re2.StringPiece * matches
 *         cdef Match m
 *         cdef list resultlist = []             # <<<<<<<<<<<<<<
 * 
 *         if maxsplit < 0:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_resultlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":442
 *         cdef list resultlist = []
 * 
 *         if maxsplit < 0:             # <<<<<<<<<<<<<<
 *             maxsplit = 0
 * 
 */
  __pyx_t_2 = (__pyx_v_maxsplit < 0);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":443
 * 
 *         if maxsplit < 0:
 *             maxsplit = 0             # <<<<<<<<<<<<<<
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 */
    __pyx_v_maxsplit = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":445
 *             maxsplit = 0
 * 
 *         string = unicode_to_bytestring(string, &encoded)             # <<<<<<<<<<<<<<
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 */
  __pyx_t_1 = __pyx_f_3re2_unicode_to_bytestring(__pyx_v_string, (&__pyx_v_encoded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_string);
  __pyx_v_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":446
 * 
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:             # <<<<<<<<<<<<<<
 *             raise TypeError("expected string or buffer")
 *         encoded = <bint>encoded or self.encoded
 */
  __pyx_t_2 = (__pyx_f_3re2_pystring_to_bytestring(__pyx_v_string, (&__pyx_v_cstring), (&__pyx_v_size)) == -1);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":447
 *         string = unicode_to_bytestring(string, &encoded)
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")             # <<<<<<<<<<<<<<
 *         encoded = <bint>encoded or self.encoded
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":448
 *         if pystring_to_bytestring(string, &cstring, &size) == -1:
 *             raise TypeError("expected string or buffer")
 *         encoded = <bint>encoded or self.encoded             # <<<<<<<<<<<<<<
 * 
 *         sp = new _re2.StringPiece(cstring, size)
 */
  __pyx_t_2 = ((int)__pyx_v_encoded);
  if (!__pyx_t_2) {
    __pyx_t_4 = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->encoded;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_encoded = __pyx_t_4;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":450
 *         encoded = <bint>encoded or self.encoded
 * 
 *         sp = new _re2.StringPiece(cstring, size)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_v_sp = new re2::StringPiece(__pyx_v_cstring, __pyx_v_size);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":452
 *         sp = new _re2.StringPiece(cstring, size)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 */
  while (1) {
    if (!1) break;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":453
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 */
    { PyThreadState *_save;
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":454
 *         while True:
 *             with nogil:
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)             # <<<<<<<<<<<<<<
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 *             if result == 0:
 */
        __pyx_v_matches = new_StringPiece_array((((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups + 1));

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":455
 *             with nogil:
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)             # <<<<<<<<<<<<<<
 *             if result == 0:
 *                 break
 */
        __pyx_v_result = ((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern->Match((__pyx_v_sp[0]), __pyx_v_pos, RE2::UNANCHORED, __pyx_v_matches, (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups + 1));
      }
      /*finally:*/ {

        /* "/home/axiak/Documents/pyre2/src/re2.pyx":453
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 */
        Py_BLOCK_THREADS
      }
    }

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":456
 *                 matches = _re2.new_StringPiece_array(self.ngroups + 1)
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_4 = (__pyx_v_result == 0);
    if (__pyx_t_4) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":457
 *                 result = self.pattern.Match(sp[0], <int>pos, _re2.UNANCHORED, matches, self.ngroups + 1)
 *             if result == 0:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             endpos = matches[0].data() - cstring
 */
      goto __pyx_L9_break;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":459
 *                 break
 * 
 *             endpos = matches[0].data() - cstring             # <<<<<<<<<<<<<<
 *             if encoded:
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))
 */
    __pyx_v_endpos = ((__pyx_v_matches[0]).data() - __pyx_v_cstring);

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":460
 * 
 *             endpos = matches[0].data() - cstring
 *             if encoded:             # <<<<<<<<<<<<<<
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))
 *             else:
 */
    if (__pyx_v_encoded) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":461
 *             endpos = matches[0].data() - cstring
 *             if encoded:
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))             # <<<<<<<<<<<<<<
 *             else:
 *                 resultlist.append(sp.data()[pos:endpos])
 */
      if (unlikely(__pyx_v_resultlist == Py_None)) {
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_3 = __pyx_f_3re2_char_to_utf8((&(__pyx_v_sp->data()[__pyx_v_pos])), (__pyx_v_endpos - __pyx_v_pos)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":463
 *                 resultlist.append(char_to_utf8(&sp.data()[pos], endpos - pos))
 *             else:
 *                 resultlist.append(sp.data()[pos:endpos])             # <<<<<<<<<<<<<<
 *             pos = endpos + matches[0].length()
 * 
 */
      if (unlikely(__pyx_v_resultlist == Py_None)) {
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_sp->data() + __pyx_v_pos, __pyx_v_endpos - __pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    }
    __pyx_L16:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":464
 *             else:
 *                 resultlist.append(sp.data()[pos:endpos])
 *             pos = endpos + matches[0].length()             # <<<<<<<<<<<<<<
 * 
 *             m = Match()
 */
    __pyx_v_pos = (__pyx_v_endpos + (__pyx_v_matches[0]).length());

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":466
 *             pos = endpos + matches[0].length()
 * 
 *             m = Match()             # <<<<<<<<<<<<<<
 *             m.encoded = encoded
 *             m.matches = matches
 */
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3re2_Match)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_v_m));
    __pyx_v_m = ((struct __pyx_obj_3re2_Match *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":467
 * 
 *             m = Match()
 *             m.encoded = encoded             # <<<<<<<<<<<<<<
 *             m.matches = matches
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 */
    __pyx_v_m->encoded = __pyx_v_encoded;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":468
 *             m = Match()
 *             m.encoded = encoded
 *             m.matches = matches             # <<<<<<<<<<<<<<
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *             m.nmatches = self.ngroups + 1
 */
    __pyx_v_m->matches = __pyx_v_matches;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":469
 *             m.encoded = encoded
 *             m.matches = matches
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())             # <<<<<<<<<<<<<<
 *             m.nmatches = self.ngroups + 1
 *             m.match_string = string
 */
    __pyx_v_m->named_groups = addressof(((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->pattern->NamedCapturingGroups());

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":470
 *             m.matches = matches
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *             m.nmatches = self.ngroups + 1             # <<<<<<<<<<<<<<
 *             m.match_string = string
 *             m.init_groups()
 */
    __pyx_v_m->nmatches = (((struct __pyx_obj_3re2_Pattern *)__pyx_v_self)->ngroups + 1);

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":471
 *             m.named_groups = _re2.addressof(self.pattern.NamedCapturingGroups())
 *             m.nmatches = self.ngroups + 1
 *             m.match_string = string             # <<<<<<<<<<<<<<
 *             m.init_groups()
 *             resultlist.append(callback(m) or '')
 */
    __Pyx_INCREF(__pyx_v_string);
    __Pyx_GIVEREF(__pyx_v_string);
    __Pyx_GOTREF(__pyx_v_m->match_string);
    __Pyx_DECREF(__pyx_v_m->match_string);
    __pyx_v_m->match_string = __pyx_v_string;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":472
 *             m.nmatches = self.ngroups + 1
 *             m.match_string = string
 *             m.init_groups()             # <<<<<<<<<<<<<<
 *             resultlist.append(callback(m) or '')
 * 
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3re2_Match *)__pyx_v_m->__pyx_vtab)->init_groups(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":473
 *             m.match_string = string
 *             m.init_groups()
 *             resultlist.append(callback(m) or '')             # <<<<<<<<<<<<<<
 * 
 *             num_repl += 1
 */
    if (unlikely(__pyx_v_resultlist == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_m));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_m));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
    __pyx_t_1 = PyObject_Call(__pyx_v_callback, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_4) {
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
      __pyx_t_3 = __pyx_kp_s_7;
    } else {
      __pyx_t_3 = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":475
 *             resultlist.append(callback(m) or '')
 * 
 *             num_repl += 1             # <<<<<<<<<<<<<<
 *             if count and num_repl >= count:
 *                 break
 */
    __pyx_v_num_repl += 1;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":476
 * 
 *             num_repl += 1
 *             if count and num_repl >= count:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    if (__pyx_v_count) {
      __pyx_t_4 = (__pyx_v_num_repl >= __pyx_v_count);
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_v_count;
    }
    if (__pyx_t_2) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":477
 *             num_repl += 1
 *             if count and num_repl >= count:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if encoded:
 */
      goto __pyx_L9_break;
      goto __pyx_L17;
    }
    __pyx_L17:;
  }
  __pyx_L9_break:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":479
 *                 break
 * 
 *         if encoded:             # <<<<<<<<<<<<<<
 *             resultlist.append(char_to_utf8(&sp.data()[pos], sp.length() - pos))
 *         else:
 */
  if (__pyx_v_encoded) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":480
 * 
 *         if encoded:
 *             resultlist.append(char_to_utf8(&sp.data()[pos], sp.length() - pos))             # <<<<<<<<<<<<<<
 *         else:
 *             resultlist.append(sp.data()[pos:])
 */
    if (unlikely(__pyx_v_resultlist == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = __pyx_f_3re2_char_to_utf8((&(__pyx_v_sp->data()[__pyx_v_pos])), (__pyx_v_sp->length() - __pyx_v_pos)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L18;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":482
 *             resultlist.append(char_to_utf8(&sp.data()[pos], sp.length() - pos))
 *         else:
 *             resultlist.append(sp.data()[pos:])             # <<<<<<<<<<<<<<
 *         del matches
 *         del sp
 */
    if (unlikely(__pyx_v_resultlist == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = PyBytes_FromString(__pyx_v_sp->data() + __pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_resultlist), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  }
  __pyx_L18:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":483
 *         else:
 *             resultlist.append(sp.data()[pos:])
 *         del matches             # <<<<<<<<<<<<<<
 *         del sp
 *         if encoded:
 */
  delete __pyx_v_matches;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":484
 *             resultlist.append(sp.data()[pos:])
 *         del matches
 *         del sp             # <<<<<<<<<<<<<<
 *         if encoded:
 *             return (u''.join(resultlist), num_repl)
 */
  delete __pyx_v_sp;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":485
 *         del matches
 *         del sp
 *         if encoded:             # <<<<<<<<<<<<<<
 *             return (u''.join(resultlist), num_repl)
 *         else:
 */
  if (__pyx_v_encoded) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":486
 *         del sp
 *         if encoded:
 *             return (u''.join(resultlist), num_repl)             # <<<<<<<<<<<<<<
 *         else:
 *             return (''.join(resultlist), num_repl)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)PyUnicode_Join(__pyx_kp_u_7, ((PyObject *)__pyx_v_resultlist))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyInt_FromLong(__pyx_v_num_repl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L19;
  }
  /*else*/ {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":488
 *             return (u''.join(resultlist), num_repl)
 *         else:
 *             return (''.join(resultlist), num_repl)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_resultlist));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_resultlist));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_resultlist));
    __pyx_t_3 = PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_num_repl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }
  __pyx_L19:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("re2.Pattern._subn_callback");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_resultlist);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_callback);
  __Pyx_DECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":491
 * 
 * 
 * def compile(pattern, int flags=0):             # <<<<<<<<<<<<<<
 *     """
 *     Compile a regular expression pattern, returning a pattern object.
 */

static PyObject *__pyx_pf_3re2_compile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_compile[] = "\n    Compile a regular expression pattern, returning a pattern object.\n    ";
static PyObject *__pyx_pf_3re2_compile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  int __pyx_v_flags;
  char *__pyx_v_string;
  int __pyx_v_length;
  re2::StringPiece *__pyx_v_s;
  RE2::Options __pyx_v_opts;
  int __pyx_v_error_code;
  int __pyx_v_encoded;
  PyObject *__pyx_v_strflags = 0;
  re2::RE2 *__pyx_v_re_pattern;
  PyObject *__pyx_v_error_msg;
  struct __pyx_obj_3re2_Pattern *__pyx_v_pypattern = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__flags,0};
  __Pyx_RefNannySetupContext("compile");
  __pyx_self = __pyx_self;
  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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "compile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    if (values[1]) {
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_flags = ((int)0);
    }
  } else {
    __pyx_v_flags = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_pattern = 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("compile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.compile");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_pattern);
  __pyx_v_error_msg = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":500
 *     cdef _re2.Options opts
 *     cdef int error_code
 *     cdef int encoded = 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(pattern, Pattern):
 */
  __pyx_v_encoded = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":502
 *     cdef int encoded = 0
 * 
 *     if isinstance(pattern, Pattern):             # <<<<<<<<<<<<<<
 *         return pattern
 * 
 */
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_pattern, ((PyTypeObject *)((PyObject*)__pyx_ptype_3re2_Pattern))); 
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":503
 * 
 *     if isinstance(pattern, Pattern):
 *         return pattern             # <<<<<<<<<<<<<<
 * 
 *     cdef str strflags = ''
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_pattern);
    __pyx_r = __pyx_v_pattern;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":505
 *         return pattern
 * 
 *     cdef str strflags = ''             # <<<<<<<<<<<<<<
 *     # Set the options given the flags above.
 *     if flags & _I:
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
  __pyx_v_strflags = __pyx_kp_s_7;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":507
 *     cdef str strflags = ''
 *     # Set the options given the flags above.
 *     if flags & _I:             # <<<<<<<<<<<<<<
 *         opts.set_case_sensitive(0);
 * 
 */
  __pyx_t_2 = (__pyx_v_flags & __pyx_v_3re2__I);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":508
 *     # Set the options given the flags above.
 *     if flags & _I:
 *         opts.set_case_sensitive(0);             # <<<<<<<<<<<<<<
 * 
 *     # The re.U flag is actually ignored since there
 */
    __pyx_v_opts.set_case_sensitive(0);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":512
 *     # The re.U flag is actually ignored since there
 *     # are no unicode dependent character classes yet...
 *     opts.set_encoding(_re2.EncodingUTF8)             # <<<<<<<<<<<<<<
 * 
 *     if not (flags & _X):
 */
  __pyx_v_opts.set_encoding(RE2::Options::EncodingUTF8);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":514
 *     opts.set_encoding(_re2.EncodingUTF8)
 * 
 *     if not (flags & _X):             # <<<<<<<<<<<<<<
 *         opts.set_log_errors(0)
 * 
 */
  __pyx_t_1 = (!(__pyx_v_flags & __pyx_v_3re2__X));
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":515
 * 
 *     if not (flags & _X):
 *         opts.set_log_errors(0)             # <<<<<<<<<<<<<<
 * 
 *     if flags & _S:
 */
    __pyx_v_opts.set_log_errors(0);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":517
 *         opts.set_log_errors(0)
 * 
 *     if flags & _S:             # <<<<<<<<<<<<<<
 *         strflags += 's'
 *     if flags & _M:
 */
  __pyx_t_2 = (__pyx_v_flags & __pyx_v_3re2__S);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":518
 * 
 *     if flags & _S:
 *         strflags += 's'             # <<<<<<<<<<<<<<
 *     if flags & _M:
 *         strflags += 'm'
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_strflags), ((PyObject *)__pyx_n_s__s)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_strflags));
    __pyx_v_strflags = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":519
 *     if flags & _S:
 *         strflags += 's'
 *     if flags & _M:             # <<<<<<<<<<<<<<
 *         strflags += 'm'
 * 
 */
  __pyx_t_2 = (__pyx_v_flags & __pyx_v_3re2__M);
  if (__pyx_t_2) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":520
 *         strflags += 's'
 *     if flags & _M:
 *         strflags += 'm'             # <<<<<<<<<<<<<<
 * 
 *     if strflags:
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_strflags), ((PyObject *)__pyx_n_s__m)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_strflags));
    __pyx_v_strflags = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":522
 *         strflags += 'm'
 * 
 *     if strflags:             # <<<<<<<<<<<<<<
 *         pattern = '(?' + strflags + ')' + pattern
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_strflags)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":523
 * 
 *     if strflags:
 *         pattern = '(?' + strflags + ')' + pattern             # <<<<<<<<<<<<<<
 * 
 *     # We use this function to get the proper length of the string.
 */
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_v_strflags)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_kp_s_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_t_4), __pyx_v_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_pattern);
    __pyx_v_pattern = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":527
 *     # We use this function to get the proper length of the string.
 * 
 *     pattern = unicode_to_bytestring(pattern, &encoded)             # <<<<<<<<<<<<<<
 *     if pystring_to_bytestring(pattern, &string, &length) == -1:
 *         raise TypeError("first argument must be a string or compiled pattern")
 */
  __pyx_t_3 = __pyx_f_3re2_unicode_to_bytestring(__pyx_v_pattern, (&__pyx_v_encoded)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_pattern);
  __pyx_v_pattern = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":528
 * 
 *     pattern = unicode_to_bytestring(pattern, &encoded)
 *     if pystring_to_bytestring(pattern, &string, &length) == -1:             # <<<<<<<<<<<<<<
 *         raise TypeError("first argument must be a string or compiled pattern")
 * 
 */
  __pyx_t_1 = (__pyx_f_3re2_pystring_to_bytestring(__pyx_v_pattern, (&__pyx_v_string), (&__pyx_v_length)) == -1);
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":529
 *     pattern = unicode_to_bytestring(pattern, &encoded)
 *     if pystring_to_bytestring(pattern, &string, &length) == -1:
 *         raise TypeError("first argument must be a string or compiled pattern")             # <<<<<<<<<<<<<<
 * 
 *     s = new _re2.StringPiece(string, length)
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_10));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":531
 *         raise TypeError("first argument must be a string or compiled pattern")
 * 
 *     s = new _re2.StringPiece(string, length)             # <<<<<<<<<<<<<<
 * 
 *     cdef _re2.RE2 * re_pattern = new _re2.RE2(s[0], opts)
 */
  __pyx_v_s = new re2::StringPiece(__pyx_v_string, __pyx_v_length);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":533
 *     s = new _re2.StringPiece(string, length)
 * 
 *     cdef _re2.RE2 * re_pattern = new _re2.RE2(s[0], opts)             # <<<<<<<<<<<<<<
 *     if not re_pattern.ok():
 *         # Something went wrong with the compilation.
 */
  __pyx_v_re_pattern = new re2::RE2((__pyx_v_s[0]), __pyx_v_opts);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":534
 * 
 *     cdef _re2.RE2 * re_pattern = new _re2.RE2(s[0], opts)
 *     if not re_pattern.ok():             # <<<<<<<<<<<<<<
 *         # Something went wrong with the compilation.
 *         del s
 */
  __pyx_t_1 = (!__pyx_v_re_pattern->ok());
  if (__pyx_t_1) {

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":536
 *     if not re_pattern.ok():
 *         # Something went wrong with the compilation.
 *         del s             # <<<<<<<<<<<<<<
 *         error_msg = cpp_to_pystring(re_pattern.error())
 *         error_code = re_pattern.error_code()
 */
    delete __pyx_v_s;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":537
 *         # Something went wrong with the compilation.
 *         del s
 *         error_msg = cpp_to_pystring(re_pattern.error())             # <<<<<<<<<<<<<<
 *         error_code = re_pattern.error_code()
 *         del re_pattern
 */
    __pyx_t_4 = __pyx_f_3re2_cpp_to_pystring(__pyx_v_re_pattern->error()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v_error_msg);
    __pyx_v_error_msg = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":538
 *         del s
 *         error_msg = cpp_to_pystring(re_pattern.error())
 *         error_code = re_pattern.error_code()             # <<<<<<<<<<<<<<
 *         del re_pattern
 *         if current_notification == <int>FALLBACK_EXCEPTION:
 */
    __pyx_v_error_code = __pyx_v_re_pattern->error_code();

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":539
 *         error_msg = cpp_to_pystring(re_pattern.error())
 *         error_code = re_pattern.error_code()
 *         del re_pattern             # <<<<<<<<<<<<<<
 *         if current_notification == <int>FALLBACK_EXCEPTION:
 *             # Raise an exception regardless of the type of error.
 */
    delete __pyx_v_re_pattern;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":540
 *         error_code = re_pattern.error_code()
 *         del re_pattern
 *         if current_notification == <int>FALLBACK_EXCEPTION:             # <<<<<<<<<<<<<<
 *             # Raise an exception regardless of the type of error.
 *             raise RegexError(error_msg)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FALLBACK_EXCEPTION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__pyx_v_3re2_current_notification == __pyx_t_2);
    if (__pyx_t_1) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":542
 *         if current_notification == <int>FALLBACK_EXCEPTION:
 *             # Raise an exception regardless of the type of error.
 *             raise RegexError(error_msg)             # <<<<<<<<<<<<<<
 *         elif error_code != _re2.ErrorBadPerlOp and error_code != _re2.ErrorRepeatSize:
 *             # Raise an error because these will not be fixed by using the ``re`` module.
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__RegexError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __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 = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_error_msg);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_error_msg);
      __Pyx_GIVEREF(__pyx_v_error_msg);
      __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":543
 *             # Raise an exception regardless of the type of error.
 *             raise RegexError(error_msg)
 *         elif error_code != _re2.ErrorBadPerlOp and error_code != _re2.ErrorRepeatSize:             # <<<<<<<<<<<<<<
 *             # Raise an error because these will not be fixed by using the ``re`` module.
 *             raise RegexError(error_msg)
 */
    __pyx_t_1 = (__pyx_v_error_code != RE2::ErrorBadPerlOp);
    if (__pyx_t_1) {
      __pyx_t_6 = (__pyx_v_error_code != RE2::ErrorRepeatSize);
      __pyx_t_7 = __pyx_t_6;
    } else {
      __pyx_t_7 = __pyx_t_1;
    }
    if (__pyx_t_7) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":545
 *         elif error_code != _re2.ErrorBadPerlOp and error_code != _re2.ErrorRepeatSize:
 *             # Raise an error because these will not be fixed by using the ``re`` module.
 *             raise RegexError(error_msg)             # <<<<<<<<<<<<<<
 *         elif current_notification == <int>FALLBACK_WARNING:
 *             warnings.warn("WARNING: Using re module. Reason: %s" % error_msg)
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__RegexError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_error_msg);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_error_msg);
      __Pyx_GIVEREF(__pyx_v_error_msg);
      __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":546
 *             # Raise an error because these will not be fixed by using the ``re`` module.
 *             raise RegexError(error_msg)
 *         elif current_notification == <int>FALLBACK_WARNING:             # <<<<<<<<<<<<<<
 *             warnings.warn("WARNING: Using re module. Reason: %s" % error_msg)
 *         return re.compile(pattern, flags)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FALLBACK_WARNING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = (__pyx_v_3re2_current_notification == __pyx_t_2);
    if (__pyx_t_7) {

      /* "/home/axiak/Documents/pyre2/src/re2.pyx":547
 *             raise RegexError(error_msg)
 *         elif current_notification == <int>FALLBACK_WARNING:
 *             warnings.warn("WARNING: Using re module. Reason: %s" % error_msg)             # <<<<<<<<<<<<<<
 *         return re.compile(pattern, flags)
 * 
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_v_error_msg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "/home/axiak/Documents/pyre2/src/re2.pyx":548
 *         elif current_notification == <int>FALLBACK_WARNING:
 *             warnings.warn("WARNING: Using re module. Reason: %s" % error_msg)
 *         return re.compile(pattern, flags)             # <<<<<<<<<<<<<<
 * 
 *     cdef Pattern pypattern = Pattern()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__compile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_pattern);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
    __Pyx_GIVEREF(__pyx_v_pattern);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":550
 *         return re.compile(pattern, flags)
 * 
 *     cdef Pattern pypattern = Pattern()             # <<<<<<<<<<<<<<
 *     pypattern.pattern = re_pattern
 *     pypattern.ngroups = re_pattern.NumberOfCapturingGroups()
 */
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3re2_Pattern)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_pypattern = ((struct __pyx_obj_3re2_Pattern *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":551
 * 
 *     cdef Pattern pypattern = Pattern()
 *     pypattern.pattern = re_pattern             # <<<<<<<<<<<<<<
 *     pypattern.ngroups = re_pattern.NumberOfCapturingGroups()
 *     pypattern.encoded = <bint>encoded
 */
  __pyx_v_pypattern->pattern = __pyx_v_re_pattern;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":552
 *     cdef Pattern pypattern = Pattern()
 *     pypattern.pattern = re_pattern
 *     pypattern.ngroups = re_pattern.NumberOfCapturingGroups()             # <<<<<<<<<<<<<<
 *     pypattern.encoded = <bint>encoded
 *     del s
 */
  __pyx_v_pypattern->ngroups = __pyx_v_re_pattern->NumberOfCapturingGroups();

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":553
 *     pypattern.pattern = re_pattern
 *     pypattern.ngroups = re_pattern.NumberOfCapturingGroups()
 *     pypattern.encoded = <bint>encoded             # <<<<<<<<<<<<<<
 *     del s
 *     return pypattern
 */
  __pyx_v_pypattern->encoded = ((int)__pyx_v_encoded);

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":554
 *     pypattern.ngroups = re_pattern.NumberOfCapturingGroups()
 *     pypattern.encoded = <bint>encoded
 *     del s             # <<<<<<<<<<<<<<
 *     return pypattern
 * 
 */
  delete __pyx_v_s;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":555
 *     pypattern.encoded = <bint>encoded
 *     del s
 *     return pypattern             # <<<<<<<<<<<<<<
 * 
 * def search(pattern, string, int flags=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_pypattern));
  __pyx_r = ((PyObject *)__pyx_v_pypattern);
  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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("re2.compile");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_strflags);
  __Pyx_DECREF(__pyx_v_error_msg);
  __Pyx_XDECREF((PyObject *)__pyx_v_pypattern);
  __Pyx_DECREF(__pyx_v_pattern);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":557
 *     return pypattern
 * 
 * def search(pattern, string, int flags=0):             # <<<<<<<<<<<<<<
 *     """
 *     Scan through string looking for a match to the pattern, returning
 */

static PyObject *__pyx_pf_3re2_search(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_search[] = "\n    Scan through string looking for a match to the pattern, returning\n    a match object or none if no match was found.\n    ";
static PyObject *__pyx_pf_3re2_search(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__flags,0};
  __Pyx_RefNannySetupContext("search");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("search", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "search") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_flags = ((int)0);
    }
  } else {
    __pyx_v_flags = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("search", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.search");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":562
 *     a match object or none if no match was found.
 *     """
 *     return compile(pattern, flags).search(string)             # <<<<<<<<<<<<<<
 * 
 * def match(pattern, string, int flags=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __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 = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__search); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("re2.search");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":564
 *     return compile(pattern, flags).search(string)
 * 
 * def match(pattern, string, int flags=0):             # <<<<<<<<<<<<<<
 *     """
 *     Try to apply the pattern at the start of the string, returning
 */

static PyObject *__pyx_pf_3re2_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_match[] = "\n    Try to apply the pattern at the start of the string, returning\n    a match object, or None if no match was found.\n    ";
static PyObject *__pyx_pf_3re2_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__flags,0};
  __Pyx_RefNannySetupContext("match");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("match", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_flags = ((int)0);
    }
  } else {
    __pyx_v_flags = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("match", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.match");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":569
 *     a match object, or None if no match was found.
 *     """
 *     return compile(pattern, flags).match(string)             # <<<<<<<<<<<<<<
 * 
 * def finditer(pattern, string, int flags=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __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 = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__match); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("re2.match");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":571
 *     return compile(pattern, flags).match(string)
 * 
 * def finditer(pattern, string, int flags=0):             # <<<<<<<<<<<<<<
 *     """
 *     Return an list of all non-overlapping matches in the
 */

static PyObject *__pyx_pf_3re2_finditer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_finditer[] = "\n    Return an list of all non-overlapping matches in the\n    string.  For each match, the iterator returns a match object.\n\n    Empty matches are included in the result.\n    ";
static PyObject *__pyx_pf_3re2_finditer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__flags,0};
  __Pyx_RefNannySetupContext("finditer");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("finditer", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "finditer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_flags = ((int)0);
    }
  } else {
    __pyx_v_flags = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("finditer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.finditer");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":578
 *     Empty matches are included in the result.
 *     """
 *     return compile(pattern, flags).finditer(string)             # <<<<<<<<<<<<<<
 * 
 * def findall(pattern, string, int flags=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __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 = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__finditer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("re2.finditer");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":580
 *     return compile(pattern, flags).finditer(string)
 * 
 * def findall(pattern, string, int flags=0):             # <<<<<<<<<<<<<<
 *     """
 *     Return an list of all non-overlapping matches in the
 */

static PyObject *__pyx_pf_3re2_findall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_findall[] = "\n    Return an list of all non-overlapping matches in the\n    string.  For each match, the iterator returns a match object.\n\n    Empty matches are included in the result.\n    ";
static PyObject *__pyx_pf_3re2_findall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__flags,0};
  __Pyx_RefNannySetupContext("findall");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("findall", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "findall") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_flags = ((int)0);
    }
  } else {
    __pyx_v_flags = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("findall", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.findall");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":587
 *     Empty matches are included in the result.
 *     """
 *     return compile(pattern, flags).findall(string)             # <<<<<<<<<<<<<<
 * 
 * def split(pattern, string, int maxsplit=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __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 = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__findall); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("re2.findall");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":589
 *     return compile(pattern, flags).findall(string)
 * 
 * def split(pattern, string, int maxsplit=0):             # <<<<<<<<<<<<<<
 *     """
 *     Split the source string by the occurrences of the pattern,
 */

static PyObject *__pyx_pf_3re2_split(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_split[] = "\n    Split the source string by the occurrences of the pattern,\n    returning a list containing the resulting substrings.\n    ";
static PyObject *__pyx_pf_3re2_split(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_maxsplit;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__maxsplit,0};
  __Pyx_RefNannySetupContext("split");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("split", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxsplit);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "split") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_maxsplit = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_maxsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_maxsplit = ((int)0);
    }
  } else {
    __pyx_v_maxsplit = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_maxsplit = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_maxsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("split", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.split");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":594
 *     returning a list containing the resulting substrings.
 *     """
 *     return compile(pattern).split(string, maxsplit)             # <<<<<<<<<<<<<<
 * 
 * def sub(pattern, string, int count=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __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 = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __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 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromLong(__pyx_v_maxsplit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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("re2.split");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":596
 *     return compile(pattern).split(string, maxsplit)
 * 
 * def sub(pattern, string, int count=0):             # <<<<<<<<<<<<<<
 *     """
 *     Return the string obtained by replacing the leftmost
 */

static PyObject *__pyx_pf_3re2_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_sub[] = "\n    Return the string obtained by replacing the leftmost\n    non-overlapping occurrences of the pattern in string by the\n    replacement repl.  repl can be either a string or a callable;\n    if a string, backslash escapes in it are processed.  If it is\n    a callable, it's passed the match object and must return\n    a replacement string to be used.\n    ";
static PyObject *__pyx_pf_3re2_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_count;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__count,0};
  __Pyx_RefNannySetupContext("sub");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("sub", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_count = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_count = ((int)0);
    }
  } else {
    __pyx_v_count = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_count = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("sub", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.sub");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":605
 *     a replacement string to be used.
 *     """
 *     return compile(pattern).sub(string, count)             # <<<<<<<<<<<<<<
 * 
 * def subn(pattern, string, int count=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __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 = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __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 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__sub); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromLong(__pyx_v_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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("re2.sub");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/axiak/Documents/pyre2/src/re2.pyx":607
 *     return compile(pattern).sub(string, count)
 * 
 * def subn(pattern, string, int count=0):             # <<<<<<<<<<<<<<
 *     """
 *     Return a 2-tuple containing (new_string, number).
 */

static PyObject *__pyx_pf_3re2_subn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3re2_subn[] = "\n    Return a 2-tuple containing (new_string, number).\n    new_string is the string obtained by replacing the leftmost\n    non-overlapping occurrences of the pattern in the source\n    string by the replacement repl.  number is the number of\n    substitutions that were made. repl can be either a string or a\n    callable; if a string, backslash escapes in it are processed.\n    If it is a callable, it's passed the match object and must\n    return a replacement string to be used.\n    ";
static PyObject *__pyx_pf_3re2_subn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_string = 0;
  int __pyx_v_count;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pattern,&__pyx_n_s__string,&__pyx_n_s__count,0};
  __Pyx_RefNannySetupContext("subn");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__pattern);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("subn", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "subn") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_pattern = values[0];
    __pyx_v_string = values[1];
    if (values[2]) {
      __pyx_v_count = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_count = ((int)0);
    }
  } else {
    __pyx_v_count = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_count = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_pattern = 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("subn", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("re2.subn");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":618
 *     return a replacement string to be used.
 *     """
 *     return compile(pattern).subn(string, count)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __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 = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_pattern);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
  __Pyx_GIVEREF(__pyx_v_pattern);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __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 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__subn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromLong(__pyx_v_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_string);
  __Pyx_GIVEREF(__pyx_v_string);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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("re2.subn");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_3re2_Match __pyx_vtable_3re2_Match;

static PyObject *__pyx_tp_new_3re2_Match(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3re2_Match *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_3re2_Match *)o);
  p->__pyx_vtab = __pyx_vtabptr_3re2_Match;
  p->_lastgroup = Py_None; Py_INCREF(Py_None);
  p->match_string = Py_None; Py_INCREF(Py_None);
  p->_groups = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->_named_groups = ((PyObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3re2_Match(PyObject *o) {
  struct __pyx_obj_3re2_Match *p = (struct __pyx_obj_3re2_Match *)o;
  Py_XDECREF(p->_lastgroup);
  Py_XDECREF(p->match_string);
  Py_XDECREF(((PyObject *)p->_groups));
  Py_XDECREF(((PyObject *)p->_named_groups));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_3re2_Match(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3re2_Match *p = (struct __pyx_obj_3re2_Match *)o;
  if (p->_lastgroup) {
    e = (*v)(p->_lastgroup, a); if (e) return e;
  }
  if (p->match_string) {
    e = (*v)(p->match_string, a); if (e) return e;
  }
  if (p->_groups) {
    e = (*v)(p->_groups, a); if (e) return e;
  }
  if (p->_named_groups) {
    e = (*v)(p->_named_groups, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3re2_Match(PyObject *o) {
  struct __pyx_obj_3re2_Match *p = (struct __pyx_obj_3re2_Match *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_lastgroup);
  p->_lastgroup = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->match_string);
  p->match_string = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_groups);
  p->_groups = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_named_groups);
  p->_named_groups = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3re2_5Match_lastindex(PyObject *o, void *x) {
  return __pyx_pf_3re2_5Match_9lastindex___get__(o);
}

static PyObject *__pyx_getprop_3re2_5Match_lastgroup(PyObject *o, void *x) {
  return __pyx_pf_3re2_5Match_9lastgroup___get__(o);
}

static PyMethodDef __pyx_methods_3re2_Match[] = {
  {__Pyx_NAMESTR("groups"), (PyCFunction)__pyx_pf_3re2_5Match_groups, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("group"), (PyCFunction)__pyx_pf_3re2_5Match_group, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("groupdict"), (PyCFunction)__pyx_pf_3re2_5Match_groupdict, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("end"), (PyCFunction)__pyx_pf_3re2_5Match_end, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pf_3re2_5Match_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("span"), (PyCFunction)__pyx_pf_3re2_5Match_span, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3re2_Match[] = {
  {(char *)"lastindex", __pyx_getprop_3re2_5Match_lastindex, 0, 0, 0},
  {(char *)"lastgroup", __pyx_getprop_3re2_5Match_lastgroup, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Match = {
  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_Match = {
  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_Match = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Match = {
  #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_3re2_Match = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("re2.Match"), /*tp_name*/
  sizeof(struct __pyx_obj_3re2_Match), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3re2_Match, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*tp_compare*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Match, /*tp_as_number*/
  &__pyx_tp_as_sequence_Match, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Match, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Match, /*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_3re2_Match, /*tp_traverse*/
  __pyx_tp_clear_3re2_Match, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3re2_Match, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3re2_Match, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_3re2_5Match___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3re2_Match, /*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_3re2_Pattern __pyx_vtable_3re2_Pattern;

static PyObject *__pyx_tp_new_3re2_Pattern(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3re2_Pattern *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_3re2_Pattern *)o);
  p->__pyx_vtab = __pyx_vtabptr_3re2_Pattern;
  return o;
}

static void __pyx_tp_dealloc_3re2_Pattern(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_3re2_Pattern[] = {
  {__Pyx_NAMESTR("search"), (PyCFunction)__pyx_pf_3re2_7Pattern_search, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_search)},
  {__Pyx_NAMESTR("match"), (PyCFunction)__pyx_pf_3re2_7Pattern_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_match)},
  {__Pyx_NAMESTR("findall"), (PyCFunction)__pyx_pf_3re2_7Pattern_findall, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_findall)},
  {__Pyx_NAMESTR("finditer"), (PyCFunction)__pyx_pf_3re2_7Pattern_finditer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_finditer)},
  {__Pyx_NAMESTR("split"), (PyCFunction)__pyx_pf_3re2_7Pattern_split, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_split)},
  {__Pyx_NAMESTR("sub"), (PyCFunction)__pyx_pf_3re2_7Pattern_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_sub)},
  {__Pyx_NAMESTR("subn"), (PyCFunction)__pyx_pf_3re2_7Pattern_subn, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern_subn)},
  {__Pyx_NAMESTR("_subn_callback"), (PyCFunction)__pyx_pf_3re2_7Pattern__subn_callback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_7Pattern__subn_callback)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Pattern = {
  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_Pattern = {
  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_Pattern = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Pattern = {
  #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_3re2_Pattern = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("re2.Pattern"), /*tp_name*/
  sizeof(struct __pyx_obj_3re2_Pattern), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3re2_Pattern, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*tp_compare*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Pattern, /*tp_as_number*/
  &__pyx_tp_as_sequence_Pattern, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Pattern, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Pattern, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3re2_Pattern, /*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_3re2_Pattern, /*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 PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("set_fallback_notification"), (PyCFunction)__pyx_pf_3re2_set_fallback_notification, METH_O, __Pyx_DOCSTR(__pyx_doc_3re2_set_fallback_notification)},
  {__Pyx_NAMESTR("compile"), (PyCFunction)__pyx_pf_3re2_compile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_compile)},
  {__Pyx_NAMESTR("search"), (PyCFunction)__pyx_pf_3re2_search, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_search)},
  {__Pyx_NAMESTR("match"), (PyCFunction)__pyx_pf_3re2_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_match)},
  {__Pyx_NAMESTR("finditer"), (PyCFunction)__pyx_pf_3re2_finditer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_finditer)},
  {__Pyx_NAMESTR("findall"), (PyCFunction)__pyx_pf_3re2_findall, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_findall)},
  {__Pyx_NAMESTR("split"), (PyCFunction)__pyx_pf_3re2_split, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_split)},
  {__Pyx_NAMESTR("sub"), (PyCFunction)__pyx_pf_3re2_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_sub)},
  {__Pyx_NAMESTR("subn"), (PyCFunction)__pyx_pf_3re2_subn, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3re2_subn)},
  {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("re2"),
    0, /* 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_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_n_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 1},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_u_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 1, 0, 0},
  {&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1},
  {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0},
  {&__pyx_kp_u_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 0, 0},
  {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0},
  {&__pyx_kp_u_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 1, 0, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_u_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 1, 0, 0},
  {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0},
  {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0},
  {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0},
  {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0},
  {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0},
  {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0},
  {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0},
  {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
  {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
  {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0},
  {&__pyx_n_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 1},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_n_s__DOTALL, __pyx_k__DOTALL, sizeof(__pyx_k__DOTALL), 0, 0, 1, 1},
  {&__pyx_n_s__FALLBACK_EXCEPTION, __pyx_k__FALLBACK_EXCEPTION, sizeof(__pyx_k__FALLBACK_EXCEPTION), 0, 0, 1, 1},
  {&__pyx_n_s__FALLBACK_QUIETLY, __pyx_k__FALLBACK_QUIETLY, sizeof(__pyx_k__FALLBACK_QUIETLY), 0, 0, 1, 1},
  {&__pyx_n_s__FALLBACK_WARNING, __pyx_k__FALLBACK_WARNING, sizeof(__pyx_k__FALLBACK_WARNING), 0, 0, 1, 1},
  {&__pyx_n_s__I, __pyx_k__I, sizeof(__pyx_k__I), 0, 0, 1, 1},
  {&__pyx_n_s__IGNORECASE, __pyx_k__IGNORECASE, sizeof(__pyx_k__IGNORECASE), 0, 0, 1, 1},
  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
  {&__pyx_n_s__M, __pyx_k__M, sizeof(__pyx_k__M), 0, 0, 1, 1},
  {&__pyx_n_s__MULTILINE, __pyx_k__MULTILINE, sizeof(__pyx_k__MULTILINE), 0, 0, 1, 1},
  {&__pyx_n_s__Match, __pyx_k__Match, sizeof(__pyx_k__Match), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__Pattern, __pyx_k__Pattern, sizeof(__pyx_k__Pattern), 0, 0, 1, 1},
  {&__pyx_n_s__RegexError, __pyx_k__RegexError, sizeof(__pyx_k__RegexError), 0, 0, 1, 1},
  {&__pyx_n_s__S, __pyx_k__S, sizeof(__pyx_k__S), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__U, __pyx_k__U, sizeof(__pyx_k__U), 0, 0, 1, 1},
  {&__pyx_n_s__UNICODE, __pyx_k__UNICODE, sizeof(__pyx_k__UNICODE), 0, 0, 1, 1},
  {&__pyx_n_s__VERBOSE, __pyx_k__VERBOSE, sizeof(__pyx_k__VERBOSE), 0, 0, 1, 1},
  {&__pyx_n_s__VERSION, __pyx_k__VERSION, sizeof(__pyx_k__VERSION), 0, 0, 1, 1},
  {&__pyx_n_s__VERSION_HEX, __pyx_k__VERSION_HEX, sizeof(__pyx_k__VERSION_HEX), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s__X, __pyx_k__X, sizeof(__pyx_k__X), 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___groups, __pyx_k___groups, sizeof(__pyx_k___groups), 0, 0, 1, 1},
  {&__pyx_n_s___lastgroup, __pyx_k___lastgroup, sizeof(__pyx_k___lastgroup), 0, 0, 1, 1},
  {&__pyx_n_s___lastindex, __pyx_k___lastindex, sizeof(__pyx_k___lastindex), 0, 0, 1, 1},
  {&__pyx_n_s___makespan, __pyx_k___makespan, sizeof(__pyx_k___makespan), 0, 0, 1, 1},
  {&__pyx_n_s___named_groups, __pyx_k___named_groups, sizeof(__pyx_k___named_groups), 0, 0, 1, 1},
  {&__pyx_n_s___search, __pyx_k___search, sizeof(__pyx_k___search), 0, 0, 1, 1},
  {&__pyx_n_s___subn_callback, __pyx_k___subn_callback, sizeof(__pyx_k___subn_callback), 0, 0, 1, 1},
  {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1},
  {&__pyx_n_s__begin, __pyx_k__begin, sizeof(__pyx_k__begin), 0, 0, 1, 1},
  {&__pyx_n_s__c_str, __pyx_k__c_str, sizeof(__pyx_k__c_str), 0, 0, 1, 1},
  {&__pyx_n_s__callable, __pyx_k__callable, sizeof(__pyx_k__callable), 0, 0, 1, 1},
  {&__pyx_n_s__callback, __pyx_k__callback, sizeof(__pyx_k__callback), 0, 0, 1, 1},
  {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1},
  {&__pyx_n_s__count, __pyx_k__count, sizeof(__pyx_k__count), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__encoded, __pyx_k__encoded, sizeof(__pyx_k__encoded), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__endpos, __pyx_k__endpos, sizeof(__pyx_k__endpos), 0, 0, 1, 1},
  {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
  {&__pyx_n_s__error_code, __pyx_k__error_code, sizeof(__pyx_k__error_code), 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__first, __pyx_k__first, sizeof(__pyx_k__first), 0, 0, 1, 1},
  {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
  {&__pyx_n_s__flush, __pyx_k__flush, sizeof(__pyx_k__flush), 0, 0, 1, 1},
  {&__pyx_n_s__groupdict, __pyx_k__groupdict, sizeof(__pyx_k__groupdict), 0, 0, 1, 1},
  {&__pyx_n_s__groupnum, __pyx_k__groupnum, sizeof(__pyx_k__groupnum), 0, 0, 1, 1},
  {&__pyx_n_s__init_groups, __pyx_k__init_groups, sizeof(__pyx_k__init_groups), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__m, __pyx_k__m, sizeof(__pyx_k__m), 0, 0, 1, 1},
  {&__pyx_n_s__match, __pyx_k__match, sizeof(__pyx_k__match), 0, 0, 1, 1},
  {&__pyx_n_s__match_string, __pyx_k__match_string, sizeof(__pyx_k__match_string), 0, 0, 1, 1},
  {&__pyx_n_s__matches, __pyx_k__matches, sizeof(__pyx_k__matches), 0, 0, 1, 1},
  {&__pyx_n_s__maxsplit, __pyx_k__maxsplit, sizeof(__pyx_k__maxsplit), 0, 0, 1, 1},
  {&__pyx_n_s__named_groups, __pyx_k__named_groups, sizeof(__pyx_k__named_groups), 0, 0, 1, 1},
  {&__pyx_n_s__ngroups, __pyx_k__ngroups, sizeof(__pyx_k__ngroups), 0, 0, 1, 1},
  {&__pyx_n_s__nmatches, __pyx_k__nmatches, sizeof(__pyx_k__nmatches), 0, 0, 1, 1},
  {&__pyx_n_s__ok, __pyx_k__ok, sizeof(__pyx_k__ok), 0, 0, 1, 1},
  {&__pyx_n_s__pattern, __pyx_k__pattern, sizeof(__pyx_k__pattern), 0, 0, 1, 1},
  {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
  {&__pyx_n_s__repl, __pyx_k__repl, sizeof(__pyx_k__repl), 0, 0, 1, 1},
  {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
  {&__pyx_n_s__search, __pyx_k__search, sizeof(__pyx_k__search), 0, 0, 1, 1},
  {&__pyx_n_s__second, __pyx_k__second, sizeof(__pyx_k__second), 0, 0, 1, 1},
  {&__pyx_n_s__set_case_sensitive, __pyx_k__set_case_sensitive, sizeof(__pyx_k__set_case_sensitive), 0, 0, 1, 1},
  {&__pyx_n_s__set_encoding, __pyx_k__set_encoding, sizeof(__pyx_k__set_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__set_log_errors, __pyx_k__set_log_errors, sizeof(__pyx_k__set_log_errors), 0, 0, 1, 1},
  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
  {&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1},
  {&__pyx_n_s__string, __pyx_k__string, sizeof(__pyx_k__string), 0, 0, 1, 1},
  {&__pyx_n_s__sub, __pyx_k__sub, sizeof(__pyx_k__sub), 0, 0, 1, 1},
  {&__pyx_n_s__subn, __pyx_k__subn, sizeof(__pyx_k__subn), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1},
  {&__pyx_n_s__warnings, __pyx_k__warnings, sizeof(__pyx_k__warnings), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_n_s__basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_callable = __Pyx_GetName(__pyx_b, __pyx_n_s__callable); if (!__pyx_builtin_callable) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __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;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x000204 = PyInt_FromLong(0x000204); if (unlikely(!__pyx_int_0x000204)) {__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 initre2(void); /*proto*/
PyMODINIT_FUNC initre2(void)
#else
PyMODINIT_FUNC PyInit_re2(void); /*proto*/
PyMODINIT_FUNC PyInit_re2(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = 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_re2(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;}
  __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;}
  /*--- 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("re2"), __pyx_methods, 0, 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_re2) {
    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_3re2_Match = &__pyx_vtable_3re2_Match;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_3re2_Match.init_groups = (PyObject *(*)(struct __pyx_obj_3re2_Match *))__pyx_f_3re2_5Match_init_groups;
  __pyx_vtable_3re2_Match._makespan = (PyObject *(*)(struct __pyx_obj_3re2_Match *, struct __pyx_opt_args_3re2_5Match__makespan *__pyx_optional_args))__pyx_f_3re2_5Match__makespan;
  #else
  *(void(**)(void))&__pyx_vtable_3re2_Match.init_groups = (void(*)(void))__pyx_f_3re2_5Match_init_groups;
  *(void(**)(void))&__pyx_vtable_3re2_Match._makespan = (void(*)(void))__pyx_f_3re2_5Match__makespan;
  #endif
  if (PyType_Ready(&__pyx_type_3re2_Match) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_3re2_Match.tp_dict, __pyx_vtabptr_3re2_Match) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Match", (PyObject *)&__pyx_type_3re2_Match) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3re2_Match = &__pyx_type_3re2_Match;
  __pyx_vtabptr_3re2_Pattern = &__pyx_vtable_3re2_Pattern;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_3re2_Pattern._search = (PyObject *(*)(struct __pyx_obj_3re2_Pattern *, PyObject *, int, int, RE2::Anchor))__pyx_f_3re2_7Pattern__search;
  __pyx_vtable_3re2_Pattern._print_pattern = (PyObject *(*)(struct __pyx_obj_3re2_Pattern *))__pyx_f_3re2_7Pattern__print_pattern;
  #else
  *(void(**)(void))&__pyx_vtable_3re2_Pattern._search = (void(*)(void))__pyx_f_3re2_7Pattern__search;
  *(void(**)(void))&__pyx_vtable_3re2_Pattern._print_pattern = (void(*)(void))__pyx_f_3re2_7Pattern__print_pattern;
  #endif
  if (PyType_Ready(&__pyx_type_3re2_Pattern) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_3re2_Pattern.tp_dict, __pyx_vtabptr_3re2_Pattern) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Pattern", (PyObject *)&__pyx_type_3re2_Pattern) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3re2_Pattern = &__pyx_type_3re2_Pattern;
  /*--- Type import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":3
 * # cython: infer_types(False)
 * # Import re flags to be compatible.
 * import sys             # <<<<<<<<<<<<<<
 * import re
 * I = re.I
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":4
 * # Import re flags to be compatible.
 * import sys
 * import re             # <<<<<<<<<<<<<<
 * I = re.I
 * IGNORECASE = re.IGNORECASE
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":5
 * import sys
 * import re
 * I = re.I             # <<<<<<<<<<<<<<
 * IGNORECASE = re.IGNORECASE
 * M = re.M
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__I); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__I, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":6
 * import re
 * I = re.I
 * IGNORECASE = re.IGNORECASE             # <<<<<<<<<<<<<<
 * M = re.M
 * MULTILINE = re.MULTILINE
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__IGNORECASE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__IGNORECASE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":7
 * I = re.I
 * IGNORECASE = re.IGNORECASE
 * M = re.M             # <<<<<<<<<<<<<<
 * MULTILINE = re.MULTILINE
 * S = re.S
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__M); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__M, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":8
 * IGNORECASE = re.IGNORECASE
 * M = re.M
 * MULTILINE = re.MULTILINE             # <<<<<<<<<<<<<<
 * S = re.S
 * DOTALL = re.DOTALL
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MULTILINE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__MULTILINE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":9
 * M = re.M
 * MULTILINE = re.MULTILINE
 * S = re.S             # <<<<<<<<<<<<<<
 * DOTALL = re.DOTALL
 * U = re.U
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__S); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__S, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":10
 * MULTILINE = re.MULTILINE
 * S = re.S
 * DOTALL = re.DOTALL             # <<<<<<<<<<<<<<
 * U = re.U
 * UNICODE = re.UNICODE
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DOTALL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DOTALL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":11
 * S = re.S
 * DOTALL = re.DOTALL
 * U = re.U             # <<<<<<<<<<<<<<
 * UNICODE = re.UNICODE
 * X = re.X
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__U); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__U, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":12
 * DOTALL = re.DOTALL
 * U = re.U
 * UNICODE = re.UNICODE             # <<<<<<<<<<<<<<
 * X = re.X
 * VERBOSE = re.VERBOSE
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__UNICODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UNICODE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":13
 * U = re.U
 * UNICODE = re.UNICODE
 * X = re.X             # <<<<<<<<<<<<<<
 * VERBOSE = re.VERBOSE
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__X, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":14
 * UNICODE = re.UNICODE
 * X = re.X
 * VERBOSE = re.VERBOSE             # <<<<<<<<<<<<<<
 * 
 * FALLBACK_QUIETLY = 0
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__VERBOSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VERBOSE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":16
 * VERBOSE = re.VERBOSE
 * 
 * FALLBACK_QUIETLY = 0             # <<<<<<<<<<<<<<
 * FALLBACK_WARNING = 1
 * FALLBACK_EXCEPTION = 2
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FALLBACK_QUIETLY, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":17
 * 
 * FALLBACK_QUIETLY = 0
 * FALLBACK_WARNING = 1             # <<<<<<<<<<<<<<
 * FALLBACK_EXCEPTION = 2
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FALLBACK_WARNING, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":18
 * FALLBACK_QUIETLY = 0
 * FALLBACK_WARNING = 1
 * FALLBACK_EXCEPTION = 2             # <<<<<<<<<<<<<<
 * 
 * VERSION = (0, 2, 4)
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FALLBACK_EXCEPTION, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":20
 * FALLBACK_EXCEPTION = 2
 * 
 * VERSION = (0, 2, 4)             # <<<<<<<<<<<<<<
 * VERSION_HEX = 0x000204
 * 
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  __Pyx_INCREF(__pyx_int_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VERSION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":21
 * 
 * VERSION = (0, 2, 4)
 * VERSION_HEX = 0x000204             # <<<<<<<<<<<<<<
 * 
 * cdef int current_notification = FALLBACK_WARNING
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VERSION_HEX, __pyx_int_0x000204) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":23
 * VERSION_HEX = 0x000204
 * 
 * cdef int current_notification = FALLBACK_WARNING             # <<<<<<<<<<<<<<
 * 
 * def set_fallback_notification(level):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FALLBACK_WARNING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_3re2_current_notification = __pyx_t_3;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":39
 * 
 * 
 * class RegexError(re.error):             # <<<<<<<<<<<<<<
 *     """
 *     Some error has occured in compilation of the regex.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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 = 39; __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;
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__RegexError, "re2"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__RegexError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":45
 *     pass
 * 
 * cdef int _I = I, _M = M, _S = S, _U = U, _X = X             # <<<<<<<<<<<<<<
 * 
 * cimport _re2
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__I); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_3re2__I = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__M); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_3re2__M = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__S); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_3re2__S = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__U); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_3re2__U = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_3re2__X = __pyx_t_3;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":50
 * cimport python_unicode
 * from cython.operator cimport preincrement as inc, dereference as deref
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * cdef inline object cpp_to_pystring(_re2.cpp_string input):
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/axiak/Documents/pyre2/src/re2.pyx":1
 * # cython: infer_types(False)             # <<<<<<<<<<<<<<
 * # Import re flags to be compatible.
 * import sys
 */
  __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_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_14), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__search); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_16), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__match); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_17), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__findall); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_18), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__finditer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_19), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_20), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__sub); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_21), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__subn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_22), __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__Pattern); 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_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___subn_callback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_23), __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__compile); 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_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_24), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__search); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_25), __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__match); 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_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_26), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__finditer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_27), __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__findall); 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_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_28), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_29), __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__sub); 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_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_30), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__subn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_31), __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;

  /* "/home/axiak/Documents/pyre2/src/_re2.pxd":2
 * 
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     ctypedef char* const_char_ptr "const char*"
 * 
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    __Pyx_AddTraceback("init re2");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init re2");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

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

/* Runtime support code */

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

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 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 CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #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;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
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
    return 0;
}

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 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 PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;

    #if PY_MAJOR_VERSION < 3
    py_modname = PyString_FromString(modname);
    #else
    py_modname = PyUnicode_FromString(modname);
    #endif
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    result = PyClass_New(bases, dict, name);
    #else
    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
    #endif
bad:
    Py_XDECREF(py_modname);
    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

#if PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    PyObject* v;
    int i;

    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}

#else /* Python 3 has a print function */

static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}

#endif

#if PY_MAJOR_VERSION < 3

static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * compiler warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}

#else /* Python 3 has a print function */

static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}

#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 int __Pyx_PyInt_AsLongDouble(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 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 >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 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) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

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