/* Generated by Nim Compiler v0.16.0 */
/*   (c) 2017 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
#undef linux
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TY_sdDP1TTkc2gaTu5fV53Zqg TY_sdDP1TTkc2gaTu5fV53Zqg;
typedef struct TY_qERWGavQjzug69cyzEYP39bQ TY_qERWGavQjzug69cyzEYP39bQ;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ropeobj_HF4qJnb6xiOddgPmsxodtQ Ropeobj_HF4qJnb6xiOddgPmsxodtQ;
typedef struct TNimObject TNimObject;
typedef struct Cell_1zcF9cV8XIAtbN8h5HRUB8g Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct Cellseq_Axo1XVm9aaQueTOldv8le5w Cellseq_Axo1XVm9aaQueTOldv8le5w;
typedef struct Gcheap_1TRH1TZMaVZTnLNcIHuNFQ Gcheap_1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct Gcstack_7fytPA5bBsob6See21YMRA Gcstack_7fytPA5bBsob6See21YMRA;
typedef struct Memregion_x81NhDv59b8ercDZ9bi85jyg Memregion_x81NhDv59b8ercDZ9bi85jyg;
typedef struct Smallchunk_tXn60W2f8h3jgAYdEmy5NQ Smallchunk_tXn60W2f8h3jgAYdEmy5NQ;
typedef struct Llchunk_XsENErzHIZV9bhvyJx56wGw Llchunk_XsENErzHIZV9bhvyJx56wGw;
typedef struct Bigchunk_Rv9c70Uhp2TytkX7eH78qEg Bigchunk_Rv9c70Uhp2TytkX7eH78qEg;
typedef struct Intset_EZObFrE3NC9bIb3YMkY9crZA Intset_EZObFrE3NC9bIb3YMkY9crZA;
typedef struct Trunk_W0r8S0Y3UGke6T9bIUWnnuw Trunk_W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct Avlnode_IaqjtwKhxLEpvDS9bct9blEw Avlnode_IaqjtwKhxLEpvDS9bct9blEw;
typedef struct Gcstat_0RwLoVBHZPfUAcLczmfQAg Gcstat_0RwLoVBHZPfUAcLczmfQAg;
typedef struct Cellset_jG87P0AI9aZtss9ccTYBIISQ Cellset_jG87P0AI9aZtss9ccTYBIISQ;
typedef struct Pagedesc_fublkgIY4LG3mT51LU2WHg Pagedesc_fublkgIY4LG3mT51LU2WHg;
typedef struct TY_LViedqhb8iWVoqgZs5LifA TY_LViedqhb8iWVoqgZs5LifA;
typedef struct Basechunk_Sdq7WpT6qAH858F5ZEdG3w Basechunk_Sdq7WpT6qAH858F5ZEdG3w;
typedef struct Freecell_u6M5LHprqzkn9axr04yg9bGQ Freecell_u6M5LHprqzkn9axr04yg9bGQ;
typedef NU8 Ropeserror_6JbePhffafOqwRh04O9bTyA;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Ropeserror_6JbePhffafOqwRh04O9bTyA err0, NimStringDesc* msg0, NIM_BOOL usewarning0, void* ClEnv);
void* ClEnv;
} TY_TyNj9auVRF1VyYw9auw0bhYg;
struct TY_sdDP1TTkc2gaTu5fV53Zqg {
void* Field0;
TY_qERWGavQjzug69cyzEYP39bQ* Field1;
};
typedef NU8 Tnimkind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 Tnimtypeflag_v8QUszD1sWlSIWZz7mC4bQ_Set;
typedef N_NIMCALL_PTR(void, TY_ojoeKfW4VYIm36I9cpDTQIg) (void* p0, NI op0);
typedef N_NIMCALL_PTR(void*, TY_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p0);
struct  TNimType  {
NI size;
Tnimkind_jIBKr1ejBgsfM33Kxw4j7A kind;
Tnimtypeflag_v8QUszD1sWlSIWZz7mC4bQ_Set flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY_ojoeKfW4VYIm36I9cpDTQIg marker;
TY_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
struct TY_qERWGavQjzug69cyzEYP39bQ {
char dummy;
};
typedef N_NIMCALL_PTR(void, TY_T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
typedef Ropeobj_HF4qJnb6xiOddgPmsxodtQ* TY_Z5POizpB19bVj5ol9cPC1eKw[4096];
typedef NU8 Tnimnodekind_unfNsxrcATrufDZmpBq4HQ;
struct  TNimNode  {
Tnimnodekind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Ropeobj_HF4qJnb6xiOddgPmsxodtQ  {
  TNimObject Sup;
Ropeobj_HF4qJnb6xiOddgPmsxodtQ* left;
Ropeobj_HF4qJnb6xiOddgPmsxodtQ* right;
NI length;
NimStringDesc* data;
};
struct  Cell_1zcF9cV8XIAtbN8h5HRUB8g  {
NI refcount;
TNimType* typ;
};
struct  Cellseq_Axo1XVm9aaQueTOldv8le5w  {
NI len;
NI cap;
Cell_1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef Smallchunk_tXn60W2f8h3jgAYdEmy5NQ* TY_SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef Trunk_W0r8S0Y3UGke6T9bIUWnnuw* TY_lh2A89ahMmYg9bCmpVaplLbA[256];
struct  Intset_EZObFrE3NC9bIb3YMkY9crZA  {
TY_lh2A89ahMmYg9bCmpVaplLbA data;
};
struct  Memregion_x81NhDv59b8ercDZ9bi85jyg  {
NI minlargeobj;
NI maxlargeobj;
TY_SiRwrEKZdLgxqz9a9aoVBglg freesmallchunks;
Llchunk_XsENErzHIZV9bhvyJx56wGw* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk_Rv9c70Uhp2TytkX7eH78qEg* freechunkslist;
Intset_EZObFrE3NC9bIb3YMkY9crZA chunkstarts;
Avlnode_IaqjtwKhxLEpvDS9bct9blEw* root;
Avlnode_IaqjtwKhxLEpvDS9bct9blEw* deleted;
Avlnode_IaqjtwKhxLEpvDS9bct9blEw* last;
Avlnode_IaqjtwKhxLEpvDS9bct9blEw* freeavlnodes;
NIM_BOOL locked;
NIM_BOOL blockchunksizeincrease;
NI nextchunksize;
};
struct  Gcstat_0RwLoVBHZPfUAcLczmfQAg  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Cellset_jG87P0AI9aZtss9ccTYBIISQ  {
NI counter;
NI max;
Pagedesc_fublkgIY4LG3mT51LU2WHg* head;
Pagedesc_fublkgIY4LG3mT51LU2WHg** data;
};
struct  Gcheap_1TRH1TZMaVZTnLNcIHuNFQ  {
Gcstack_7fytPA5bBsob6See21YMRA* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq_Axo1XVm9aaQueTOldv8le5w zct;
Cellseq_Axo1XVm9aaQueTOldv8le5w decstack;
Cellseq_Axo1XVm9aaQueTOldv8le5w tempstack;
NI recgclock;
Memregion_x81NhDv59b8ercDZ9bi85jyg region;
Gcstat_0RwLoVBHZPfUAcLczmfQAg stat;
Cellset_jG87P0AI9aZtss9ccTYBIISQ marked;
Cellseq_Axo1XVm9aaQueTOldv8le5w additionalroots;
};
typedef Ropeobj_HF4qJnb6xiOddgPmsxodtQ* TY_ZqT9cbUNKsl55MABiLlPDxA[1];
typedef N_CLOSURE_PTR(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_9) (Ropeserror_6JbePhffafOqwRh04O9bTyA err0, NimStringDesc* msg0, NIM_BOOL usewarning0);
typedef N_CLOSURE_PTR(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_10) (Ropeserror_6JbePhffafOqwRh04O9bTyA err0, NimStringDesc* msg0, NIM_BOOL usewarning0);
typedef N_CLOSURE_PTR(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_11) (Ropeserror_6JbePhffafOqwRh04O9bTyA err0, NimStringDesc* msg0, NIM_BOOL usewarning0);
typedef N_CLOSURE_PTR(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_12) (Ropeserror_6JbePhffafOqwRh04O9bTyA err0, NimStringDesc* msg0, NIM_BOOL usewarning0);
typedef NU8 Filemode_fVUBHvW79bXUw1j55Oo9avSQ;
typedef N_CLOSURE_PTR(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_13) (Ropeserror_6JbePhffafOqwRh04O9bTyA err0, NimStringDesc* msg0, NIM_BOOL usewarning0);
typedef NIM_CHAR TY_9bKy7UA2LOi2vzOViufaW1Q[1024];
struct  Gcstack_7fytPA5bBsob6See21YMRA  {
Gcstack_7fytPA5bBsob6See21YMRA* prev;
Gcstack_7fytPA5bBsob6See21YMRA* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Basechunk_Sdq7WpT6qAH858F5ZEdG3w  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk_tXn60W2f8h3jgAYdEmy5NQ  {
  Basechunk_Sdq7WpT6qAH858F5ZEdG3w Sup;
Smallchunk_tXn60W2f8h3jgAYdEmy5NQ* next;
Smallchunk_tXn60W2f8h3jgAYdEmy5NQ* prev;
Freecell_u6M5LHprqzkn9axr04yg9bGQ* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk_XsENErzHIZV9bhvyJx56wGw  {
NI size;
NI acc;
Llchunk_XsENErzHIZV9bhvyJx56wGw* next;
};
struct  Bigchunk_Rv9c70Uhp2TytkX7eH78qEg  {
  Basechunk_Sdq7WpT6qAH858F5ZEdG3w Sup;
Bigchunk_Rv9c70Uhp2TytkX7eH78qEg* next;
Bigchunk_Rv9c70Uhp2TytkX7eH78qEg* prev;
NI align;
NF data;
};
typedef NI TY_9agrCtWKhCnWWMJpKKugJag[16];
struct  Trunk_W0r8S0Y3UGke6T9bIUWnnuw  {
Trunk_W0r8S0Y3UGke6T9bIUWnnuw* next;
NI key;
TY_9agrCtWKhCnWWMJpKKugJag bits;
};
typedef Avlnode_IaqjtwKhxLEpvDS9bct9blEw* TY_0aOLqZchNi8nWtMTi8ND8w[2];
struct  Avlnode_IaqjtwKhxLEpvDS9bct9blEw  {
TY_0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperbound;
NI level;
};
struct  Pagedesc_fublkgIY4LG3mT51LU2WHg  {
Pagedesc_fublkgIY4LG3mT51LU2WHg* next;
NI key;
TY_9agrCtWKhCnWWMJpKKugJag bits;
};
struct  Freecell_u6M5LHprqzkn9axr04yg9bGQ  {
Freecell_u6M5LHprqzkn9axr04yg9bGQ* next;
NI zerofield;
};
struct TY_LViedqhb8iWVoqgZs5LifA {
  TGenericSeq Sup;
  Ropeobj_HF4qJnb6xiOddgPmsxodtQ* data[SEQ_DECL_SIZE];
};
static N_NIMCALL(void, Marker_TY_j4IZVEbOYTm9aXKJeVb8ILQ)(void* p, NI op);
N_NIMCALL(void, nimGCvisit)(void* d0, NI op0);
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_3)(void);
N_NIMCALL(void, nimRegisterGlobalMarker)(TY_T4eqaYlFJYZUv9aG9b1TV0bQ markerproc0);
static N_NIMCALL(void, Marker_TY_d0QF71x0BgMQlc7zEXMYTQ)(void* p, NI op);
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_5)(void);
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_6)(void);
N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, newrope_FFvNE9bTZHQQSLFPakYFt8w)(NimStringDesc* data0);
N_NIMCALL(void*, newObj)(TNimType* typ0, NI size0);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src0);
static N_INLINE(void, nimGCunrefNoCycle)(void* p0);
static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr0);
static N_INLINE(void, rtladdzct_MV4BBk6J1qu70IbBxwEn4w_2system)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0);
N_NOINLINE(void, addzct_fCDI7oO1NNVXXURtxSzsRw)(Cellseq_Axo1XVm9aaQueTOldv8le5w* s0, Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0);
static N_INLINE(void, asgnRefNoCycle)(void** dest0, void* src0);
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_7)(void);
N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX26_FyliSLNPyN7IibfEAQfpRA)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* b0);
N_NIMCALL(void, unsureAsgnRef)(void** dest0, void* src0);
N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, insertincache_53CHEX05HP0HacydnwoUYg_2)(NimStringDesc* s0);
N_NIMCALL(NI, hash_uBstFm5SYVQeOL3j9c9bc58A)(NimStringDesc* x0);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a0, NimStringDesc* b0);
static N_INLINE(NIM_BOOL, equalmem_DCrUjdaMvFDHaR1hs7sQGwropes)(void* a0, void* b0, NI size0);
N_NIMCALL(NimStringDesc*, mnewString)(NI len0);
N_NIMCALL(NimStringDesc*, mnewString)(NI len0);
N_NIMCALL(NI, len_Z8dKuB9cr9b9ciPiCD63t6h5w)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a0);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s0, NI newlen0);
N_NIMCALL(void*, newSeq)(TNimType* typ0, NI len0);
static N_INLINE(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, pop_Uwv9aKTtuI0HDD9bflz9aw9cCAropes)(TY_LViedqhb8iWVoqgZs5LifA** s0);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq0, NI elemsize0, NI newlen0);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq0, NI elemsize0);
static N_INLINE(void, appendString)(NimStringDesc* dest0, NimStringDesc* src0);
static N_INLINE(void, copymem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest0, void* source0, NI size0);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest0, NI addlen0);
N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, rope_53CHEX05HP0HacydnwoUYg)(NimStringDesc* s0);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x0);
N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX26_sUFtkQXj2TQTADyk9cLFdDg)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a0, NimStringDesc* b0);
N_NIMCALL(void, add_cDalAhgBlDWoYHadkaqqxw)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ** a0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* b0);
N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX25_tH0lgOCTcFVFSKThSUgFEg)(NimStringDesc* frmt0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ** args0, NI args0Len0);
N_NIMCALL(void, add_UJnSY21g59awhvSFBxJ9a9aPg)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ** a0, NimStringDesc* b0);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x0);
N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x0);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s0, NI start_WPWyPKk58Cr5a6XFFviMjg, NI last0);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s0, NI first0, NI last0);
N_NIMCALL(NIM_BOOL, open_sEp0GH2306oGo9bqBpj5oTQ)(FILE** f0, NimStringDesc* filename0, Filemode_fVUBHvW79bXUw1j55Oo9avSQ mode0, NI bufsize0);
N_NIMCALL(void, writerope_PkOcWnH9aQsX1yfnD0BW2Dg)(FILE* f0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0);
N_NIMCALL(void, write_c4mGyJBvK73pdM22jiweKQ)(FILE* f0, NimStringDesc* s0);
N_NIMCALL(void, close_BWnr8V7RERYno9bIdPmw8Hw_2)(FILE* f0);
N_NIMCALL(NIM_BOOL, equalsfile_J1CvHJJz3W7oEXSmrd5b9aA)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0, FILE* f0);
N_NIMCALL(NI, readbuffer_nZ0pNe9cd9cXtoayexCiaDtA_2)(FILE* f0, void* buffer0, NI len0);
N_NIMCALL(NIM_BOOL, equalsfile_NRjmJ38NeonBbXARkPJquA)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0, NimStringDesc* filename0);
N_NIMCALL(void, writerope_BleoID9btBn4KgpblZYx8nQ)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* head0, NimStringDesc* filename0, NIM_BOOL usewarning0);
TY_TyNj9auVRF1VyYw9auw0bhYg errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ;
TNimType NTI_TyNj9auVRF1VyYw9auw0bhYg;
TNimType NTI_vr5DoT1jILTGdRlYv1OYpw;
TNimType NTI_qERWGavQjzug69cyzEYP39bQ;
TNimType NTI_j4IZVEbOYTm9aXKJeVb8ILQ;
TY_Z5POizpB19bVj5ol9cPC1eKw cache_WGMp5Wo1NlgbAMOysPIfmQ;
extern TNimType NTI_13RNkKqUOX1TtorOUlKtqA;
TNimType NTI_HF4qJnb6xiOddgPmsxodtQ;
extern TNimType NTI_rR5Bzr1D5krxoo1NcNyeMA;
extern TNimType NTI_77mFvmsOLKik79ci2hXkHEg;
TNimType NTI_d0QF71x0BgMQlc7zEXMYTQ;
TNimType NTI_Z5POizpB19bVj5ol9cPC1eKw;
NI gcachetries_5GfZTThHPBfB9bjRZdFluBw;
NI gcachemisses_fLRm9am8S0daYBVNK6JKyBg;
NI gcacheinttries_opyfsNv023Md1P05mqsDew;
Ropeobj_HF4qJnb6xiOddgPmsxodtQ* rnl_cGyNlPEm9bfohklPdVEsyNg;
extern Gcheap_1TRH1TZMaVZTnLNcIHuNFQ gch_IcYaEuuWivYAS86vFMTS3Q;
extern NimStringDesc* tnl_Gp8EwkcsAP9am1klnCCHM4w;
Ropeobj_HF4qJnb6xiOddgPmsxodtQ* softrnl_iUOtmgRcRwCUc9cEJC66Hsw;
extern TNimType NTI_LViedqhb8iWVoqgZs5LifA;
STRING_LITERAL(T_Vw9cfUOQOae9b9bzZBlucMZQg_8, "$", 1);
static N_NIMCALL(void, Marker_TY_j4IZVEbOYTm9aXKJeVb8ILQ)(void* p, NI op) {
	TY_qERWGavQjzug69cyzEYP39bQ* a;
	a = (TY_qERWGavQjzug69cyzEYP39bQ*)p;
}
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_3)(void) {
	nimGCvisit((void*)errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv, 0);
}
static N_NIMCALL(void, Marker_TY_d0QF71x0BgMQlc7zEXMYTQ)(void* p, NI op) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a;
	a = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)p;
	nimGCvisit((void*)(*a).left, op);
	nimGCvisit((void*)(*a).right, op);
	nimGCvisit((void*)(*a).data, op);
}
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_5)(void) {
	NI LOC1;
	LOC1 = (NI)0;
	for (LOC1 = 0; LOC1 < 4096; LOC1++) {
	nimGCvisit((void*)cache_WGMp5Wo1NlgbAMOysPIfmQ[LOC1], 0);
	}
}
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_6)(void) {
	nimGCvisit((void*)rnl_cGyNlPEm9bfohklPdVEsyNg, 0);
}

static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr0) {
	Cell_1zcF9cV8XIAtbN8h5HRUB8g* result0;
	result0 = (Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result0 = ((Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (usr0))) - (NU32)(((NI)sizeof(Cell_1zcF9cV8XIAtbN8h5HRUB8g))))));
	return result0;
}

static N_INLINE(void, rtladdzct_MV4BBk6J1qu70IbBxwEn4w_2system)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0) {
	addzct_fCDI7oO1NNVXXURtxSzsRw((&gch_IcYaEuuWivYAS86vFMTS3Q.zct), c0);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p0) {
	Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0;
	c0 = usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem(p0);
	{
		(*c0).refcount -= ((NI) 8);
		if (!((NU32)((*c0).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_MV4BBk6J1qu70IbBxwEn4w_2system(c0);
	}
	LA3: ;
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, newrope_FFvNE9bTZHQQSLFPakYFt8w)(NimStringDesc* data0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*) newObj((&NTI_d0QF71x0BgMQlc7zEXMYTQ), sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ));
	(*result0).Sup.m_type = (&NTI_HF4qJnb6xiOddgPmsxodtQ);
	{
		NimStringDesc* LOC5;
		if (!!((data0 == NIM_NIL))) goto LA3;
		(*result0).length = (data0 ? data0->Sup.len : 0);
		LOC5 = (NimStringDesc*)0;
		LOC5 = (*result0).data; (*result0).data = copyStringRC1(data0);
		if (LOC5) nimGCunrefNoCycle(LOC5);
	}
	LA3: ;
	return result0;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest0, void* src0) {
	{
		Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0;
		if (!!((src0 == NIM_NIL))) goto LA3;
		c0 = usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem(src0);
		(*c0).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell_1zcF9cV8XIAtbN8h5HRUB8g* c0;
		if (!!(((*dest0) == NIM_NIL))) goto LA7;
		c0 = usrtocell_yB9aH5WIlwd0xkYrcdPeXrQsystem((*dest0));
		{
			(*c0).refcount -= ((NI) 8);
			if (!((NU32)((*c0).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_MV4BBk6J1qu70IbBxwEn4w_2system(c0);
		}
		LA11: ;
	}
	LA7: ;
	(*dest0) = src0;
}
static N_NIMCALL(void, T_Vw9cfUOQOae9b9bzZBlucMZQg_7)(void) {
	nimGCvisit((void*)softrnl_iUOtmgRcRwCUc9cEJC66Hsw, 0);
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX26_FyliSLNPyN7IibfEAQfpRA)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* b0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	{
		if (!(a0 == NIM_NIL)) goto LA3;
		result0 = b0;
	}
	goto LA1;
	LA3: ;
	{
		if (!(b0 == NIM_NIL)) goto LA6;
		result0 = a0;
	}
	goto LA1;
	LA6: ;
	{
		result0 = newrope_FFvNE9bTZHQQSLFPakYFt8w(NIM_NIL);
		(*result0).length = (NI)((*a0).length + (*b0).length);
		asgnRefNoCycle((void**) (&(*result0).left), a0);
		asgnRefNoCycle((void**) (&(*result0).right), b0);
	}
	LA1: ;
	return result0;
}

N_NIMCALL(void, add_cDalAhgBlDWoYHadkaqqxw)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ** a0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* b0) {
	unsureAsgnRef((void**) (&(*a0)), HEX26_FyliSLNPyN7IibfEAQfpRA((*a0), b0));
}

static N_INLINE(NIM_BOOL, equalmem_DCrUjdaMvFDHaR1hs7sQGwropes)(void* a0, void* b0, NI size0) {
	NIM_BOOL result0;
	int LOC1;
	result0 = (NIM_BOOL)0;
	LOC1 = (int)0;
	LOC1 = memcmp(a0, b0, ((size_t) (size0)));
	result0 = (LOC1 == ((NI32) 0));
	return result0;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a0, NimStringDesc* b0) {
	NIM_BOOL result0;
	NIM_BOOL LOC11;
{	result0 = (NIM_BOOL)0;
	{
		if (!(a0 == b0)) goto LA3;
		result0 = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = (NIM_BOOL)0;
		LOC7 = (a0 == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b0 == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result0 = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = (NIM_BOOL)0;
	LOC11 = ((*a0).Sup.len == (*b0).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC11 = equalmem_DCrUjdaMvFDHaR1hs7sQGwropes(((void*) ((*a0).data)), ((void*) ((*b0).data)), ((NI) ((*a0).Sup.len)));
	LA12: ;
	result0 = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result0;
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, insertincache_53CHEX05HP0HacydnwoUYg_2)(NimStringDesc* s0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	NI h0;
	NI LOC1;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	gcachetries_5GfZTThHPBfB9bjRZdFluBw += ((NI) 1);
	LOC1 = (NI)0;
	LOC1 = hash_uBstFm5SYVQeOL3j9c9bc58A(s0);
	h0 = (NI)(LOC1 & ((NI) 4095));
	result0 = cache_WGMp5Wo1NlgbAMOysPIfmQ[(h0)- 0];
	{
		NIM_BOOL LOC4;
		LOC4 = (NIM_BOOL)0;
		LOC4 = (result0 == 0);
		if (LOC4) goto LA5;
		LOC4 = !(eqStrings((*result0).data, s0));
		LA5: ;
		if (!LOC4) goto LA6;
		gcachemisses_fLRm9am8S0daYBVNK6JKyBg += ((NI) 1);
		result0 = newrope_FFvNE9bTZHQQSLFPakYFt8w(s0);
		asgnRefNoCycle((void**) (&cache_WGMp5Wo1NlgbAMOysPIfmQ[(h0)- 0]), result0);
	}
	LA6: ;
	return result0;
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, rope_53CHEX05HP0HacydnwoUYg)(NimStringDesc* s0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	{
		if (!((s0 ? s0->Sup.len : 0) == ((NI) 0))) goto LA3;
		result0 = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result0 = insertincache_53CHEX05HP0HacydnwoUYg_2(s0);
	}
	LA1: ;
	return result0;
}

N_NIMCALL(NI, len_Z8dKuB9cr9b9ciPiCD63t6h5w)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a0) {
	NI result0;
	result0 = (NI)0;
	{
		if (!(a0 == NIM_NIL)) goto LA3;
		result0 = ((NI) 0);
	}
	goto LA1;
	LA3: ;
	{
		result0 = (*a0).length;
	}
	LA1: ;
	return result0;
}

static N_INLINE(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, pop_Uwv9aKTtuI0HDD9bflz9aw9cCAropes)(TY_LViedqhb8iWVoqgZs5LifA** s0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	NI L0;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	L0 = (NI)(((*s0) ? (*s0)->Sup.len : 0) - ((NI) 1));
	result0 = (*s0)->data[L0];
	(*s0) = (TY_LViedqhb8iWVoqgZs5LifA*) setLengthSeq(&((*s0))->Sup, sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*), ((NI) (L0)));
	return result0;
}

static N_INLINE(void, copymem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest0, void* source0, NI size0) {
	void* LOC1;
	LOC1 = (void*)0;
	LOC1 = memcpy(dest0, source0, ((size_t) (size0)));
}

static N_INLINE(void, appendString)(NimStringDesc* dest0, NimStringDesc* src0) {
	copymem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) ((&(*dest0).data[((*dest0).Sup.len)- 0]))), ((void*) ((*src0).data)), ((NI) ((NI)((*src0).Sup.len + ((NI) 1)))));
	(*dest0).Sup.len += (*src0).Sup.len;
}

N_NIMCALL(NimStringDesc*, HEX24_PstQrDfj9a7hGXM74AN2wzg)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0) {
	NimStringDesc* result0;
	NI LOC1;
	result0 = (NimStringDesc*)0;
	LOC1 = (NI)0;
	LOC1 = len_Z8dKuB9cr9b9ciPiCD63t6h5w(r0);
	result0 = mnewString(((NI) (LOC1)));
	result0 = setLengthStr(result0, ((NI) 0));
	{
		NimStringDesc* s_pkyapOOgObYy3cTo9a9boLdA;
		s_pkyapOOgObYy3cTo9a9boLdA = (NimStringDesc*)0;
		{
			TY_LViedqhb8iWVoqgZs5LifA* stack_gz1MVzVYjaZXV6kzWygo1A;
			TY_ZqT9cbUNKsl55MABiLlPDxA LOC7;
			if (!!((r0 == NIM_NIL))) goto LA5;
			stack_gz1MVzVYjaZXV6kzWygo1A = (TY_LViedqhb8iWVoqgZs5LifA*) newSeq((&NTI_LViedqhb8iWVoqgZs5LifA), 1);
			memset((void*)LOC7, 0, sizeof(LOC7));
			LOC7[0] = r0;
			asgnRefNoCycle((void**) (&stack_gz1MVzVYjaZXV6kzWygo1A->data[0]), LOC7[0]);
			{
				while (1) {
					Ropeobj_HF4qJnb6xiOddgPmsxodtQ* it_M2qlcUBgfU9biky1ievHJhA;
					if (!(((NI) 0) < (stack_gz1MVzVYjaZXV6kzWygo1A ? stack_gz1MVzVYjaZXV6kzWygo1A->Sup.len : 0))) goto LA9;
					it_M2qlcUBgfU9biky1ievHJhA = pop_Uwv9aKTtuI0HDD9bflz9aw9cCAropes((&stack_gz1MVzVYjaZXV6kzWygo1A));
					{
						while (1) {
							if (!((*it_M2qlcUBgfU9biky1ievHJhA).data == 0)) goto LA11;
							stack_gz1MVzVYjaZXV6kzWygo1A = (TY_LViedqhb8iWVoqgZs5LifA*) incrSeqV2(&(stack_gz1MVzVYjaZXV6kzWygo1A)->Sup, sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*));
							asgnRefNoCycle((void**) (&stack_gz1MVzVYjaZXV6kzWygo1A->data[stack_gz1MVzVYjaZXV6kzWygo1A->Sup.len]), (*it_M2qlcUBgfU9biky1ievHJhA).right);
							++stack_gz1MVzVYjaZXV6kzWygo1A->Sup.len;
							it_M2qlcUBgfU9biky1ievHJhA = (*it_M2qlcUBgfU9biky1ievHJhA).left;
						} LA11: ;
					}
					s_pkyapOOgObYy3cTo9a9boLdA = (*it_M2qlcUBgfU9biky1ievHJhA).data;
					result0 = resizeString(result0, s_pkyapOOgObYy3cTo9a9boLdA->Sup.len + 0);
appendString(result0, s_pkyapOOgObYy3cTo9a9boLdA);
				} LA9: ;
			}
		}
		LA5: ;
	}
	return result0;
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, rope_pEztpD6TFe5jk3aCrOSACA)(NI64 i0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	NimStringDesc* LOC1;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	gcacheinttries_opyfsNv023Md1P05mqsDew += ((NI) 1);
	LOC1 = (NimStringDesc*)0;
	LOC1 = nimInt64ToStr(i0);
	result0 = rope_53CHEX05HP0HacydnwoUYg(LOC1);
	return result0;
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX26_sUFtkQXj2TQTADyk9cLFdDg)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* a0, NimStringDesc* b0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* LOC1;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	LOC1 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	LOC1 = rope_53CHEX05HP0HacydnwoUYg(b0);
	result0 = HEX26_FyliSLNPyN7IibfEAQfpRA(a0, LOC1);
	return result0;
}

N_NIMCALL(void, add_UJnSY21g59awhvSFBxJ9a9aPg)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ** a0, NimStringDesc* b0) {
	unsureAsgnRef((void**) (&(*a0)), HEX26_sUFtkQXj2TQTADyk9cLFdDg((*a0), b0));
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX26_OL8oYU3myMrLfqhcdP9b3Ig)(NimStringDesc* a0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* b0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* LOC1;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	LOC1 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	LOC1 = rope_53CHEX05HP0HacydnwoUYg(a0);
	result0 = HEX26_FyliSLNPyN7IibfEAQfpRA(LOC1, b0);
	return result0;
}

N_NIMCALL(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*, HEX25_tH0lgOCTcFVFSKThSUgFEg)(NimStringDesc* frmt0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ** args0, NI args0Len0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* result0;
	NI i0;
	NI length0;
	NI num0;
	result0 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	i0 = ((NI) 0);
	length0 = (frmt0 ? frmt0->Sup.len : 0);
	result0 = NIM_NIL;
	num0 = ((NI) 0);
	{
		while (1) {
			NI start0;
			if (!(i0 < length0)) goto LA2;
			{
				if (!((NU8)(frmt0->data[i0]) == (NU8)(36))) goto LA5;
				i0 += ((NI) 1);
				switch (((NU8)(frmt0->data[i0]))) {
				case 36:
				{
					add_UJnSY21g59awhvSFBxJ9a9aPg(&result0, ((NimStringDesc*) &T_Vw9cfUOQOae9b9bzZBlucMZQg_8));
					i0 += ((NI) 1);
				}
				break;
				case 35:
				{
					i0 += ((NI) 1);
					add_cDalAhgBlDWoYHadkaqqxw(&result0, args0[num0]);
					num0 += ((NI) 1);
				}
				break;
				case 48 ... 57:
				{
					NI j0;
					j0 = ((NI) 0);
					{
						while (1) {
							j0 = (NI)((NI)((NI)(j0 * ((NI) 10)) + ((NI) (((NU8)(frmt0->data[i0]))))) - ((NI) 48));
							i0 += ((NI) 1);
							{
								if (!!((((NU8)(frmt0->data[i0])) >= ((NU8)(48)) && ((NU8)(frmt0->data[i0])) <= ((NU8)(57))))) goto LA14;
								goto LA10;
							}
							LA14: ;
						}
					} LA10: ;
					num0 = j0;
					{
						NimStringDesc* LOC20;
						if (!((NI)((args0Len0-1) + ((NI) 1)) < j0)) goto LA18;
						LOC20 = (NimStringDesc*)0;
						LOC20 = nimIntToStr(j0);
						errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv? errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC20, NIM_FALSE, errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv):((T_Vw9cfUOQOae9b9bzZBlucMZQg_9)(errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc))(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC20, NIM_FALSE);
					}
					goto LA16;
					LA18: ;
					{
						add_cDalAhgBlDWoYHadkaqqxw(&result0, args0[(NI)(j0 - ((NI) 1))]);
					}
					LA16: ;
				}
				break;
				case 123:
				{
					NI j0;
					i0 += ((NI) 1);
					j0 = ((NI) 0);
					{
						while (1) {
							if (!(((NU8)(frmt0->data[i0])) >= ((NU8)(48)) && ((NU8)(frmt0->data[i0])) <= ((NU8)(57)))) goto LA24;
							j0 = (NI)((NI)((NI)(j0 * ((NI) 10)) + ((NI) (((NU8)(frmt0->data[i0]))))) - ((NI) 48));
							i0 += ((NI) 1);
						} LA24: ;
					}
					num0 = j0;
					{
						if (!((NU8)(frmt0->data[i0]) == (NU8)(125))) goto LA27;
						i0 += ((NI) 1);
					}
					goto LA25;
					LA27: ;
					{
						NimStringDesc* LOC30;
						LOC30 = (NimStringDesc*)0;
						LOC30 = nimCharToStr(frmt0->data[i0]);
						errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv? errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC30, NIM_FALSE, errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv):((T_Vw9cfUOQOae9b9bzZBlucMZQg_10)(errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc))(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC30, NIM_FALSE);
					}
					LA25: ;
					{
						NimStringDesc* LOC35;
						if (!((NI)((args0Len0-1) + ((NI) 1)) < j0)) goto LA33;
						LOC35 = (NimStringDesc*)0;
						LOC35 = nimIntToStr(j0);
						errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv? errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC35, NIM_FALSE, errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv):((T_Vw9cfUOQOae9b9bzZBlucMZQg_11)(errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc))(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC35, NIM_FALSE);
					}
					goto LA31;
					LA33: ;
					{
						add_cDalAhgBlDWoYHadkaqqxw(&result0, args0[(NI)(j0 - ((NI) 1))]);
					}
					LA31: ;
				}
				break;
				case 110:
				{
					add_cDalAhgBlDWoYHadkaqqxw(&result0, softrnl_iUOtmgRcRwCUc9cEJC66Hsw);
					i0 += ((NI) 1);
				}
				break;
				case 78:
				{
					add_cDalAhgBlDWoYHadkaqqxw(&result0, rnl_cGyNlPEm9bfohklPdVEsyNg);
					i0 += ((NI) 1);
				}
				break;
				default:
				{
					NimStringDesc* LOC40;
					LOC40 = (NimStringDesc*)0;
					LOC40 = nimCharToStr(frmt0->data[i0]);
					errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv? errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC40, NIM_FALSE, errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv):((T_Vw9cfUOQOae9b9bzZBlucMZQg_12)(errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc))(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 1), LOC40, NIM_FALSE);
				}
				break;
				}
			}
			LA5: ;
			start0 = i0;
			{
				while (1) {
					if (!(i0 < length0)) goto LA42;
					{
						if (!!(((NU8)(frmt0->data[i0]) == (NU8)(36)))) goto LA45;
						i0 += ((NI) 1);
					}
					goto LA43;
					LA45: ;
					{
						goto LA41;
					}
					LA43: ;
				} LA42: ;
			} LA41: ;
			{
				NimStringDesc* LOC52;
				if (!(start0 <= (NI)(i0 - ((NI) 1)))) goto LA50;
				LOC52 = (NimStringDesc*)0;
				LOC52 = copyStrLast(frmt0, start0, (NI)(i0 - ((NI) 1)));
				add_UJnSY21g59awhvSFBxJ9a9aPg(&result0, LOC52);
			}
			LA50: ;
		} LA2: ;
	}
	return result0;
}

N_NIMCALL(void, addf_8UUGW4xtgpag0J4uEnVLuQ)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ** c0, NimStringDesc* frmt0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ** args0, NI args0Len0) {
	Ropeobj_HF4qJnb6xiOddgPmsxodtQ* LOC1;
	LOC1 = (Ropeobj_HF4qJnb6xiOddgPmsxodtQ*)0;
	LOC1 = HEX25_tH0lgOCTcFVFSKThSUgFEg(frmt0, args0, args0Len0);
	add_cDalAhgBlDWoYHadkaqqxw(c0, LOC1);
}

N_NIMCALL(void, prepend_cDalAhgBlDWoYHadkaqqxw_2)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ** a0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* b0) {
	unsureAsgnRef((void**) (&(*a0)), HEX26_FyliSLNPyN7IibfEAQfpRA(b0, (*a0)));
}

N_NIMCALL(void, writerope_PkOcWnH9aQsX1yfnD0BW2Dg)(FILE* f0, Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0) {
	{
		NimStringDesc* s_KnuMhDfXMAoKRWjppn8ToQ;
		s_KnuMhDfXMAoKRWjppn8ToQ = (NimStringDesc*)0;
		{
			TY_LViedqhb8iWVoqgZs5LifA* stack_RVshHGY00KYS49c8CcOWyCw;
			TY_ZqT9cbUNKsl55MABiLlPDxA LOC6;
			if (!!((r0 == NIM_NIL))) goto LA4;
			stack_RVshHGY00KYS49c8CcOWyCw = (TY_LViedqhb8iWVoqgZs5LifA*) newSeq((&NTI_LViedqhb8iWVoqgZs5LifA), 1);
			memset((void*)LOC6, 0, sizeof(LOC6));
			LOC6[0] = r0;
			asgnRefNoCycle((void**) (&stack_RVshHGY00KYS49c8CcOWyCw->data[0]), LOC6[0]);
			{
				while (1) {
					Ropeobj_HF4qJnb6xiOddgPmsxodtQ* it_sgZh79bixNbHcvlUXRayrgQ;
					if (!(((NI) 0) < (stack_RVshHGY00KYS49c8CcOWyCw ? stack_RVshHGY00KYS49c8CcOWyCw->Sup.len : 0))) goto LA8;
					it_sgZh79bixNbHcvlUXRayrgQ = pop_Uwv9aKTtuI0HDD9bflz9aw9cCAropes((&stack_RVshHGY00KYS49c8CcOWyCw));
					{
						while (1) {
							if (!((*it_sgZh79bixNbHcvlUXRayrgQ).data == 0)) goto LA10;
							stack_RVshHGY00KYS49c8CcOWyCw = (TY_LViedqhb8iWVoqgZs5LifA*) incrSeqV2(&(stack_RVshHGY00KYS49c8CcOWyCw)->Sup, sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*));
							asgnRefNoCycle((void**) (&stack_RVshHGY00KYS49c8CcOWyCw->data[stack_RVshHGY00KYS49c8CcOWyCw->Sup.len]), (*it_sgZh79bixNbHcvlUXRayrgQ).right);
							++stack_RVshHGY00KYS49c8CcOWyCw->Sup.len;
							it_sgZh79bixNbHcvlUXRayrgQ = (*it_sgZh79bixNbHcvlUXRayrgQ).left;
						} LA10: ;
					}
					s_KnuMhDfXMAoKRWjppn8ToQ = (*it_sgZh79bixNbHcvlUXRayrgQ).data;
					write_c4mGyJBvK73pdM22jiweKQ(f0, s_KnuMhDfXMAoKRWjppn8ToQ);
				} LA8: ;
			}
		}
		LA4: ;
	}
}

N_NIMCALL(void, writerope_BleoID9btBn4KgpblZYx8nQ)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* head0, NimStringDesc* filename0, NIM_BOOL usewarning0) {
	FILE* f0;
	f0 = (FILE*)0;
	{
		NIM_BOOL LOC3;
		LOC3 = (NIM_BOOL)0;
		LOC3 = open_sEp0GH2306oGo9bqBpj5oTQ(&f0, filename0, ((Filemode_fVUBHvW79bXUw1j55Oo9avSQ) 1), ((NI) -1));
		if (!LOC3) goto LA4;
		{
			if (!!((head0 == NIM_NIL))) goto LA8;
			writerope_PkOcWnH9aQsX1yfnD0BW2Dg(f0, head0);
		}
		LA8: ;
		close_BWnr8V7RERYno9bIdPmw8Hw_2(f0);
	}
	goto LA1;
	LA4: ;
	{
		errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv? errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 0), filename0, usewarning0, errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClEnv):((T_Vw9cfUOQOae9b9bzZBlucMZQg_13)(errorhandler_TAnYbcufPVh4Ie6Bi1RCCQ.ClPrc))(((Ropeserror_6JbePhffafOqwRh04O9bTyA) 0), filename0, usewarning0);
	}
	LA1: ;
}

N_NIMCALL(NIM_BOOL, equalsfile_J1CvHJJz3W7oEXSmrd5b9aA)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0, FILE* f0) {
	NIM_BOOL result0;
	TY_9bKy7UA2LOi2vzOViufaW1Q buf0;
	NI bpos0;
	NI blen0;
	NI btotal0;
	NI rtotal0;
	NIM_BOOL LOC26;
	NI LOC27;
{	result0 = (NIM_BOOL)0;
	memset((void*)buf0, 0, sizeof(buf0));
	bpos0 = ((NI) 1024);
	blen0 = ((NI) 1024);
	btotal0 = ((NI) 0);
	rtotal0 = ((NI) 0);
	{
		NimStringDesc* s_xKv6UI1in9byEtowjY9aPuDg;
		s_xKv6UI1in9byEtowjY9aPuDg = (NimStringDesc*)0;
		{
			TY_LViedqhb8iWVoqgZs5LifA* stack_5VBTey7e9bFRKJxRDIjCH1w;
			TY_ZqT9cbUNKsl55MABiLlPDxA LOC6;
			if (!!((r0 == NIM_NIL))) goto LA4;
			stack_5VBTey7e9bFRKJxRDIjCH1w = (TY_LViedqhb8iWVoqgZs5LifA*) newSeq((&NTI_LViedqhb8iWVoqgZs5LifA), 1);
			memset((void*)LOC6, 0, sizeof(LOC6));
			LOC6[0] = r0;
			asgnRefNoCycle((void**) (&stack_5VBTey7e9bFRKJxRDIjCH1w->data[0]), LOC6[0]);
			{
				while (1) {
					Ropeobj_HF4qJnb6xiOddgPmsxodtQ* it_6J5YP71m9a2a9c9aztDrpN1Nw;
					NI spos0;
					NI slen0;
					if (!(((NI) 0) < (stack_5VBTey7e9bFRKJxRDIjCH1w ? stack_5VBTey7e9bFRKJxRDIjCH1w->Sup.len : 0))) goto LA8;
					it_6J5YP71m9a2a9c9aztDrpN1Nw = pop_Uwv9aKTtuI0HDD9bflz9aw9cCAropes((&stack_5VBTey7e9bFRKJxRDIjCH1w));
					{
						while (1) {
							if (!((*it_6J5YP71m9a2a9c9aztDrpN1Nw).data == 0)) goto LA10;
							stack_5VBTey7e9bFRKJxRDIjCH1w = (TY_LViedqhb8iWVoqgZs5LifA*) incrSeqV2(&(stack_5VBTey7e9bFRKJxRDIjCH1w)->Sup, sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*));
							asgnRefNoCycle((void**) (&stack_5VBTey7e9bFRKJxRDIjCH1w->data[stack_5VBTey7e9bFRKJxRDIjCH1w->Sup.len]), (*it_6J5YP71m9a2a9c9aztDrpN1Nw).right);
							++stack_5VBTey7e9bFRKJxRDIjCH1w->Sup.len;
							it_6J5YP71m9a2a9c9aztDrpN1Nw = (*it_6J5YP71m9a2a9c9aztDrpN1Nw).left;
						} LA10: ;
					}
					s_xKv6UI1in9byEtowjY9aPuDg = (*it_6J5YP71m9a2a9c9aztDrpN1Nw).data;
					spos0 = ((NI) 0);
					slen0 = (s_xKv6UI1in9byEtowjY9aPuDg ? s_xKv6UI1in9byEtowjY9aPuDg->Sup.len : 0);
					rtotal0 += slen0;
					{
						while (1) {
							NI n0;
							if (!(spos0 < slen0)) goto LA12;
							{
								if (!(bpos0 == blen0)) goto LA15;
								bpos0 = ((NI) 0);
								blen0 = readbuffer_nZ0pNe9cd9cXtoayexCiaDtA_2(f0, ((void*) ((&buf0[(((NI) 0))- 0]))), ((NI) 1024));
								btotal0 += blen0;
								{
									if (!(blen0 == ((NI) 0))) goto LA19;
									result0 = NIM_FALSE;
									goto BeforeRet;
								}
								LA19: ;
							}
							LA15: ;
							n0 = (((NI)(blen0 - bpos0) <= (NI)(slen0 - spos0)) ? (NI)(blen0 - bpos0) : (NI)(slen0 - spos0));
							{
								NIM_BOOL LOC23;
								LOC23 = (NIM_BOOL)0;
								LOC23 = equalmem_DCrUjdaMvFDHaR1hs7sQGwropes(((void*) ((&buf0[(bpos0)- 0]))), ((void*) ((NI)(((NI) (s_xKv6UI1in9byEtowjY9aPuDg->data)) + spos0))), ((NI) (n0)));
								if (!!(LOC23)) goto LA24;
								result0 = NIM_FALSE;
								goto BeforeRet;
							}
							LA24: ;
							spos0 += n0;
							bpos0 += n0;
						} LA12: ;
					}
				} LA8: ;
			}
		}
		LA4: ;
	}
	LOC26 = (NIM_BOOL)0;
	LOC27 = (NI)0;
	LOC27 = readbuffer_nZ0pNe9cd9cXtoayexCiaDtA_2(f0, ((void*) ((&buf0[(((NI) 0))- 0]))), ((NI) 1));
	LOC26 = (LOC27 == ((NI) 0));
	if (!(LOC26)) goto LA28;
	LOC26 = (btotal0 == rtotal0);
	LA28: ;
	result0 = LOC26;
	}BeforeRet: ;
	return result0;
}

N_NIMCALL(NIM_BOOL, equalsfile_NRjmJ38NeonBbXARkPJquA)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0, NimStringDesc* filename0) {
	NIM_BOOL result0;
	FILE* f0;
	result0 = (NIM_BOOL)0;
	f0 = (FILE*)0;
	result0 = open_sEp0GH2306oGo9bqBpj5oTQ(&f0, filename0, ((Filemode_fVUBHvW79bXUw1j55Oo9avSQ) 0), ((NI) -1));
	{
		if (!result0) goto LA3;
		result0 = equalsfile_J1CvHJJz3W7oEXSmrd5b9aA(r0, f0);
		close_BWnr8V7RERYno9bIdPmw8Hw_2(f0);
	}
	LA3: ;
	return result0;
}

N_NIMCALL(NIM_BOOL, writeropeifnotequal_oaAc5rjj5CT7oZUrYvXsyw)(Ropeobj_HF4qJnb6xiOddgPmsxodtQ* r0, NimStringDesc* filename0) {
	NIM_BOOL result0;
	result0 = (NIM_BOOL)0;
	{
		NIM_BOOL LOC3;
		LOC3 = (NIM_BOOL)0;
		LOC3 = equalsfile_NRjmJ38NeonBbXARkPJquA(r0, filename0);
		if (!!(LOC3)) goto LA4;
		writerope_BleoID9btBn4KgpblZYx8nQ(r0, filename0, NIM_FALSE);
		result0 = NIM_TRUE;
	}
	goto LA1;
	LA4: ;
	{
		result0 = NIM_FALSE;
	}
	LA1: ;
	return result0;
}
NIM_EXTERNC N_NOINLINE(void, compiler_ropesInit000)(void) {
nimRegisterGlobalMarker(T_Vw9cfUOQOae9b9bzZBlucMZQg_3);
nimRegisterGlobalMarker(T_Vw9cfUOQOae9b9bzZBlucMZQg_5);
nimRegisterGlobalMarker(T_Vw9cfUOQOae9b9bzZBlucMZQg_6);
nimRegisterGlobalMarker(T_Vw9cfUOQOae9b9bzZBlucMZQg_7);
	gcachetries_5GfZTThHPBfB9bjRZdFluBw = ((NI) 0);
	gcachemisses_fLRm9am8S0daYBVNK6JKyBg = ((NI) 0);
	gcacheinttries_opyfsNv023Md1P05mqsDew = ((NI) 0);
	asgnRefNoCycle((void**) (&rnl_cGyNlPEm9bfohklPdVEsyNg), newrope_FFvNE9bTZHQQSLFPakYFt8w(tnl_Gp8EwkcsAP9am1klnCCHM4w));
	asgnRefNoCycle((void**) (&softrnl_iUOtmgRcRwCUc9cEJC66Hsw), newrope_FFvNE9bTZHQQSLFPakYFt8w(tnl_Gp8EwkcsAP9am1klnCCHM4w));
}

NIM_EXTERNC N_NOINLINE(void, compiler_ropesDatInit000)(void) {
static TNimNode* T_Vw9cfUOQOae9b9bzZBlucMZQg_2[2];
static TNimNode* T_Vw9cfUOQOae9b9bzZBlucMZQg_4[4];
static TNimNode T_Vw9cfUOQOae9b9bzZBlucMZQg_0[9];
NTI_TyNj9auVRF1VyYw9auw0bhYg.size = sizeof(TY_sdDP1TTkc2gaTu5fV53Zqg);
NTI_TyNj9auVRF1VyYw9auw0bhYg.kind = 18;
NTI_TyNj9auVRF1VyYw9auw0bhYg.base = 0;
NTI_TyNj9auVRF1VyYw9auw0bhYg.flags = 2;
T_Vw9cfUOQOae9b9bzZBlucMZQg_2[0] = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[1];
NTI_vr5DoT1jILTGdRlYv1OYpw.size = sizeof(void*);
NTI_vr5DoT1jILTGdRlYv1OYpw.kind = 26;
NTI_vr5DoT1jILTGdRlYv1OYpw.base = 0;
NTI_vr5DoT1jILTGdRlYv1OYpw.flags = 3;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[1].kind = 1;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[1].offset = offsetof(TY_sdDP1TTkc2gaTu5fV53Zqg, Field0);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[1].typ = (&NTI_vr5DoT1jILTGdRlYv1OYpw);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[1].name = "Field0";
T_Vw9cfUOQOae9b9bzZBlucMZQg_2[1] = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[2];
NTI_qERWGavQjzug69cyzEYP39bQ.size = sizeof(TY_qERWGavQjzug69cyzEYP39bQ);
NTI_qERWGavQjzug69cyzEYP39bQ.kind = 18;
NTI_qERWGavQjzug69cyzEYP39bQ.base = 0;
NTI_qERWGavQjzug69cyzEYP39bQ.flags = 3;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[3].len = 0; T_Vw9cfUOQOae9b9bzZBlucMZQg_0[3].kind = 2;
NTI_qERWGavQjzug69cyzEYP39bQ.node = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[3];
NTI_j4IZVEbOYTm9aXKJeVb8ILQ.size = sizeof(TY_qERWGavQjzug69cyzEYP39bQ*);
NTI_j4IZVEbOYTm9aXKJeVb8ILQ.kind = 22;
NTI_j4IZVEbOYTm9aXKJeVb8ILQ.base = (&NTI_qERWGavQjzug69cyzEYP39bQ);
NTI_j4IZVEbOYTm9aXKJeVb8ILQ.flags = 2;
NTI_j4IZVEbOYTm9aXKJeVb8ILQ.marker = Marker_TY_j4IZVEbOYTm9aXKJeVb8ILQ;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[2].kind = 1;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[2].offset = offsetof(TY_sdDP1TTkc2gaTu5fV53Zqg, Field1);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[2].typ = (&NTI_j4IZVEbOYTm9aXKJeVb8ILQ);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[2].name = "Field1";
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[0].len = 2; T_Vw9cfUOQOae9b9bzZBlucMZQg_0[0].kind = 2; T_Vw9cfUOQOae9b9bzZBlucMZQg_0[0].sons = &T_Vw9cfUOQOae9b9bzZBlucMZQg_2[0];
NTI_TyNj9auVRF1VyYw9auw0bhYg.node = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[0];
NTI_HF4qJnb6xiOddgPmsxodtQ.size = sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ);
NTI_HF4qJnb6xiOddgPmsxodtQ.kind = 17;
NTI_HF4qJnb6xiOddgPmsxodtQ.base = (&NTI_13RNkKqUOX1TtorOUlKtqA);
NTI_HF4qJnb6xiOddgPmsxodtQ.flags = 2;
T_Vw9cfUOQOae9b9bzZBlucMZQg_4[0] = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[5];
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[5].kind = 1;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[5].offset = offsetof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ, left);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[5].typ = (&NTI_d0QF71x0BgMQlc7zEXMYTQ);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[5].name = "left";
T_Vw9cfUOQOae9b9bzZBlucMZQg_4[1] = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[6];
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[6].kind = 1;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[6].offset = offsetof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ, right);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[6].typ = (&NTI_d0QF71x0BgMQlc7zEXMYTQ);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[6].name = "right";
T_Vw9cfUOQOae9b9bzZBlucMZQg_4[2] = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[7];
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[7].kind = 1;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[7].offset = offsetof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ, length);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[7].typ = (&NTI_rR5Bzr1D5krxoo1NcNyeMA);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[7].name = "length";
T_Vw9cfUOQOae9b9bzZBlucMZQg_4[3] = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[8];
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[8].kind = 1;
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[8].offset = offsetof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ, data);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[8].typ = (&NTI_77mFvmsOLKik79ci2hXkHEg);
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[8].name = "data";
T_Vw9cfUOQOae9b9bzZBlucMZQg_0[4].len = 4; T_Vw9cfUOQOae9b9bzZBlucMZQg_0[4].kind = 2; T_Vw9cfUOQOae9b9bzZBlucMZQg_0[4].sons = &T_Vw9cfUOQOae9b9bzZBlucMZQg_4[0];
NTI_HF4qJnb6xiOddgPmsxodtQ.node = &T_Vw9cfUOQOae9b9bzZBlucMZQg_0[4];
NTI_d0QF71x0BgMQlc7zEXMYTQ.size = sizeof(Ropeobj_HF4qJnb6xiOddgPmsxodtQ*);
NTI_d0QF71x0BgMQlc7zEXMYTQ.kind = 22;
NTI_d0QF71x0BgMQlc7zEXMYTQ.base = (&NTI_HF4qJnb6xiOddgPmsxodtQ);
NTI_d0QF71x0BgMQlc7zEXMYTQ.flags = 2;
NTI_d0QF71x0BgMQlc7zEXMYTQ.marker = Marker_TY_d0QF71x0BgMQlc7zEXMYTQ;
NTI_Z5POizpB19bVj5ol9cPC1eKw.size = sizeof(TY_Z5POizpB19bVj5ol9cPC1eKw);
NTI_Z5POizpB19bVj5ol9cPC1eKw.kind = 16;
NTI_Z5POizpB19bVj5ol9cPC1eKw.base = (&NTI_d0QF71x0BgMQlc7zEXMYTQ);
NTI_Z5POizpB19bVj5ol9cPC1eKw.flags = 2;
}

