/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64
#include "nimbase.h"

#include <string.h>
typedef struct ttype224852 ttype224852;
typedef struct tcontext289021 tcontext289021;
typedef struct tidtable224864 tidtable224864;
typedef struct tidpairseq224862 tidpairseq224862;
typedef struct tidpair224860 tidpair224860;
typedef struct tidobj199015 tidobj199015;
typedef struct TNimObject TNimObject;
typedef struct TGenericSeq TGenericSeq;
typedef struct tlineinfo194539 tlineinfo194539;
typedef struct trepltypevars316786 trepltypevars316786;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq224848 ttypeseq224848;
typedef struct tnode224816 tnode224816;
typedef struct tsym224846 tsym224846;
typedef struct tloc224830 tloc224830;
typedef struct trope176009 trope176009;
typedef struct NimStringDesc NimStringDesc;
typedef struct TY84745 TY84745;
typedef struct tscope224840 tscope224840;
typedef struct TY224947 TY224947;
typedef struct tinstantiation224836 tinstantiation224836;
typedef struct tstrtable224820 tstrtable224820;
typedef struct tsymseq224818 tsymseq224818;
typedef struct tident199021 tident199021;
typedef struct tlib224834 tlib224834;
typedef struct tcell44935 tcell44935;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44947 tcellset44947;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct tpasscontext285005 tpasscontext285005;
typedef struct tproccon289011 tproccon289011;
typedef struct intset221056 intset221056;
typedef struct ttrunk221052 ttrunk221052;
typedef struct ttrunkseq221054 ttrunkseq221054;
typedef struct tlinkedlist126028 tlinkedlist126028;
typedef struct tlistentry126022 tlistentry126022;
typedef struct tctx288048 tctx288048;
typedef struct TY289133 TY289133;
typedef struct tinstantiationpair289013 tinstantiationpair289013;
typedef struct tnodeseq224810 tnodeseq224810;
typedef struct TY224936 TY224936;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef struct TY288250 TY288250;
typedef struct TY195414 TY195414;
typedef struct pprocHEX3Aobjecttype288230 pprocHEX3Aobjecttype288230;
typedef struct TY288269 TY288269;
typedef struct TY288270 TY288270;
typedef struct vmargs288042 vmargs288042;
typedef struct TY288231 TY288231;
typedef struct tblock288030 tblock288030;
typedef struct TY288211 TY288211;
typedef struct TY288237 TY288237;
struct  tidpair224860  {
tidobj199015* Key;
TNimObject* Val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tidtable224864  {
NI Counter;
tidpairseq224862* Data;
};
struct  tlineinfo194539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  trepltypevars316786  {
tcontext289021* C;
tidtable224864 Typemap;
tidtable224864 Symmap;
tidtable224864 Localcache;
tlineinfo194539 Info;
NIM_BOOL Allowmetatypes;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj199015  {
  TNimObject Sup;
NI Id;
};
struct  tloc224830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype224852* T;
trope176009* R;
trope176009* Heaproot;
};
struct  ttype224852  {
  tidobj199015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq224848* Sons;
tnode224816* N;
tsym224846* Owner;
tsym224846* Sym;
tsym224846* Destructor;
tsym224846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc224830 Loc;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct TY84745 {
NimStringDesc* Field0;
NI Field1;
};
struct  tstrtable224820  {
NI Counter;
tsymseq224818* Data;
};
struct  tsym224846  {
  tidobj199015 Sup;
NU8 Kind;
union {
struct {ttypeseq224848* Typeinstcache;
tscope224840* Typscope;
} S1;
struct {TY224947* Procinstcache;
tscope224840* Scope;
} S2;
struct {TY224947* Usedgenerics;
tstrtable224820 Tab;
} S3;
struct {tsym224846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype224852* Typ;
tident199021* Name;
tlineinfo194539 Info;
tsym224846* Owner;
NU32 Flags;
tnode224816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc224830 Loc;
tlib224834* Annex;
tnode224816* Constraint;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef ttype224852* TY410748[1];
struct  tpasscontext285005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset221056  {
NI Counter;
NI Max;
ttrunk221052* Head;
ttrunkseq221054* Data;
};
struct  tlinkedlist126028  {
tlistentry126022* Head;
tlistentry126022* Tail;
NI Counter;
};
typedef N_NIMCALL_PTR(tnode224816*, TY289064) (tcontext289021* c, tnode224816* n);
typedef N_NIMCALL_PTR(tnode224816*, TY289069) (tcontext289021* c, tnode224816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode224816*, TY289077) (tcontext289021* c, tnode224816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode224816*, TY289085) (tcontext289021* c, tnode224816* n);
typedef N_NIMCALL_PTR(tnode224816*, TY289090) (tcontext289021* c, tnode224816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode224816*, TY289098) (tcontext289021* c, tnode224816* n);
typedef N_NIMCALL_PTR(tnode224816*, TY289103) (tcontext289021* c, tnode224816* n, tnode224816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype224852*, TY289110) (tcontext289021* c, tnode224816* n, ttype224852* prev);
typedef struct {
N_NIMCALL_PTR(tnode224816*, ClPrc) (tcontext289021* c, tidtable224864 pt, tnode224816* n, void* ClEnv);
void* ClEnv;
} TY289116;
typedef struct {
N_NIMCALL_PTR(tsym224846*, ClPrc) (tcontext289021* c, tsym224846* fn, tidtable224864 pt, tlineinfo194539 info, void* ClEnv);
void* ClEnv;
} TY289122;
struct  tinstantiationpair289013  {
tsym224846* Genericsym;
tinstantiation224836* Inst;
};
typedef N_NIMCALL_PTR(tsym224846*, TY289138) (tcontext289021* c, tsym224846* dc, ttype224852* t, tlineinfo194539 info);
struct  tcontext289021  {
  tpasscontext285005 Sup;
tsym224846* Module;
tscope224840* Currentscope;
tscope224840* Importtable;
tscope224840* Toplevelscope;
tproccon289011* P;
tsymseq224818* Friendmodules;
NI Instcounter;
intset221056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq224818* Converters;
tsymseq224818* Patterns;
tlinkedlist126028 Optionstack;
tidtable224864 Symmapping;
tlinkedlist126028 Libs;
TY289064 Semconstexpr;
TY289069 Semexpr;
TY289077 Semtryexpr;
TY289085 Semtryconstexpr;
TY289090 Semoperand;
TY289098 Semconstboolexpr;
TY289103 Semoverloadedcall;
TY289110 Semtypenode;
TY289116 Seminferredlambda;
TY289122 Semgenerateinstance;
intset221056 Includedfiles;
tstrtable224820 Userpragmas;
tctx288048* Evalcontext;
intset221056 Unknownidents;
TY289133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY289138 Instdeepcopy;
};
struct  tnode224816  {
ttype224852* Typ;
tlineinfo194539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym224846* Sym;
} S4;
struct {tident199021* Ident;
} S5;
struct {tnodeseq224810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  trope176009  {
  TNimObject Sup;
trope176009* Left;
trope176009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope224840  {
NI Depthlevel;
tstrtable224820 Symbols;
tnodeseq224810* Usingsyms;
tscope224840* Parent;
};
struct  tinstantiation224836  {
tsym224846* Sym;
ttypeseq224848* Concretetypes;
TY224936* Usedby;
};
struct  tident199021  {
  tidobj199015 Sup;
NimStringDesc* S;
tident199021* Next;
NI H;
};
struct  tlistentry126022  {
  TNimObject Sup;
tlistentry126022* Prev;
tlistentry126022* Next;
};
struct  tlib224834  {
  tlistentry126022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope176009* Name;
tnode224816* Path;
};
typedef NI TY26420[8];
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tproccon289011  {
tsym224846* Owner;
tsym224846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon289011* Next;
};
struct  ttrunk221052  {
ttrunk221052* Next;
NI Key;
TY26420 Bits;
};
struct  vmargs288042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode224816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs288042* args, void* ClEnv);
void* ClEnv;
} vmcallback288044;
struct TY288270 {
NimStringDesc* Field0;
vmcallback288044 Field1;
};
struct  tctx288048  {
  tpasscontext285005 Sup;
TY288250* Code;
TY195414* Debug;
tnode224816* Globals;
tnode224816* Constants;
ttypeseq224848* Types;
tnode224816* Currentexceptiona;
tnode224816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype288230* Prc;
tsym224846* Module;
tnode224816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo194539 Comesfromheuristic;
TY288269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct  tblock288030  {
tsym224846* Label;
TY288211* Fixups;
};
struct TY288237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY288237 TY288234[256];
struct  pprocHEX3Aobjecttype288230  {
TY288231* Blocks;
tsym224846* Sym;
TY288234 Slots;
NI Maxslots;
};
struct tidpairseq224862 {
  TGenericSeq Sup;
  tidpair224860 data[SEQ_DECL_SIZE];
};
struct ttypeseq224848 {
  TGenericSeq Sup;
  ttype224852* data[SEQ_DECL_SIZE];
};
struct TY224947 {
  TGenericSeq Sup;
  tinstantiation224836* data[SEQ_DECL_SIZE];
};
struct tsymseq224818 {
  TGenericSeq Sup;
  tsym224846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq221054 {
  TGenericSeq Sup;
  ttrunk221052* data[SEQ_DECL_SIZE];
};
struct TY289133 {
  TGenericSeq Sup;
  tinstantiationpair289013 data[SEQ_DECL_SIZE];
};
struct tnodeseq224810 {
  TGenericSeq Sup;
  tnode224816* data[SEQ_DECL_SIZE];
};
struct TY224936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY288250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY195414 {
  TGenericSeq Sup;
  tlineinfo194539 data[SEQ_DECL_SIZE];
};
struct TY288269 {
  TGenericSeq Sup;
  TY288270 data[SEQ_DECL_SIZE];
};
struct TY288211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY288231 {
  TGenericSeq Sup;
  tblock288030 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittypevars_319474)(tcontext289021* p, tidtable224864 pt, tlineinfo194539 info, trepltypevars316786* Result);
N_NIMCALL(void, initidtable_225167)(tidtable224864* x);
N_NIMCALL(void, copyidtable_225241)(tidtable224864* dest, tidtable224864 src);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, pushinfocontext_195930)(tlineinfo194539 info);
N_NIMCALL(ttype224852*, replacetypevarst_316834)(trepltypevars316786* cl, ttype224852* t);
N_NIMCALL(ttype224852*, replacetypevarstaux_316796)(trepltypevars316786* cl, ttype224852* t);
N_NIMCALL(TNimObject*, idtableget_234182)(tidtable224864 t, tidobj199015* key);
N_NIMCALL(ttype224852*, handlegenericinvokation_318285)(trepltypevars316786* cl, ttype224852* t);
N_NIMCALL(void, internalerror_196987)(tlineinfo194539 info, NimStringDesc* errmsg);
N_NIMCALL(ttype224852*, searchinsttypes_316407)(ttype224852* key);
N_NIMCALL(void, internalerror_197006)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_197126)(TY84745 x_197130);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_272497)(ttypeseq224848* x_272503, ttypeseq224848* y_272508);
N_NIMCALL(NIM_BOOL, comparetypes_269571)(ttype224852* x, ttype224852* y, NU8 cmp, NU8 flags);
static N_INLINE(NI, sonslen_225255)(ttype224852* n);
N_NIMCALL(ttype224852*, lookuptypevar_318186)(trepltypevars316786* cl, ttype224852* t);
N_NIMCALL(void, localerror_196955)(tlineinfo194539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, typetostring_262031)(ttype224852* typ, NU8 prefer);
N_NIMCALL(ttype224852*, errortype_290318)(tcontext289021* c);
N_NIMCALL(void, idtableput_234196)(tidtable224864* t, tidobj199015* key, TNimObject* val);
N_NIMCALL(ttype224852*, instcopytype_318238)(trepltypevars316786* cl, ttype224852* t);
N_NIMCALL(ttype224852*, copytype_225195)(ttype224852* t, tsym224846* owner, NIM_BOOL keepid);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(void, propagatetoowner_229318)(ttype224852* owner, ttype224852* elem);
N_NIMCALL(ttype224852*, newtype_225083)(NU8 kind, tsym224846* owner);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, cachetypeinst_316688)(ttype224852* inst);
N_NIMCALL(void, safeadd_316709)(ttypeseq224848** x_316717, ttype224852* y_316721);
N_NIMCALL(void, rawaddson_229562)(ttype224852* father, ttype224852* son);
static N_INLINE(ttype224852*, lastson_225267)(ttype224852* n);
N_NIMCALL(NIM_BOOL, isgenericalias_268591)(ttype224852* t);
N_NIMCALL(ttype224852*, skipgenericalias_268619)(ttype224852* t);
N_NIMCALL(void, checkpartialconstructedtype_316102)(tlineinfo194539 info, ttype224852* t);
N_NIMCALL(ttype224852*, skiptypes_229245)(ttype224852* t, NU64 kinds);
N_NIMCALL(void, sharedptrcheck_316014)(tlineinfo194539 info, ttype224852* t);
N_NIMCALL(NI, len_229005)(ttype224852* n);
static N_INLINE(NIM_BOOL, isgcedmem_229276)(ttype224852* t);
N_NIMCALL(tnode224816*, preparenode_317007)(trepltypevars316786* cl, tnode224816* n);
N_NIMCALL(tnode224816*, copynode_225323)(tnode224816* src);
N_NIMCALL(tsym224846*, replacetypevarss_316804)(trepltypevars316786* cl, tsym224846* s);
N_NIMCALL(tsym224846*, copysym_225203)(tsym224846* s, NIM_BOOL keepid);
N_NIMCALL(tnode224816*, replacetypevarsn_316812)(trepltypevars316786* cl, tnode224816* n_316816);
N_NIMCALL(tnode224816*, newnode_227207)(NU8 kind, tlineinfo194539 info, tnodeseq224810* sons, ttype224852* typ);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
static N_INLINE(NI, sonslen_225249)(tnode224816* n);
N_NIMCALL(void, illformedast_290405)(tnode224816* n);
N_NIMCALL(void, checksonslen_290415)(tnode224816* n, NI length);
N_NIMCALL(tnode224816*, newnodei_225138)(NU8 kind, tlineinfo194539 info);
N_NIMCALL(tnode224816*, reresolvecallswithtypedescparams_317410)(trepltypevars316786* cl, tnode224816* n);
static N_INLINE(tnode224816*, HEX5BHEX5D_225698)(tnode224816* n, NI i);
static N_INLINE(NI, safelen_225424)(tnode224816* n);
N_NIMCALL(NIM_BOOL, istypeparam_317151)(tnode224816* n);
N_NIMCALL(tnode224816*, newsymnode_225132)(tsym224846* sym);
N_NIMCALL(void, newsons_225273)(tnode224816* father, NI length);
N_NIMCALL(void, add_225498)(tnode224816* father, tnode224816* son);
N_NIMCALL(ttype224852*, newtypes_289213)(NU8 kind, tcontext289021* c);
static N_INLINE(ttype224852*, skipintlit_281533)(ttype224852* t);
N_NIMCALL(ttype224852*, getsystype_281030)(NU8 kind);
N_NIMCALL(ttype224852*, base_262038)(ttype224852* t);
N_NIMCALL(ttype224852*, maketypedesc_289762)(tcontext289021* c, ttype224852* typ);
N_NIMCALL(NIM_BOOL, containsgenerictype_271929)(ttype224852* t);
N_NIMCALL(void, propagatefieldflags_319139)(ttype224852* t, tnode224816* n);
static N_INLINE(NI, len_225364)(tnode224816* n);
N_NIMCALL(void, erasevoidparams_318784)(ttype224852* t);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, skipintliteralparams_318999)(ttype224852* t);
N_NIMCALL(void, popinfocontext_195957)(void);
N_NIMCALL(NIM_BOOL, hasgenericarguments_317243)(tnode224816* n);
N_NIMCALL(NI64, computesize_262193)(ttype224852* typ);
STRING_LITERAL(TMP2667, "no generic body", 15);
STRING_LITERAL(TMP2669, "compiler/semtypinst.nim", 23);
NIM_CONST TY84745 TMP2668 = {((NimStringDesc*) &TMP2669),
52}
;
STRING_LITERAL(TMP2670, "substitution with generic parameter", 35);
STRING_LITERAL(TMP2671, "acyclic", 7);
STRING_LITERAL(TMP2672, "", 0);
STRING_LITERAL(TMP2673, "shared memory may not refer to GC\'ed thread local memory", 56);
STRING_LITERAL(TMP2674, "ReplaceTypeVarsN: when condition not a bool", 43);
NIM_CONST TY84745 TMP2677 = {((NimStringDesc*) &TMP2669),
429}
;
NIM_CONST TY84745 TMP2678 = {((NimStringDesc*) &TMP2669),
345}
;
extern tgcheap47016 gch_47044;
extern TNimType NTI224848; /* TTypeSeq */
extern TNimType NTI224810; /* TNodeSeq */

N_NIMCALL(void, inittypevars_319474)(tcontext289021* p, tidtable224864 pt, tlineinfo194539 info, trepltypevars316786* Result) {
	initidtable_225167((&(*Result).Symmap));
	copyidtable_225241((&(*Result).Typemap), pt);
	initidtable_225167((&(*Result).Localcache));
	(*Result).Info = info;
	unsureAsgnRef((void**) (&(*Result).C), p);
}

N_NIMCALL(ttype224852*, searchinsttypes_316407)(ttype224852* key) {
	ttype224852* result;
	ttype224852* generictyp;
	result = 0;
	generictyp = (*key).Sons->data[0];
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* LOC9;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((*generictyp).Kind == ((NU8) 10));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*key).Sons->data[0] == generictyp);
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC3 = !(((*generictyp).Sym == NIM_NIL));
		LA6: ;
		if (!!(LOC3)) goto LA7;
		LOC9 = 0;
		LOC9 = HEX24_197126(TMP2668);
		internalerror_197006(LOC9);
	}
	LA7: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = HEX3DHEX3D_272497((*(*generictyp).Sym).kindU.S1.Typeinstcache, NIM_NIL);
		if (!LOC12) goto LA13;
		goto BeforeRet;
	}
	LA13: ;
	{
		ttype224852* inst_316611;
		ttypeseq224848* HEX3Atmp_316655;
		NI i_316658;
		NI l_316660;
		inst_316611 = 0;
		HEX3Atmp_316655 = 0;
		HEX3Atmp_316655 = (*(*generictyp).Sym).kindU.S1.Typeinstcache;
		i_316658 = 0;
		l_316660 = HEX3Atmp_316655->Sup.len;
		{
			while (1) {
				if (!(i_316658 < l_316660)) goto LA17;
				inst_316611 = HEX3Atmp_316655->data[i_316658];
				{
					if (!((*inst_316611).Sup.Id == (*key).Sup.Id)) goto LA20;
					result = inst_316611;
					goto BeforeRet;
				}
				LA20: ;
				{
					if (!((*inst_316611).Sons->Sup.len < (*key).Sons->Sup.len)) goto LA24;
					goto BeforeRet;
				}
				LA24: ;
				{
					{
						NI j_316646;
						NI HEX3Atmp_316650;
						NI res_316653;
						j_316646 = 0;
						HEX3Atmp_316650 = 0;
						HEX3Atmp_316650 = ((*key).Sons->Sup.len-1);
						res_316653 = 1;
						{
							while (1) {
								if (!(res_316653 <= HEX3Atmp_316650)) goto LA29;
								j_316646 = res_316653;
								{
									NIM_BOOL LOC32;
									LOC32 = 0;
									LOC32 = comparetypes_269571((*inst_316611).Sons->data[j_316646], (*key).Sons->data[j_316646], ((NU8) 0), 8);
									if (!!(LOC32)) goto LA33;
									goto LA26;
								}
								LA33: ;
								res_316653 += 1;
							} LA29: ;
						}
					}
					result = inst_316611;
					goto BeforeRet;
				} LA26: ;
				i_316658 += 1;
			} LA17: ;
		}
	}
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_225255)(ttype224852* n) {
	NI result;
	result = 0;
	{
		if (!(*n).Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).Sons->Sup.len;
	}
	LA1: ;
	return result;
}

N_NIMCALL(ttype224852*, lookuptypevar_318186)(trepltypevars316786* cl, ttype224852* t) {
	ttype224852* result;
	tidobj199015* LOC1;
	TNimObject* LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = &t->Sup;
	LOC2 = 0;
	LOC2 = idtableget_234182((*cl).Typemap, LOC1);
	result = ((ttype224852*) (LOC2));
	{
		NimStringDesc* LOC13;
		tidobj199015* LOC14;
		TNimObject* LOC15;
		if (!(result == NIM_NIL)) goto LA5;
		{
			NIM_BOOL LOC9;
			LOC9 = 0;
			LOC9 = (*cl).Allowmetatypes;
			if (LOC9) goto LA10;
			LOC9 = (((*t).Flags &(1<<((((NU8) 10))&31)))!=0);
			LA10: ;
			if (!LOC9) goto LA11;
			goto BeforeRet;
		}
		LA11: ;
		LOC13 = 0;
		LOC13 = typetostring_262031(t, ((NU8) 0));
		localerror_196955((*(*t).Sym).Info, ((NU16) 124), LOC13);
		result = errortype_290318((*cl).C);
		LOC14 = 0;
		LOC14 = &t->Sup;
		LOC15 = 0;
		LOC15 = &result->Sup.Sup;
		idtableput_234196((&(*cl).Typemap), LOC14, LOC15);
	}
	goto LA3;
	LA5: ;
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = ((*result).Kind == ((NU8) 12));
		if (!(LOC17)) goto LA18;
		LOC17 = !((*cl).Allowmetatypes);
		LA18: ;
		if (!LOC17) goto LA19;
		internalerror_196987((*cl).Info, ((NimStringDesc*) &TMP2670));
	}
	goto LA3;
	LA19: ;
	LA3: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(ttype224852*, instcopytype_318238)(trepltypevars316786* cl, ttype224852* t) {
	ttype224852* result;
	result = 0;
	result = copytype_225195(t, (*t).Owner, (*cl).Allowmetatypes);
	(*result).Flags |= ((NI32)1)<<((((NU8) 8))%(sizeof(NI32)*8));
	(*result).Flags = ((*result).Flags & ~ 524288);
	return result;
}

static N_INLINE(tcell44935*, usrtocell_48646)(void* usr) {
	tcell44935* result;
	result = 0;
	result = ((tcell44935*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((NI)sizeof(tcell44935))))));
	return result;
}

static N_INLINE(void, rtladdzct_50204)(tcell44935* c) {
	addzct_48617((&gch_47044.Zct), c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44935* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48646(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44935* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48646((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA11;
			rtladdzct_50204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell44935* c;
	c = usrtocell_48646(p);
	{
		(*c).Refcount -= 8;
		if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA3;
		rtladdzct_50204(c);
	}
	LA3: ;
}

N_NIMCALL(void, cachetypeinst_316688)(ttype224852* inst) {
	ttype224852* generictyp;
	generictyp = (*inst).Sons->data[0];
	safeadd_316709((&(*(*generictyp).Sym).kindU.S1.Typeinstcache), inst);
}

static N_INLINE(ttype224852*, lastson_225267)(ttype224852* n) {
	ttype224852* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = sonslen_225255(n);
	result = (*n).Sons->data[(NI64)(LOC1 - 1)];
	return result;
}

static N_INLINE(NIM_BOOL, isgcedmem_229276)(ttype224852* t) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NIM_BOOL LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = ((289406976 &(IL64(1)<<(((*t).Kind)&IL64(63))))!=0);
	if (LOC1) goto LA2;
	LOC3 = 0;
	LOC3 = ((*t).Kind == ((NU8) 25));
	if (!(LOC3)) goto LA4;
	LOC3 = ((*t).Callconv == ((NU8) 8));
	LA4: ;
	LOC1 = LOC3;
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, sharedptrcheck_316014)(tlineinfo194539 info, ttype224852* t) {
	{
		NIM_BOOL LOC3;
		NI LOC5;
		LOC3 = 0;
		LOC3 = ((*t).Kind == ((NU8) 21));
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = len_229005(t);
		LOC3 = (1 < LOC5);
		LA4: ;
		if (!LOC3) goto LA6;
		{
			if (!((*(*(*t).Sons->data[0]).Sym).Magic == ((NU16) 210) || (*(*(*t).Sons->data[0]).Sym).Magic == ((NU16) 211))) goto LA10;
			(*t).Flags |= ((NI32)1)<<((((NU8) 15))%(sizeof(NI32)*8));
			{
				if (!((*(*(*t).Sons->data[0]).Sym).Magic == ((NU16) 211))) goto LA14;
				(*t).Flags |= ((NI32)1)<<((((NU8) 26))%(sizeof(NI32)*8));
			}
			LA14: ;
			{
				NIM_BOOL LOC18;
				LOC18 = 0;
				LOC18 = (((*t).Flags &(1<<((((NU8) 20))&31)))!=0);
				if (LOC18) goto LA19;
				LOC18 = isgcedmem_229276(t);
				LA19: ;
				if (!LOC18) goto LA20;
				localerror_196955(info, ((NU16) 4), ((NimStringDesc*) &TMP2673));
			}
			LA20: ;
		}
		LA10: ;
	}
	LA6: ;
}

N_NIMCALL(void, checkpartialconstructedtype_316102)(tlineinfo194539 info, ttype224852* t) {
	{
		NIM_BOOL LOC3;
		ttype224852* LOC5;
		LOC3 = 0;
		LOC3 = (((*t).Flags &(1<<((((NU8) 4))&31)))!=0);
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = skiptypes_229245(t, IL64(211106232576256));
		LOC3 = !(((*LOC5).Kind == ((NU8) 17)));
		LA4: ;
		if (!LOC3) goto LA6;
		localerror_196955(info, ((NU16) 162), ((NimStringDesc*) &TMP2671));
	}
	goto LA1;
	LA6: ;
	{
		NIM_BOOL LOC9;
		LOC9 = 0;
		LOC9 = ((*t).Kind == ((NU8) 23));
		if (!(LOC9)) goto LA10;
		LOC9 = ((*(*t).Sons->data[0]).Kind == ((NU8) 23));
		LA10: ;
		if (!LOC9) goto LA11;
		localerror_196955(info, ((NU16) 197), ((NimStringDesc*) &TMP2672));
	}
	goto LA1;
	LA11: ;
	{
		sharedptrcheck_316014(info, t);
	}
	LA1: ;
}

N_NIMCALL(ttype224852*, handlegenericinvokation_318285)(trepltypevars316786* cl, ttype224852* t) {
	ttype224852* result;
	ttype224852* body;
	ttype224852* header;
	TY410748 LOC42;
	ttype224852* newbody;
	ttype224852* LOC60;
	tsym224846* dc;
	result = 0;
	body = (*t).Sons->data[0];
	{
		if (!!(((*body).Kind == ((NU8) 10)))) goto LA3;
		internalerror_196987((*cl).Info, ((NimStringDesc*) &TMP2667));
	}
	LA3: ;
	header = t;
	{
		tidobj199015* LOC9;
		TNimObject* LOC10;
		if (!(*cl).Allowmetatypes) goto LA7;
		LOC9 = 0;
		LOC9 = &t->Sup;
		LOC10 = 0;
		LOC10 = idtableget_234182((*cl).Localcache, LOC9);
		result = ((ttype224852*) (LOC10));
	}
	goto LA5;
	LA7: ;
	{
		result = searchinsttypes_316407(t);
	}
	LA5: ;
	{
		if (!!((result == NIM_NIL))) goto LA14;
		goto BeforeRet;
	}
	LA14: ;
	{
		NI i_318331;
		NI HEX3Atmp_318734;
		NI LOC17;
		NI res_318737;
		i_318331 = 0;
		HEX3Atmp_318734 = 0;
		LOC17 = 0;
		LOC17 = sonslen_225255(t);
		HEX3Atmp_318734 = (NI64)(LOC17 - 1);
		res_318737 = 1;
		{
			while (1) {
				ttype224852* x;
				if (!(res_318737 <= HEX3Atmp_318734)) goto LA19;
				i_318331 = res_318737;
				x = (*t).Sons->data[i_318331];
				{
					if (!((*x).Kind == ((NU8) 12))) goto LA22;
					x = lookuptypevar_318186(cl, x);
					{
						if (!!((x == NIM_NIL))) goto LA26;
						{
							if (!(header == t)) goto LA30;
							header = instcopytype_318238(cl, t);
						}
						LA30: ;
						asgnRefNoCycle((void**) (&(*header).Sons->data[i_318331]), x);
						propagatetoowner_229318(header, x);
					}
					LA26: ;
				}
				goto LA20;
				LA22: ;
				{
					propagatetoowner_229318(header, x);
				}
				LA20: ;
				res_318737 += 1;
			} LA19: ;
		}
	}
	{
		if (!!((header == t))) goto LA35;
		result = searchinsttypes_316407(header);
		{
			if (!!((result == NIM_NIL))) goto LA39;
			goto BeforeRet;
		}
		LA39: ;
	}
	goto LA33;
	LA35: ;
	{
		header = instcopytype_318238(cl, t);
	}
	LA33: ;
	result = newtype_225083(((NU8) 11), (*(*t).Sons->data[0]).Owner);
	(*result).Flags = (*header).Flags;
	if ((*result).Sons) nimGCunrefNoCycle((*result).Sons);
	(*result).Sons = (ttypeseq224848*) newSeqRC1((&NTI224848), 1);
	memset((void*)LOC42, 0, sizeof(LOC42));
	LOC42[0] = (*header).Sons->data[0];
	asgnRefNoCycle((void**) (&(*result).Sons->data[0]), LOC42[0]);
	{
		if (!!((*cl).Allowmetatypes)) goto LA45;
		cachetypeinst_316688(result);
	}
	goto LA43;
	LA45: ;
	{
		tidobj199015* LOC48;
		TNimObject* LOC49;
		LOC48 = 0;
		LOC48 = &t->Sup;
		LOC49 = 0;
		LOC49 = &result->Sup.Sup;
		idtableput_234196((&(*cl).Localcache), LOC48, LOC49);
	}
	LA43: ;
	{
		NI i_318439;
		NI HEX3Atmp_318740;
		NI LOC51;
		NI res_318743;
		i_318439 = 0;
		HEX3Atmp_318740 = 0;
		LOC51 = 0;
		LOC51 = sonslen_225255(t);
		HEX3Atmp_318740 = (NI64)(LOC51 - 1);
		res_318743 = 1;
		{
			while (1) {
				ttype224852* x;
				tidobj199015* LOC54;
				TNimObject* LOC55;
				if (!(res_318743 <= HEX3Atmp_318740)) goto LA53;
				i_318439 = res_318743;
				x = replacetypevarst_316834(cl, (*t).Sons->data[i_318439]);
				asgnRefNoCycle((void**) (&(*header).Sons->data[i_318439]), x);
				propagatetoowner_229318(header, x);
				LOC54 = 0;
				LOC54 = &(*body).Sons->data[(NI64)(i_318439 - 1)]->Sup;
				LOC55 = 0;
				LOC55 = &x->Sup.Sup;
				idtableput_234196((&(*cl).Typemap), LOC54, LOC55);
				res_318743 += 1;
			} LA53: ;
		}
	}
	{
		NI i_318614;
		NI HEX3Atmp_318746;
		NI LOC57;
		NI res_318749;
		i_318614 = 0;
		HEX3Atmp_318746 = 0;
		LOC57 = 0;
		LOC57 = sonslen_225255(t);
		HEX3Atmp_318746 = (NI64)(LOC57 - 1);
		res_318749 = 1;
		{
			while (1) {
				if (!(res_318749 <= HEX3Atmp_318746)) goto LA59;
				i_318614 = res_318749;
				rawaddson_229562(result, (*header).Sons->data[i_318614]);
				res_318749 += 1;
			} LA59: ;
		}
	}
	LOC60 = 0;
	LOC60 = lastson_225267(body);
	newbody = replacetypevarst_316834(cl, LOC60);
	(*newbody).Flags = ((*newbody).Flags | (((*t).Flags | (*body).Flags) & ~ 524288));
	(*result).Flags = (((*result).Flags | (*newbody).Flags) & ~ 524288);
	{
		NIM_BOOL LOC63;
		LOC63 = 0;
		LOC63 = isgenericalias_268591(newbody);
		if (!LOC63) goto LA64;
		newbody = skipgenericalias_268619(newbody);
	}
	LA64: ;
	rawaddson_229562(result, newbody);
	checkpartialconstructedtype_316102((*cl).Info, newbody);
	dc = (*newbody).Deepcopy;
	{
		NIM_BOOL LOC68;
		LOC68 = 0;
		LOC68 = !((dc == NIM_NIL));
		if (!(LOC68)) goto LA69;
		LOC68 = !((((*(*newbody).Deepcopy).Flags &(1<<((((NU8) 2))&31)))!=0));
		LA69: ;
		if (!LOC68) goto LA70;
		asgnRefNoCycle((void**) (&(*newbody).Deepcopy), (*(*cl).C).Instdeepcopy((*cl).C, dc, result, (*cl).Info));
	}
	LA70: ;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_225249)(tnode224816* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

static N_INLINE(tnode224816*, HEX5BHEX5D_225698)(tnode224816* n, NI i) {
	tnode224816* result;
	result = 0;
	result = (*n).kindU.S6.Sons->data[i];
	return result;
}

static N_INLINE(NI, safelen_225424)(tnode224816* n) {
	NI result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*n).Kind >= ((NU8) 0) && (*n).Kind <= ((NU8) 23));
		if (LOC3) goto LA4;
		LOC3 = (*n).kindU.S6.Sons == 0;
		LA4: ;
		if (!LOC3) goto LA5;
		result = 0;
	}
	goto LA1;
	LA5: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, istypeparam_317151)(tnode224816* n) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NIM_BOOL LOC3;
	NIM_BOOL LOC5;
	result = 0;
	LOC1 = 0;
	LOC1 = ((*n).Kind == ((NU8) 3));
	if (!(LOC1)) goto LA2;
	LOC3 = 0;
	LOC3 = ((*(*n).kindU.S4.Sym).Kind == ((NU8) 4));
	if (LOC3) goto LA4;
	LOC5 = 0;
	LOC5 = ((*(*n).kindU.S4.Sym).Kind == ((NU8) 7));
	if (!(LOC5)) goto LA6;
	LOC5 = (((*(*n).kindU.S4.Sym).Flags &(1<<((((NU8) 2))&31)))!=0);
	LA6: ;
	LOC3 = LOC5;
	LA4: ;
	LOC1 = LOC3;
	LA2: ;
	result = LOC1;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode224816*, reresolvecallswithtypedescparams_317410)(trepltypevars316786* cl, tnode224816* n) {
	tnode224816* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		tnode224816* LOC5;
		NIM_BOOL needsfixing;
		LOC3 = 0;
		LOC3 = ((*n).Kind == ((NU8) 27) || (*n).Kind == ((NU8) 29) || (*n).Kind == ((NU8) 30) || (*n).Kind == ((NU8) 31) || (*n).Kind == ((NU8) 26) || (*n).Kind == ((NU8) 28) || (*n).Kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = HEX5BHEX5D_225698(n, 0);
		LOC3 = (((*(*LOC5).kindU.S4.Sym).Flags &(1<<((((NU8) 2))&31)))!=0);
		LA4: ;
		if (!LOC3) goto LA6;
		needsfixing = NIM_FALSE;
		{
			NI i_317478;
			NI HEX3Atmp_317559;
			NI LOC9;
			NI res_317562;
			i_317478 = 0;
			HEX3Atmp_317559 = 0;
			LOC9 = 0;
			LOC9 = safelen_225424(n);
			HEX3Atmp_317559 = (LOC9 - 1);
			res_317562 = 1;
			{
				while (1) {
					if (!(res_317562 <= HEX3Atmp_317559)) goto LA11;
					i_317478 = res_317562;
					{
						tnode224816* LOC14;
						NIM_BOOL LOC15;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_225698(n, i_317478);
						LOC15 = 0;
						LOC15 = istypeparam_317151(LOC14);
						if (!LOC15) goto LA16;
						needsfixing = NIM_TRUE;
					}
					LA16: ;
					res_317562 += 1;
				} LA11: ;
			}
		}
		{
			if (!needsfixing) goto LA20;
			asgnRefNoCycle((void**) (&(*n).kindU.S6.Sons->data[0]), newsymnode_225132((*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Owner));
			result = (*(*cl).C).Semoverloadedcall((*cl).C, n, n, 4096);
			goto BeforeRet;
		}
		LA20: ;
	}
	LA6: ;
	{
		NI i_317543;
		NI HEX3Atmp_317565;
		NI LOC23;
		NI res_317568;
		i_317543 = 0;
		HEX3Atmp_317565 = 0;
		LOC23 = 0;
		LOC23 = safelen_225424(n);
		HEX3Atmp_317565 = (LOC23 - 1);
		res_317568 = 0;
		{
			while (1) {
				tnode224816* LOC26;
				if (!(res_317568 <= HEX3Atmp_317565)) goto LA25;
				i_317543 = res_317568;
				LOC26 = 0;
				LOC26 = HEX5BHEX5D_225698(n, i_317543);
				asgnRefNoCycle((void**) (&(*n).kindU.S6.Sons->data[i_317543]), reresolvecallswithtypedescparams_317410(cl, LOC26));
				res_317568 += 1;
			} LA25: ;
		}
	}
	result = n;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode224816*, replacetypevarsn_316812)(trepltypevars316786* cl, tnode224816* n_316816) {
	tnode224816* result;
	result = 0;
	{
		if (!(n_316816 == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	result = copynode_225323(n_316816);
	{
		if (!!(((*n_316816).Typ == NIM_NIL))) goto LA7;
		asgnRefNoCycle((void**) (&(*result).Typ), replacetypevarst_316834(cl, (*n_316816).Typ));
	}
	LA7: ;
	switch ((*n_316816).Kind) {
	case ((NU8) 0) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	{
	}
	break;
	case ((NU8) 3):
	{
		asgnRefNoCycle((void**) (&(*result).kindU.S4.Sym), replacetypevarss_316804(cl, (*n_316816).kindU.S4.Sym));
		{
			tnodeseq224810* LOC15;
			if (!((*(*(*result).kindU.S4.Sym).Typ).Kind == ((NU8) 3))) goto LA13;
			LOC15 = 0;
			LOC15 = (tnodeseq224810*) newSeq((&NTI224810), 0);
			result = newnode_227207(((NU8) 137), (*n_316816).Info, LOC15, NIM_NIL);
		}
		LA13: ;
	}
	break;
	case ((NU8) 139):
	{
		tnode224816* branch;
		branch = NIM_NIL;
		{
			NI i_317891;
			NI HEX3Atmp_318088;
			NI LOC18;
			NI res_318091;
			i_317891 = 0;
			HEX3Atmp_318088 = 0;
			LOC18 = 0;
			LOC18 = sonslen_225249(n_316816);
			HEX3Atmp_318088 = (NI64)(LOC18 - 1);
			res_318091 = 0;
			{
				while (1) {
					tnode224816* it;
					if (!(res_318091 <= HEX3Atmp_318088)) goto LA20;
					i_317891 = res_318091;
					it = (*n_316816).kindU.S6.Sons->data[i_317891];
					{
						if (!(it == NIM_NIL)) goto LA23;
						illformedast_290405(n_316816);
					}
					LA23: ;
					switch ((*it).Kind) {
					case ((NU8) 86):
					{
						tnode224816* cond;
						tnode224816* e;
						checksonslen_290415(it, 2);
						cond = preparenode_317007(cl, (*it).kindU.S6.Sons->data[0]);
						e = (*(*cl).C).Semconstexpr((*cl).C, cond);
						{
							if (!!(((*e).Kind == ((NU8) 6)))) goto LA28;
							internalerror_196987((*e).Info, ((NimStringDesc*) &TMP2674));
						}
						LA28: ;
						{
							NIM_BOOL LOC32;
							LOC32 = 0;
							LOC32 = !(((*e).kindU.S1.Intval == IL64(0)));
							if (!(LOC32)) goto LA33;
							LOC32 = (branch == NIM_NIL);
							LA33: ;
							if (!LOC32) goto LA34;
							branch = (*it).kindU.S6.Sons->data[1];
						}
						LA34: ;
					}
					break;
					case ((NU8) 88):
					{
						checksonslen_290415(it, 1);
						{
							if (!(branch == NIM_NIL)) goto LA39;
							branch = (*it).kindU.S6.Sons->data[0];
						}
						LA39: ;
					}
					break;
					default:
					{
						illformedast_290405(n_316816);
					}
					break;
					}
					res_318091 += 1;
				} LA20: ;
			}
		}
		{
			if (!!((branch == NIM_NIL))) goto LA44;
			result = replacetypevarsn_316812(cl, branch);
		}
		goto LA42;
		LA44: ;
		{
			result = newnodei_225138(((NU8) 137), (*n_316816).Info);
		}
		LA42: ;
	}
	break;
	case ((NU8) 62):
	{
		tnode224816* n;
		n = preparenode_317007(cl, n_316816);
		n = reresolvecallswithtypedescparams_317410(cl, n);
		{
			if (!(*cl).Allowmetatypes) goto LA50;
			result = n;
		}
		goto LA48;
		LA50: ;
		{
			result = (*(*cl).C).Semexpr((*cl).C, n, 0);
		}
		LA48: ;
	}
	break;
	default:
	{
		NI length;
		length = sonslen_225249(n_316816);
		{
			if (!(0 < length)) goto LA56;
			newsons_225273(result, length);
			{
				NI i_318057;
				NI HEX3Atmp_318094;
				NI res_318097;
				i_318057 = 0;
				HEX3Atmp_318094 = 0;
				HEX3Atmp_318094 = (NI64)(length - 1);
				res_318097 = 0;
				{
					while (1) {
						if (!(res_318097 <= HEX3Atmp_318094)) goto LA60;
						i_318057 = res_318097;
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[i_318057]), replacetypevarsn_316812(cl, (*n_316816).kindU.S6.Sons->data[i_318057]));
						res_318097 += 1;
					} LA60: ;
				}
			}
		}
		LA56: ;
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym224846*, replacetypevarss_316804)(trepltypevars316786* cl, tsym224846* s) {
	tsym224846* result;
	tidobj199015* LOC5;
	TNimObject* LOC6;
	result = 0;
	{
		if (!(s == NIM_NIL)) goto LA3;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = &s->Sup;
	LOC6 = 0;
	LOC6 = idtableget_234182((*cl).Symmap, LOC5);
	result = ((tsym224846*) (LOC6));
	{
		tidobj199015* LOC11;
		TNimObject* LOC12;
		if (!(result == NIM_NIL)) goto LA9;
		result = copysym_225203(s, NIM_FALSE);
		(*result).Flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
		LOC11 = 0;
		LOC11 = &s->Sup;
		LOC12 = 0;
		LOC12 = &result->Sup.Sup;
		idtableput_234196((&(*cl).Symmap), LOC11, LOC12);
		asgnRefNoCycle((void**) (&(*result).Owner), (*s).Owner);
		asgnRefNoCycle((void**) (&(*result).Typ), replacetypevarst_316834(cl, (*s).Typ));
		asgnRefNoCycle((void**) (&(*result).Ast), replacetypevarsn_316812(cl, (*s).Ast));
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode224816*, preparenode_317007)(trepltypevars316786* cl, tnode224816* n) {
	tnode224816* result;
	ttype224852* t;
	NIM_BOOL iscall;
	result = 0;
	t = replacetypevarst_316834(cl, (*n).Typ);
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = !((t == NIM_NIL));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*t).Kind == ((NU8) 59));
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC3 = !(((*t).N == NIM_NIL));
		LA6: ;
		if (!LOC3) goto LA7;
		result = (*t).N;
		goto BeforeRet;
	}
	LA7: ;
	result = copynode_225323(n);
	asgnRefNoCycle((void**) (&(*result).Typ), t);
	{
		if (!((*result).Kind == ((NU8) 3))) goto LA11;
		asgnRefNoCycle((void**) (&(*result).kindU.S4.Sym), replacetypevarss_316804(cl, (*n).kindU.S4.Sym));
	}
	LA11: ;
	iscall = ((*result).Kind == ((NU8) 27) || (*result).Kind == ((NU8) 29) || (*result).Kind == ((NU8) 30) || (*result).Kind == ((NU8) 31) || (*result).Kind == ((NU8) 26) || (*result).Kind == ((NU8) 28) || (*result).Kind == ((NU8) 32));
	{
		NI i_317129;
		NI HEX3Atmp_317131;
		NI LOC14;
		NI res_317134;
		i_317129 = 0;
		HEX3Atmp_317131 = 0;
		LOC14 = 0;
		LOC14 = safelen_225424(n);
		HEX3Atmp_317131 = (LOC14 - 1);
		res_317134 = 0;
		{
			while (1) {
				if (!(res_317134 <= HEX3Atmp_317131)) goto LA16;
				i_317129 = res_317134;
				{
					NIM_BOOL LOC19;
					tnode224816* LOC23;
					LOC19 = 0;
					LOC19 = iscall;
					if (!(LOC19)) goto LA20;
					LOC19 = (i_317129 == 0);
					LA20: ;
					if (!LOC19) goto LA21;
					LOC23 = 0;
					LOC23 = HEX5BHEX5D_225698(n, i_317129);
					add_225498(result, LOC23);
				}
				goto LA17;
				LA21: ;
				{
					tnode224816* LOC25;
					tnode224816* LOC26;
					LOC25 = 0;
					LOC25 = HEX5BHEX5D_225698(n, i_317129);
					LOC26 = 0;
					LOC26 = preparenode_317007(cl, LOC25);
					add_225498(result, LOC26);
				}
				LA17: ;
				res_317134 += 1;
			} LA16: ;
		}
	}
	BeforeRet: ;
	return result;
}

static N_INLINE(ttype224852*, skipintlit_281533)(ttype224852* t) {
	ttype224852* result;
	result = 0;
	{
		if (!!(((*t).N == NIM_NIL))) goto LA3;
		{
			if (!((IL64(70866960384) &(IL64(1)<<(((*t).Kind)&IL64(63))))!=0)) goto LA7;
			result = getsystype_281030((*t).Kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, len_225364)(tnode224816* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, propagatefieldflags_319139)(ttype224852* t, tnode224816* n) {
	{
		NimStringDesc* LOC5;
		if (!!(!(((*n).Kind == ((NU8) 139))))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_197126(TMP2678);
		internalerror_197006(LOC5);
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 3):
	{
		propagatetoowner_229318(t, (*(*n).kindU.S4.Sym).Typ);
	}
	break;
	case ((NU8) 137):
	case ((NU8) 138):
	case ((NU8) 85):
	case ((NU8) 88):
	{
		{
			tnode224816* son_319182;
			son_319182 = 0;
			{
				NI i_319187;
				NI HEX3Atmp_319189;
				NI LOC10;
				NI res_319191;
				i_319187 = 0;
				HEX3Atmp_319189 = 0;
				LOC10 = 0;
				LOC10 = len_225364(n);
				HEX3Atmp_319189 = (LOC10 - 1);
				res_319191 = 0;
				{
					while (1) {
						if (!(res_319191 <= HEX3Atmp_319189)) goto LA12;
						i_319187 = res_319191;
						son_319182 = (*n).kindU.S6.Sons->data[i_319187];
						propagatefieldflags_319139(t, son_319182);
						res_319191 += 1;
					} LA12: ;
				}
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
}

N_NIMCALL(void, erasevoidparams_318784)(ttype224852* t) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !(((*t).Sons->data[0] == NIM_NIL));
		if (!(LOC3)) goto LA4;
		LOC3 = ((*(*t).Sons->data[0]).Kind == ((NU8) 3));
		LA4: ;
		if (!LOC3) goto LA5;
		asgnRefNoCycle((void**) (&(*t).Sons->data[0]), NIM_NIL);
	}
	LA5: ;
	{
		NI i_318834;
		NI HEX3Atmp_318970;
		NI LOC8;
		NI res_318973;
		i_318834 = 0;
		HEX3Atmp_318970 = 0;
		LOC8 = 0;
		LOC8 = sonslen_225255(t);
		HEX3Atmp_318970 = (LOC8 - 1);
		res_318973 = 1;
		{
			while (1) {
				if (!(res_318973 <= HEX3Atmp_318970)) goto LA10;
				i_318834 = res_318973;
				{
					NI pos;
					if (!((*(*t).Sons->data[i_318834]).Kind == ((NU8) 3))) goto LA13;
					pos = i_318834;
					{
						NI j_318866;
						NI HEX3Atmp_318964;
						NI HEX3Atmp_318965;
						NI LOC16;
						NI res_318968;
						j_318866 = 0;
						HEX3Atmp_318964 = 0;
						HEX3Atmp_318965 = 0;
						HEX3Atmp_318964 = (NI64)(i_318834 + 1);
						LOC16 = 0;
						LOC16 = sonslen_225255(t);
						HEX3Atmp_318965 = (LOC16 - 1);
						res_318968 = HEX3Atmp_318964;
						{
							while (1) {
								if (!(res_318968 <= HEX3Atmp_318965)) goto LA18;
								j_318866 = res_318968;
								{
									if (!!(((*(*t).Sons->data[j_318866]).Kind == ((NU8) 3)))) goto LA21;
									asgnRefNoCycle((void**) (&(*t).Sons->data[pos]), (*t).Sons->data[j_318866]);
									asgnRefNoCycle((void**) (&(*(*t).N).kindU.S6.Sons->data[pos]), (*(*t).N).kindU.S6.Sons->data[j_318866]);
									pos += 1;
								}
								LA21: ;
								res_318968 += 1;
							} LA18: ;
						}
					}
					(*t).Sons = (ttypeseq224848*) setLengthSeq(&((*t).Sons)->Sup, sizeof(ttype224852*), pos);
					(*(*t).N).kindU.S6.Sons = (tnodeseq224810*) setLengthSeq(&((*(*t).N).kindU.S6.Sons)->Sup, sizeof(tnode224816*), pos);
					goto BeforeRet;
				}
				LA13: ;
				res_318973 += 1;
			} LA10: ;
		}
	}
	BeforeRet: ;
}

N_NIMCALL(void, skipintliteralparams_318999)(ttype224852* t) {
	{
		NI i_319023;
		NI HEX3Atmp_319116;
		NI LOC2;
		NI res_319119;
		i_319023 = 0;
		HEX3Atmp_319116 = 0;
		LOC2 = 0;
		LOC2 = sonslen_225255(t);
		HEX3Atmp_319116 = (LOC2 - 1);
		res_319119 = 0;
		{
			while (1) {
				if (!(res_319119 <= HEX3Atmp_319116)) goto LA4;
				i_319023 = res_319119;
				{
					ttype224852* p;
					ttype224852* skipped;
					p = (*t).Sons->data[i_319023];
					{
						if (!(p == NIM_NIL)) goto LA8;
						goto LA5;
					}
					LA8: ;
					skipped = skipintlit_281533(p);
					{
						if (!!((skipped == p))) goto LA12;
						asgnRefNoCycle((void**) (&(*t).Sons->data[i_319023]), skipped);
						{
							if (!(0 < i_319023)) goto LA16;
							asgnRefNoCycle((void**) (&(*(*(*(*t).N).kindU.S6.Sons->data[i_319023]).kindU.S4.Sym).Typ), skipped);
						}
						LA16: ;
					}
					LA12: ;
				} LA5: ;
				res_319119 += 1;
			} LA4: ;
		}
	}
	{
		NIM_BOOL LOC20;
		LOC20 = 0;
		LOC20 = !(((*t).Sons->data[0] == NIM_NIL));
		if (!(LOC20)) goto LA21;
		LOC20 = ((*(*t).Sons->data[0]).Kind == ((NU8) 59));
		LA21: ;
		if (!LOC20) goto LA22;
		asgnRefNoCycle((void**) (&(*t).Sons->data[0]), base_262038((*t).Sons->data[0]));
	}
	LA22: ;
}

N_NIMCALL(ttype224852*, replacetypevarstaux_316796)(trepltypevars316786* cl, ttype224852* t) {
	ttype224852* result;
	result = 0;
	result = t;
	{
		if (!(t == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		ttype224852* lookup;
		tidobj199015* LOC9;
		TNimObject* LOC10;
		if (!((IL64(1151232654746587136) &(IL64(1)<<(((*t).Kind)&IL64(63))))!=0)) goto LA7;
		LOC9 = 0;
		LOC9 = &t->Sup;
		LOC10 = 0;
		LOC10 = idtableget_234182((*cl).Typemap, LOC9);
		lookup = ((ttype224852*) (LOC10));
		{
			if (!!((lookup == NIM_NIL))) goto LA13;
			result = lookup;
			goto BeforeRet;
		}
		LA13: ;
	}
	LA7: ;
	switch ((*t).Kind) {
	case ((NU8) 9):
	{
		result = handlegenericinvokation_318285(cl, t);
	}
	break;
	case ((NU8) 10):
	{
		NimStringDesc* LOC17;
		LOC17 = 0;
		LOC17 = typetostring_262031(t, ((NU8) 0));
		localerror_196955((*cl).Info, ((NU16) 124), LOC17);
		result = errortype_290318((*cl).C);
	}
	break;
	case ((NU8) 60):
	{
		tnode224816* n;
		{
			if (!(*cl).Allowmetatypes) goto LA21;
			goto BeforeRet;
		}
		LA21: ;
		n = preparenode_317007(cl, (*t).N);
		n = (*(*cl).C).Semconstexpr((*cl).C, n);
		{
			if (!((*(*n).Typ).Kind == ((NU8) 8))) goto LA25;
			result = skiptypes_229245((*n).Typ, 256);
		}
		goto LA23;
		LA25: ;
		{
			{
				TY410748 LOC32;
				if (!!(((*(*n).Typ).Kind == ((NU8) 59)))) goto LA30;
				result = newtypes_289213(((NU8) 59), (*cl).C);
				if ((*result).Sons) nimGCunrefNoCycle((*result).Sons);
				(*result).Sons = (ttypeseq224848*) newSeqRC1((&NTI224848), 1);
				memset((void*)LOC32, 0, sizeof(LOC32));
				LOC32[0] = (*n).Typ;
				asgnRefNoCycle((void**) (&(*result).Sons->data[0]), LOC32[0]);
				asgnRefNoCycle((void**) (&(*result).N), n);
			}
			goto LA28;
			LA30: ;
			{
				result = (*n).Typ;
			}
			LA28: ;
		}
		LA23: ;
	}
	break;
	case ((NU8) 31):
	{
		result = skipintlit_281533(t);
	}
	break;
	case ((NU8) 8):
	{
		ttype224852* lookup;
		tidobj199015* LOC36;
		TNimObject* LOC37;
		LOC36 = 0;
		LOC36 = &t->Sup;
		LOC37 = 0;
		LOC37 = idtableget_234182((*cl).Typemap, LOC36);
		lookup = ((ttype224852*) (LOC37));
		{
			if (!!((lookup == NIM_NIL))) goto LA40;
			result = lookup;
			{
				if (!(((*t).Flags &(1<<((((NU8) 9))&31)))!=0)) goto LA44;
				result = base_262038(result);
			}
			LA44: ;
		}
		goto LA38;
		LA40: ;
		{
			ttype224852* LOC49;
			if (!!(((*(*t).Sons->data[0]).Kind == ((NU8) 0)))) goto LA47;
			LOC49 = 0;
			LOC49 = replacetypevarst_316834(cl, (*t).Sons->data[0]);
			result = maketypedesc_289762((*cl).C, LOC49);
		}
		goto LA38;
		LA47: ;
		LA38: ;
	}
	break;
	case ((NU8) 52):
	{
		result = t;
	}
	break;
	case ((NU8) 11):
	{
		ttype224852* LOC56;
		result = instcopytype_318238(cl, t);
		{
			NI i_319381;
			NI HEX3Atmp_319439;
			NI LOC53;
			NI res_319442;
			i_319381 = 0;
			HEX3Atmp_319439 = 0;
			LOC53 = 0;
			LOC53 = sonslen_225255(result);
			HEX3Atmp_319439 = (LOC53 - 1);
			res_319442 = 1;
			{
				while (1) {
					if (!(res_319442 <= HEX3Atmp_319439)) goto LA55;
					i_319381 = res_319442;
					asgnRefNoCycle((void**) (&(*result).Sons->data[i_319381]), replacetypevarst_316834(cl, (*result).Sons->data[i_319381]));
					res_319442 += 1;
				} LA55: ;
			}
		}
		LOC56 = 0;
		LOC56 = lastson_225267(result);
		propagatetoowner_229318(result, LOC56);
	}
	break;
	default:
	{
		{
			NIM_BOOL LOC60;
			LOC60 = 0;
			LOC60 = containsgenerictype_271929(t);
			if (!LOC60) goto LA61;
			result = instcopytype_318238(cl, t);
			(*result).Size = IL64(-1);
			{
				NI i_319394;
				NI HEX3Atmp_319445;
				NI LOC64;
				NI res_319448;
				i_319394 = 0;
				HEX3Atmp_319445 = 0;
				LOC64 = 0;
				LOC64 = sonslen_225255(result);
				HEX3Atmp_319445 = (NI64)(LOC64 - 1);
				res_319448 = 0;
				{
					while (1) {
						if (!(res_319448 <= HEX3Atmp_319445)) goto LA66;
						i_319394 = res_319448;
						{
							if (!!(((*result).Sons->data[i_319394] == NIM_NIL))) goto LA69;
							asgnRefNoCycle((void**) (&(*result).Sons->data[i_319394]), replacetypevarst_316834(cl, (*result).Sons->data[i_319394]));
							propagatetoowner_229318(result, (*result).Sons->data[i_319394]);
						}
						LA69: ;
						res_319448 += 1;
					} LA66: ;
				}
			}
			asgnRefNoCycle((void**) (&(*result).N), replacetypevarsn_316812(cl, (*result).N));
			switch ((*result).Kind) {
			case ((NU8) 16):
			{
				ttype224852* idx;
				idx = (*result).Sons->data[0];
				{
					NimStringDesc* LOC76;
					if (!!(!(((*idx).Kind == ((NU8) 59))))) goto LA74;
					LOC76 = 0;
					LOC76 = HEX24_197126(TMP2677);
					internalerror_197006(LOC76);
				}
				LA74: ;
			}
			break;
			case ((NU8) 17):
			case ((NU8) 18):
			{
				propagatefieldflags_319139(result, (*result).N);
			}
			break;
			case ((NU8) 25):
			{
				erasevoidparams_318784(result);
				skipintliteralparams_318999(result);
			}
			break;
			default:
			{
			}
			break;
			}
		}
		LA61: ;
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(ttype224852*, replacetypevarst_316834)(trepltypevars316786* cl, ttype224852* t) {
	ttype224852* result;
	result = 0;
	result = replacetypevarstaux_316796(cl, t);
	return result;
}

N_NIMCALL(ttype224852*, generatetypeinstance_319503)(tcontext289021* p, tidtable224864 pt, tlineinfo194539 info, ttype224852* t) {
	ttype224852* result;
	trepltypevars316786 cl;
	result = 0;
	memset((void*)(&cl), 0, sizeof(cl));
	chckNil((void*)(&cl));
	memset((void*)(&cl), 0, sizeof(cl));
	inittypevars_319474(p, pt, info, (&cl));
	pushinfocontext_195930(info);
	result = replacetypevarst_316834((&cl), t);
	popinfocontext_195957();
	return result;
}

N_NIMCALL(tnode224816*, replacetypesinbody_319489)(tcontext289021* p, tidtable224864 pt, tnode224816* n) {
	tnode224816* result;
	trepltypevars316786 cl;
	result = 0;
	memset((void*)(&cl), 0, sizeof(cl));
	chckNil((void*)(&cl));
	memset((void*)(&cl), 0, sizeof(cl));
	inittypevars_319474(p, pt, (*n).Info, (&cl));
	pushinfocontext_195930((*n).Info);
	result = replacetypevarsn_316812((&cl), n);
	popinfocontext_195957();
	return result;
}

N_NIMCALL(NIM_BOOL, hasgenericarguments_317243)(tnode224816* n) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC5;
		NIM_BOOL LOC7;
		if (!((*n).Kind == ((NU8) 3))) goto LA3;
		LOC5 = 0;
		LOC5 = ((*(*n).kindU.S4.Sym).Kind == ((NU8) 4));
		if (LOC5) goto LA6;
		LOC7 = 0;
		LOC7 = ((*(*n).kindU.S4.Sym).Kind == ((NU8) 7));
		if (!(LOC7)) goto LA8;
		LOC7 = !((((*(*(*n).kindU.S4.Sym).Typ).Flags & 25165824) == 0));
		LA8: ;
		LOC5 = LOC7;
		LA6: ;
		result = LOC5;
		goto BeforeRet;
	}
	goto LA1;
	LA3: ;
	{
		{
			NI i_317374;
			NI HEX3Atmp_317390;
			NI LOC11;
			NI res_317393;
			i_317374 = 0;
			HEX3Atmp_317390 = 0;
			LOC11 = 0;
			LOC11 = safelen_225424(n);
			HEX3Atmp_317390 = (LOC11 - 1);
			res_317393 = 0;
			{
				while (1) {
					if (!(res_317393 <= HEX3Atmp_317390)) goto LA13;
					i_317374 = res_317393;
					{
						NIM_BOOL LOC16;
						LOC16 = 0;
						LOC16 = hasgenericarguments_317243((*n).kindU.S6.Sons->data[i_317374]);
						if (!LOC16) goto LA17;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA17: ;
					res_317393 += 1;
				} LA13: ;
			}
		}
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, checkconstructedtype_316152)(tlineinfo194539 info, ttype224852* typ) {
	ttype224852* t;
	t = skiptypes_229245(typ, 8192);
	{
		if (!((IL64(574208952489738240) &(IL64(1)<<(((*t).Kind)&IL64(63))))!=0)) goto LA3;
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		ttype224852* LOC8;
		LOC6 = 0;
		LOC6 = (((*t).Flags &(1<<((((NU8) 4))&31)))!=0);
		if (!(LOC6)) goto LA7;
		LOC8 = 0;
		LOC8 = skiptypes_229245(t, IL64(211106232576256));
		LOC6 = !(((*LOC8).Kind == ((NU8) 17)));
		LA7: ;
		if (!LOC6) goto LA9;
		localerror_196955(info, ((NU16) 162), ((NimStringDesc*) &TMP2671));
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = ((*t).Kind == ((NU8) 23));
		if (!(LOC12)) goto LA13;
		LOC12 = ((*(*t).Sons->data[0]).Kind == ((NU8) 23));
		LA13: ;
		if (!LOC12) goto LA14;
		localerror_196955(info, ((NU16) 197), ((NimStringDesc*) &TMP2672));
	}
	goto LA1;
	LA14: ;
	{
		NI64 LOC17;
		NimStringDesc* LOC20;
		LOC17 = 0;
		LOC17 = computesize_262193(t);
		if (!(LOC17 == IL64(-2))) goto LA18;
		LOC20 = 0;
		LOC20 = typetostring_262031(t, ((NU8) 0));
		localerror_196955(info, ((NU16) 123), LOC20);
	}
	goto LA1;
	LA18: ;
	{
		sharedptrcheck_316014(info, t);
	}
	LA1: ;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_semtypinstInit)(void) {
}

NIM_EXTERNC N_NOINLINE(void, HEX00_semtypinstDatInit)(void) {
}

