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

#include <string.h>
typedef struct ttype226852 ttype226852;
typedef struct tcontext291021 tcontext291021;
typedef struct tidtable226864 tidtable226864;
typedef struct tidpairseq226862 tidpairseq226862;
typedef struct tidpair226860 tidpair226860;
typedef struct tidobj201015 tidobj201015;
typedef struct TNimObject TNimObject;
typedef struct TGenericSeq TGenericSeq;
typedef struct tlineinfo196539 tlineinfo196539;
typedef struct trepltypevars318786 trepltypevars318786;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq226848 ttypeseq226848;
typedef struct tnode226816 tnode226816;
typedef struct tsym226846 tsym226846;
typedef struct tloc226830 tloc226830;
typedef struct trope178009 trope178009;
typedef struct NimStringDesc NimStringDesc;
typedef struct TY84745 TY84745;
typedef struct tscope226840 tscope226840;
typedef struct TY226947 TY226947;
typedef struct tinstantiation226836 tinstantiation226836;
typedef struct tstrtable226820 tstrtable226820;
typedef struct tsymseq226818 tsymseq226818;
typedef struct tident201021 tident201021;
typedef struct tlib226834 tlib226834;
typedef struct tcell44933 tcell44933;
typedef struct tcellseq44949 tcellseq44949;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44945 tcellset44945;
typedef struct tpagedesc44941 tpagedesc44941;
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 tpasscontext287005 tpasscontext287005;
typedef struct tproccon291011 tproccon291011;
typedef struct intset223056 intset223056;
typedef struct ttrunk223052 ttrunk223052;
typedef struct ttrunkseq223054 ttrunkseq223054;
typedef struct tlinkedlist127028 tlinkedlist127028;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tctx290048 tctx290048;
typedef struct TY291133 TY291133;
typedef struct tinstantiationpair291013 tinstantiationpair291013;
typedef struct tnodeseq226810 tnodeseq226810;
typedef struct TY226936 TY226936;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef struct TY290250 TY290250;
typedef struct TY197414 TY197414;
typedef struct pprocHEX3Aobjecttype290230 pprocHEX3Aobjecttype290230;
typedef struct TY290269 TY290269;
typedef struct TY290270 TY290270;
typedef struct vmargs290042 vmargs290042;
typedef struct TY290231 TY290231;
typedef struct tblock290030 tblock290030;
typedef struct TY290211 TY290211;
typedef struct TY290237 TY290237;
struct  tidpair226860  {
tidobj201015* Key;
TNimObject* Val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tidtable226864  {
NI Counter;
tidpairseq226862* Data;
};
struct  tlineinfo196539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  trepltypevars318786  {
tcontext291021* C;
tidtable226864 Typemap;
tidtable226864 Symmap;
tidtable226864 Localcache;
tlineinfo196539 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  tidobj201015  {
  TNimObject Sup;
NI Id;
};
struct  tloc226830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype226852* T;
trope178009* R;
trope178009* Heaproot;
};
struct  ttype226852  {
  tidobj201015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq226848* Sons;
tnode226816* N;
tsym226846* Owner;
tsym226846* Sym;
tsym226846* Destructor;
tsym226846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc226830 Loc;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct TY84745 {
NimStringDesc* Field0;
NI Field1;
};
struct  tstrtable226820  {
NI Counter;
tsymseq226818* Data;
};
struct  tsym226846  {
  tidobj201015 Sup;
NU8 Kind;
union {
struct {ttypeseq226848* Typeinstcache;
tscope226840* Typscope;
} S1;
struct {TY226947* Procinstcache;
tscope226840* Scope;
} S2;
struct {TY226947* Usedgenerics;
tstrtable226820 Tab;
} S3;
struct {tsym226846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype226852* Typ;
tident201021* Name;
tlineinfo196539 Info;
tsym226846* Owner;
NU32 Flags;
tnode226816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc226830 Loc;
tlib226834* Annex;
tnode226816* Constraint;
};
struct  tcell44933  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44949  {
NI Len;
NI Cap;
tcell44933** D;
};
struct  tcellset44945  {
NI Counter;
NI Max;
tpagedesc44941* Head;
tpagedesc44941** 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;
tcellseq44949 Zct;
tcellseq44949 Decstack;
tcellset44945 Cycleroots;
tcellseq44949 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef ttype226852* TY412748[1];
struct  tpasscontext287005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset223056  {
NI Counter;
NI Max;
ttrunk223052* Head;
ttrunkseq223054* Data;
};
struct  tlinkedlist127028  {
tlistentry127022* Head;
tlistentry127022* Tail;
NI Counter;
};
typedef N_NIMCALL_PTR(tnode226816*, TY291064) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291069) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291077) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291085) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291090) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291098) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291103) (tcontext291021* c, tnode226816* n, tnode226816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype226852*, TY291110) (tcontext291021* c, tnode226816* n, ttype226852* prev);
typedef struct {
N_NIMCALL_PTR(tnode226816*, ClPrc) (tcontext291021* c, tidtable226864 pt, tnode226816* n, void* ClEnv);
void* ClEnv;
} TY291116;
typedef struct {
N_NIMCALL_PTR(tsym226846*, ClPrc) (tcontext291021* c, tsym226846* fn, tidtable226864 pt, tlineinfo196539 info, void* ClEnv);
void* ClEnv;
} TY291122;
struct  tinstantiationpair291013  {
tsym226846* Genericsym;
tinstantiation226836* Inst;
};
typedef N_NIMCALL_PTR(tsym226846*, TY291138) (tcontext291021* c, tsym226846* dc, ttype226852* t, tlineinfo196539 info);
struct  tcontext291021  {
  tpasscontext287005 Sup;
tsym226846* Module;
tscope226840* Currentscope;
tscope226840* Importtable;
tscope226840* Toplevelscope;
tproccon291011* P;
tsymseq226818* Friendmodules;
NI Instcounter;
intset223056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq226818* Converters;
tsymseq226818* Patterns;
tlinkedlist127028 Optionstack;
tidtable226864 Symmapping;
tlinkedlist127028 Libs;
TY291064 Semconstexpr;
TY291069 Semexpr;
TY291077 Semtryexpr;
TY291085 Semtryconstexpr;
TY291090 Semoperand;
TY291098 Semconstboolexpr;
TY291103 Semoverloadedcall;
TY291110 Semtypenode;
TY291116 Seminferredlambda;
TY291122 Semgenerateinstance;
intset223056 Includedfiles;
tstrtable226820 Userpragmas;
tctx290048* Evalcontext;
intset223056 Unknownidents;
TY291133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY291138 Instdeepcopy;
};
struct  tnode226816  {
ttype226852* Typ;
tlineinfo196539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym226846* Sym;
} S4;
struct {tident201021* Ident;
} S5;
struct {tnodeseq226810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  trope178009  {
  TNimObject Sup;
trope178009* Left;
trope178009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope226840  {
NI Depthlevel;
tstrtable226820 Symbols;
tnodeseq226810* Usingsyms;
tscope226840* Parent;
};
struct  tinstantiation226836  {
tsym226846* Sym;
ttypeseq226848* Concretetypes;
TY226936* Usedby;
};
struct  tident201021  {
  tidobj201015 Sup;
NimStringDesc* S;
tident201021* Next;
NI H;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tlib226834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope178009* Name;
tnode226816* Path;
};
typedef NI TY26420[16];
struct  tpagedesc44941  {
tpagedesc44941* 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  tproccon291011  {
tsym226846* Owner;
tsym226846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon291011* Next;
};
struct  ttrunk223052  {
ttrunk223052* Next;
NI Key;
TY26420 Bits;
};
struct  vmargs290042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode226816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs290042* args, void* ClEnv);
void* ClEnv;
} vmcallback290044;
struct TY290270 {
NimStringDesc* Field0;
vmcallback290044 Field1;
};
struct  tctx290048  {
  tpasscontext287005 Sup;
TY290250* Code;
TY197414* Debug;
tnode226816* Globals;
tnode226816* Constants;
ttypeseq226848* Types;
tnode226816* Currentexceptiona;
tnode226816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype290230* Prc;
tsym226846* Module;
tnode226816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo196539 Comesfromheuristic;
TY290269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct  tblock290030  {
tsym226846* Label;
TY290211* Fixups;
};
struct TY290237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY290237 TY290234[256];
struct  pprocHEX3Aobjecttype290230  {
TY290231* Blocks;
tsym226846* Sym;
TY290234 Slots;
NI Maxslots;
};
struct tidpairseq226862 {
  TGenericSeq Sup;
  tidpair226860 data[SEQ_DECL_SIZE];
};
struct ttypeseq226848 {
  TGenericSeq Sup;
  ttype226852* data[SEQ_DECL_SIZE];
};
struct TY226947 {
  TGenericSeq Sup;
  tinstantiation226836* data[SEQ_DECL_SIZE];
};
struct tsymseq226818 {
  TGenericSeq Sup;
  tsym226846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq223054 {
  TGenericSeq Sup;
  ttrunk223052* data[SEQ_DECL_SIZE];
};
struct TY291133 {
  TGenericSeq Sup;
  tinstantiationpair291013 data[SEQ_DECL_SIZE];
};
struct tnodeseq226810 {
  TGenericSeq Sup;
  tnode226816* data[SEQ_DECL_SIZE];
};
struct TY226936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY290250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY197414 {
  TGenericSeq Sup;
  tlineinfo196539 data[SEQ_DECL_SIZE];
};
struct TY290269 {
  TGenericSeq Sup;
  TY290270 data[SEQ_DECL_SIZE];
};
struct TY290211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY290231 {
  TGenericSeq Sup;
  tblock290030 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittypevars_321474)(tcontext291021* p, tidtable226864 pt, tlineinfo196539 info, trepltypevars318786* Result);
N_NIMCALL(void, initidtable_227167)(tidtable226864* x);
N_NIMCALL(void, copyidtable_227241)(tidtable226864* dest, tidtable226864 src);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, pushinfocontext_197930)(tlineinfo196539 info);
N_NIMCALL(ttype226852*, replacetypevarst_318834)(trepltypevars318786* cl, ttype226852* t);
N_NIMCALL(ttype226852*, replacetypevarstaux_318796)(trepltypevars318786* cl, ttype226852* t);
N_NIMCALL(TNimObject*, idtableget_236182)(tidtable226864 t, tidobj201015* key);
N_NIMCALL(ttype226852*, handlegenericinvokation_320285)(trepltypevars318786* cl, ttype226852* t);
N_NIMCALL(void, internalerror_198987)(tlineinfo196539 info, NimStringDesc* errmsg);
N_NIMCALL(ttype226852*, searchinsttypes_318407)(ttype226852* key);
N_NIMCALL(void, internalerror_199006)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_199126)(TY84745 x_199130);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_274497)(ttypeseq226848* x_274503, ttypeseq226848* y_274508);
N_NIMCALL(NIM_BOOL, comparetypes_271571)(ttype226852* x, ttype226852* y, NU8 cmp, NU8 flags);
static N_INLINE(NI, sonslen_227255)(ttype226852* n);
N_NIMCALL(ttype226852*, lookuptypevar_320186)(trepltypevars318786* cl, ttype226852* t);
N_NIMCALL(void, localerror_198955)(tlineinfo196539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, typetostring_264031)(ttype226852* typ, NU8 prefer);
N_NIMCALL(ttype226852*, errortype_292319)(tcontext291021* c);
N_NIMCALL(void, idtableput_236196)(tidtable226864* t, tidobj201015* key, TNimObject* val);
N_NIMCALL(ttype226852*, instcopytype_320238)(trepltypevars318786* cl, ttype226852* t);
N_NIMCALL(ttype226852*, copytype_227195)(ttype226852* t, tsym226846* owner, NIM_BOOL keepid);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell44933*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44933* c);
N_NOINLINE(void, addzct_48617)(tcellseq44949* s, tcell44933* c);
N_NIMCALL(void, propagatetoowner_231318)(ttype226852* owner, ttype226852* elem);
N_NIMCALL(ttype226852*, newtype_227083)(NU8 kind, tsym226846* owner);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, cachetypeinst_318688)(ttype226852* inst);
N_NIMCALL(void, safeadd_318709)(ttypeseq226848** x_318717, ttype226852* y_318721);
N_NIMCALL(void, rawaddson_231562)(ttype226852* father, ttype226852* son);
static N_INLINE(ttype226852*, lastson_227267)(ttype226852* n);
N_NIMCALL(NIM_BOOL, isgenericalias_270591)(ttype226852* t);
N_NIMCALL(ttype226852*, skipgenericalias_270619)(ttype226852* t);
N_NIMCALL(void, checkpartialconstructedtype_318102)(tlineinfo196539 info, ttype226852* t);
N_NIMCALL(ttype226852*, skiptypes_231245)(ttype226852* t, NU64 kinds);
N_NIMCALL(void, sharedptrcheck_318014)(tlineinfo196539 info, ttype226852* t);
N_NIMCALL(NI, len_231005)(ttype226852* n);
static N_INLINE(NIM_BOOL, isgcedmem_231276)(ttype226852* t);
N_NIMCALL(tnode226816*, preparenode_319007)(trepltypevars318786* cl, tnode226816* n);
N_NIMCALL(tnode226816*, copynode_227323)(tnode226816* src);
N_NIMCALL(tsym226846*, replacetypevarss_318804)(trepltypevars318786* cl, tsym226846* s);
N_NIMCALL(tsym226846*, copysym_227203)(tsym226846* s, NIM_BOOL keepid);
N_NIMCALL(tnode226816*, replacetypevarsn_318812)(trepltypevars318786* cl, tnode226816* n_318816);
N_NIMCALL(tnode226816*, newnode_229207)(NU8 kind, tlineinfo196539 info, tnodeseq226810* sons, ttype226852* typ);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
static N_INLINE(NI, sonslen_227249)(tnode226816* n);
N_NIMCALL(void, illformedast_292406)(tnode226816* n);
N_NIMCALL(void, checksonslen_292416)(tnode226816* n, NI length);
N_NIMCALL(tnode226816*, newnodei_227138)(NU8 kind, tlineinfo196539 info);
N_NIMCALL(tnode226816*, reresolvecallswithtypedescparams_319410)(trepltypevars318786* cl, tnode226816* n);
static N_INLINE(tnode226816*, HEX5BHEX5D_227698)(tnode226816* n, NI i);
static N_INLINE(NI, safelen_227424)(tnode226816* n);
N_NIMCALL(NIM_BOOL, istypeparam_319151)(tnode226816* n);
N_NIMCALL(tnode226816*, newsymnode_227132)(tsym226846* sym);
N_NIMCALL(void, newsons_227273)(tnode226816* father, NI length);
N_NIMCALL(void, add_227498)(tnode226816* father, tnode226816* son);
N_NIMCALL(ttype226852*, newtypes_291214)(NU8 kind, tcontext291021* c);
static N_INLINE(ttype226852*, skipintlit_283531)(ttype226852* t);
N_NIMCALL(ttype226852*, getsystype_283030)(NU8 kind);
N_NIMCALL(ttype226852*, base_264038)(ttype226852* t);
N_NIMCALL(ttype226852*, maketypedesc_291763)(tcontext291021* c, ttype226852* typ);
N_NIMCALL(NIM_BOOL, containsgenerictype_273929)(ttype226852* t);
N_NIMCALL(void, propagatefieldflags_321139)(ttype226852* t, tnode226816* n);
static N_INLINE(NI, len_227364)(tnode226816* n);
N_NIMCALL(void, erasevoidparams_320784)(ttype226852* t);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, skipintliteralparams_320999)(ttype226852* t);
N_NIMCALL(void, popinfocontext_197957)(void);
N_NIMCALL(NIM_BOOL, hasgenericarguments_319243)(tnode226816* n);
N_NIMCALL(NI64, computesize_264193)(ttype226852* typ);
STRING_LITERAL(TMP2669, "no generic body", 15);
STRING_LITERAL(TMP2671, "compiler/semtypinst.nim", 23);
NIM_CONST TY84745 TMP2670 = {((NimStringDesc*) &TMP2671),
52}
;
STRING_LITERAL(TMP2672, "substitution with generic parameter", 35);
STRING_LITERAL(TMP2673, "acyclic", 7);
STRING_LITERAL(TMP2674, "", 0);
STRING_LITERAL(TMP2675, "shared memory may not refer to GC\'ed thread local memory", 56);
STRING_LITERAL(TMP2676, "ReplaceTypeVarsN: when condition not a bool", 43);
NIM_CONST TY84745 TMP2679 = {((NimStringDesc*) &TMP2671),
429}
;
NIM_CONST TY84745 TMP2680 = {((NimStringDesc*) &TMP2671),
345}
;
extern tgcheap47016 gch_47044;
extern TNimType NTI226848; /* TTypeSeq */
extern TNimType NTI226810; /* TNodeSeq */

N_NIMCALL(void, inittypevars_321474)(tcontext291021* p, tidtable226864 pt, tlineinfo196539 info, trepltypevars318786* Result) {
	initidtable_227167((&(*Result).Symmap));
	copyidtable_227241((&(*Result).Typemap), pt);
	initidtable_227167((&(*Result).Localcache));
	(*Result).Info = info;
	unsureAsgnRef((void**) (&(*Result).C), p);
}

N_NIMCALL(ttype226852*, searchinsttypes_318407)(ttype226852* key) {
	ttype226852* result;
	ttype226852* 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_199126(TMP2670);
		internalerror_199006(LOC9);
	}
	LA7: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = HEX3DHEX3D_274497((*(*generictyp).Sym).kindU.S1.Typeinstcache, NIM_NIL);
		if (!LOC12) goto LA13;
		goto BeforeRet;
	}
	LA13: ;
	{
		ttype226852* inst_318611;
		ttypeseq226848* HEX3Atmp_318655;
		NI i_318658;
		NI l_318660;
		inst_318611 = 0;
		HEX3Atmp_318655 = 0;
		HEX3Atmp_318655 = (*(*generictyp).Sym).kindU.S1.Typeinstcache;
		i_318658 = 0;
		l_318660 = HEX3Atmp_318655->Sup.len;
		{
			while (1) {
				if (!(i_318658 < l_318660)) goto LA17;
				inst_318611 = HEX3Atmp_318655->data[i_318658];
				{
					if (!((*inst_318611).Sup.Id == (*key).Sup.Id)) goto LA20;
					result = inst_318611;
					goto BeforeRet;
				}
				LA20: ;
				{
					if (!((*inst_318611).Sons->Sup.len < (*key).Sons->Sup.len)) goto LA24;
					goto BeforeRet;
				}
				LA24: ;
				{
					{
						NI j_318646;
						NI HEX3Atmp_318650;
						NI res_318653;
						j_318646 = 0;
						HEX3Atmp_318650 = 0;
						HEX3Atmp_318650 = ((*key).Sons->Sup.len-1);
						res_318653 = 1;
						{
							while (1) {
								if (!(res_318653 <= HEX3Atmp_318650)) goto LA29;
								j_318646 = res_318653;
								{
									NIM_BOOL LOC32;
									LOC32 = 0;
									LOC32 = comparetypes_271571((*inst_318611).Sons->data[j_318646], (*key).Sons->data[j_318646], ((NU8) 0), 8);
									if (!!(LOC32)) goto LA33;
									goto LA26;
								}
								LA33: ;
								res_318653 += 1;
							} LA29: ;
						}
					}
					result = inst_318611;
					goto BeforeRet;
				} LA26: ;
				i_318658 += 1;
			} LA17: ;
		}
	}
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_227255)(ttype226852* 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(ttype226852*, lookuptypevar_320186)(trepltypevars318786* cl, ttype226852* t) {
	ttype226852* result;
	tidobj201015* LOC1;
	TNimObject* LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = &t->Sup;
	LOC2 = 0;
	LOC2 = idtableget_236182((*cl).Typemap, LOC1);
	result = ((ttype226852*) (LOC2));
	{
		NimStringDesc* LOC13;
		tidobj201015* 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_264031(t, ((NU8) 0));
		localerror_198955((*(*t).Sym).Info, ((NU16) 124), LOC13);
		result = errortype_292319((*cl).C);
		LOC14 = 0;
		LOC14 = &t->Sup;
		LOC15 = 0;
		LOC15 = &result->Sup.Sup;
		idtableput_236196((&(*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_198987((*cl).Info, ((NimStringDesc*) &TMP2672));
	}
	goto LA3;
	LA19: ;
	LA3: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(ttype226852*, instcopytype_320238)(trepltypevars318786* cl, ttype226852* t) {
	ttype226852* result;
	result = 0;
	result = copytype_227195(t, (*t).Owner, (*cl).Allowmetatypes);
	(*result).Flags |= ((NI32)1)<<((((NU8) 8))%(sizeof(NI32)*8));
	(*result).Flags = ((*result).Flags & ~ 524288);
	return result;
}

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

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

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

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

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

static N_INLINE(ttype226852*, lastson_227267)(ttype226852* n) {
	ttype226852* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = sonslen_227255(n);
	result = (*n).Sons->data[(NI32)(LOC1 - 1)];
	return result;
}

static N_INLINE(NIM_BOOL, isgcedmem_231276)(ttype226852* t) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NIM_BOOL LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = ((*t).Kind == ((NU8) 28) || (*t).Kind == ((NU8) 22) || (*t).Kind == ((NU8) 24));
	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_318014)(tlineinfo196539 info, ttype226852* t) {
	{
		NIM_BOOL LOC3;
		NI LOC5;
		LOC3 = 0;
		LOC3 = ((*t).Kind == ((NU8) 21));
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = len_231005(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_231276(t);
				LA19: ;
				if (!LOC18) goto LA20;
				localerror_198955(info, ((NU16) 4), ((NimStringDesc*) &TMP2675));
			}
			LA20: ;
		}
		LA10: ;
	}
	LA6: ;
}

N_NIMCALL(void, checkpartialconstructedtype_318102)(tlineinfo196539 info, ttype226852* t) {
	{
		NIM_BOOL LOC3;
		ttype226852* LOC5;
		LOC3 = 0;
		LOC3 = (((*t).Flags &(1<<((((NU8) 4))&31)))!=0);
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = skiptypes_231245(t, IL64(211106232576256));
		LOC3 = !(((*LOC5).Kind == ((NU8) 17)));
		LA4: ;
		if (!LOC3) goto LA6;
		localerror_198955(info, ((NU16) 162), ((NimStringDesc*) &TMP2673));
	}
	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_198955(info, ((NU16) 197), ((NimStringDesc*) &TMP2674));
	}
	goto LA1;
	LA11: ;
	{
		sharedptrcheck_318014(info, t);
	}
	LA1: ;
}

N_NIMCALL(ttype226852*, handlegenericinvokation_320285)(trepltypevars318786* cl, ttype226852* t) {
	ttype226852* result;
	ttype226852* body;
	ttype226852* header;
	TY412748 LOC42;
	ttype226852* newbody;
	ttype226852* LOC60;
	tsym226846* dc;
	result = 0;
	body = (*t).Sons->data[0];
	{
		if (!!(((*body).Kind == ((NU8) 10)))) goto LA3;
		internalerror_198987((*cl).Info, ((NimStringDesc*) &TMP2669));
	}
	LA3: ;
	header = t;
	{
		tidobj201015* LOC9;
		TNimObject* LOC10;
		if (!(*cl).Allowmetatypes) goto LA7;
		LOC9 = 0;
		LOC9 = &t->Sup;
		LOC10 = 0;
		LOC10 = idtableget_236182((*cl).Localcache, LOC9);
		result = ((ttype226852*) (LOC10));
	}
	goto LA5;
	LA7: ;
	{
		result = searchinsttypes_318407(t);
	}
	LA5: ;
	{
		if (!!((result == NIM_NIL))) goto LA14;
		goto BeforeRet;
	}
	LA14: ;
	{
		NI i_320331;
		NI HEX3Atmp_320734;
		NI LOC17;
		NI res_320737;
		i_320331 = 0;
		HEX3Atmp_320734 = 0;
		LOC17 = 0;
		LOC17 = sonslen_227255(t);
		HEX3Atmp_320734 = (NI32)(LOC17 - 1);
		res_320737 = 1;
		{
			while (1) {
				ttype226852* x;
				if (!(res_320737 <= HEX3Atmp_320734)) goto LA19;
				i_320331 = res_320737;
				x = (*t).Sons->data[i_320331];
				{
					if (!((*x).Kind == ((NU8) 12))) goto LA22;
					x = lookuptypevar_320186(cl, x);
					{
						if (!!((x == NIM_NIL))) goto LA26;
						{
							if (!(header == t)) goto LA30;
							header = instcopytype_320238(cl, t);
						}
						LA30: ;
						asgnRefNoCycle((void**) (&(*header).Sons->data[i_320331]), x);
						propagatetoowner_231318(header, x);
					}
					LA26: ;
				}
				goto LA20;
				LA22: ;
				{
					propagatetoowner_231318(header, x);
				}
				LA20: ;
				res_320737 += 1;
			} LA19: ;
		}
	}
	{
		if (!!((header == t))) goto LA35;
		result = searchinsttypes_318407(header);
		{
			if (!!((result == NIM_NIL))) goto LA39;
			goto BeforeRet;
		}
		LA39: ;
	}
	goto LA33;
	LA35: ;
	{
		header = instcopytype_320238(cl, t);
	}
	LA33: ;
	result = newtype_227083(((NU8) 11), (*(*t).Sons->data[0]).Owner);
	(*result).Flags = (*header).Flags;
	if ((*result).Sons) nimGCunrefNoCycle((*result).Sons);
	(*result).Sons = (ttypeseq226848*) newSeqRC1((&NTI226848), 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_318688(result);
	}
	goto LA43;
	LA45: ;
	{
		tidobj201015* LOC48;
		TNimObject* LOC49;
		LOC48 = 0;
		LOC48 = &t->Sup;
		LOC49 = 0;
		LOC49 = &result->Sup.Sup;
		idtableput_236196((&(*cl).Localcache), LOC48, LOC49);
	}
	LA43: ;
	{
		NI i_320439;
		NI HEX3Atmp_320740;
		NI LOC51;
		NI res_320743;
		i_320439 = 0;
		HEX3Atmp_320740 = 0;
		LOC51 = 0;
		LOC51 = sonslen_227255(t);
		HEX3Atmp_320740 = (NI32)(LOC51 - 1);
		res_320743 = 1;
		{
			while (1) {
				ttype226852* x;
				tidobj201015* LOC54;
				TNimObject* LOC55;
				if (!(res_320743 <= HEX3Atmp_320740)) goto LA53;
				i_320439 = res_320743;
				x = replacetypevarst_318834(cl, (*t).Sons->data[i_320439]);
				asgnRefNoCycle((void**) (&(*header).Sons->data[i_320439]), x);
				propagatetoowner_231318(header, x);
				LOC54 = 0;
				LOC54 = &(*body).Sons->data[(NI32)(i_320439 - 1)]->Sup;
				LOC55 = 0;
				LOC55 = &x->Sup.Sup;
				idtableput_236196((&(*cl).Typemap), LOC54, LOC55);
				res_320743 += 1;
			} LA53: ;
		}
	}
	{
		NI i_320614;
		NI HEX3Atmp_320746;
		NI LOC57;
		NI res_320749;
		i_320614 = 0;
		HEX3Atmp_320746 = 0;
		LOC57 = 0;
		LOC57 = sonslen_227255(t);
		HEX3Atmp_320746 = (NI32)(LOC57 - 1);
		res_320749 = 1;
		{
			while (1) {
				if (!(res_320749 <= HEX3Atmp_320746)) goto LA59;
				i_320614 = res_320749;
				rawaddson_231562(result, (*header).Sons->data[i_320614]);
				res_320749 += 1;
			} LA59: ;
		}
	}
	LOC60 = 0;
	LOC60 = lastson_227267(body);
	newbody = replacetypevarst_318834(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_270591(newbody);
		if (!LOC63) goto LA64;
		newbody = skipgenericalias_270619(newbody);
	}
	LA64: ;
	rawaddson_231562(result, newbody);
	checkpartialconstructedtype_318102((*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_227249)(tnode226816* 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(tnode226816*, HEX5BHEX5D_227698)(tnode226816* n, NI i) {
	tnode226816* result;
	result = 0;
	result = (*n).kindU.S6.Sons->data[i];
	return result;
}

static N_INLINE(NI, safelen_227424)(tnode226816* 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_319151)(tnode226816* 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(tnode226816*, reresolvecallswithtypedescparams_319410)(trepltypevars318786* cl, tnode226816* n) {
	tnode226816* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		tnode226816* 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_227698(n, 0);
		LOC3 = (((*(*LOC5).kindU.S4.Sym).Flags &(1<<((((NU8) 2))&31)))!=0);
		LA4: ;
		if (!LOC3) goto LA6;
		needsfixing = NIM_FALSE;
		{
			NI i_319478;
			NI HEX3Atmp_319559;
			NI LOC9;
			NI res_319562;
			i_319478 = 0;
			HEX3Atmp_319559 = 0;
			LOC9 = 0;
			LOC9 = safelen_227424(n);
			HEX3Atmp_319559 = (LOC9 - 1);
			res_319562 = 1;
			{
				while (1) {
					if (!(res_319562 <= HEX3Atmp_319559)) goto LA11;
					i_319478 = res_319562;
					{
						tnode226816* LOC14;
						NIM_BOOL LOC15;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_227698(n, i_319478);
						LOC15 = 0;
						LOC15 = istypeparam_319151(LOC14);
						if (!LOC15) goto LA16;
						needsfixing = NIM_TRUE;
					}
					LA16: ;
					res_319562 += 1;
				} LA11: ;
			}
		}
		{
			if (!needsfixing) goto LA20;
			asgnRefNoCycle((void**) (&(*n).kindU.S6.Sons->data[0]), newsymnode_227132((*(*(*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_319543;
		NI HEX3Atmp_319565;
		NI LOC23;
		NI res_319568;
		i_319543 = 0;
		HEX3Atmp_319565 = 0;
		LOC23 = 0;
		LOC23 = safelen_227424(n);
		HEX3Atmp_319565 = (LOC23 - 1);
		res_319568 = 0;
		{
			while (1) {
				tnode226816* LOC26;
				if (!(res_319568 <= HEX3Atmp_319565)) goto LA25;
				i_319543 = res_319568;
				LOC26 = 0;
				LOC26 = HEX5BHEX5D_227698(n, i_319543);
				asgnRefNoCycle((void**) (&(*n).kindU.S6.Sons->data[i_319543]), reresolvecallswithtypedescparams_319410(cl, LOC26));
				res_319568 += 1;
			} LA25: ;
		}
	}
	result = n;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode226816*, replacetypevarsn_318812)(trepltypevars318786* cl, tnode226816* n_318816) {
	tnode226816* result;
	result = 0;
	{
		if (!(n_318816 == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	result = copynode_227323(n_318816);
	{
		if (!!(((*n_318816).Typ == NIM_NIL))) goto LA7;
		asgnRefNoCycle((void**) (&(*result).Typ), replacetypevarst_318834(cl, (*n_318816).Typ));
	}
	LA7: ;
	switch ((*n_318816).Kind) {
	case ((NU8) 0) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	{
	}
	break;
	case ((NU8) 3):
	{
		asgnRefNoCycle((void**) (&(*result).kindU.S4.Sym), replacetypevarss_318804(cl, (*n_318816).kindU.S4.Sym));
		{
			tnodeseq226810* LOC15;
			if (!((*(*(*result).kindU.S4.Sym).Typ).Kind == ((NU8) 3))) goto LA13;
			LOC15 = 0;
			LOC15 = (tnodeseq226810*) newSeq((&NTI226810), 0);
			result = newnode_229207(((NU8) 137), (*n_318816).Info, LOC15, NIM_NIL);
		}
		LA13: ;
	}
	break;
	case ((NU8) 139):
	{
		tnode226816* branch;
		branch = NIM_NIL;
		{
			NI i_319891;
			NI HEX3Atmp_320088;
			NI LOC18;
			NI res_320091;
			i_319891 = 0;
			HEX3Atmp_320088 = 0;
			LOC18 = 0;
			LOC18 = sonslen_227249(n_318816);
			HEX3Atmp_320088 = (NI32)(LOC18 - 1);
			res_320091 = 0;
			{
				while (1) {
					tnode226816* it;
					if (!(res_320091 <= HEX3Atmp_320088)) goto LA20;
					i_319891 = res_320091;
					it = (*n_318816).kindU.S6.Sons->data[i_319891];
					{
						if (!(it == NIM_NIL)) goto LA23;
						illformedast_292406(n_318816);
					}
					LA23: ;
					switch ((*it).Kind) {
					case ((NU8) 86):
					{
						tnode226816* cond;
						tnode226816* e;
						checksonslen_292416(it, 2);
						cond = preparenode_319007(cl, (*it).kindU.S6.Sons->data[0]);
						e = (*(*cl).C).Semconstexpr((*cl).C, cond);
						{
							if (!!(((*e).Kind == ((NU8) 6)))) goto LA28;
							internalerror_198987((*e).Info, ((NimStringDesc*) &TMP2676));
						}
						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_292416(it, 1);
						{
							if (!(branch == NIM_NIL)) goto LA39;
							branch = (*it).kindU.S6.Sons->data[0];
						}
						LA39: ;
					}
					break;
					default:
					{
						illformedast_292406(n_318816);
					}
					break;
					}
					res_320091 += 1;
				} LA20: ;
			}
		}
		{
			if (!!((branch == NIM_NIL))) goto LA44;
			result = replacetypevarsn_318812(cl, branch);
		}
		goto LA42;
		LA44: ;
		{
			result = newnodei_227138(((NU8) 137), (*n_318816).Info);
		}
		LA42: ;
	}
	break;
	case ((NU8) 62):
	{
		tnode226816* n;
		n = preparenode_319007(cl, n_318816);
		n = reresolvecallswithtypedescparams_319410(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_227249(n_318816);
		{
			if (!(0 < length)) goto LA56;
			newsons_227273(result, length);
			{
				NI i_320057;
				NI HEX3Atmp_320094;
				NI res_320097;
				i_320057 = 0;
				HEX3Atmp_320094 = 0;
				HEX3Atmp_320094 = (NI32)(length - 1);
				res_320097 = 0;
				{
					while (1) {
						if (!(res_320097 <= HEX3Atmp_320094)) goto LA60;
						i_320057 = res_320097;
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[i_320057]), replacetypevarsn_318812(cl, (*n_318816).kindU.S6.Sons->data[i_320057]));
						res_320097 += 1;
					} LA60: ;
				}
			}
		}
		LA56: ;
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym226846*, replacetypevarss_318804)(trepltypevars318786* cl, tsym226846* s) {
	tsym226846* result;
	tidobj201015* 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_236182((*cl).Symmap, LOC5);
	result = ((tsym226846*) (LOC6));
	{
		tidobj201015* LOC11;
		TNimObject* LOC12;
		if (!(result == NIM_NIL)) goto LA9;
		result = copysym_227203(s, NIM_FALSE);
		(*result).Flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
		LOC11 = 0;
		LOC11 = &s->Sup;
		LOC12 = 0;
		LOC12 = &result->Sup.Sup;
		idtableput_236196((&(*cl).Symmap), LOC11, LOC12);
		asgnRefNoCycle((void**) (&(*result).Owner), (*s).Owner);
		asgnRefNoCycle((void**) (&(*result).Typ), replacetypevarst_318834(cl, (*s).Typ));
		asgnRefNoCycle((void**) (&(*result).Ast), replacetypevarsn_318812(cl, (*s).Ast));
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode226816*, preparenode_319007)(trepltypevars318786* cl, tnode226816* n) {
	tnode226816* result;
	ttype226852* t;
	NIM_BOOL iscall;
	result = 0;
	t = replacetypevarst_318834(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_227323(n);
	asgnRefNoCycle((void**) (&(*result).Typ), t);
	{
		if (!((*result).Kind == ((NU8) 3))) goto LA11;
		asgnRefNoCycle((void**) (&(*result).kindU.S4.Sym), replacetypevarss_318804(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_319129;
		NI HEX3Atmp_319131;
		NI LOC14;
		NI res_319134;
		i_319129 = 0;
		HEX3Atmp_319131 = 0;
		LOC14 = 0;
		LOC14 = safelen_227424(n);
		HEX3Atmp_319131 = (LOC14 - 1);
		res_319134 = 0;
		{
			while (1) {
				if (!(res_319134 <= HEX3Atmp_319131)) goto LA16;
				i_319129 = res_319134;
				{
					NIM_BOOL LOC19;
					tnode226816* LOC23;
					LOC19 = 0;
					LOC19 = iscall;
					if (!(LOC19)) goto LA20;
					LOC19 = (i_319129 == 0);
					LA20: ;
					if (!LOC19) goto LA21;
					LOC23 = 0;
					LOC23 = HEX5BHEX5D_227698(n, i_319129);
					add_227498(result, LOC23);
				}
				goto LA17;
				LA21: ;
				{
					tnode226816* LOC25;
					tnode226816* LOC26;
					LOC25 = 0;
					LOC25 = HEX5BHEX5D_227698(n, i_319129);
					LOC26 = 0;
					LOC26 = preparenode_319007(cl, LOC25);
					add_227498(result, LOC26);
				}
				LA17: ;
				res_319134 += 1;
			} LA16: ;
		}
	}
	BeforeRet: ;
	return result;
}

static N_INLINE(ttype226852*, skipintlit_283531)(ttype226852* t) {
	ttype226852* result;
	result = 0;
	{
		if (!!(((*t).N == NIM_NIL))) goto LA3;
		{
			if (!((*t).Kind == ((NU8) 31) || (*t).Kind == ((NU8) 36))) goto LA7;
			result = getsystype_283030((*t).Kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, len_227364)(tnode226816* 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_321139)(ttype226852* t, tnode226816* n) {
	{
		NimStringDesc* LOC5;
		if (!!(!(((*n).Kind == ((NU8) 139))))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_199126(TMP2680);
		internalerror_199006(LOC5);
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 3):
	{
		propagatetoowner_231318(t, (*(*n).kindU.S4.Sym).Typ);
	}
	break;
	case ((NU8) 137):
	case ((NU8) 138):
	case ((NU8) 85):
	case ((NU8) 88):
	{
		{
			tnode226816* son_321182;
			son_321182 = 0;
			{
				NI i_321187;
				NI HEX3Atmp_321189;
				NI LOC10;
				NI res_321191;
				i_321187 = 0;
				HEX3Atmp_321189 = 0;
				LOC10 = 0;
				LOC10 = len_227364(n);
				HEX3Atmp_321189 = (LOC10 - 1);
				res_321191 = 0;
				{
					while (1) {
						if (!(res_321191 <= HEX3Atmp_321189)) goto LA12;
						i_321187 = res_321191;
						son_321182 = (*n).kindU.S6.Sons->data[i_321187];
						propagatefieldflags_321139(t, son_321182);
						res_321191 += 1;
					} LA12: ;
				}
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
}

N_NIMCALL(void, erasevoidparams_320784)(ttype226852* 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_320834;
		NI HEX3Atmp_320970;
		NI LOC8;
		NI res_320973;
		i_320834 = 0;
		HEX3Atmp_320970 = 0;
		LOC8 = 0;
		LOC8 = sonslen_227255(t);
		HEX3Atmp_320970 = (LOC8 - 1);
		res_320973 = 1;
		{
			while (1) {
				if (!(res_320973 <= HEX3Atmp_320970)) goto LA10;
				i_320834 = res_320973;
				{
					NI pos;
					if (!((*(*t).Sons->data[i_320834]).Kind == ((NU8) 3))) goto LA13;
					pos = i_320834;
					{
						NI j_320866;
						NI HEX3Atmp_320964;
						NI HEX3Atmp_320965;
						NI LOC16;
						NI res_320968;
						j_320866 = 0;
						HEX3Atmp_320964 = 0;
						HEX3Atmp_320965 = 0;
						HEX3Atmp_320964 = (NI32)(i_320834 + 1);
						LOC16 = 0;
						LOC16 = sonslen_227255(t);
						HEX3Atmp_320965 = (LOC16 - 1);
						res_320968 = HEX3Atmp_320964;
						{
							while (1) {
								if (!(res_320968 <= HEX3Atmp_320965)) goto LA18;
								j_320866 = res_320968;
								{
									if (!!(((*(*t).Sons->data[j_320866]).Kind == ((NU8) 3)))) goto LA21;
									asgnRefNoCycle((void**) (&(*t).Sons->data[pos]), (*t).Sons->data[j_320866]);
									asgnRefNoCycle((void**) (&(*(*t).N).kindU.S6.Sons->data[pos]), (*(*t).N).kindU.S6.Sons->data[j_320866]);
									pos += 1;
								}
								LA21: ;
								res_320968 += 1;
							} LA18: ;
						}
					}
					(*t).Sons = (ttypeseq226848*) setLengthSeq(&((*t).Sons)->Sup, sizeof(ttype226852*), pos);
					(*(*t).N).kindU.S6.Sons = (tnodeseq226810*) setLengthSeq(&((*(*t).N).kindU.S6.Sons)->Sup, sizeof(tnode226816*), pos);
					goto BeforeRet;
				}
				LA13: ;
				res_320973 += 1;
			} LA10: ;
		}
	}
	BeforeRet: ;
}

N_NIMCALL(void, skipintliteralparams_320999)(ttype226852* t) {
	{
		NI i_321023;
		NI HEX3Atmp_321116;
		NI LOC2;
		NI res_321119;
		i_321023 = 0;
		HEX3Atmp_321116 = 0;
		LOC2 = 0;
		LOC2 = sonslen_227255(t);
		HEX3Atmp_321116 = (LOC2 - 1);
		res_321119 = 0;
		{
			while (1) {
				if (!(res_321119 <= HEX3Atmp_321116)) goto LA4;
				i_321023 = res_321119;
				{
					ttype226852* p;
					ttype226852* skipped;
					p = (*t).Sons->data[i_321023];
					{
						if (!(p == NIM_NIL)) goto LA8;
						goto LA5;
					}
					LA8: ;
					skipped = skipintlit_283531(p);
					{
						if (!!((skipped == p))) goto LA12;
						asgnRefNoCycle((void**) (&(*t).Sons->data[i_321023]), skipped);
						{
							if (!(0 < i_321023)) goto LA16;
							asgnRefNoCycle((void**) (&(*(*(*(*t).N).kindU.S6.Sons->data[i_321023]).kindU.S4.Sym).Typ), skipped);
						}
						LA16: ;
					}
					LA12: ;
				} LA5: ;
				res_321119 += 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_264038((*t).Sons->data[0]));
	}
	LA22: ;
}

N_NIMCALL(ttype226852*, replacetypevarstaux_318796)(trepltypevars318786* cl, ttype226852* t) {
	ttype226852* result;
	result = 0;
	result = t;
	{
		if (!(t == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		ttype226852* lookup;
		tidobj201015* LOC9;
		TNimObject* LOC10;
		if (!((*t).Kind == ((NU8) 12) || (*t).Kind == ((NU8) 49) || (*t).Kind >= ((NU8) 51) && (*t).Kind <= ((NU8) 59))) goto LA7;
		LOC9 = 0;
		LOC9 = &t->Sup;
		LOC10 = 0;
		LOC10 = idtableget_236182((*cl).Typemap, LOC9);
		lookup = ((ttype226852*) (LOC10));
		{
			if (!!((lookup == NIM_NIL))) goto LA13;
			result = lookup;
			goto BeforeRet;
		}
		LA13: ;
	}
	LA7: ;
	switch ((*t).Kind) {
	case ((NU8) 9):
	{
		result = handlegenericinvokation_320285(cl, t);
	}
	break;
	case ((NU8) 10):
	{
		NimStringDesc* LOC17;
		LOC17 = 0;
		LOC17 = typetostring_264031(t, ((NU8) 0));
		localerror_198955((*cl).Info, ((NU16) 124), LOC17);
		result = errortype_292319((*cl).C);
	}
	break;
	case ((NU8) 60):
	{
		tnode226816* n;
		{
			if (!(*cl).Allowmetatypes) goto LA21;
			goto BeforeRet;
		}
		LA21: ;
		n = preparenode_319007(cl, (*t).N);
		n = (*(*cl).C).Semconstexpr((*cl).C, n);
		{
			if (!((*(*n).Typ).Kind == ((NU8) 8))) goto LA25;
			result = skiptypes_231245((*n).Typ, 256);
		}
		goto LA23;
		LA25: ;
		{
			{
				TY412748 LOC32;
				if (!!(((*(*n).Typ).Kind == ((NU8) 59)))) goto LA30;
				result = newtypes_291214(((NU8) 59), (*cl).C);
				if ((*result).Sons) nimGCunrefNoCycle((*result).Sons);
				(*result).Sons = (ttypeseq226848*) newSeqRC1((&NTI226848), 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_283531(t);
	}
	break;
	case ((NU8) 8):
	{
		ttype226852* lookup;
		tidobj201015* LOC36;
		TNimObject* LOC37;
		LOC36 = 0;
		LOC36 = &t->Sup;
		LOC37 = 0;
		LOC37 = idtableget_236182((*cl).Typemap, LOC36);
		lookup = ((ttype226852*) (LOC37));
		{
			if (!!((lookup == NIM_NIL))) goto LA40;
			result = lookup;
			{
				if (!(((*t).Flags &(1<<((((NU8) 9))&31)))!=0)) goto LA44;
				result = base_264038(result);
			}
			LA44: ;
		}
		goto LA38;
		LA40: ;
		{
			ttype226852* LOC49;
			if (!!(((*(*t).Sons->data[0]).Kind == ((NU8) 0)))) goto LA47;
			LOC49 = 0;
			LOC49 = replacetypevarst_318834(cl, (*t).Sons->data[0]);
			result = maketypedesc_291763((*cl).C, LOC49);
		}
		goto LA38;
		LA47: ;
		LA38: ;
	}
	break;
	case ((NU8) 52):
	{
		result = t;
	}
	break;
	case ((NU8) 11):
	{
		ttype226852* LOC56;
		result = instcopytype_320238(cl, t);
		{
			NI i_321381;
			NI HEX3Atmp_321439;
			NI LOC53;
			NI res_321442;
			i_321381 = 0;
			HEX3Atmp_321439 = 0;
			LOC53 = 0;
			LOC53 = sonslen_227255(result);
			HEX3Atmp_321439 = (LOC53 - 1);
			res_321442 = 1;
			{
				while (1) {
					if (!(res_321442 <= HEX3Atmp_321439)) goto LA55;
					i_321381 = res_321442;
					asgnRefNoCycle((void**) (&(*result).Sons->data[i_321381]), replacetypevarst_318834(cl, (*result).Sons->data[i_321381]));
					res_321442 += 1;
				} LA55: ;
			}
		}
		LOC56 = 0;
		LOC56 = lastson_227267(result);
		propagatetoowner_231318(result, LOC56);
	}
	break;
	default:
	{
		{
			NIM_BOOL LOC60;
			LOC60 = 0;
			LOC60 = containsgenerictype_273929(t);
			if (!LOC60) goto LA61;
			result = instcopytype_320238(cl, t);
			(*result).Size = IL64(-1);
			{
				NI i_321394;
				NI HEX3Atmp_321445;
				NI LOC64;
				NI res_321448;
				i_321394 = 0;
				HEX3Atmp_321445 = 0;
				LOC64 = 0;
				LOC64 = sonslen_227255(result);
				HEX3Atmp_321445 = (NI32)(LOC64 - 1);
				res_321448 = 0;
				{
					while (1) {
						if (!(res_321448 <= HEX3Atmp_321445)) goto LA66;
						i_321394 = res_321448;
						{
							if (!!(((*result).Sons->data[i_321394] == NIM_NIL))) goto LA69;
							asgnRefNoCycle((void**) (&(*result).Sons->data[i_321394]), replacetypevarst_318834(cl, (*result).Sons->data[i_321394]));
							propagatetoowner_231318(result, (*result).Sons->data[i_321394]);
						}
						LA69: ;
						res_321448 += 1;
					} LA66: ;
				}
			}
			asgnRefNoCycle((void**) (&(*result).N), replacetypevarsn_318812(cl, (*result).N));
			switch ((*result).Kind) {
			case ((NU8) 16):
			{
				ttype226852* idx;
				idx = (*result).Sons->data[0];
				{
					NimStringDesc* LOC76;
					if (!!(!(((*idx).Kind == ((NU8) 59))))) goto LA74;
					LOC76 = 0;
					LOC76 = HEX24_199126(TMP2679);
					internalerror_199006(LOC76);
				}
				LA74: ;
			}
			break;
			case ((NU8) 17):
			case ((NU8) 18):
			{
				propagatefieldflags_321139(result, (*result).N);
			}
			break;
			case ((NU8) 25):
			{
				erasevoidparams_320784(result);
				skipintliteralparams_320999(result);
			}
			break;
			default:
			{
			}
			break;
			}
		}
		LA61: ;
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(ttype226852*, replacetypevarst_318834)(trepltypevars318786* cl, ttype226852* t) {
	ttype226852* result;
	result = 0;
	result = replacetypevarstaux_318796(cl, t);
	return result;
}

N_NIMCALL(ttype226852*, generatetypeinstance_321503)(tcontext291021* p, tidtable226864 pt, tlineinfo196539 info, ttype226852* t) {
	ttype226852* result;
	trepltypevars318786 cl;
	result = 0;
	memset((void*)(&cl), 0, sizeof(cl));
	chckNil((void*)(&cl));
	memset((void*)(&cl), 0, sizeof(cl));
	inittypevars_321474(p, pt, info, (&cl));
	pushinfocontext_197930(info);
	result = replacetypevarst_318834((&cl), t);
	popinfocontext_197957();
	return result;
}

N_NIMCALL(tnode226816*, replacetypesinbody_321489)(tcontext291021* p, tidtable226864 pt, tnode226816* n) {
	tnode226816* result;
	trepltypevars318786 cl;
	result = 0;
	memset((void*)(&cl), 0, sizeof(cl));
	chckNil((void*)(&cl));
	memset((void*)(&cl), 0, sizeof(cl));
	inittypevars_321474(p, pt, (*n).Info, (&cl));
	pushinfocontext_197930((*n).Info);
	result = replacetypevarsn_318812((&cl), n);
	popinfocontext_197957();
	return result;
}

N_NIMCALL(NIM_BOOL, hasgenericarguments_319243)(tnode226816* 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_319374;
			NI HEX3Atmp_319390;
			NI LOC11;
			NI res_319393;
			i_319374 = 0;
			HEX3Atmp_319390 = 0;
			LOC11 = 0;
			LOC11 = safelen_227424(n);
			HEX3Atmp_319390 = (LOC11 - 1);
			res_319393 = 0;
			{
				while (1) {
					if (!(res_319393 <= HEX3Atmp_319390)) goto LA13;
					i_319374 = res_319393;
					{
						NIM_BOOL LOC16;
						LOC16 = 0;
						LOC16 = hasgenericarguments_319243((*n).kindU.S6.Sons->data[i_319374]);
						if (!LOC16) goto LA17;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA17: ;
					res_319393 += 1;
				} LA13: ;
			}
		}
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, checkconstructedtype_318152)(tlineinfo196539 info, ttype226852* typ) {
	ttype226852* t;
	t = skiptypes_231245(typ, 8192);
	{
		if (!((*t).Kind == ((NU8) 51) || (*t).Kind == ((NU8) 54) || (*t).Kind == ((NU8) 52) || (*t).Kind == ((NU8) 53) || (*t).Kind == ((NU8) 55) || (*t).Kind == ((NU8) 56) || (*t).Kind == ((NU8) 57) || (*t).Kind == ((NU8) 58))) goto LA3;
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		ttype226852* LOC8;
		LOC6 = 0;
		LOC6 = (((*t).Flags &(1<<((((NU8) 4))&31)))!=0);
		if (!(LOC6)) goto LA7;
		LOC8 = 0;
		LOC8 = skiptypes_231245(t, IL64(211106232576256));
		LOC6 = !(((*LOC8).Kind == ((NU8) 17)));
		LA7: ;
		if (!LOC6) goto LA9;
		localerror_198955(info, ((NU16) 162), ((NimStringDesc*) &TMP2673));
	}
	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_198955(info, ((NU16) 197), ((NimStringDesc*) &TMP2674));
	}
	goto LA1;
	LA14: ;
	{
		NI64 LOC17;
		NimStringDesc* LOC20;
		LOC17 = 0;
		LOC17 = computesize_264193(t);
		if (!(LOC17 == IL64(-2))) goto LA18;
		LOC20 = 0;
		LOC20 = typetostring_264031(t, ((NU8) 0));
		localerror_198955(info, ((NU16) 123), LOC20);
	}
	goto LA1;
	LA18: ;
	{
		sharedptrcheck_318014(info, t);
	}
	LA1: ;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_semtypinstInit)(void) {
}

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

