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

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tllstream213204 Tllstream213204;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tnode225809 Tnode225809;
typedef struct Ttmplparser252020 Ttmplparser252020;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttype225847 Ttype225847;
typedef struct Tsym225841 Tsym225841;
typedef struct Tident198021 Tident198021;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Tidobj198015 Tidobj198015;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tlib225827 Tlib225827;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY225932 TY225932;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Ttmplparser252020  {
Tllstream213204* inp;
NU8 state;
Tlineinfo190352 info;
NI indent;
NI emitpar;
NimStringDesc* x;
Tllstream213204* outp;
NIM_CHAR subschar;
NIM_CHAR nimdirective;
NimStringDesc* emit;
NimStringDesc* conc;
NimStringDesc* tostr;
NI curly;
NI bracket;
NI par;
NIM_BOOL pendingexprline;
};
typedef NU8 TY213407[32];
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tllstream213204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
static N_INLINE(Tlineinfo190352, newlineinfo_191279)(NimStringDesc* filename, NI line, NI col);
N_NIMCALL(Tlineinfo190352, newlineinfo_191267)(NI32 fileinfoidx, NI line, NI col);
N_NIMCALL(NI32, fileinfoidx_191254)(NimStringDesc* filename);
N_NIMCALL(Tllstream213204*, llstreamopen_213220)(NimStringDesc* data);
N_NIMCALL(NIM_CHAR, chararg_251020)(Tnode225809* n, NimStringDesc* name, NI pos, NIM_CHAR default_251025);
N_NIMCALL(NimStringDesc*, strarg_251029)(Tnode225809* n, NimStringDesc* name, NI pos, NimStringDesc* default_251034);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, llstreamreadline_213610)(Tllstream213204* s, NimStringDesc** line);
N_NIMCALL(void, parseline_252149)(Ttmplparser252020* p);
N_NIMCALL(void, newline_252047)(Ttmplparser252020* p);
N_NIMCALL(void, llstreamwrite_213665)(Tllstream213204* s, NimStringDesc* data);
N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_NIMCALL(void, scanpar_252057)(Ttmplparser252020* p, NI d);
static N_INLINE(NIM_BOOL, withinexpr_252139)(Ttmplparser252020* p);
N_NIMCALL(NIM_BOOL, endswithopr_213450)(NimStringDesc* x);
N_NIMCALL(NU16, whichkeyword_206400)(NimStringDesc* id);
N_NIMCALL(void, localerror_196128)(Tlineinfo190352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(NIM_BOOL, contains_103975)(NimStringDesc* s, TY213407 chars);
N_NIMCALL(NimStringDesc*, nsuToHex)(NI64 x, NI len);
N_NIMCALL(void, llstreamwrite_213696)(Tllstream213204* s, NIM_CHAR data);
N_NIMCALL(void, llstreamclose_213310)(Tllstream213204* s);
STRING_LITERAL(TMP1488, "", 0);
STRING_LITERAL(TMP1489, "subschar", 8);
STRING_LITERAL(TMP1490, "metachar", 8);
STRING_LITERAL(TMP1491, "emit", 4);
STRING_LITERAL(TMP1492, "result.add", 10);
STRING_LITERAL(TMP1493, "conc", 4);
STRING_LITERAL(TMP1494, " & ", 3);
STRING_LITERAL(TMP1495, "tostring", 8);
STRING_LITERAL(TMP1496, "$", 1);
STRING_LITERAL(TMP1497, "\012", 1);
STRING_LITERAL(TMP1499, "end", 3);
STRING_LITERAL(TMP1500, "#end", 4);
static NIM_CONST TY213407 TMP1501 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
STRING_LITERAL(TMP1502, "\"", 1);
STRING_LITERAL(TMP1503, "(\"", 2);
STRING_LITERAL(TMP1504, "\\x", 2);
STRING_LITERAL(TMP1505, "\\\\", 2);
STRING_LITERAL(TMP1506, "\\\'", 2);
STRING_LITERAL(TMP1507, "\\\"", 2);
STRING_LITERAL(TMP1508, "}", 1);
STRING_LITERAL(TMP1509, "\\n\"", 3);

static N_INLINE(Tlineinfo190352, newlineinfo_191279)(NimStringDesc* filename, NI line, NI col) {
	Tlineinfo190352 result;
	NI32 LOC1;
	memset((void*)(&result), 0, sizeof(result));
	LOC1 = 0;
	LOC1 = fileinfoidx_191254(filename);
	result = newlineinfo_191267(LOC1, line, col);
	return result;
}

N_NIMCALL(void, newline_252047)(Ttmplparser252020* p) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = nsuRepeatChar(41, ((NI) ((*p).emitpar)));
	llstreamwrite_213665((*p).outp, LOC1);
	(*p).emitpar = ((NI) 0);
	{
		if (!(((NI16) 1) < (*p).info.line)) goto LA4;
		llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1497));
	}
	LA4: ;
	{
		NimStringDesc* LOC10;
		if (!(*p).pendingexprline) goto LA8;
		LOC10 = 0;
		LOC10 = nsuRepeatChar(32, ((NI) 2));
		llstreamwrite_213665((*p).outp, LOC10);
		(*p).pendingexprline = NIM_FALSE;
	}
	LA8: ;
}

N_NIMCALL(void, scanpar_252057)(Ttmplparser252020* p, NI d) {
	NI i;
	i = d;
	{
		while (1) {
			switch (((NU8)((*p).x->data[i]))) {
			case 0:
			{
				goto LA1;
			}
			break;
			case 40:
			{
				(*p).par += ((NI) 1);
			}
			break;
			case 41:
			{
				(*p).par -= ((NI) 1);
			}
			break;
			case 91:
			{
				(*p).bracket += ((NI) 1);
			}
			break;
			case 93:
			{
				(*p).bracket -= ((NI) 1);
			}
			break;
			case 123:
			{
				(*p).curly += ((NI) 1);
			}
			break;
			case 125:
			{
				(*p).curly -= ((NI) 1);
			}
			break;
			default:
			{
			}
			break;
			}
			i += ((NI) 1);
		}
	} LA1: ;
}

static N_INLINE(NIM_BOOL, withinexpr_252139)(Ttmplparser252020* p) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NIM_BOOL LOC2;
	result = 0;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = (((NI) 0) < (*p).par);
	if (LOC2) goto LA3;
	LOC2 = (((NI) 0) < (*p).bracket);
	LA3: ;
	LOC1 = LOC2;
	if (LOC1) goto LA4;
	LOC1 = (((NI) 0) < (*p).curly);
	LA4: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, parseline_252149)(Ttmplparser252020* p) {
	NI d;
	NI j;
	NI curly;
	NimStringDesc* keyw;
	d = 0;
	j = 0;
	curly = 0;
	keyw = 0;
	j = ((NI) 0);
	{
		while (1) {
			if (!((NU8)((*p).x->data[j]) == (NU8)(32))) goto LA2;
			j += ((NI) 1);
		} LA2: ;
	}
	{
		NIM_BOOL LOC5;
		LOC5 = 0;
		LOC5 = ((NU8)((*p).x->data[((NI) 0)]) == (NU8)((*p).nimdirective));
		if (!(LOC5)) goto LA6;
		LOC5 = (((NU8)((*p).x->data[((NI) 1)])) == ((NU8)(63)) || ((NU8)((*p).x->data[((NI) 1)])) == ((NU8)(33)));
		LA6: ;
		if (!LOC5) goto LA7;
		newline_252047(p);
	}
	goto LA3;
	LA7: ;
	{
		NIM_BOOL LOC16;
		NU16 LOC18;
		if (!((NU8)((*p).x->data[j]) == (NU8)((*p).nimdirective))) goto LA10;
		newline_252047(p);
		j += ((NI) 1);
		{
			while (1) {
				if (!((NU8)((*p).x->data[j]) == (NU8)(32))) goto LA13;
				j += ((NI) 1);
			} LA13: ;
		}
		d = j;
		keyw = copyString(((NimStringDesc*) &TMP1488));
		{
			while (1) {
				if (!(((NU8)((*p).x->data[j])) >= ((NU8)(97)) && ((NU8)((*p).x->data[j])) <= ((NU8)(122)) || ((NU8)((*p).x->data[j])) >= ((NU8)(65)) && ((NU8)((*p).x->data[j])) <= ((NU8)(90)) || ((NU8)((*p).x->data[j])) >= ((NU8)(48)) && ((NU8)((*p).x->data[j])) <= ((NU8)(57)) || ((NU8)((*p).x->data[j])) >= ((NU8)(128)) && ((NU8)((*p).x->data[j])) <= ((NU8)(255)) || ((NU8)((*p).x->data[j])) == ((NU8)(46)) || ((NU8)((*p).x->data[j])) == ((NU8)(95)))) goto LA15;
				keyw = addChar(keyw, (*p).x->data[j]);
				j += ((NI) 1);
			} LA15: ;
		}
		scanpar_252057(p, j);
		LOC16 = 0;
		LOC16 = withinexpr_252139((&(*p)));
		if (LOC16) goto LA17;
		LOC16 = endswithopr_213450((*p).x);
		LA17: ;
		(*p).pendingexprline = LOC16;
		LOC18 = 0;
		LOC18 = whichkeyword_206400(keyw);
		switch (LOC18) {
		case ((NU16) 22):
		{
			NimStringDesc* LOC25;
			{
				if (!(((NI) 2) <= (*p).indent)) goto LA22;
				(*p).indent -= ((NI) 2);
			}
			goto LA20;
			LA22: ;
			{
				(*p).info.col = ((NI16) (j));
				localerror_196128((*p).info, ((NU16) 167), ((NimStringDesc*) &TMP1499));
			}
			LA20: ;
			LOC25 = 0;
			LOC25 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_213665((*p).outp, LOC25);
			llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1500));
		}
		break;
		case ((NU16) 31):
		case ((NU16) 65):
		case ((NU16) 60):
		case ((NU16) 66):
		case ((NU16) 27):
		case ((NU16) 7):
		case ((NU16) 9):
		case ((NU16) 51):
		case ((NU16) 38):
		case ((NU16) 14):
		case ((NU16) 40):
		case ((NU16) 59):
		case ((NU16) 41):
		{
			NimStringDesc* LOC27;
			NimStringDesc* LOC28;
			LOC27 = 0;
			LOC27 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_213665((*p).outp, LOC27);
			LOC28 = 0;
			LOC28 = copyStr((*p).x, d);
			llstreamwrite_213665((*p).outp, LOC28);
			(*p).indent += ((NI) 2);
		}
		break;
		case ((NU16) 20):
		case ((NU16) 48):
		case ((NU16) 21):
		case ((NU16) 24):
		case ((NU16) 26):
		{
			NimStringDesc* LOC30;
			NimStringDesc* LOC31;
			LOC30 = 0;
			LOC30 = nsuRepeatChar(32, ((NI) ((NI)((*p).indent - ((NI) 2)))));
			llstreamwrite_213665((*p).outp, LOC30);
			LOC31 = 0;
			LOC31 = copyStr((*p).x, d);
			llstreamwrite_213665((*p).outp, LOC31);
		}
		break;
		case ((NU16) 39):
		case ((NU16) 64):
		case ((NU16) 12):
		case ((NU16) 62):
		{
			NimStringDesc* LOC33;
			NimStringDesc* LOC34;
			LOC33 = 0;
			LOC33 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_213665((*p).outp, LOC33);
			LOC34 = 0;
			LOC34 = copyStr((*p).x, d);
			llstreamwrite_213665((*p).outp, LOC34);
			{
				NIM_BOOL LOC37;
				LOC37 = 0;
				LOC37 = contains_103975((*p).x, TMP1501);
				if (!!(LOC37)) goto LA38;
				(*p).indent += ((NI) 2);
			}
			LA38: ;
		}
		break;
		default:
		{
			NimStringDesc* LOC41;
			NimStringDesc* LOC42;
			LOC41 = 0;
			LOC41 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_213665((*p).outp, LOC41);
			LOC42 = 0;
			LOC42 = copyStr((*p).x, d);
			llstreamwrite_213665((*p).outp, LOC42);
		}
		break;
		}
		(*p).state = ((NU8) 0);
	}
	goto LA3;
	LA10: ;
	{
		(*p).par = ((NI) 0);
		(*p).curly = ((NI) 0);
		(*p).bracket = ((NI) 0);
		j = ((NI) 0);
		switch ((*p).state) {
		case ((NU8) 1):
		{
			NimStringDesc* LOC45;
			llstreamwrite_213665((*p).outp, (*p).conc);
			llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1497));
			LOC45 = 0;
			LOC45 = nsuRepeatChar(32, ((NI) ((NI)((*p).indent + ((NI) 2)))));
			llstreamwrite_213665((*p).outp, LOC45);
			llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1502));
		}
		break;
		case ((NU8) 0):
		{
			NimStringDesc* LOC47;
			newline_252047(p);
			LOC47 = 0;
			LOC47 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_213665((*p).outp, LOC47);
			llstreamwrite_213665((*p).outp, (*p).emit);
			llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1503));
			(*p).emitpar += ((NI) 1);
		}
		break;
		}
		(*p).state = ((NU8) 1);
		{
			while (1) {
				switch (((NU8)((*p).x->data[j]))) {
				case 0:
				{
					goto LA48;
				}
				break;
				case 1 ... 31:
				case 128 ... 255:
				{
					NimStringDesc* LOC52;
					llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1504));
					LOC52 = 0;
					LOC52 = nsuToHex(((NI64) (((NU8)((*p).x->data[j])))), ((NI) 2));
					llstreamwrite_213665((*p).outp, LOC52);
					j += ((NI) 1);
				}
				break;
				case 92:
				{
					llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1505));
					j += ((NI) 1);
				}
				break;
				case 39:
				{
					llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1506));
					j += ((NI) 1);
				}
				break;
				case 34:
				{
					llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1507));
					j += ((NI) 1);
				}
				break;
				default:
				{
					{
						if (!((NU8)((*p).x->data[j]) == (NU8)((*p).subschar))) goto LA59;
						j += ((NI) 1);
						switch (((NU8)((*p).x->data[j]))) {
						case 123:
						{
							(*p).info.col = ((NI16) (j));
							llstreamwrite_213696((*p).outp, 34);
							llstreamwrite_213665((*p).outp, (*p).conc);
							llstreamwrite_213665((*p).outp, (*p).tostr);
							llstreamwrite_213696((*p).outp, 40);
							j += ((NI) 1);
							curly = ((NI) 0);
							{
								while (1) {
									switch (((NU8)((*p).x->data[j]))) {
									case 0:
									{
										localerror_196128((*p).info, ((NU16) 193), ((NimStringDesc*) &TMP1508));
										goto LA62;
									}
									break;
									case 123:
									{
										j += ((NI) 1);
										curly += ((NI) 1);
										llstreamwrite_213696((*p).outp, 123);
									}
									break;
									case 125:
									{
										j += ((NI) 1);
										{
											if (!(curly == ((NI) 0))) goto LA69;
											goto LA62;
										}
										LA69: ;
										{
											if (!(((NI) 0) < curly)) goto LA73;
											curly -= ((NI) 1);
										}
										LA73: ;
										llstreamwrite_213696((*p).outp, 125);
									}
									break;
									default:
									{
										llstreamwrite_213696((*p).outp, (*p).x->data[j]);
										j += ((NI) 1);
									}
									break;
									}
								}
							} LA62: ;
							llstreamwrite_213696((*p).outp, 41);
							llstreamwrite_213665((*p).outp, (*p).conc);
							llstreamwrite_213696((*p).outp, 34);
						}
						break;
						case 97 ... 122:
						case 65 ... 90:
						case 128 ... 255:
						{
							llstreamwrite_213696((*p).outp, 34);
							llstreamwrite_213665((*p).outp, (*p).conc);
							llstreamwrite_213665((*p).outp, (*p).tostr);
							llstreamwrite_213696((*p).outp, 40);
							{
								while (1) {
									if (!(((NU8)((*p).x->data[j])) >= ((NU8)(97)) && ((NU8)((*p).x->data[j])) <= ((NU8)(122)) || ((NU8)((*p).x->data[j])) >= ((NU8)(65)) && ((NU8)((*p).x->data[j])) <= ((NU8)(90)) || ((NU8)((*p).x->data[j])) >= ((NU8)(48)) && ((NU8)((*p).x->data[j])) <= ((NU8)(57)) || ((NU8)((*p).x->data[j])) >= ((NU8)(128)) && ((NU8)((*p).x->data[j])) <= ((NU8)(255)) || ((NU8)((*p).x->data[j])) == ((NU8)(46)) || ((NU8)((*p).x->data[j])) == ((NU8)(95)))) goto LA78;
									llstreamwrite_213696((*p).outp, (*p).x->data[j]);
									j += ((NI) 1);
								} LA78: ;
							}
							llstreamwrite_213696((*p).outp, 41);
							llstreamwrite_213665((*p).outp, (*p).conc);
							llstreamwrite_213696((*p).outp, 34);
						}
						break;
						default:
						{
							{
								if (!((NU8)((*p).x->data[j]) == (NU8)((*p).subschar))) goto LA82;
								llstreamwrite_213696((*p).outp, (*p).subschar);
								j += ((NI) 1);
							}
							goto LA80;
							LA82: ;
							{
								(*p).info.col = ((NI16) (j));
								localerror_196128((*p).info, ((NU16) 171), ((NimStringDesc*) &TMP1496));
							}
							LA80: ;
						}
						break;
						}
					}
					goto LA57;
					LA59: ;
					{
						llstreamwrite_213696((*p).outp, (*p).x->data[j]);
						j += ((NI) 1);
					}
					LA57: ;
				}
				break;
				}
			}
		} LA48: ;
		llstreamwrite_213665((*p).outp, ((NimStringDesc*) &TMP1509));
	}
	LA3: ;
}

N_NIMCALL(Tllstream213204*, filtertmpl_252009)(Tllstream213204* stdin_252011, NimStringDesc* filename, Tnode225809* call) {
	Tllstream213204* result;
	Ttmplparser252020 p;
	result = 0;
	memset((void*)(&p), 0, sizeof(p));
	p.info = newlineinfo_191279(filename, ((NI) 0), ((NI) 0));
	p.outp = llstreamopen_213220(((NimStringDesc*) &TMP1488));
	p.inp = stdin_252011;
	p.subschar = chararg_251020(call, ((NimStringDesc*) &TMP1489), ((NI) 1), 36);
	p.nimdirective = chararg_251020(call, ((NimStringDesc*) &TMP1490), ((NI) 2), 35);
	p.emit = strarg_251029(call, ((NimStringDesc*) &TMP1491), ((NI) 3), ((NimStringDesc*) &TMP1492));
	p.conc = strarg_251029(call, ((NimStringDesc*) &TMP1493), ((NI) 4), ((NimStringDesc*) &TMP1494));
	p.tostr = strarg_251029(call, ((NimStringDesc*) &TMP1495), ((NI) 5), ((NimStringDesc*) &TMP1496));
	p.x = rawNewString(((NI) 120));
	{
		while (1) {
			NIM_BOOL LOC3;
			LOC3 = 0;
			LOC3 = llstreamreadline_213610(p.inp, (&p.x));
			if (!LOC3) goto LA2;
			p.info.line = (NI16)(p.info.line + ((NI16) 1));
			parseline_252149((&p));
		} LA2: ;
	}
	newline_252047((&p));
	result = p.outp;
	llstreamclose_213310(p.inp);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_filter_tmplInit000)(void) {
}

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

