text: /* Generated by Nim Compiler v1.4.0 */
  /*   (c) 2020 Andreas Rumpf */
  /* The generated code is subject to the original license. */
  #define NIM_INTBITS 64
  
  /* section: NIM_merge_HEADERS */
  
  #include "nimbase.h"
  #include <string.h>
  #include <windows.h>
  #undef LANGUAGE_C
  #undef MIPSEB
  #undef MIPSEL
  #undef PPC
  #undef R3000
  #undef R4000
  #undef i386
  #undef linux
  #undef mips
  #undef near
  #undef far
  #undef powerpc
  #undef unix
  
  /* section: NIM_merge_FRAME_DEFINES */
  #define nimfr_(x, y)
  #define nimln_(x, y)
  
  /* section: NIM_merge_FORWARD_TYPES */
  typedef struct NimStringDesc NimStringDesc;
  typedef struct TGenericSeq TGenericSeq;
  typedef struct tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw;
  typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
  typedef struct tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg;
  typedef struct tySequence__9apztJSmgERYU8fZOjI4pOg tySequence__9apztJSmgERYU8fZOjI4pOg;
  typedef struct tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A;
  typedef struct tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ;
  typedef struct TNimType TNimType;
  typedef struct TNimNode TNimNode;
  typedef struct tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw;
  typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
  typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
  typedef struct Exception Exception;
  typedef struct RootObj RootObj;
  typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
  typedef struct tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg;
  typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
  typedef struct tySequence__aNpJjaoUowCQc7fBn3wtDQ tySequence__aNpJjaoUowCQc7fBn3wtDQ;
  typedef struct TSafePoint TSafePoint;
  typedef struct GcFrameHeader GcFrameHeader;
  typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
  typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
  typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
  typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
  typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
  typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
  typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
  typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
  typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
  typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
  typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
  typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
  typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
  typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
  typedef struct tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw;
  typedef struct tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg;
  typedef struct tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw;
  typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
  typedef struct tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg;
  typedef struct tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w;
  
  /* section: NIM_merge_TYPES */
  struct TGenericSeq {
  NI len;
  NI reserved;
  };
  struct NimStringDesc {
    TGenericSeq Sup;
  NIM_CHAR data[SEQ_DECL_SIZE];
  };
  struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
  NI Field0;
  NI Field1;
  };
  typedef int tyArray__hlIpJIfs8ECqDyETXoMStg[10];
  struct tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg {
  NI L;
  tySequence__9apztJSmgERYU8fZOjI4pOg* spart;
  tyArray__hlIpJIfs8ECqDyETXoMStg apart;
  };
  typedef N_CDECL_PTR(int, tyProc__y4Iy0gL1MDnSGVt43uUAgQ) (tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A* code, tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ* extra, NCSTRING subject, int length, int startoffset, int options, int* ovector, int ovecsize);
  struct tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw {
  tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A* h;
  tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ* e;
  };
  typedef NU8 tySet_tyEnum_RegexFlag__gA189bEOtGhLt2cCHGW4ywg;
  typedef N_CDECL_PTR(void, tyProc__5cp59bim9aJ4WupX5aVaD1Sg) (NCSTRING stringptr);
  typedef N_CDECL_PTR(void, tyProc__hMR3nXvmHGbyZzcDul78bg) (tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ* extra);
  typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
  typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
  typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
  typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
  struct TNimType {
  NI size;
  NI align;
  tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
  tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
  TNimType* base;
  TNimNode* node;
  void* finalizer;
  tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
  tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
  };
  typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
  struct TNimNode {
  tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
  NI offset;
  TNimType* typ;
  NCSTRING name;
  NI len;
  TNimNode** sons;
  };
  struct tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A {
  char dummy;
  };
  typedef N_CDECL_PTR(tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A*, tyProc__OMNNRjh8IIE9bAc9btZcg0NA) (NCSTRING pattern, int options, NCSTRING* errptr, int* erroffset, void* tableptr);
  struct RootObj {
  TNimType* m_type;
  };
  struct Exception {
    RootObj Sup;
  Exception* parent;
  NCSTRING name;
  NimStringDesc* message;
  tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
  Exception* up;
  };
  struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
    Exception Sup;
  };
  struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
    tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
  };
  struct tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw {
    tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw Sup;
  };
  typedef NF tyArray__iV2wVpdhi9coq9cstlcqapXg[2001];
  struct tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg {
  tyArray__iV2wVpdhi9coq9cstlcqapXg tls;
  };
  typedef NU8 tyEnum_RegexFlag__gA189bEOtGhLt2cCHGW4ywg;
  typedef N_CDECL_PTR(int, tyProc__KqPl2ltkjnSoyb04zAVCAQ) (int what, void* where);
  struct tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ {
  long flags;
  void* study_data;
  long match_limit;
  void* callout_data;
  void* tables;
  long match_limit_recursion;
  void* mark;
  void* executable_jit;
  };
  typedef N_CDECL_PTR(tyObject_ExtraData__aRbi7557vgG4KV47nk1CWQ*, tyProc__qU2uMIyWirSwn1Nd4hJjDw) (tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A* code, int options, NCSTRING* errptr);
  typedef NimStringDesc* tyArray__Qdg3zgcNlmwGTTeVxyC9bbw[20];
  struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
  NCSTRING procname;
  NI line;
  NCSTRING filename;
  };
  typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__9axCnCRMUx32AHzFgBrzSMg) (Exception* e);
  typedef struct {
  N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
  void* ClE_0;
  } tyProc__HzVCwACFYM9cx9aV62PdjtuA;
  struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
  void* bottom;
  };
  struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
  NI len;
  NI cap;
  tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
  };
  typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
  typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
  typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
  typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
  typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
  struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
  tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
  };
  typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
  struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
  tyArray__0aOLqZchNi8nWtMTi8ND8w link;
  NI key;
  NI upperBound;
  NI level;
  };
  struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
  tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
  NI Field1;
  };
  typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
  struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
  NI len;
  tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
  tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
  };
  struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
  NI minLargeObj;
  NI maxLargeObj;
  tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
  NU32 flBitmap;
  tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
  tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
  tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
  NI currMem;
  NI maxMem;
  NI freeMem;
  NI occ;
  NI lastSize;
  tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
  tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
  tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
  tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
  tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
  NIM_BOOL locked;
  NIM_BOOL blockChunkSizeIncrease;
  NI nextChunkSize;
  tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
  tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
  };
  struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
  NI collections;
  NI maxThreshold;
  NI maxStackSize;
  NI freedObjects;
  };
  struct tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw {
  tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg* head;
  tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg* tail;
  CRITICAL_SECTION lock;
  };
  struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
  tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
  NI cycleThreshold;
  tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
  NI recGcLock;
  tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
  tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
  tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw toDispose;
  NI gcThreadId;
  tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
  };
  typedef struct {
  N_NIMCALL_PTR(void, ClP_0) (tyProc__HzVCwACFYM9cx9aV62PdjtuA cbproc, void* ClE_0);
  void* ClE_0;
  } tyProc__VHS3NdmbwcdcZKmKV1JWhw;
  
  /* section: NIM_merge_SEQ_TYPES */
  struct tySequence__9apztJSmgERYU8fZOjI4pOg {
    TGenericSeq Sup;
    int data[SEQ_DECL_SIZE];
  };
  struct tySequence__uB9b75OUPRENsBAu4AnoePA {
    TGenericSeq Sup;
    tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
  };
  struct tySequence__aNpJjaoUowCQc7fBn3wtDQ {
    TGenericSeq Sup;
    tyProc__HzVCwACFYM9cx9aV62PdjtuA data[SEQ_DECL_SIZE];
  };
  struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
    TGenericSeq Sup;
    NimStringDesc* data[SEQ_DECL_SIZE];
  };
  typedef struct {tyProc__9axCnCRMUx32AHzFgBrzSMg localRaiseHook__EIvMhANBvB9cp2Ezvt29cADg;
  tySequence__aNpJjaoUowCQc7fBn3wtDQ* threadDestructionHandlers__8OmU3x0fNdA0DLtOmU3kWw;
  NI threadId__wzrdPYhtL9czkCWS4o9an9cRw;
  TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
  TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
  Exception* currException__9bVPeDJlYTi9bQApZpfH8wjg;
  GcFrameHeader* gcFramePtr__ot48iojqko9aFxGhyjjjVaA;
  NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
  tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
  tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw* utcInstance__oeKVHn4dFpBJO35HhEkelw;
  tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw* localInstance__cLtN9cK9bCe6IPhJ3UFNLNKA;
  NIM_BOOL envComputed__LLyFo9bsdu1ZXMDvAe8DhrQ;
  tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
  tySequence__sM4lkSb7zS6F7OVMvW9cffQ* ownArgv__WVJ54JSHy7VxacV39bwBPFA;
  NIM_BOOL ownParsedArgv__9btHydaUC5pNXxitEZsyzIg;
  tyProc__VHS3NdmbwcdcZKmKV1JWhw callSoonProc__9b9b4iUSd60RO2UqC52ifJ6A;
  tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg* gDisp__yIbBArLUsg2pBJkilx4yvg;
  tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w* defaultSslContext__3GZQajZtKdLpqTTN2RjTzw;
  NIM_BOOL pyThreadFrameInited__0LBR4zzVR5uWvgtv8SrMjg;
  NIM_BOOL gcInited__uuy3PWTwb5gov9ao9bXJYBPg;
  NIM_BOOL isSlave__t9a8wsVVRYqGEKhg1vb49b3g;
  } NimThreadVars;
  
  /* section: NIM_merge_PROC_HEADERS */
  static N_INLINE(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__ZvBW7oBQW0AL9bVNHeQYhIQre)(NimStringDesc* s, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NI start);
  static N_INLINE(void, nimZeroMem)(void* p, NI size);
  static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
  N_LIB_PRIVATE N_NIMCALL(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__h9bDVC3slPvpTdoiuHp3Q2A)(NCSTRING buf, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NI start, NI bufSize);
  N_LIB_PRIVATE N_NIMCALL(void, initRtArray__dgRhxurJYSkIc9bzLmhcMfQ)(NI len, tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg* Result);
  N_LIB_PRIVATE N_NIMCALL(int*, getRawData__P13NCPA0zhaXrvo9bVrTd9bw)(tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg* x);
  static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__2yh9cer0ymNRHlOOg8P7IuA)(NimStringDesc* s, NI first, NI last);
  static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
  static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
  static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__iGg0RIKceRvsmvq8FUHOEw)(NimStringDesc* s, NI first);
  N_LIB_PRIVATE N_NIMCALL(void, finalizeRegEx__4SdnqaehCmfUiW6zxHfMFw)(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* x);
  static N_NIMCALL(void, Marker_tyRef__dkhOdInu11QXB2HnNpgmJQ)(void* p, NI op);
  N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
  N_LIB_PRIVATE N_NIMCALL(tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A*, rawCompile__rlKpWhYxks9aCWeSwmjOpCA)(NimStringDesc* pattern, int flags);
  N_LIB_PRIVATE N_NOINLINE(void, raiseInvalidRegex__TdB6gTnZgnp1MW3lpWDu3w)(NimStringDesc* msg);
  N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
  static N_NIMCALL(void, Marker_tyRef__9aOkmtaUNuD5bHWcVuLdIoQ)(void* p, NI op);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
  N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
  static N_INLINE(NimStringDesc*, spaces__rssDy7zs9cDeoYTeCoIy0Wgstrutils)(NI n);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
  static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
  static N_INLINE(void*, GetThreadLocalVars)(void);
  N_LIB_PRIVATE N_NIMCALL(void*, threadVarGetValue__O8VJSmwa3WY6y9bP6Ht9b7hw)(NI32 dwTlsIndex);
  static N_INLINE(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__ErPsn1xgCi9aXFBAJU0VM3Qre)(NimStringDesc* s, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NimStringDesc** matches, NI matchesLen_0, NI start);
  N_LIB_PRIVATE N_NIMCALL(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__9b9c65p7ndnR5YgK5UQCtsFg)(NCSTRING buf, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NimStringDesc** matches, NI matchesLen_0, NI start, NI bufSize);
  static N_INLINE(NimStringDesc*, bufSubstr__VsoPEEMURtH3vOYlZ89cahwre)(NCSTRING b, NI sPos, NI ePos);
  N_NIMCALL(NimStringDesc*, mnewString)(NI len);
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
  N_LIB_PRIVATE N_NIMCALL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
  
  /* section: NIM_merge_DATA */
  N_LIB_PRIVATE TNimType NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_;
  extern TNimType NTI__WH9aVfHDhtZbU6Y5QgauqZQ_;
  extern TNimType NTI__z1uZWlkSdiDfd9ahW9a6Ibug_;
  N_LIB_PRIVATE TNimType NTI__dkhOdInu11QXB2HnNpgmJQ_;
  extern TNimType NTI__yoNlBGx0D2tRizIdhQuENw_;
  N_LIB_PRIVATE TNimType NTI__eXUKe0yimErFvWt9bGtwijw_;
  N_LIB_PRIVATE TNimType NTI__9aOkmtaUNuD5bHWcVuLdIoQ_;
  STRING_LITERAL(TM__EFUBs0zJOEvQ2SEKsixA2w_3, "\012", 1);
  STRING_LITERAL(TM__EFUBs0zJOEvQ2SEKsixA2w_4, "^\012", 2);
  
  /* section: NIM_merge_VARS */
  extern tyProc__y4Iy0gL1MDnSGVt43uUAgQ Dl_28637476_;
  extern tyProc__5cp59bim9aJ4WupX5aVaD1Sg Dl_28637504_;
  extern tyProc__hMR3nXvmHGbyZzcDul78bg Dl_28637571_;
  extern tyProc__OMNNRjh8IIE9bAc9btZcg0NA Dl_28637414_;
  extern NI32 globalsSlot__ciXDZu9c27pHpCRMoz4RIgw;
  extern tyProc__KqPl2ltkjnSoyb04zAVCAQ Dl_28637436_;
  extern tyProc__qU2uMIyWirSwn1Nd4hJjDw Dl_28637563_;
  
  /* section: NIM_merge_PROCS */
  static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
  	void* T1_;
  	T1_ = (void*)0;
  	T1_ = memset(a, v, ((size_t) (size)));
  }
  static N_INLINE(void, nimZeroMem)(void* p, NI size) {
  	nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
  }
  N_LIB_PRIVATE N_NIMCALL(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__h9bDVC3slPvpTdoiuHp3Q2A)(NCSTRING buf, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NI start, NI bufSize) {
  	tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ result;
  	tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg rtarray;
  	int* rawMatches;
  	int res;
  	NI colontmp__3;
  	NI colontmp__4;
  {	nimZeroMem((void*)(&result), sizeof(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ));
  	nimZeroMem((void*)(&rtarray), sizeof(tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg));
  	initRtArray__dgRhxurJYSkIc9bzLmhcMfQ(((NI) 3), (&rtarray));
  	rawMatches = getRawData__P13NCPA0zhaXrvo9bVrTd9bw((&rtarray));
  	res = Dl_28637476_((*pattern).h, (*pattern).e, buf, ((int) (bufSize)), ((int) (start)), ((NI32) 0), ((int*) (rawMatches)), ((int) 3));
  	{
  		NI colontmp_;
  		NI colontmp__2;
  		if (!(res < ((NI32) 0))) goto LA3_;
  		colontmp_ = ((NI) (res));
  		colontmp__2 = ((NI) 0);
  		result.Field0 = colontmp_;
  		result.Field1 = colontmp__2;
  		goto BeforeRet_;
  	}
  	LA3_: ;
  	colontmp__3 = ((NI) (rawMatches[((NI) 0)]));
  	colontmp__4 = ((NI) ((NI32)(rawMatches[((NI) 1)] - ((NI32) 1))));
  	result.Field0 = colontmp__3;
  	result.Field1 = colontmp__4;
  	goto BeforeRet_;
  	}BeforeRet_: ;
  	return result;
  }
  static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) {
  	NCSTRING result;
  	result = (NCSTRING)0;
  	{
  		NIM_BOOL T3_;
  		T3_ = (NIM_BOOL)0;
  		T3_ = (s == NIM_NIL);
  		if (T3_) goto LA4_;
  		T3_ = ((*s).Sup.len == ((NI) 0));
  		LA4_: ;
  		if (!T3_) goto LA5_;
  		result = "";
  	}
  	goto LA1_;
  	LA5_: ;
  	{
  		result = ((NCSTRING) ((*s).data));
  	}
  	LA1_: ;
  	return result;
  }
  static N_INLINE(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__ZvBW7oBQW0AL9bVNHeQYhIQre)(NimStringDesc* s, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NI start) {
  	tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ result;
  	NimStringDesc* T1_;
  	nimZeroMem((void*)(&result), sizeof(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ));
  	T1_ = (NimStringDesc*)0;
  	T1_ = s;
  	result = findBounds__h9bDVC3slPvpTdoiuHp3Q2A(nimToCStringConv(T1_), pattern, start, (s ? s->Sup.len : 0));
  	return result;
  }
  static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
  	void* T1_;
  	T1_ = (void*)0;
  	T1_ = memcpy(dest, source, ((size_t) (size)));
  }
  static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
  	nimCopyMem(dest, source, size);
  }
  static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
  	{
  		void* T5_;
  		void* T6_;
  		if (!!((src == NIM_NIL))) goto LA3_;
  		T5_ = (void*)0;
  		T5_ = ((void*) ((&(*dest).data[(*dest).Sup.len])));
  		T6_ = (void*)0;
  		T6_ = ((void*) ((*src).data));
  		copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(T5_, T6_, ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
  		(*dest).Sup.len += (*src).Sup.len;
  	}
  	LA3_: ;
  }
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, replace__xph9cKzqe9aWKZ0mnKnfmGHg)(NimStringDesc* s, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* sub, NimStringDesc* by) {
  	NimStringDesc* result;
  	NI prev;
  	NimStringDesc* T12_;
  	result = (NimStringDesc*)0;
  	result = ((NimStringDesc*) NIM_NIL);
  	prev = ((NI) 0);
  	{
  		while (1) {
  			tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ match;
  			NimStringDesc* T7_;
  			if (!(prev < (s ? s->Sup.len : 0))) goto LA2;
  			match = findBounds__ZvBW7oBQW0AL9bVNHeQYhIQre(s, sub, prev);
  			{
  				if (!(match.Field0 < ((NI) 0))) goto LA5_;
  				goto LA1;
  			}
  			LA5_: ;
  			T7_ = (NimStringDesc*)0;
  			T7_ = substr__2yh9cer0ymNRHlOOg8P7IuA(s, prev, (NI)(match.Field0 - ((NI) 1)));
  			result = resizeString(result, (T7_ ? T7_->Sup.len : 0) + 0);
  appendString(result, T7_);
  			result = resizeString(result, (by ? by->Sup.len : 0) + 0);
  appendString(result, by);
  			{
  				if (!((NI)(match.Field1 + ((NI) 1)) == prev)) goto LA10_;
  				goto LA1;
  			}
  			LA10_: ;
  			prev = (NI)(match.Field1 + ((NI) 1));
  		} LA2: ;
  	} LA1: ;
  	T12_ = (NimStringDesc*)0;
  	T12_ = substr__iGg0RIKceRvsmvq8FUHOEw(s, prev);
  	result = resizeString(result, (T12_ ? T12_->Sup.len : 0) + 0);
  appendString(result, T12_);
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(void, finalizeRegEx__4SdnqaehCmfUiW6zxHfMFw)(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* x) {
  	Dl_28637504_(((NCSTRING) ((*x).h)));
  	{
  		if (!!(((*x).e == 0))) goto LA3_;
  		Dl_28637571_((*x).e);
  	}
  	LA3_: ;
  }
  static N_NIMCALL(void, Marker_tyRef__dkhOdInu11QXB2HnNpgmJQ)(void* p, NI op) {
  	tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* a;
  	a = (tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw*)p;
  }
  static N_NIMCALL(void, Marker_tyRef__9aOkmtaUNuD5bHWcVuLdIoQ)(void* p, NI op) {
  	tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw* a;
  	a = (tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw*)p;
  	nimGCvisit((void*)(*a).Sup.Sup.Sup.parent, op);
  	nimGCvisit((void*)(*a).Sup.Sup.Sup.message, op);
  	nimGCvisit((void*)(*a).Sup.Sup.Sup.trace, op);
  	nimGCvisit((void*)(*a).Sup.Sup.Sup.up, op);
  }
  N_LIB_PRIVATE N_NOINLINE(void, raiseInvalidRegex__TdB6gTnZgnp1MW3lpWDu3w)(NimStringDesc* msg) {
  	tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw* e;
  {	e = (tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw*)0;
  	e = (tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw*) newObj((&NTI__9aOkmtaUNuD5bHWcVuLdIoQ_), sizeof(tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw));
  	(*e).Sup.Sup.Sup.Sup.m_type = (&NTI__eXUKe0yimErFvWt9bGtwijw_);
  	(*e).Sup.Sup.Sup.name = "RegexError";
  	(*e).Sup.Sup.Sup.message = copyString(msg);
  	raiseExceptionEx((Exception*)e, "RegexError", "raiseInvalidRegex", "re.nim", 70);
  	goto BeforeRet_;
  	}BeforeRet_: ;
  }
  static N_INLINE(NimStringDesc*, spaces__rssDy7zs9cDeoYTeCoIy0Wgstrutils)(NI n) {
  	NimStringDesc* result;
  	result = (NimStringDesc*)0;
  	result = nsuRepeatChar(32, n);
  	return result;
  }
  static N_INLINE(void*, GetThreadLocalVars)(void) {
  	void* result;
  	void* T1_;
  	result = (void*)0;
  	T1_ = (void*)0;
  	T1_ = threadVarGetValue__O8VJSmwa3WY6y9bP6Ht9b7hw(globalsSlot__ciXDZu9c27pHpCRMoz4RIgw);
  	result = ((void*) ((*((tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg*) (T1_))).tls));
  	return result;
  }
  static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
  	NIM_BOOL* result;
  	NimThreadVars* NimTV_;
  	NimTV_ = (NimThreadVars*) GetThreadLocalVars();
  	result = (NIM_BOOL*)0;
  	result = (&NimTV_->nimInErrorMode__759bT87luu8XGcbkw13FUjA);
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A*, rawCompile__rlKpWhYxks9aCWeSwmjOpCA)(NimStringDesc* pattern, int flags) {
  	tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A* result;
  	NCSTRING msg;
  	int offset;
  NIM_BOOL* nimErr_;
  {nimErr_ = nimErrorFlag();
  	result = (tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A*)0;
  	msg = "";
  	offset = ((int) 0);
  	result = Dl_28637414_(nimToCStringConv(pattern), flags, (&msg), (&offset), NIM_NIL);
  	{
  		NimStringDesc* T5_;
  		NimStringDesc* T6_;
  		NimStringDesc* T7_;
  		if (!(result == NIM_NIL)) goto LA3_;
  		T5_ = (NimStringDesc*)0;
  		T6_ = (NimStringDesc*)0;
  		T6_ = cstrToNimstr(msg);
  		T7_ = (NimStringDesc*)0;
  		T7_ = spaces__rssDy7zs9cDeoYTeCoIy0Wgstrutils(((NI) (offset)));
  		T5_ = rawNewString((T6_ ? T6_->Sup.len : 0) + (pattern ? pattern->Sup.len : 0) + (T7_ ? T7_->Sup.len : 0) + 4);
  appendString(T5_, T6_);
  appendString(T5_, ((NimStringDesc*) &TM__EFUBs0zJOEvQ2SEKsixA2w_3));
  appendString(T5_, pattern);
  appendString(T5_, ((NimStringDesc*) &TM__EFUBs0zJOEvQ2SEKsixA2w_3));
  appendString(T5_, T7_);
  appendString(T5_, ((NimStringDesc*) &TM__EFUBs0zJOEvQ2SEKsixA2w_4));
  		raiseInvalidRegex__TdB6gTnZgnp1MW3lpWDu3w(T5_);
  		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
  	}
  	LA3_: ;
  	}BeforeRet_: ;
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw*, re__BHdoI8AriYxT9bGXrX9c7EhQ)(NimStringDesc* s, tySet_tyEnum_RegexFlag__gA189bEOtGhLt2cCHGW4ywg flags) {
  	tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* result;
  	tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A* T1_;
  NIM_BOOL* nimErr_;
  {nimErr_ = nimErrorFlag();
  	result = (tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw*)0;
  	result = (tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw*) newObj((&NTI__dkhOdInu11QXB2HnNpgmJQ_), sizeof(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw));
  	T1_ = (tyObject_Pcre__bGVj3RgRlNY6kwJpiYI9b3A*)0;
  	T1_ = rawCompile__rlKpWhYxks9aCWeSwmjOpCA(s, ((int) ((flags & ~ 16))));
  	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
  	(*result).h = T1_;
  	{
  		NCSTRING msg;
  		int options;
  		int hasJit;
  		if (!((flags &((NU8)1<<((NU)(((tyEnum_RegexFlag__gA189bEOtGhLt2cCHGW4ywg) 4))&7U)))!=0)) goto LA4_;
  		msg = "";
  		options = ((int) 0);
  		hasJit = ((int) 0);
  		{
  			int T8_;
  			T8_ = (int)0;
  			T8_ = Dl_28637436_(((int) 9), ((void*) ((&hasJit))));
  			if (!(T8_ == ((NI32) 0))) goto LA9_;
  			{
  				if (!(hasJit == ((NI32) 1))) goto LA13_;
  				options = ((int) 1);
  			}
  			LA13_: ;
  		}
  		LA9_: ;
  		(*result).e = Dl_28637563_((*result).h, options, (&msg));
  		{
  			NimStringDesc* T19_;
  			if (!!((msg == 0))) goto LA17_;
  			T19_ = (NimStringDesc*)0;
  			T19_ = cstrToNimstr(msg);
  			raiseInvalidRegex__TdB6gTnZgnp1MW3lpWDu3w(T19_);
  			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
  		}
  		LA17_: ;
  	}
  	LA4_: ;
  	}BeforeRet_: ;
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(int, matchOrFind__jpcUBS27e6bot0QabDwvkw)(NCSTRING buf, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NI start, NI bufSize, int flags) {
  	int result;
  	tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg rtarray;
  	int* rawMatches;
  	result = (int)0;
  	nimZeroMem((void*)(&rtarray), sizeof(tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg));
  	initRtArray__dgRhxurJYSkIc9bzLmhcMfQ(((NI) 3), (&rtarray));
  	rawMatches = getRawData__P13NCPA0zhaXrvo9bVrTd9bw((&rtarray));
  	result = Dl_28637476_((*pattern).h, (*pattern).e, buf, ((int) (bufSize)), ((int) (start)), flags, ((int*) (rawMatches)), ((int) 3));
  	{
  		if (!(((NI32) 0) <= result)) goto LA3_;
  		result = (NI32)(rawMatches[((NI) 1)] - rawMatches[((NI) 0)]);
  	}
  	LA3_: ;
  	return result;
  }
  static N_INLINE(NimStringDesc*, bufSubstr__VsoPEEMURtH3vOYlZ89cahwre)(NCSTRING b, NI sPos, NI ePos) {
  	NimStringDesc* result;
  	NI sz;
  	result = (NimStringDesc*)0;
  	sz = (NI)(ePos - sPos);
  	result = mnewString(((NI) ((NI)(sz + ((NI) 1)))));
  	copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&result->data[((NI) 0)]))), ((void*) ((&b[sPos]))), ((NI) (sz)));
  	result = setLengthStr(result, ((NI) (sz)));
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__9b9c65p7ndnR5YgK5UQCtsFg)(NCSTRING buf, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NimStringDesc** matches, NI matchesLen_0, NI start, NI bufSize) {
  	tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ result;
  	tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg rtarray;
  	int* rawMatches;
  	int res;
  	NI colontmp__4;
  	NI colontmp__5;
  {	nimZeroMem((void*)(&result), sizeof(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ));
  	nimZeroMem((void*)(&rtarray), sizeof(tyObject_RtArray__3dAfOhmMnD56kQD3eeo0Lg));
  	initRtArray__dgRhxurJYSkIc9bzLmhcMfQ(((NI) ((NI)((NI)(matchesLen_0 + ((NI) 1)) * ((NI) 3)))), (&rtarray));
  	rawMatches = getRawData__P13NCPA0zhaXrvo9bVrTd9bw((&rtarray));
  	res = Dl_28637476_((*pattern).h, (*pattern).e, buf, ((int) (bufSize)), ((int) (start)), ((NI32) 0), ((int*) (rawMatches)), (NI32)(((int) ((NI)(matchesLen_0 + ((NI) 1)))) * ((NI32) 3)));
  	{
  		NI colontmp_;
  		NI colontmp__2;
  		if (!(res < ((NI32) 0))) goto LA3_;
  		colontmp_ = ((NI) -1);
  		colontmp__2 = ((NI) 0);
  		result.Field0 = colontmp_;
  		result.Field1 = colontmp__2;
  		goto BeforeRet_;
  	}
  	LA3_: ;
  	{
  		NI i;
  		NI colontmp__3;
  		NI res_2;
  		i = (NI)0;
  		colontmp__3 = (NI)0;
  		colontmp__3 = (NI)(((NI) (res)) - ((NI) 1));
  		res_2 = ((NI) 1);
  		{
  			while (1) {
  				int a;
  				int b;
  				if (!(res_2 <= colontmp__3)) goto LA7;
  				i = res_2;
  				a = rawMatches[(NI)(i * ((NI) 2))];
  				b = rawMatches[(NI)((NI)(i * ((NI) 2)) + ((NI) 1))];
  				{
  					if (!(((NI32) 0) <= a)) goto LA10_;
  					matches[(NI)(i - ((NI) 1))] = bufSubstr__VsoPEEMURtH3vOYlZ89cahwre(buf, ((NI) (a)), ((NI) (b)));
  				}
  				goto LA8_;
  				LA10_: ;
  				{
  					matches[(NI)(i - ((NI) 1))] = ((NimStringDesc*) NIM_NIL);
  				}
  				LA8_: ;
  				res_2 += ((NI) 1);
  			} LA7: ;
  		}
  	}
  	colontmp__4 = ((NI) (rawMatches[((NI) 0)]));
  	colontmp__5 = (NI)(((NI) (rawMatches[((NI) 1)])) - ((NI) 1));
  	result.Field0 = colontmp__4;
  	result.Field1 = colontmp__5;
  	goto BeforeRet_;
  	}BeforeRet_: ;
  	return result;
  }
  static N_INLINE(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, findBounds__ErPsn1xgCi9aXFBAJU0VM3Qre)(NimStringDesc* s, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* pattern, NimStringDesc** matches, NI matchesLen_0, NI start) {
  	tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ result;
  	NimStringDesc* T1_;
  	nimZeroMem((void*)(&result), sizeof(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ));
  	T1_ = (NimStringDesc*)0;
  	T1_ = s;
  	result = findBounds__9b9c65p7ndnR5YgK5UQCtsFg(nimToCStringConv(T1_), pattern, matches, matchesLen_0, start, (s ? s->Sup.len : 0));
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, replacef__xph9cKzqe9aWKZ0mnKnfmGHg_2)(NimStringDesc* s, tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw* sub, NimStringDesc* by) {
  	NimStringDesc* result;
  	tyArray__Qdg3zgcNlmwGTTeVxyC9bbw caps;
  	NI prev;
  	NimStringDesc* T12_;
  NIM_BOOL* nimErr_;
  {nimErr_ = nimErrorFlag();
  	result = (NimStringDesc*)0;
  	result = ((NimStringDesc*) NIM_NIL);
  	nimZeroMem((void*)caps, sizeof(tyArray__Qdg3zgcNlmwGTTeVxyC9bbw));
  	prev = ((NI) 0);
  	{
  		while (1) {
  			tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ match;
  			NimStringDesc* T7_;
  			if (!(prev < (s ? s->Sup.len : 0))) goto LA2;
  			match = findBounds__ErPsn1xgCi9aXFBAJU0VM3Qre(s, sub, caps, 20, prev);
  			{
  				if (!(match.Field0 < ((NI) 0))) goto LA5_;
  				goto LA1;
  			}
  			LA5_: ;
  			T7_ = (NimStringDesc*)0;
  			T7_ = substr__2yh9cer0ymNRHlOOg8P7IuA(s, prev, (NI)(match.Field0 - ((NI) 1)));
  			result = resizeString(result, (T7_ ? T7_->Sup.len : 0) + 0);
  appendString(result, T7_);
  			nsuAddf((&result), by, caps, 20);
  			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
  			{
  				if (!((NI)(match.Field1 + ((NI) 1)) == prev)) goto LA10_;
  				goto LA1;
  			}
  			LA10_: ;
  			prev = (NI)(match.Field1 + ((NI) 1));
  		} LA2: ;
  	} LA1: ;
  	T12_ = (NimStringDesc*)0;
  	T12_ = substr__iGg0RIKceRvsmvq8FUHOEw(s, prev);
  	result = resizeString(result, (T12_ ? T12_->Sup.len : 0) + 0);
  appendString(result, T12_);
  	}BeforeRet_: ;
  	return result;
  }
  N_LIB_PRIVATE N_NIMCALL(void, stdlib_reDatInit000)(void) {
  
  /* section: NIM_merge_TYPE_INIT1 */
  static TNimNode* TM__EFUBs0zJOEvQ2SEKsixA2w_2_2[2];
  static TNimNode TM__EFUBs0zJOEvQ2SEKsixA2w_0[4];
  
  /* section: NIM_merge_TYPE_INIT3 */
  NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_.size = sizeof(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw);
  NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_.align = NIM_ALIGNOF(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw);
  NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_.kind = 18;
  NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_.base = 0;
  NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_.flags = 3;
  TM__EFUBs0zJOEvQ2SEKsixA2w_2_2[0] = &TM__EFUBs0zJOEvQ2SEKsixA2w_0[1];
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[1].kind = 1;
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[1].offset = offsetof(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw, h);
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[1].typ = (&NTI__WH9aVfHDhtZbU6Y5QgauqZQ_);
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[1].name = "h";
  TM__EFUBs0zJOEvQ2SEKsixA2w_2_2[1] = &TM__EFUBs0zJOEvQ2SEKsixA2w_0[2];
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[2].kind = 1;
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[2].offset = offsetof(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw, e);
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[2].typ = (&NTI__z1uZWlkSdiDfd9ahW9a6Ibug_);
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[2].name = "e";
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[0].len = 2; TM__EFUBs0zJOEvQ2SEKsixA2w_0[0].kind = 2; TM__EFUBs0zJOEvQ2SEKsixA2w_0[0].sons = &TM__EFUBs0zJOEvQ2SEKsixA2w_2_2[0];
  NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_.node = &TM__EFUBs0zJOEvQ2SEKsixA2w_0[0];
  NTI__dkhOdInu11QXB2HnNpgmJQ_.size = sizeof(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw*);
  NTI__dkhOdInu11QXB2HnNpgmJQ_.align = NIM_ALIGNOF(tyObject_RegexDesc__jxMAPyr9aBYX9b0g7iZ2E8zw*);
  NTI__dkhOdInu11QXB2HnNpgmJQ_.kind = 22;
  NTI__dkhOdInu11QXB2HnNpgmJQ_.base = (&NTI__jxMAPyr9aBYX9b0g7iZ2E8zw_);
  NTI__dkhOdInu11QXB2HnNpgmJQ_.flags = 2;
  NTI__dkhOdInu11QXB2HnNpgmJQ_.marker = Marker_tyRef__dkhOdInu11QXB2HnNpgmJQ;
  (&NTI__dkhOdInu11QXB2HnNpgmJQ_)->finalizer = (void*)finalizeRegEx__4SdnqaehCmfUiW6zxHfMFw;
  NTI__eXUKe0yimErFvWt9bGtwijw_.size = sizeof(tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw);
  NTI__eXUKe0yimErFvWt9bGtwijw_.align = NIM_ALIGNOF(tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw);
  NTI__eXUKe0yimErFvWt9bGtwijw_.kind = 17;
  NTI__eXUKe0yimErFvWt9bGtwijw_.base = (&NTI__yoNlBGx0D2tRizIdhQuENw_);
  TM__EFUBs0zJOEvQ2SEKsixA2w_0[3].len = 0; TM__EFUBs0zJOEvQ2SEKsixA2w_0[3].kind = 2;
  NTI__eXUKe0yimErFvWt9bGtwijw_.node = &TM__EFUBs0zJOEvQ2SEKsixA2w_0[3];
  NTI__9aOkmtaUNuD5bHWcVuLdIoQ_.size = sizeof(tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw*);
  NTI__9aOkmtaUNuD5bHWcVuLdIoQ_.align = NIM_ALIGNOF(tyObject_RegexError__eXUKe0yimErFvWt9bGtwijw*);
  NTI__9aOkmtaUNuD5bHWcVuLdIoQ_.kind = 22;
  NTI__9aOkmtaUNuD5bHWcVuLdIoQ_.base = (&NTI__eXUKe0yimErFvWt9bGtwijw_);
  NTI__9aOkmtaUNuD5bHWcVuLdIoQ_.marker = Marker_tyRef__9aOkmtaUNuD5bHWcVuLdIoQ;
  }
  
  