/* 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 ttype225852 ttype225852;
typedef struct tcontext290021 tcontext290021;
typedef struct tidtable225864 tidtable225864;
typedef struct tidpairseq225862 tidpairseq225862;
typedef struct tidpair225860 tidpair225860;
typedef struct tidobj200015 tidobj200015;
typedef struct TNimObject TNimObject;
typedef struct TGenericSeq TGenericSeq;
typedef struct tlineinfo195539 tlineinfo195539;
typedef struct trepltypevars317786 trepltypevars317786;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq225848 ttypeseq225848;
typedef struct tnode225816 tnode225816;
typedef struct tsym225846 tsym225846;
typedef struct tloc225830 tloc225830;
typedef struct trope177009 trope177009;
typedef struct NimStringDesc NimStringDesc;
typedef struct TY84745 TY84745;
typedef struct tscope225840 tscope225840;
typedef struct TY225947 TY225947;
typedef struct tinstantiation225836 tinstantiation225836;
typedef struct tstrtable225820 tstrtable225820;
typedef struct tsymseq225818 tsymseq225818;
typedef struct tident200021 tident200021;
typedef struct tlib225834 tlib225834;
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 tpasscontext286005 tpasscontext286005;
typedef struct tproccon290011 tproccon290011;
typedef struct intset222056 intset222056;
typedef struct ttrunk222052 ttrunk222052;
typedef struct ttrunkseq222054 ttrunkseq222054;
typedef struct tlinkedlist127028 tlinkedlist127028;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tctx289048 tctx289048;
typedef struct TY290133 TY290133;
typedef struct tinstantiationpair290013 tinstantiationpair290013;
typedef struct tnodeseq225810 tnodeseq225810;
typedef struct TY225936 TY225936;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef struct TY289250 TY289250;
typedef struct TY196414 TY196414;
typedef struct pprocHEX3Aobjecttype289230 pprocHEX3Aobjecttype289230;
typedef struct TY289269 TY289269;
typedef struct TY289270 TY289270;
typedef struct vmargs289042 vmargs289042;
typedef struct TY289231 TY289231;
typedef struct tblock289030 tblock289030;
typedef struct TY289211 TY289211;
typedef struct TY289237 TY289237;
struct  tidpair225860  {
tidobj200015* Key;
TNimObject* Val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tidtable225864  {
NI Counter;
tidpairseq225862* Data;
};
struct  tlineinfo195539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  trepltypevars317786  {
tcontext290021* C;
tidtable225864 Typemap;
tidtable225864 Symmap;
tidtable225864 Localcache;
tlineinfo195539 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  tidobj200015  {
  TNimObject Sup;
NI Id;
};
struct  tloc225830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype225852* T;
trope177009* R;
trope177009* Heaproot;
};
struct  ttype225852  {
  tidobj200015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq225848* Sons;
tnode225816* N;
tsym225846* Owner;
tsym225846* Sym;
tsym225846* Destructor;
tsym225846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc225830 Loc;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct TY84745 {
NimStringDesc* Field0;
NI Field1;
};
struct  tstrtable225820  {
NI Counter;
tsymseq225818* Data;
};
struct  tsym225846  {
  tidobj200015 Sup;
NU8 Kind;
union {
struct {ttypeseq225848* Typeinstcache;
tscope225840* Typscope;
} S1;
struct {TY225947* Procinstcache;
tscope225840* Scope;
} S2;
struct {TY225947* Usedgenerics;
tstrtable225820 Tab;
} S3;
struct {tsym225846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype225852* Typ;
tident200021* Name;
tlineinfo195539 Info;
tsym225846* Owner;
NU32 Flags;
tnode225816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc225830 Loc;
tlib225834* Annex;
tnode225816* 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 ttype225852* TY411748[1];
struct  tpasscontext286005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset222056  {
NI Counter;
NI Max;
ttrunk222052* Head;
ttrunkseq222054* Data;
};
struct  tlinkedlist127028  {
tlistentry127022* Head;
tlistentry127022* Tail;
NI Counter;
};
typedef N_NIMCALL_PTR(tnode225816*, TY290064) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290069) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290077) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290085) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290090) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290098) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290103) (tcontext290021* c, tnode225816* n, tnode225816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype225852*, TY290110) (tcontext290021* c, tnode225816* n, ttype225852* prev);
typedef struct {
N_NIMCALL_PTR(tnode225816*, ClPrc) (tcontext290021* c, tidtable225864 pt, tnode225816* n, void* ClEnv);
void* ClEnv;
} TY290116;
typedef struct {
N_NIMCALL_PTR(tsym225846*, ClPrc) (tcontext290021* c, tsym225846* fn, tidtable225864 pt, tlineinfo195539 info, void* ClEnv);
void* ClEnv;
} TY290122;
struct  tinstantiationpair290013  {
tsym225846* Genericsym;
tinstantiation225836* Inst;
};
typedef N_NIMCALL_PTR(tsym225846*, TY290138) (tcontext290021* c, tsym225846* dc, ttype225852* t, tlineinfo195539 info);
struct  tcontext290021  {
  tpasscontext286005 Sup;
tsym225846* Module;
tscope225840* Currentscope;
tscope225840* Importtable;
tscope225840* Toplevelscope;
tproccon290011* P;
tsymseq225818* Friendmodules;
NI Instcounter;
intset222056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq225818* Converters;
tsymseq225818* Patterns;
tlinkedlist127028 Optionstack;
tidtable225864 Symmapping;
tlinkedlist127028 Libs;
TY290064 Semconstexpr;
TY290069 Semexpr;
TY290077 Semtryexpr;
TY290085 Semtryconstexpr;
TY290090 Semoperand;
TY290098 Semconstboolexpr;
TY290103 Semoverloadedcall;
TY290110 Semtypenode;
TY290116 Seminferredlambda;
TY290122 Semgenerateinstance;
intset222056 Includedfiles;
tstrtable225820 Userpragmas;
tctx289048* Evalcontext;
intset222056 Unknownidents;
TY290133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY290138 Instdeepcopy;
};
struct  tnode225816  {
ttype225852* Typ;
tlineinfo195539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym225846* Sym;
} S4;
struct {tident200021* Ident;
} S5;
struct {tnodeseq225810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  trope177009  {
  TNimObject Sup;
trope177009* Left;
trope177009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope225840  {
NI Depthlevel;
tstrtable225820 Symbols;
tnodeseq225810* Usingsyms;
tscope225840* Parent;
};
struct  tinstantiation225836  {
tsym225846* Sym;
ttypeseq225848* Concretetypes;
TY225936* Usedby;
};
struct  tident200021  {
  tidobj200015 Sup;
NimStringDesc* S;
tident200021* Next;
NI H;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tlib225834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope177009* Name;
tnode225816* 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  tproccon290011  {
tsym225846* Owner;
tsym225846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon290011* Next;
};
struct  ttrunk222052  {
ttrunk222052* Next;
NI Key;
TY26420 Bits;
};
struct  vmargs289042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode225816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs289042* args, void* ClEnv);
void* ClEnv;
} vmcallback289044;
struct TY289270 {
NimStringDesc* Field0;
vmcallback289044 Field1;
};
struct  tctx289048  {
  tpasscontext286005 Sup;
TY289250* Code;
TY196414* Debug;
tnode225816* Globals;
tnode225816* Constants;
ttypeseq225848* Types;
tnode225816* Currentexceptiona;
tnode225816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype289230* Prc;
tsym225846* Module;
tnode225816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo195539 Comesfromheuristic;
TY289269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct  tblock289030  {
tsym225846* Label;
TY289211* Fixups;
};
struct TY289237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY289237 TY289234[256];
struct  pprocHEX3Aobjecttype289230  {
TY289231* Blocks;
tsym225846* Sym;
TY289234 Slots;
NI Maxslots;
};
struct tidpairseq225862 {
  TGenericSeq Sup;
  tidpair225860 data[SEQ_DECL_SIZE];
};
struct ttypeseq225848 {
  TGenericSeq Sup;
  ttype225852* data[SEQ_DECL_SIZE];
};
struct TY225947 {
  TGenericSeq Sup;
  tinstantiation225836* data[SEQ_DECL_SIZE];
};
struct tsymseq225818 {
  TGenericSeq Sup;
  tsym225846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq222054 {
  TGenericSeq Sup;
  ttrunk222052* data[SEQ_DECL_SIZE];
};
struct TY290133 {
  TGenericSeq Sup;
  tinstantiationpair290013 data[SEQ_DECL_SIZE];
};
struct tnodeseq225810 {
  TGenericSeq Sup;
  tnode225816* data[SEQ_DECL_SIZE];
};
struct TY225936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY289250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY196414 {
  TGenericSeq Sup;
  tlineinfo195539 data[SEQ_DECL_SIZE];
};
struct TY289269 {
  TGenericSeq Sup;
  TY289270 data[SEQ_DECL_SIZE];
};
struct TY289211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY289231 {
  TGenericSeq Sup;
  tblock289030 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittypevars_320474)(tcontext290021* p, tidtable225864 pt, tlineinfo195539 info, trepltypevars317786* Result);
N_NIMCALL(void, initidtable_226167)(tidtable225864* x);
N_NIMCALL(void, copyidtable_226241)(tidtable225864* dest, tidtable225864 src);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, pushinfocontext_196930)(tlineinfo195539 info);
N_NIMCALL(ttype225852*, replacetypevarst_317834)(trepltypevars317786* cl, ttype225852* t);
N_NIMCALL(ttype225852*, replacetypevarstaux_317796)(trepltypevars317786* cl, ttype225852* t);
N_NIMCALL(TNimObject*, idtableget_235182)(tidtable225864 t, tidobj200015* key);
N_NIMCALL(ttype225852*, handlegenericinvokation_319285)(trepltypevars317786* cl, ttype225852* t);
N_NIMCALL(void, internalerror_197987)(tlineinfo195539 info, NimStringDesc* errmsg);
N_NIMCALL(ttype225852*, searchinsttypes_317407)(ttype225852* key);
N_NIMCALL(void, internalerror_198006)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_198126)(TY84745 x_198130);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_273497)(ttypeseq225848* x_273503, ttypeseq225848* y_273508);
N_NIMCALL(NIM_BOOL, comparetypes_270571)(ttype225852* x, ttype225852* y, NU8 cmp, NU8 flags);
static N_INLINE(NI, sonslen_226255)(ttype225852* n);
N_NIMCALL(ttype225852*, lookuptypevar_319186)(trepltypevars317786* cl, ttype225852* t);
N_NIMCALL(void, localerror_197955)(tlineinfo195539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, typetostring_263031)(ttype225852* typ, NU8 prefer);
N_NIMCALL(ttype225852*, errortype_291318)(tcontext290021* c);
N_NIMCALL(void, idtableput_235196)(tidtable225864* t, tidobj200015* key, TNimObject* val);
N_NIMCALL(ttype225852*, instcopytype_319238)(trepltypevars317786* cl, ttype225852* t);
N_NIMCALL(ttype225852*, copytype_226195)(ttype225852* t, tsym225846* 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_230318)(ttype225852* owner, ttype225852* elem);
N_NIMCALL(ttype225852*, newtype_226083)(NU8 kind, tsym225846* owner);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, cachetypeinst_317688)(ttype225852* inst);
N_NIMCALL(void, safeadd_317709)(ttypeseq225848** x_317717, ttype225852* y_317721);
N_NIMCALL(void, rawaddson_230562)(ttype225852* father, ttype225852* son);
static N_INLINE(ttype225852*, lastson_226267)(ttype225852* n);
N_NIMCALL(NIM_BOOL, isgenericalias_269591)(ttype225852* t);
N_NIMCALL(ttype225852*, skipgenericalias_269619)(ttype225852* t);
N_NIMCALL(void, checkpartialconstructedtype_317102)(tlineinfo195539 info, ttype225852* t);
N_NIMCALL(ttype225852*, skiptypes_230245)(ttype225852* t, NU64 kinds);
N_NIMCALL(void, sharedptrcheck_317014)(tlineinfo195539 info, ttype225852* t);
N_NIMCALL(NI, len_230005)(ttype225852* n);
static N_INLINE(NIM_BOOL, isgcedmem_230276)(ttype225852* t);
N_NIMCALL(tnode225816*, preparenode_318007)(trepltypevars317786* cl, tnode225816* n);
N_NIMCALL(tnode225816*, copynode_226323)(tnode225816* src);
N_NIMCALL(tsym225846*, replacetypevarss_317804)(trepltypevars317786* cl, tsym225846* s);
N_NIMCALL(tsym225846*, copysym_226203)(tsym225846* s, NIM_BOOL keepid);
N_NIMCALL(tnode225816*, replacetypevarsn_317812)(trepltypevars317786* cl, tnode225816* n_317816);
N_NIMCALL(tnode225816*, newnode_228207)(NU8 kind, tlineinfo195539 info, tnodeseq225810* sons, ttype225852* typ);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
static N_INLINE(NI, sonslen_226249)(tnode225816* n);
N_NIMCALL(void, illformedast_291405)(tnode225816* n);
N_NIMCALL(void, checksonslen_291415)(tnode225816* n, NI length);
N_NIMCALL(tnode225816*, newnodei_226138)(NU8 kind, tlineinfo195539 info);
N_NIMCALL(tnode225816*, reresolvecallswithtypedescparams_318410)(trepltypevars317786* cl, tnode225816* n);
static N_INLINE(tnode225816*, HEX5BHEX5D_226698)(tnode225816* n, NI i);
static N_INLINE(NI, safelen_226424)(tnode225816* n);
N_NIMCALL(NIM_BOOL, istypeparam_318151)(tnode225816* n);
N_NIMCALL(tnode225816*, newsymnode_226132)(tsym225846* sym);
N_NIMCALL(void, newsons_226273)(tnode225816* father, NI length);
N_NIMCALL(void, add_226498)(tnode225816* father, tnode225816* son);
N_NIMCALL(ttype225852*, newtypes_290213)(NU8 kind, tcontext290021* c);
static N_INLINE(ttype225852*, skipintlit_282533)(ttype225852* t);
N_NIMCALL(ttype225852*, getsystype_282030)(NU8 kind);
N_NIMCALL(ttype225852*, base_263038)(ttype225852* t);
N_NIMCALL(ttype225852*, maketypedesc_290762)(tcontext290021* c, ttype225852* typ);
N_NIMCALL(NIM_BOOL, containsgenerictype_272929)(ttype225852* t);
N_NIMCALL(void, propagatefieldflags_320139)(ttype225852* t, tnode225816* n);
static N_INLINE(NI, len_226364)(tnode225816* n);
N_NIMCALL(void, erasevoidparams_319784)(ttype225852* t);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, skipintliteralparams_319999)(ttype225852* t);
N_NIMCALL(void, popinfocontext_196957)(void);
N_NIMCALL(NIM_BOOL, hasgenericarguments_318243)(tnode225816* n);
N_NIMCALL(NI64, computesize_263193)(ttype225852* typ);
STRING_LITERAL(TMP2668, "no generic body", 15);
STRING_LITERAL(TMP2670, "compiler/semtypinst.nim", 23);
NIM_CONST TY84745 TMP2669 = {((NimStringDesc*) &TMP2670),
52}
;
STRING_LITERAL(TMP2671, "substitution with generic parameter", 35);
STRING_LITERAL(TMP2672, "acyclic", 7);
STRING_LITERAL(TMP2673, "", 0);
STRING_LITERAL(TMP2674, "shared memory may not refer to GC\'ed thread local memory", 56);
STRING_LITERAL(TMP2675, "ReplaceTypeVarsN: when condition not a bool", 43);
NIM_CONST TY84745 TMP2678 = {((NimStringDesc*) &TMP2670),
429}
;
NIM_CONST TY84745 TMP2679 = {((NimStringDesc*) &TMP2670),
345}
;
extern tgcheap47016 gch_47044;
extern TNimType NTI225848; /* TTypeSeq */
extern TNimType NTI225810; /* TNodeSeq */

N_NIMCALL(void, inittypevars_320474)(tcontext290021* p, tidtable225864 pt, tlineinfo195539 info, trepltypevars317786* Result) {
	initidtable_226167((&(*Result).Symmap));
	copyidtable_226241((&(*Result).Typemap), pt);
	initidtable_226167((&(*Result).Localcache));
	(*Result).Info = info;
	unsureAsgnRef((void**) (&(*Result).C), p);
}

N_NIMCALL(ttype225852*, searchinsttypes_317407)(ttype225852* key) {
	ttype225852* result;
	ttype225852* 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_198126(TMP2669);
		internalerror_198006(LOC9);
	}
	LA7: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = HEX3DHEX3D_273497((*(*generictyp).Sym).kindU.S1.Typeinstcache, NIM_NIL);
		if (!LOC12) goto LA13;
		goto BeforeRet;
	}
	LA13: ;
	{
		ttype225852* inst_317611;
		ttypeseq225848* HEX3Atmp_317655;
		NI i_317658;
		NI l_317660;
		inst_317611 = 0;
		HEX3Atmp_317655 = 0;
		HEX3Atmp_317655 = (*(*generictyp).Sym).kindU.S1.Typeinstcache;
		i_317658 = 0;
		l_317660 = HEX3Atmp_317655->Sup.len;
		{
			while (1) {
				if (!(i_317658 < l_317660)) goto LA17;
				inst_317611 = HEX3Atmp_317655->data[i_317658];
				{
					if (!((*inst_317611).Sup.Id == (*key).Sup.Id)) goto LA20;
					result = inst_317611;
					goto BeforeRet;
				}
				LA20: ;
				{
					if (!((*inst_317611).Sons->Sup.len < (*key).Sons->Sup.len)) goto LA24;
					goto BeforeRet;
				}
				LA24: ;
				{
					{
						NI j_317646;
						NI HEX3Atmp_317650;
						NI res_317653;
						j_317646 = 0;
						HEX3Atmp_317650 = 0;
						HEX3Atmp_317650 = ((*key).Sons->Sup.len-1);
						res_317653 = 1;
						{
							while (1) {
								if (!(res_317653 <= HEX3Atmp_317650)) goto LA29;
								j_317646 = res_317653;
								{
									NIM_BOOL LOC32;
									LOC32 = 0;
									LOC32 = comparetypes_270571((*inst_317611).Sons->data[j_317646], (*key).Sons->data[j_317646], ((NU8) 0), 8);
									if (!!(LOC32)) goto LA33;
									goto LA26;
								}
								LA33: ;
								res_317653 += 1;
							} LA29: ;
						}
					}
					result = inst_317611;
					goto BeforeRet;
				} LA26: ;
				i_317658 += 1;
			} LA17: ;
		}
	}
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_226255)(ttype225852* 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(ttype225852*, lookuptypevar_319186)(trepltypevars317786* cl, ttype225852* t) {
	ttype225852* result;
	tidobj200015* LOC1;
	TNimObject* LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = &t->Sup;
	LOC2 = 0;
	LOC2 = idtableget_235182((*cl).Typemap, LOC1);
	result = ((ttype225852*) (LOC2));
	{
		NimStringDesc* LOC13;
		tidobj200015* 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_263031(t, ((NU8) 0));
		localerror_197955((*(*t).Sym).Info, ((NU16) 124), LOC13);
		result = errortype_291318((*cl).C);
		LOC14 = 0;
		LOC14 = &t->Sup;
		LOC15 = 0;
		LOC15 = &result->Sup.Sup;
		idtableput_235196((&(*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_197987((*cl).Info, ((NimStringDesc*) &TMP2671));
	}
	goto LA3;
	LA19: ;
	LA3: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(ttype225852*, instcopytype_319238)(trepltypevars317786* cl, ttype225852* t) {
	ttype225852* result;
	result = 0;
	result = copytype_226195(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_317688)(ttype225852* inst) {
	ttype225852* generictyp;
	generictyp = (*inst).Sons->data[0];
	safeadd_317709((&(*(*generictyp).Sym).kindU.S1.Typeinstcache), inst);
}

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

static N_INLINE(NIM_BOOL, isgcedmem_230276)(ttype225852* 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_317014)(tlineinfo195539 info, ttype225852* t) {
	{
		NIM_BOOL LOC3;
		NI LOC5;
		LOC3 = 0;
		LOC3 = ((*t).Kind == ((NU8) 21));
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = len_230005(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_230276(t);
				LA19: ;
				if (!LOC18) goto LA20;
				localerror_197955(info, ((NU16) 4), ((NimStringDesc*) &TMP2674));
			}
			LA20: ;
		}
		LA10: ;
	}
	LA6: ;
}

N_NIMCALL(void, checkpartialconstructedtype_317102)(tlineinfo195539 info, ttype225852* t) {
	{
		NIM_BOOL LOC3;
		ttype225852* LOC5;
		LOC3 = 0;
		LOC3 = (((*t).Flags &(1<<((((NU8) 4))&31)))!=0);
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = skiptypes_230245(t, IL64(211106232576256));
		LOC3 = !(((*LOC5).Kind == ((NU8) 17)));
		LA4: ;
		if (!LOC3) goto LA6;
		localerror_197955(info, ((NU16) 162), ((NimStringDesc*) &TMP2672));
	}
	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_197955(info, ((NU16) 197), ((NimStringDesc*) &TMP2673));
	}
	goto LA1;
	LA11: ;
	{
		sharedptrcheck_317014(info, t);
	}
	LA1: ;
}

N_NIMCALL(ttype225852*, handlegenericinvokation_319285)(trepltypevars317786* cl, ttype225852* t) {
	ttype225852* result;
	ttype225852* body;
	ttype225852* header;
	TY411748 LOC42;
	ttype225852* newbody;
	ttype225852* LOC60;
	tsym225846* dc;
	result = 0;
	body = (*t).Sons->data[0];
	{
		if (!!(((*body).Kind == ((NU8) 10)))) goto LA3;
		internalerror_197987((*cl).Info, ((NimStringDesc*) &TMP2668));
	}
	LA3: ;
	header = t;
	{
		tidobj200015* LOC9;
		TNimObject* LOC10;
		if (!(*cl).Allowmetatypes) goto LA7;
		LOC9 = 0;
		LOC9 = &t->Sup;
		LOC10 = 0;
		LOC10 = idtableget_235182((*cl).Localcache, LOC9);
		result = ((ttype225852*) (LOC10));
	}
	goto LA5;
	LA7: ;
	{
		result = searchinsttypes_317407(t);
	}
	LA5: ;
	{
		if (!!((result == NIM_NIL))) goto LA14;
		goto BeforeRet;
	}
	LA14: ;
	{
		NI i_319331;
		NI HEX3Atmp_319734;
		NI LOC17;
		NI res_319737;
		i_319331 = 0;
		HEX3Atmp_319734 = 0;
		LOC17 = 0;
		LOC17 = sonslen_226255(t);
		HEX3Atmp_319734 = (NI64)(LOC17 - 1);
		res_319737 = 1;
		{
			while (1) {
				ttype225852* x;
				if (!(res_319737 <= HEX3Atmp_319734)) goto LA19;
				i_319331 = res_319737;
				x = (*t).Sons->data[i_319331];
				{
					if (!((*x).Kind == ((NU8) 12))) goto LA22;
					x = lookuptypevar_319186(cl, x);
					{
						if (!!((x == NIM_NIL))) goto LA26;
						{
							if (!(header == t)) goto LA30;
							header = instcopytype_319238(cl, t);
						}
						LA30: ;
						asgnRefNoCycle((void**) (&(*header).Sons->data[i_319331]), x);
						propagatetoowner_230318(header, x);
					}
					LA26: ;
				}
				goto LA20;
				LA22: ;
				{
					propagatetoowner_230318(header, x);
				}
				LA20: ;
				res_319737 += 1;
			} LA19: ;
		}
	}
	{
		if (!!((header == t))) goto LA35;
		result = searchinsttypes_317407(header);
		{
			if (!!((result == NIM_NIL))) goto LA39;
			goto BeforeRet;
		}
		LA39: ;
	}
	goto LA33;
	LA35: ;
	{
		header = instcopytype_319238(cl, t);
	}
	LA33: ;
	result = newtype_226083(((NU8) 11), (*(*t).Sons->data[0]).Owner);
	(*result).Flags = (*header).Flags;
	if ((*result).Sons) nimGCunrefNoCycle((*result).Sons);
	(*result).Sons = (ttypeseq225848*) newSeqRC1((&NTI225848), 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_317688(result);
	}
	goto LA43;
	LA45: ;
	{
		tidobj200015* LOC48;
		TNimObject* LOC49;
		LOC48 = 0;
		LOC48 = &t->Sup;
		LOC49 = 0;
		LOC49 = &result->Sup.Sup;
		idtableput_235196((&(*cl).Localcache), LOC48, LOC49);
	}
	LA43: ;
	{
		NI i_319439;
		NI HEX3Atmp_319740;
		NI LOC51;
		NI res_319743;
		i_319439 = 0;
		HEX3Atmp_319740 = 0;
		LOC51 = 0;
		LOC51 = sonslen_226255(t);
		HEX3Atmp_319740 = (NI64)(LOC51 - 1);
		res_319743 = 1;
		{
			while (1) {
				ttype225852* x;
				tidobj200015* LOC54;
				TNimObject* LOC55;
				if (!(res_319743 <= HEX3Atmp_319740)) goto LA53;
				i_319439 = res_319743;
				x = replacetypevarst_317834(cl, (*t).Sons->data[i_319439]);
				asgnRefNoCycle((void**) (&(*header).Sons->data[i_319439]), x);
				propagatetoowner_230318(header, x);
				LOC54 = 0;
				LOC54 = &(*body).Sons->data[(NI64)(i_319439 - 1)]->Sup;
				LOC55 = 0;
				LOC55 = &x->Sup.Sup;
				idtableput_235196((&(*cl).Typemap), LOC54, LOC55);
				res_319743 += 1;
			} LA53: ;
		}
	}
	{
		NI i_319614;
		NI HEX3Atmp_319746;
		NI LOC57;
		NI res_319749;
		i_319614 = 0;
		HEX3Atmp_319746 = 0;
		LOC57 = 0;
		LOC57 = sonslen_226255(t);
		HEX3Atmp_319746 = (NI64)(LOC57 - 1);
		res_319749 = 1;
		{
			while (1) {
				if (!(res_319749 <= HEX3Atmp_319746)) goto LA59;
				i_319614 = res_319749;
				rawaddson_230562(result, (*header).Sons->data[i_319614]);
				res_319749 += 1;
			} LA59: ;
		}
	}
	LOC60 = 0;
	LOC60 = lastson_226267(body);
	newbody = replacetypevarst_317834(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_269591(newbody);
		if (!LOC63) goto LA64;
		newbody = skipgenericalias_269619(newbody);
	}
	LA64: ;
	rawaddson_230562(result, newbody);
	checkpartialconstructedtype_317102((*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_226249)(tnode225816* 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(tnode225816*, HEX5BHEX5D_226698)(tnode225816* n, NI i) {
	tnode225816* result;
	result = 0;
	result = (*n).kindU.S6.Sons->data[i];
	return result;
}

static N_INLINE(NI, safelen_226424)(tnode225816* 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_318151)(tnode225816* 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(tnode225816*, reresolvecallswithtypedescparams_318410)(trepltypevars317786* cl, tnode225816* n) {
	tnode225816* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		tnode225816* 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_226698(n, 0);
		LOC3 = (((*(*LOC5).kindU.S4.Sym).Flags &(1<<((((NU8) 2))&31)))!=0);
		LA4: ;
		if (!LOC3) goto LA6;
		needsfixing = NIM_FALSE;
		{
			NI i_318478;
			NI HEX3Atmp_318559;
			NI LOC9;
			NI res_318562;
			i_318478 = 0;
			HEX3Atmp_318559 = 0;
			LOC9 = 0;
			LOC9 = safelen_226424(n);
			HEX3Atmp_318559 = (LOC9 - 1);
			res_318562 = 1;
			{
				while (1) {
					if (!(res_318562 <= HEX3Atmp_318559)) goto LA11;
					i_318478 = res_318562;
					{
						tnode225816* LOC14;
						NIM_BOOL LOC15;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_226698(n, i_318478);
						LOC15 = 0;
						LOC15 = istypeparam_318151(LOC14);
						if (!LOC15) goto LA16;
						needsfixing = NIM_TRUE;
					}
					LA16: ;
					res_318562 += 1;
				} LA11: ;
			}
		}
		{
			if (!needsfixing) goto LA20;
			asgnRefNoCycle((void**) (&(*n).kindU.S6.Sons->data[0]), newsymnode_226132((*(*(*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_318543;
		NI HEX3Atmp_318565;
		NI LOC23;
		NI res_318568;
		i_318543 = 0;
		HEX3Atmp_318565 = 0;
		LOC23 = 0;
		LOC23 = safelen_226424(n);
		HEX3Atmp_318565 = (LOC23 - 1);
		res_318568 = 0;
		{
			while (1) {
				tnode225816* LOC26;
				if (!(res_318568 <= HEX3Atmp_318565)) goto LA25;
				i_318543 = res_318568;
				LOC26 = 0;
				LOC26 = HEX5BHEX5D_226698(n, i_318543);
				asgnRefNoCycle((void**) (&(*n).kindU.S6.Sons->data[i_318543]), reresolvecallswithtypedescparams_318410(cl, LOC26));
				res_318568 += 1;
			} LA25: ;
		}
	}
	result = n;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode225816*, replacetypevarsn_317812)(trepltypevars317786* cl, tnode225816* n_317816) {
	tnode225816* result;
	result = 0;
	{
		if (!(n_317816 == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	result = copynode_226323(n_317816);
	{
		if (!!(((*n_317816).Typ == NIM_NIL))) goto LA7;
		asgnRefNoCycle((void**) (&(*result).Typ), replacetypevarst_317834(cl, (*n_317816).Typ));
	}
	LA7: ;
	switch ((*n_317816).Kind) {
	case ((NU8) 0) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	{
	}
	break;
	case ((NU8) 3):
	{
		asgnRefNoCycle((void**) (&(*result).kindU.S4.Sym), replacetypevarss_317804(cl, (*n_317816).kindU.S4.Sym));
		{
			tnodeseq225810* LOC15;
			if (!((*(*(*result).kindU.S4.Sym).Typ).Kind == ((NU8) 3))) goto LA13;
			LOC15 = 0;
			LOC15 = (tnodeseq225810*) newSeq((&NTI225810), 0);
			result = newnode_228207(((NU8) 137), (*n_317816).Info, LOC15, NIM_NIL);
		}
		LA13: ;
	}
	break;
	case ((NU8) 139):
	{
		tnode225816* branch;
		branch = NIM_NIL;
		{
			NI i_318891;
			NI HEX3Atmp_319088;
			NI LOC18;
			NI res_319091;
			i_318891 = 0;
			HEX3Atmp_319088 = 0;
			LOC18 = 0;
			LOC18 = sonslen_226249(n_317816);
			HEX3Atmp_319088 = (NI64)(LOC18 - 1);
			res_319091 = 0;
			{
				while (1) {
					tnode225816* it;
					if (!(res_319091 <= HEX3Atmp_319088)) goto LA20;
					i_318891 = res_319091;
					it = (*n_317816).kindU.S6.Sons->data[i_318891];
					{
						if (!(it == NIM_NIL)) goto LA23;
						illformedast_291405(n_317816);
					}
					LA23: ;
					switch ((*it).Kind) {
					case ((NU8) 86):
					{
						tnode225816* cond;
						tnode225816* e;
						checksonslen_291415(it, 2);
						cond = preparenode_318007(cl, (*it).kindU.S6.Sons->data[0]);
						e = (*(*cl).C).Semconstexpr((*cl).C, cond);
						{
							if (!!(((*e).Kind == ((NU8) 6)))) goto LA28;
							internalerror_197987((*e).Info, ((NimStringDesc*) &TMP2675));
						}
						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_291415(it, 1);
						{
							if (!(branch == NIM_NIL)) goto LA39;
							branch = (*it).kindU.S6.Sons->data[0];
						}
						LA39: ;
					}
					break;
					default:
					{
						illformedast_291405(n_317816);
					}
					break;
					}
					res_319091 += 1;
				} LA20: ;
			}
		}
		{
			if (!!((branch == NIM_NIL))) goto LA44;
			result = replacetypevarsn_317812(cl, branch);
		}
		goto LA42;
		LA44: ;
		{
			result = newnodei_226138(((NU8) 137), (*n_317816).Info);
		}
		LA42: ;
	}
	break;
	case ((NU8) 62):
	{
		tnode225816* n;
		n = preparenode_318007(cl, n_317816);
		n = reresolvecallswithtypedescparams_318410(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_226249(n_317816);
		{
			if (!(0 < length)) goto LA56;
			newsons_226273(result, length);
			{
				NI i_319057;
				NI HEX3Atmp_319094;
				NI res_319097;
				i_319057 = 0;
				HEX3Atmp_319094 = 0;
				HEX3Atmp_319094 = (NI64)(length - 1);
				res_319097 = 0;
				{
					while (1) {
						if (!(res_319097 <= HEX3Atmp_319094)) goto LA60;
						i_319057 = res_319097;
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[i_319057]), replacetypevarsn_317812(cl, (*n_317816).kindU.S6.Sons->data[i_319057]));
						res_319097 += 1;
					} LA60: ;
				}
			}
		}
		LA56: ;
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym225846*, replacetypevarss_317804)(trepltypevars317786* cl, tsym225846* s) {
	tsym225846* result;
	tidobj200015* 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_235182((*cl).Symmap, LOC5);
	result = ((tsym225846*) (LOC6));
	{
		tidobj200015* LOC11;
		TNimObject* LOC12;
		if (!(result == NIM_NIL)) goto LA9;
		result = copysym_226203(s, NIM_FALSE);
		(*result).Flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
		LOC11 = 0;
		LOC11 = &s->Sup;
		LOC12 = 0;
		LOC12 = &result->Sup.Sup;
		idtableput_235196((&(*cl).Symmap), LOC11, LOC12);
		asgnRefNoCycle((void**) (&(*result).Owner), (*s).Owner);
		asgnRefNoCycle((void**) (&(*result).Typ), replacetypevarst_317834(cl, (*s).Typ));
		asgnRefNoCycle((void**) (&(*result).Ast), replacetypevarsn_317812(cl, (*s).Ast));
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode225816*, preparenode_318007)(trepltypevars317786* cl, tnode225816* n) {
	tnode225816* result;
	ttype225852* t;
	NIM_BOOL iscall;
	result = 0;
	t = replacetypevarst_317834(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_226323(n);
	asgnRefNoCycle((void**) (&(*result).Typ), t);
	{
		if (!((*result).Kind == ((NU8) 3))) goto LA11;
		asgnRefNoCycle((void**) (&(*result).kindU.S4.Sym), replacetypevarss_317804(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_318129;
		NI HEX3Atmp_318131;
		NI LOC14;
		NI res_318134;
		i_318129 = 0;
		HEX3Atmp_318131 = 0;
		LOC14 = 0;
		LOC14 = safelen_226424(n);
		HEX3Atmp_318131 = (LOC14 - 1);
		res_318134 = 0;
		{
			while (1) {
				if (!(res_318134 <= HEX3Atmp_318131)) goto LA16;
				i_318129 = res_318134;
				{
					NIM_BOOL LOC19;
					tnode225816* LOC23;
					LOC19 = 0;
					LOC19 = iscall;
					if (!(LOC19)) goto LA20;
					LOC19 = (i_318129 == 0);
					LA20: ;
					if (!LOC19) goto LA21;
					LOC23 = 0;
					LOC23 = HEX5BHEX5D_226698(n, i_318129);
					add_226498(result, LOC23);
				}
				goto LA17;
				LA21: ;
				{
					tnode225816* LOC25;
					tnode225816* LOC26;
					LOC25 = 0;
					LOC25 = HEX5BHEX5D_226698(n, i_318129);
					LOC26 = 0;
					LOC26 = preparenode_318007(cl, LOC25);
					add_226498(result, LOC26);
				}
				LA17: ;
				res_318134 += 1;
			} LA16: ;
		}
	}
	BeforeRet: ;
	return result;
}

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

static N_INLINE(NI, len_226364)(tnode225816* 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_320139)(ttype225852* t, tnode225816* n) {
	{
		NimStringDesc* LOC5;
		if (!!(!(((*n).Kind == ((NU8) 139))))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_198126(TMP2679);
		internalerror_198006(LOC5);
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 3):
	{
		propagatetoowner_230318(t, (*(*n).kindU.S4.Sym).Typ);
	}
	break;
	case ((NU8) 137):
	case ((NU8) 138):
	case ((NU8) 85):
	case ((NU8) 88):
	{
		{
			tnode225816* son_320182;
			son_320182 = 0;
			{
				NI i_320187;
				NI HEX3Atmp_320189;
				NI LOC10;
				NI res_320191;
				i_320187 = 0;
				HEX3Atmp_320189 = 0;
				LOC10 = 0;
				LOC10 = len_226364(n);
				HEX3Atmp_320189 = (LOC10 - 1);
				res_320191 = 0;
				{
					while (1) {
						if (!(res_320191 <= HEX3Atmp_320189)) goto LA12;
						i_320187 = res_320191;
						son_320182 = (*n).kindU.S6.Sons->data[i_320187];
						propagatefieldflags_320139(t, son_320182);
						res_320191 += 1;
					} LA12: ;
				}
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
}

N_NIMCALL(void, erasevoidparams_319784)(ttype225852* 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_319834;
		NI HEX3Atmp_319970;
		NI LOC8;
		NI res_319973;
		i_319834 = 0;
		HEX3Atmp_319970 = 0;
		LOC8 = 0;
		LOC8 = sonslen_226255(t);
		HEX3Atmp_319970 = (LOC8 - 1);
		res_319973 = 1;
		{
			while (1) {
				if (!(res_319973 <= HEX3Atmp_319970)) goto LA10;
				i_319834 = res_319973;
				{
					NI pos;
					if (!((*(*t).Sons->data[i_319834]).Kind == ((NU8) 3))) goto LA13;
					pos = i_319834;
					{
						NI j_319866;
						NI HEX3Atmp_319964;
						NI HEX3Atmp_319965;
						NI LOC16;
						NI res_319968;
						j_319866 = 0;
						HEX3Atmp_319964 = 0;
						HEX3Atmp_319965 = 0;
						HEX3Atmp_319964 = (NI64)(i_319834 + 1);
						LOC16 = 0;
						LOC16 = sonslen_226255(t);
						HEX3Atmp_319965 = (LOC16 - 1);
						res_319968 = HEX3Atmp_319964;
						{
							while (1) {
								if (!(res_319968 <= HEX3Atmp_319965)) goto LA18;
								j_319866 = res_319968;
								{
									if (!!(((*(*t).Sons->data[j_319866]).Kind == ((NU8) 3)))) goto LA21;
									asgnRefNoCycle((void**) (&(*t).Sons->data[pos]), (*t).Sons->data[j_319866]);
									asgnRefNoCycle((void**) (&(*(*t).N).kindU.S6.Sons->data[pos]), (*(*t).N).kindU.S6.Sons->data[j_319866]);
									pos += 1;
								}
								LA21: ;
								res_319968 += 1;
							} LA18: ;
						}
					}
					(*t).Sons = (ttypeseq225848*) setLengthSeq(&((*t).Sons)->Sup, sizeof(ttype225852*), pos);
					(*(*t).N).kindU.S6.Sons = (tnodeseq225810*) setLengthSeq(&((*(*t).N).kindU.S6.Sons)->Sup, sizeof(tnode225816*), pos);
					goto BeforeRet;
				}
				LA13: ;
				res_319973 += 1;
			} LA10: ;
		}
	}
	BeforeRet: ;
}

N_NIMCALL(void, skipintliteralparams_319999)(ttype225852* t) {
	{
		NI i_320023;
		NI HEX3Atmp_320116;
		NI LOC2;
		NI res_320119;
		i_320023 = 0;
		HEX3Atmp_320116 = 0;
		LOC2 = 0;
		LOC2 = sonslen_226255(t);
		HEX3Atmp_320116 = (LOC2 - 1);
		res_320119 = 0;
		{
			while (1) {
				if (!(res_320119 <= HEX3Atmp_320116)) goto LA4;
				i_320023 = res_320119;
				{
					ttype225852* p;
					ttype225852* skipped;
					p = (*t).Sons->data[i_320023];
					{
						if (!(p == NIM_NIL)) goto LA8;
						goto LA5;
					}
					LA8: ;
					skipped = skipintlit_282533(p);
					{
						if (!!((skipped == p))) goto LA12;
						asgnRefNoCycle((void**) (&(*t).Sons->data[i_320023]), skipped);
						{
							if (!(0 < i_320023)) goto LA16;
							asgnRefNoCycle((void**) (&(*(*(*(*t).N).kindU.S6.Sons->data[i_320023]).kindU.S4.Sym).Typ), skipped);
						}
						LA16: ;
					}
					LA12: ;
				} LA5: ;
				res_320119 += 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_263038((*t).Sons->data[0]));
	}
	LA22: ;
}

N_NIMCALL(ttype225852*, replacetypevarstaux_317796)(trepltypevars317786* cl, ttype225852* t) {
	ttype225852* result;
	result = 0;
	result = t;
	{
		if (!(t == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		ttype225852* lookup;
		tidobj200015* LOC9;
		TNimObject* LOC10;
		if (!((IL64(1151232654746587136) &(IL64(1)<<(((*t).Kind)&IL64(63))))!=0)) goto LA7;
		LOC9 = 0;
		LOC9 = &t->Sup;
		LOC10 = 0;
		LOC10 = idtableget_235182((*cl).Typemap, LOC9);
		lookup = ((ttype225852*) (LOC10));
		{
			if (!!((lookup == NIM_NIL))) goto LA13;
			result = lookup;
			goto BeforeRet;
		}
		LA13: ;
	}
	LA7: ;
	switch ((*t).Kind) {
	case ((NU8) 9):
	{
		result = handlegenericinvokation_319285(cl, t);
	}
	break;
	case ((NU8) 10):
	{
		NimStringDesc* LOC17;
		LOC17 = 0;
		LOC17 = typetostring_263031(t, ((NU8) 0));
		localerror_197955((*cl).Info, ((NU16) 124), LOC17);
		result = errortype_291318((*cl).C);
	}
	break;
	case ((NU8) 60):
	{
		tnode225816* n;
		{
			if (!(*cl).Allowmetatypes) goto LA21;
			goto BeforeRet;
		}
		LA21: ;
		n = preparenode_318007(cl, (*t).N);
		n = (*(*cl).C).Semconstexpr((*cl).C, n);
		{
			if (!((*(*n).Typ).Kind == ((NU8) 8))) goto LA25;
			result = skiptypes_230245((*n).Typ, 256);
		}
		goto LA23;
		LA25: ;
		{
			{
				TY411748 LOC32;
				if (!!(((*(*n).Typ).Kind == ((NU8) 59)))) goto LA30;
				result = newtypes_290213(((NU8) 59), (*cl).C);
				if ((*result).Sons) nimGCunrefNoCycle((*result).Sons);
				(*result).Sons = (ttypeseq225848*) newSeqRC1((&NTI225848), 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_282533(t);
	}
	break;
	case ((NU8) 8):
	{
		ttype225852* lookup;
		tidobj200015* LOC36;
		TNimObject* LOC37;
		LOC36 = 0;
		LOC36 = &t->Sup;
		LOC37 = 0;
		LOC37 = idtableget_235182((*cl).Typemap, LOC36);
		lookup = ((ttype225852*) (LOC37));
		{
			if (!!((lookup == NIM_NIL))) goto LA40;
			result = lookup;
			{
				if (!(((*t).Flags &(1<<((((NU8) 9))&31)))!=0)) goto LA44;
				result = base_263038(result);
			}
			LA44: ;
		}
		goto LA38;
		LA40: ;
		{
			ttype225852* LOC49;
			if (!!(((*(*t).Sons->data[0]).Kind == ((NU8) 0)))) goto LA47;
			LOC49 = 0;
			LOC49 = replacetypevarst_317834(cl, (*t).Sons->data[0]);
			result = maketypedesc_290762((*cl).C, LOC49);
		}
		goto LA38;
		LA47: ;
		LA38: ;
	}
	break;
	case ((NU8) 52):
	{
		result = t;
	}
	break;
	case ((NU8) 11):
	{
		ttype225852* LOC56;
		result = instcopytype_319238(cl, t);
		{
			NI i_320381;
			NI HEX3Atmp_320439;
			NI LOC53;
			NI res_320442;
			i_320381 = 0;
			HEX3Atmp_320439 = 0;
			LOC53 = 0;
			LOC53 = sonslen_226255(result);
			HEX3Atmp_320439 = (LOC53 - 1);
			res_320442 = 1;
			{
				while (1) {
					if (!(res_320442 <= HEX3Atmp_320439)) goto LA55;
					i_320381 = res_320442;
					asgnRefNoCycle((void**) (&(*result).Sons->data[i_320381]), replacetypevarst_317834(cl, (*result).Sons->data[i_320381]));
					res_320442 += 1;
				} LA55: ;
			}
		}
		LOC56 = 0;
		LOC56 = lastson_226267(result);
		propagatetoowner_230318(result, LOC56);
	}
	break;
	default:
	{
		{
			NIM_BOOL LOC60;
			LOC60 = 0;
			LOC60 = containsgenerictype_272929(t);
			if (!LOC60) goto LA61;
			result = instcopytype_319238(cl, t);
			(*result).Size = IL64(-1);
			{
				NI i_320394;
				NI HEX3Atmp_320445;
				NI LOC64;
				NI res_320448;
				i_320394 = 0;
				HEX3Atmp_320445 = 0;
				LOC64 = 0;
				LOC64 = sonslen_226255(result);
				HEX3Atmp_320445 = (NI64)(LOC64 - 1);
				res_320448 = 0;
				{
					while (1) {
						if (!(res_320448 <= HEX3Atmp_320445)) goto LA66;
						i_320394 = res_320448;
						{
							if (!!(((*result).Sons->data[i_320394] == NIM_NIL))) goto LA69;
							asgnRefNoCycle((void**) (&(*result).Sons->data[i_320394]), replacetypevarst_317834(cl, (*result).Sons->data[i_320394]));
							propagatetoowner_230318(result, (*result).Sons->data[i_320394]);
						}
						LA69: ;
						res_320448 += 1;
					} LA66: ;
				}
			}
			asgnRefNoCycle((void**) (&(*result).N), replacetypevarsn_317812(cl, (*result).N));
			switch ((*result).Kind) {
			case ((NU8) 16):
			{
				ttype225852* idx;
				idx = (*result).Sons->data[0];
				{
					NimStringDesc* LOC76;
					if (!!(!(((*idx).Kind == ((NU8) 59))))) goto LA74;
					LOC76 = 0;
					LOC76 = HEX24_198126(TMP2678);
					internalerror_198006(LOC76);
				}
				LA74: ;
			}
			break;
			case ((NU8) 17):
			case ((NU8) 18):
			{
				propagatefieldflags_320139(result, (*result).N);
			}
			break;
			case ((NU8) 25):
			{
				erasevoidparams_319784(result);
				skipintliteralparams_319999(result);
			}
			break;
			default:
			{
			}
			break;
			}
		}
		LA61: ;
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(ttype225852*, replacetypevarst_317834)(trepltypevars317786* cl, ttype225852* t) {
	ttype225852* result;
	result = 0;
	result = replacetypevarstaux_317796(cl, t);
	return result;
}

N_NIMCALL(ttype225852*, generatetypeinstance_320503)(tcontext290021* p, tidtable225864 pt, tlineinfo195539 info, ttype225852* t) {
	ttype225852* result;
	trepltypevars317786 cl;
	result = 0;
	memset((void*)(&cl), 0, sizeof(cl));
	chckNil((void*)(&cl));
	memset((void*)(&cl), 0, sizeof(cl));
	inittypevars_320474(p, pt, info, (&cl));
	pushinfocontext_196930(info);
	result = replacetypevarst_317834((&cl), t);
	popinfocontext_196957();
	return result;
}

N_NIMCALL(tnode225816*, replacetypesinbody_320489)(tcontext290021* p, tidtable225864 pt, tnode225816* n) {
	tnode225816* result;
	trepltypevars317786 cl;
	result = 0;
	memset((void*)(&cl), 0, sizeof(cl));
	chckNil((void*)(&cl));
	memset((void*)(&cl), 0, sizeof(cl));
	inittypevars_320474(p, pt, (*n).Info, (&cl));
	pushinfocontext_196930((*n).Info);
	result = replacetypevarsn_317812((&cl), n);
	popinfocontext_196957();
	return result;
}

N_NIMCALL(NIM_BOOL, hasgenericarguments_318243)(tnode225816* 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_318374;
			NI HEX3Atmp_318390;
			NI LOC11;
			NI res_318393;
			i_318374 = 0;
			HEX3Atmp_318390 = 0;
			LOC11 = 0;
			LOC11 = safelen_226424(n);
			HEX3Atmp_318390 = (LOC11 - 1);
			res_318393 = 0;
			{
				while (1) {
					if (!(res_318393 <= HEX3Atmp_318390)) goto LA13;
					i_318374 = res_318393;
					{
						NIM_BOOL LOC16;
						LOC16 = 0;
						LOC16 = hasgenericarguments_318243((*n).kindU.S6.Sons->data[i_318374]);
						if (!LOC16) goto LA17;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA17: ;
					res_318393 += 1;
				} LA13: ;
			}
		}
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, checkconstructedtype_317152)(tlineinfo195539 info, ttype225852* typ) {
	ttype225852* t;
	t = skiptypes_230245(typ, 8192);
	{
		if (!((IL64(574208952489738240) &(IL64(1)<<(((*t).Kind)&IL64(63))))!=0)) goto LA3;
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		ttype225852* LOC8;
		LOC6 = 0;
		LOC6 = (((*t).Flags &(1<<((((NU8) 4))&31)))!=0);
		if (!(LOC6)) goto LA7;
		LOC8 = 0;
		LOC8 = skiptypes_230245(t, IL64(211106232576256));
		LOC6 = !(((*LOC8).Kind == ((NU8) 17)));
		LA7: ;
		if (!LOC6) goto LA9;
		localerror_197955(info, ((NU16) 162), ((NimStringDesc*) &TMP2672));
	}
	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_197955(info, ((NU16) 197), ((NimStringDesc*) &TMP2673));
	}
	goto LA1;
	LA14: ;
	{
		NI64 LOC17;
		NimStringDesc* LOC20;
		LOC17 = 0;
		LOC17 = computesize_263193(t);
		if (!(LOC17 == IL64(-2))) goto LA18;
		LOC20 = 0;
		LOC20 = typetostring_263031(t, ((NU8) 0));
		localerror_197955(info, ((NU16) 123), LOC20);
	}
	goto LA1;
	LA18: ;
	{
		sharedptrcheck_317014(info, t);
	}
	LA1: ;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_semtypinstInit)(void) {
}

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

