/* 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 Tllstream212204 Tllstream212204;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tnode224809 Tnode224809;
typedef struct Ttmplparser251020 Ttmplparser251020;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttype224847 Ttype224847;
typedef struct Tsym224841 Tsym224841;
typedef struct Tident197021 Tident197021;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Tidobj197015 Tidobj197015;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tlib224827 Tlib224827;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY224932 TY224932;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Ttmplparser251020  {
Tllstream212204* inp;
NU8 state;
Tlineinfo189352 info;
NI indent;
NI emitpar;
NimStringDesc* x;
Tllstream212204* outp;
NIM_CHAR subschar;
NIM_CHAR nimdirective;
NimStringDesc* emit;
NimStringDesc* conc;
NimStringDesc* tostr;
NI curly;
NI bracket;
NI par;
NIM_BOOL pendingexprline;
};
typedef NU8 TY212407[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  Tllstream212204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
static N_INLINE(Tlineinfo189352, newlineinfo_190279)(NimStringDesc* filename, NI line, NI col);
N_NIMCALL(Tlineinfo189352, newlineinfo_190267)(NI32 fileinfoidx, NI line, NI col);
N_NIMCALL(NI32, fileinfoidx_190254)(NimStringDesc* filename);
N_NIMCALL(Tllstream212204*, llstreamopen_212220)(NimStringDesc* data);
N_NIMCALL(NIM_CHAR, chararg_250020)(Tnode224809* n, NimStringDesc* name, NI pos, NIM_CHAR default_250025);
N_NIMCALL(NimStringDesc*, strarg_250029)(Tnode224809* n, NimStringDesc* name, NI pos, NimStringDesc* default_250034);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, llstreamreadline_212610)(Tllstream212204* s, NimStringDesc** line);
N_NIMCALL(void, parseline_251149)(Ttmplparser251020* p);
N_NIMCALL(void, newline_251047)(Ttmplparser251020* p);
N_NIMCALL(void, llstreamwrite_212665)(Tllstream212204* 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_251057)(Ttmplparser251020* p, NI d);
static N_INLINE(NIM_BOOL, withinexpr_251139)(Ttmplparser251020* p);
N_NIMCALL(NIM_BOOL, endswithopr_212450)(NimStringDesc* x);
N_NIMCALL(NU16, whichkeyword_205400)(NimStringDesc* id);
N_NIMCALL(void, localerror_195128)(Tlineinfo189352 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, TY212407 chars);
N_NIMCALL(NimStringDesc*, nsuToHex)(NI64 x, NI len);
N_NIMCALL(void, llstreamwrite_212696)(Tllstream212204* s, NIM_CHAR data);
N_NIMCALL(void, llstreamclose_212310)(Tllstream212204* s);
STRING_LITERAL(TMP1487, "", 0);
STRING_LITERAL(TMP1488, "subschar", 8);
STRING_LITERAL(TMP1489, "metachar", 8);
STRING_LITERAL(TMP1490, "emit", 4);
STRING_LITERAL(TMP1491, "result.add", 10);
STRING_LITERAL(TMP1492, "conc", 4);
STRING_LITERAL(TMP1493, " & ", 3);
STRING_LITERAL(TMP1494, "tostring", 8);
STRING_LITERAL(TMP1495, "$", 1);
STRING_LITERAL(TMP1496, "\012", 1);
STRING_LITERAL(TMP1498, "end", 3);
STRING_LITERAL(TMP1499, "#end", 4);
static NIM_CONST TY212407 TMP1500 = {
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(TMP1501, "\"", 1);
STRING_LITERAL(TMP1502, "(\"", 2);
STRING_LITERAL(TMP1503, "\\x", 2);
STRING_LITERAL(TMP1504, "\\\\", 2);
STRING_LITERAL(TMP1505, "\\\'", 2);
STRING_LITERAL(TMP1506, "\\\"", 2);
STRING_LITERAL(TMP1507, "}", 1);
STRING_LITERAL(TMP1508, "\\n\"", 3);

static N_INLINE(Tlineinfo189352, newlineinfo_190279)(NimStringDesc* filename, NI line, NI col) {
	Tlineinfo189352 result;
	NI32 LOC1;
	memset((void*)(&result), 0, sizeof(result));
	LOC1 = 0;
	LOC1 = fileinfoidx_190254(filename);
	result = newlineinfo_190267(LOC1, line, col);
	return result;
}

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

N_NIMCALL(void, scanpar_251057)(Ttmplparser251020* 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_251139)(Ttmplparser251020* 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_251149)(Ttmplparser251020* 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_251047(p);
	}
	goto LA3;
	LA7: ;
	{
		NIM_BOOL LOC16;
		NU16 LOC18;
		if (!((NU8)((*p).x->data[j]) == (NU8)((*p).nimdirective))) goto LA10;
		newline_251047(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*) &TMP1487));
		{
			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_251057(p, j);
		LOC16 = 0;
		LOC16 = withinexpr_251139((&(*p)));
		if (LOC16) goto LA17;
		LOC16 = endswithopr_212450((*p).x);
		LA17: ;
		(*p).pendingexprline = LOC16;
		LOC18 = 0;
		LOC18 = whichkeyword_205400(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_195128((*p).info, ((NU16) 167), ((NimStringDesc*) &TMP1498));
			}
			LA20: ;
			LOC25 = 0;
			LOC25 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_212665((*p).outp, LOC25);
			llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1499));
		}
		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_212665((*p).outp, LOC27);
			LOC28 = 0;
			LOC28 = copyStr((*p).x, d);
			llstreamwrite_212665((*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_212665((*p).outp, LOC30);
			LOC31 = 0;
			LOC31 = copyStr((*p).x, d);
			llstreamwrite_212665((*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_212665((*p).outp, LOC33);
			LOC34 = 0;
			LOC34 = copyStr((*p).x, d);
			llstreamwrite_212665((*p).outp, LOC34);
			{
				NIM_BOOL LOC37;
				LOC37 = 0;
				LOC37 = contains_103975((*p).x, TMP1500);
				if (!!(LOC37)) goto LA38;
				(*p).indent += ((NI) 2);
			}
			LA38: ;
		}
		break;
		default:
		{
			NimStringDesc* LOC41;
			NimStringDesc* LOC42;
			LOC41 = 0;
			LOC41 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_212665((*p).outp, LOC41);
			LOC42 = 0;
			LOC42 = copyStr((*p).x, d);
			llstreamwrite_212665((*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_212665((*p).outp, (*p).conc);
			llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1496));
			LOC45 = 0;
			LOC45 = nsuRepeatChar(32, ((NI) ((NI)((*p).indent + ((NI) 2)))));
			llstreamwrite_212665((*p).outp, LOC45);
			llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1501));
		}
		break;
		case ((NU8) 0):
		{
			NimStringDesc* LOC47;
			newline_251047(p);
			LOC47 = 0;
			LOC47 = nsuRepeatChar(32, ((NI) ((*p).indent)));
			llstreamwrite_212665((*p).outp, LOC47);
			llstreamwrite_212665((*p).outp, (*p).emit);
			llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1502));
			(*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_212665((*p).outp, ((NimStringDesc*) &TMP1503));
					LOC52 = 0;
					LOC52 = nsuToHex(((NI64) (((NU8)((*p).x->data[j])))), ((NI) 2));
					llstreamwrite_212665((*p).outp, LOC52);
					j += ((NI) 1);
				}
				break;
				case 92:
				{
					llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1504));
					j += ((NI) 1);
				}
				break;
				case 39:
				{
					llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1505));
					j += ((NI) 1);
				}
				break;
				case 34:
				{
					llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1506));
					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_212696((*p).outp, 34);
							llstreamwrite_212665((*p).outp, (*p).conc);
							llstreamwrite_212665((*p).outp, (*p).tostr);
							llstreamwrite_212696((*p).outp, 40);
							j += ((NI) 1);
							curly = ((NI) 0);
							{
								while (1) {
									switch (((NU8)((*p).x->data[j]))) {
									case 0:
									{
										localerror_195128((*p).info, ((NU16) 193), ((NimStringDesc*) &TMP1507));
										goto LA62;
									}
									break;
									case 123:
									{
										j += ((NI) 1);
										curly += ((NI) 1);
										llstreamwrite_212696((*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_212696((*p).outp, 125);
									}
									break;
									default:
									{
										llstreamwrite_212696((*p).outp, (*p).x->data[j]);
										j += ((NI) 1);
									}
									break;
									}
								}
							} LA62: ;
							llstreamwrite_212696((*p).outp, 41);
							llstreamwrite_212665((*p).outp, (*p).conc);
							llstreamwrite_212696((*p).outp, 34);
						}
						break;
						case 97 ... 122:
						case 65 ... 90:
						case 128 ... 255:
						{
							llstreamwrite_212696((*p).outp, 34);
							llstreamwrite_212665((*p).outp, (*p).conc);
							llstreamwrite_212665((*p).outp, (*p).tostr);
							llstreamwrite_212696((*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_212696((*p).outp, (*p).x->data[j]);
									j += ((NI) 1);
								} LA78: ;
							}
							llstreamwrite_212696((*p).outp, 41);
							llstreamwrite_212665((*p).outp, (*p).conc);
							llstreamwrite_212696((*p).outp, 34);
						}
						break;
						default:
						{
							{
								if (!((NU8)((*p).x->data[j]) == (NU8)((*p).subschar))) goto LA82;
								llstreamwrite_212696((*p).outp, (*p).subschar);
								j += ((NI) 1);
							}
							goto LA80;
							LA82: ;
							{
								(*p).info.col = ((NI16) (j));
								localerror_195128((*p).info, ((NU16) 171), ((NimStringDesc*) &TMP1495));
							}
							LA80: ;
						}
						break;
						}
					}
					goto LA57;
					LA59: ;
					{
						llstreamwrite_212696((*p).outp, (*p).x->data[j]);
						j += ((NI) 1);
					}
					LA57: ;
				}
				break;
				}
			}
		} LA48: ;
		llstreamwrite_212665((*p).outp, ((NimStringDesc*) &TMP1508));
	}
	LA3: ;
}

N_NIMCALL(Tllstream212204*, filtertmpl_251009)(Tllstream212204* stdin_251011, NimStringDesc* filename, Tnode224809* call) {
	Tllstream212204* result;
	Ttmplparser251020 p;
	result = 0;
	memset((void*)(&p), 0, sizeof(p));
	p.info = newlineinfo_190279(filename, ((NI) 0), ((NI) 0));
	p.outp = llstreamopen_212220(((NimStringDesc*) &TMP1487));
	p.inp = stdin_251011;
	p.subschar = chararg_250020(call, ((NimStringDesc*) &TMP1488), ((NI) 1), 36);
	p.nimdirective = chararg_250020(call, ((NimStringDesc*) &TMP1489), ((NI) 2), 35);
	p.emit = strarg_250029(call, ((NimStringDesc*) &TMP1490), ((NI) 3), ((NimStringDesc*) &TMP1491));
	p.conc = strarg_250029(call, ((NimStringDesc*) &TMP1492), ((NI) 4), ((NimStringDesc*) &TMP1493));
	p.tostr = strarg_250029(call, ((NimStringDesc*) &TMP1494), ((NI) 5), ((NimStringDesc*) &TMP1495));
	p.x = rawNewString(((NI) 120));
	{
		while (1) {
			NIM_BOOL LOC3;
			LOC3 = 0;
			LOC3 = llstreamreadline_212610(p.inp, (&p.x));
			if (!LOC3) goto LA2;
			p.info.line = (NI16)(p.info.line + ((NI16) 1));
			parseline_251149((&p));
		} LA2: ;
	}
	newline_251047((&p));
	result = p.outp;
	llstreamclose_212310(p.inp);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_filter_tmplInit000)(void) {
}

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

