Ejemplo n.º 1
0
N_NIMCALL(TY185929*, select_182649)(Selector181456* s, NI timeout) {
	TY185929* result;
	int evnum;
{	result = 0;
	result = (TY185929*) newSeq((&NTI185929), 0);
	evnum = epoll_wait((*s).epollfd, (&(*s).events[(((NI) 0))- 0]), ((int) 64), ((int) (timeout)));
	{
		NI32 err;
		if (!(evnum < ((NI32) 0))) goto LA3;
		err = oslasterror_125034();
		{
			if (!(err == EINTR)) goto LA7;
			result = (TY185929*) newSeq((&NTI185929), 0);
			goto BeforeRet;
		}
		LA7: ;
		raiseoserror_125009(err, ((NimStringDesc*) &TMP1090));
	}
	LA3: ;
	{
		if (!(evnum == ((NI32) 0))) goto LA11;
		result = (TY185929*) newSeq((&NTI185929), 0);
		goto BeforeRet;
	}
	LA11: ;
	{
		int i_182731;
		int HEX3Atmp_183016;
		NI res_183019;
		i_182731 = 0;
		HEX3Atmp_183016 = 0;
		HEX3Atmp_183016 = (evnum - 1);
		res_183019 = ((NI) 0);
		{
			while (1) {
				int fd;
				NU8 evset;
				Selectorkey181439 selectorkey;
				Selectorkey181439* LOC30;
				Readyinfo181441 LOC31;
				if (!(res_183019 <= ((NI) (HEX3Atmp_183016)))) goto LA15;
				i_182731 = ((int) (res_183019));
				fd = (*s).events[(i_182731)- 0].data.fd;
				evset = 0;
				{
					NIM_BOOL LOC18;
					LOC18 = 0;
					LOC18 = !(((NU32)((*s).events[(i_182731)- 0].events & ((NI) 8)) == ((NI) 0)));
					if (LOC18) goto LA19;
					LOC18 = !(((NU32)((*s).events[(i_182731)- 0].events & ((NI) 16)) == ((NI) 0)));
					LA19: ;
					if (!LOC18) goto LA20;
					evset = (evset | 4);
				}
				LA20: ;
				{
					if (!!((((NI) ((NU32)((*s).events[(i_182731)- 0].events & ((NI) 1)))) == ((NI) 0)))) goto LA24;
					evset = (evset | 1);
				}
				LA24: ;
				{
					if (!!(((NU32)((*s).events[(i_182731)- 0].events & ((NI) 4)) == ((NI) 0)))) goto LA28;
					evset = (evset | 2);
				}
				LA28: ;
				memset((void*)(&selectorkey), 0, sizeof(selectorkey));
				LOC30 = 0;
				LOC30 = HEX5BHEX5D_181804((&(*s).fds), fd);
				selectorkey.fd = (*LOC30).fd;
				selectorkey.events = (*LOC30).events;
				selectorkey.data = (*LOC30).data;
				memset((void*)(&LOC31), 0, sizeof(LOC31));
				LOC31.Field0.fd = selectorkey.fd;
				LOC31.Field0.events = selectorkey.events;
				LOC31.Field0.data = selectorkey.data;
				LOC31.Field1 = evset;
				result = (TY185929*) incrSeq(&(result)->Sup, sizeof(Readyinfo181441));
				result->data[result->Sup.len-1].Field0.fd = LOC31.Field0.fd;
				result->data[result->Sup.len-1].Field0.events = LOC31.Field0.events;
				asgnRef((void**) (&result->data[result->Sup.len-1].Field0.data), LOC31.Field0.data);
				result->data[result->Sup.len-1].Field1 = LOC31.Field1;
				res_183019 += ((NI) 1);
			} LA15: ;
		}
	}
	}BeforeRet: ;
	return result;
}
Ejemplo n.º 2
0
N_NIMCALL(NI, nodetabletestorset_246928)(tnodetable186871* t, tnode186813* key, NI val) {
	NI result;
	tnodepairseq186869* n;
	NI k;
	NI index;
	nimfr("nodeTableTestOrSet", "treetab.nim")
	result = 0;
	n = 0;
	nimln(96, "treetab.nim");
	k = hashtree_246022(key);
	nimln(97, "treetab.nim");
	index = nodetablerawget_246475((*t), k, key);
	nimln(98, "treetab.nim");
	{
		nimln(98, "treetab.nim");
		if (!(0 <= index)) goto LA3;
		nimln(99, "treetab.nim");
		{
			nimln(99, "treetab.nim");
			nimln(99, "treetab.nim");
			nimln(99, "treetab.nim");
			if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			if (!!(!(((*t).Data->data[index].Key == NIM_NIL)))) goto LA7;
			nimln(99, "treetab.nim");
			failedassertimpl_79821(((NimStringDesc*) &TMP3210));
		}
		LA7: ;
		nimln(100, "treetab.nim");
		if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
		result = (*t).Data->data[index].Val;
	}
	goto LA1;
	LA3: ;
	{
		nimln(102, "treetab.nim");
		{
			NIM_BOOL LOC12;
			NI TMP3212;
			NI i_247068;
			NI HEX3Atmp_247121;
			NI res_247123;
			tnodepairseq186869* LOC20;
			nimln(102, "treetab.nim");
			nimln(102, "treetab.nim");
			LOC12 = 0;
			LOC12 = mustrehash_195187((*t).Data->Sup.len, (*t).Counter);
			if (!LOC12) goto LA13;
			nimln(103, "treetab.nim");
			nimln(103, "treetab.nim");
			nimln(103, "treetab.nim");
			TMP3212 = mulInt((*t).Data->Sup.len, 2);
			n = (tnodepairseq186869*) newSeq((&NTI186869), (NI32)(TMP3212));
			i_247068 = 0;
			HEX3Atmp_247121 = 0;
			nimln(104, "treetab.nim");
			nimln(104, "treetab.nim");
			HEX3Atmp_247121 = ((*t).Data->Sup.len-1);
			nimln(1450, "system.nim");
			res_247123 = 0;
			nimln(1451, "system.nim");
			while (1) {
				nimln(1451, "system.nim");
				if (!(res_247123 <= HEX3Atmp_247121)) goto LA15;
				nimln(1450, "system.nim");
				i_247068 = res_247123;
				nimln(105, "treetab.nim");
				{
					nimln(105, "treetab.nim");
					nimln(105, "treetab.nim");
					if ((NU)(i_247068) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if (!!(((*t).Data->data[i_247068].Key == NIM_NIL))) goto LA18;
					nimln(106, "treetab.nim");
					if ((NU)(i_247068) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_247068) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_247068) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					nodetablerawinsert_246514(&n, (*t).Data->data[i_247068].H, (*t).Data->data[i_247068].Key, (*t).Data->data[i_247068].Val);
				}
				LA18: ;
				nimln(1453, "system.nim");
				res_247123 = addInt(res_247123, 1);
			} LA15: ;
			nimln(107, "treetab.nim");
			LOC20 = 0;
			LOC20 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC20;
		}
		LA13: ;
		nimln(108, "treetab.nim");
		nodetablerawinsert_246514(&(*t).Data, k, key, val);
		nimln(109, "treetab.nim");
		result = val;
		nimln(110, "treetab.nim");
		(*t).Counter = addInt((*t).Counter, 1);
	}
	LA1: ;
	popFrame();
	return result;
}
Ejemplo n.º 3
0
N_NIMCALL(void, bitsetinit_242017)(tbitset242012** b, NI length) {
    nimfr("bitSetInit", "bitsets.nim")
    nimln(47, "bitsets.nim");
    unsureAsgnRef((void**) &(*b), (tbitset242012*) newSeq((&NTI242012), length));
    popFrame();
}
Ejemplo n.º 4
0
N_NIMCALL(void, bitsetinit_239021)(Tbitset239012** b, NI length) {
	nimfr("bitSetInit", "bitsets.nim")
	nimln(47, "bitsets.nim");
	unsureAsgnRef((void**) (&(*b)), (Tbitset239012*) newSeq((&NTI239012), ((NI)chckRange(length, ((NI) 0), ((NI) 2147483647)))));
	popFrame();
}
Ejemplo n.º 5
0
N_NIMCALL(void, nodetableput_223605)(tnodetable171717* t, tnode171659* key, NI val) {
	tnodepairseq171715* n;
	NI k;
	NI index;
	nimfr("NodeTablePut", "treetab.nim")
	n = 0;
	nimln(79, "treetab.nim");
	k = hashtree_223018(key);
	nimln(80, "treetab.nim");
	index = nodetablerawget_223378((*t), k, key);
	nimln(81, "treetab.nim");
	{
		nimln(702, "system.nim");
		if (!(0 <= index)) goto LA3;
		nimln(82, "treetab.nim");
		{
			nimln(82, "treetab.nim");
			nimln(82, "treetab.nim");
			nimln(82, "treetab.nim");
			if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			if (!!(!(((*t).Data->data[index].Key == NIM_NIL)))) goto LA7;
			nimln(82, "treetab.nim");
			hiddenraiseassert_76017(((NimStringDesc*) &TMP3155));		}		LA7: ;
		nimln(83, "treetab.nim");
		if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
		(*t).Data->data[index].Val = val;
	}	goto LA1;
	LA3: ;
	{
		nimln(85, "treetab.nim");
		{
			NIM_BOOL LOC12;
			NI TMP3156;
			NI i_223836;
			NI HEX3Atmp_223874;
			NI res_223876;
			tnodepairseq171715* LOC20;
			nimln(85, "treetab.nim");
			nimln(85, "treetab.nim");
			LOC12 = 0;
			LOC12 = mustrehash_178191((*t).Data->Sup.len, (*t).Counter);
			if (!LOC12) goto LA13;
			nimln(86, "treetab.nim");
			nimln(86, "treetab.nim");
			nimln(86, "treetab.nim");
			TMP3156 = mulInt((*t).Data->Sup.len, 2);
			n = (tnodepairseq171715*) newSeq((&NTI171715), (NI64)(TMP3156));
			i_223836 = 0;
			HEX3Atmp_223874 = 0;
			nimln(87, "treetab.nim");
			nimln(87, "treetab.nim");
			HEX3Atmp_223874 = ((*t).Data->Sup.len-1);
			nimln(1301, "system.nim");
			res_223876 = 0;
			nimln(1302, "system.nim");
			while (1) {
				nimln(1302, "system.nim");
				if (!(res_223876 <= HEX3Atmp_223874)) goto LA15;
				nimln(1301, "system.nim");
				i_223836 = res_223876;
				nimln(88, "treetab.nim");
				{
					nimln(698, "system.nim");
					nimln(698, "system.nim");
					if ((NU)(i_223836) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if (!!(((*t).Data->data[i_223836].Key == NIM_NIL))) goto LA18;
					nimln(89, "treetab.nim");
					if ((NU)(i_223836) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_223836) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_223836) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					nodetablerawinsert_223412(&n, (*t).Data->data[i_223836].H, (*t).Data->data[i_223836].Key, (*t).Data->data[i_223836].Val);				}				LA18: ;
				nimln(1304, "system.nim");
				res_223876 = addInt(res_223876, 1);
			} LA15: ;
			nimln(90, "treetab.nim");
			LOC20 = 0;
			LOC20 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC20;
		}		LA13: ;
		nimln(91, "treetab.nim");
		nodetablerawinsert_223412(&(*t).Data, k, key, val);		nimln(92, "treetab.nim");
		(*t).Counter = addInt((*t).Counter, 1);
	}	LA1: ;
	popFrame();
}
Ejemplo n.º 6
0
N_NIMCALL(void, newrecropetostr_144474)(NimStringDesc** result, NI* resultlen, trope144007* r) {
    tropeseq144009* stack;
    TY144497 LOC1;
    nimfr("newRecRopeToStr", "ropes.nim")
    nimln(173, "ropes.nim");
    nimln(173, "ropes.nim");
    stack = (tropeseq144009*) newSeq((&NTI144009), 1);
    memset((void*)LOC1, 0, sizeof(LOC1));
    LOC1[0] = r;
    asgnRefNoCycle((void**) &stack->data[0], LOC1[0]);
    nimln(174, "ropes.nim");
    while (1) {
        trope144007* it;
        nimln(174, "ropes.nim");
        nimln(174, "ropes.nim");
        if (!(0 < stack->Sup.len)) goto LA2;
        nimln(175, "ropes.nim");
        it = pop_144515(&stack);
        nimln(176, "ropes.nim");
        while (1) {
            nimln(176, "ropes.nim");
            if (!((*it).Data == NIM_NIL)) goto LA3;
            nimln(177, "ropes.nim");
            stack = (tropeseq144009*) incrSeq(&(stack)->Sup, sizeof(trope144007*));
            asgnRefNoCycle((void**) &stack->data[stack->Sup.len-1], (*it).Right);
            nimln(178, "ropes.nim");
            it = (*it).Left;
        }
LA3:
        ;
        nimln(179, "ropes.nim");
        {
            nimln(179, "ropes.nim");
            nimln(179, "ropes.nim");
            nimln(179, "ropes.nim");
            if (!!(!(((*it).Data == NIM_NIL)))) goto LA6;
            nimln(179, "ropes.nim");
            failedassertimpl_79821(((NimStringDesc*) &TMP548));
        }
LA6:
        ;
        nimln(180, "ropes.nim");
        if ((NU)((*resultlen)) > (NU)((*result)->Sup.len)) raiseIndexError();
        if ((NU)(0) > (NU)((*it).Data->Sup.len)) raiseIndexError();
        memcpy(((void*) (&(*result)->data[(*resultlen)])), ((void*) (&(*it).Data->data[0])), (*it).Length);
        nimln(181, "ropes.nim");
        (*resultlen) = addInt((*resultlen), (*it).Length);
        nimln(182, "ropes.nim");
        {
            nimln(182, "ropes.nim");
            nimln(182, "ropes.nim");
            nimln(182, "ropes.nim");
            if (!!(((*resultlen) <= (*result)->Sup.len))) goto LA10;
            nimln(182, "ropes.nim");
            failedassertimpl_79821(((NimStringDesc*) &TMP549));
        }
LA10:
        ;
    }
LA2:
    ;
    popFrame();
}
Ejemplo n.º 7
0
N_NIMCALL(void, bitsetinit_238021)(Tbitset238012** b, NI length) {
	unsureAsgnRef((void**) (&(*b)), (Tbitset238012*) newSeq((&NTI238012), ((NI) (length))));
}
Ejemplo n.º 8
0
N_NIMCALL(Processobj143402*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingdir, NimStringDesc** args, NI argsLen0, Stringtableobj134012* env, NU8 options) {
	Processobj143402* result;
	TY145025 pstdin;
	TY145025 pstdout;
	TY145025 pstderr;
	NimStringDesc* syscommand;
	TY122208* sysargsraw;
	pid_t volatile pid;
	NCSTRING* sysargs;
	TSafePoint TMP2889;
	result = 0;
	memset((void*)pstdin, 0, sizeof(pstdin));
	memset((void*)pstdout, 0, sizeof(pstdout));
	memset((void*)pstderr, 0, sizeof(pstderr));
	result = (Processobj143402*) newObj((&NTI143404), sizeof(Processobj143402));
	(*result).Sup.m_type = (&NTI143402);
	(*result).exitcode = ((int) -3);
	{
		if (!!(((options &(1<<((((NU8) 4))&7)))!=0))) goto LA3;
		{
			NIM_BOOL LOC7;
			NIM_BOOL LOC8;
			int LOC9;
			int LOC11;
			int LOC13;
			NI32 LOC16;
			LOC7 = 0;
			LOC8 = 0;
			LOC9 = 0;
			LOC9 = pipe(pstdin);
			LOC8 = !((LOC9 == ((NI32) 0)));
			if (LOC8) goto LA10;
			LOC11 = 0;
			LOC11 = pipe(pstdout);
			LOC8 = !((LOC11 == ((NI32) 0)));
			LA10: ;
			LOC7 = LOC8;
			if (LOC7) goto LA12;
			LOC13 = 0;
			LOC13 = pipe(pstderr);
			LOC7 = !((LOC13 == ((NI32) 0)));
			LA12: ;
			if (!LOC7) goto LA14;
			LOC16 = 0;
			LOC16 = oslasterror_117033();
			raiseoserror_117009(LOC16);
		}
		LA14: ;
	}
	LA3: ;
	syscommand = 0;
	sysargsraw = 0;
	{
		TY176063 LOC21;
		NimStringDesc* LOC22;
		NimStringDesc* LOC23;
		NimStringDesc* LOC24;
		if (!((options &(1<<((((NU8) 2))&7)))!=0)) goto LA19;
		syscommand = copyString(((NimStringDesc*) &TMP2887));
		sysargsraw = (TY122208*) newSeq((&NTI122208), 3);
		memset((void*)LOC21, 0, sizeof(LOC21));
		LOC21[0] = copyString(syscommand);
		LOC21[1] = copyString(((NimStringDesc*) &TMP2888));
		LOC21[2] = copyString(command);
		LOC22 = 0;
		LOC22 = sysargsraw->data[0]; sysargsraw->data[0] = copyStringRC1(LOC21[0]);
		if (LOC22) nimGCunrefNoCycle(LOC22);
		LOC23 = 0;
		LOC23 = sysargsraw->data[1]; sysargsraw->data[1] = copyStringRC1(LOC21[1]);
		if (LOC23) nimGCunrefNoCycle(LOC23);
		LOC24 = 0;
		LOC24 = sysargsraw->data[2]; sysargsraw->data[2] = copyStringRC1(LOC21[2]);
		if (LOC24) nimGCunrefNoCycle(LOC24);
	}
	goto LA17;
	LA19: ;
	{
		TY164580 LOC26;
		NimStringDesc* LOC27;
		syscommand = copyString(command);
		sysargsraw = (TY122208*) newSeq((&NTI122208), 1);
		memset((void*)LOC26, 0, sizeof(LOC26));
		LOC26[0] = copyString(command);
		LOC27 = 0;
		LOC27 = sysargsraw->data[0]; sysargsraw->data[0] = copyStringRC1(LOC26[0]);
		if (LOC27) nimGCunrefNoCycle(LOC27);
		{
			NimStringDesc* arg_145224;
			NI i_145481;
			arg_145224 = 0;
			i_145481 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC31;
					if (!(i_145481 < argsLen0)) goto LA30;
					arg_145224 = args[i_145481];
					sysargsraw = (TY122208*) incrSeq(&(sysargsraw)->Sup, sizeof(NimStringDesc*));
					LOC31 = 0;
					LOC31 = sysargsraw->data[sysargsraw->Sup.len-1]; sysargsraw->data[sysargsraw->Sup.len-1] = copyStringRC1(arg_145224);
					if (LOC31) nimGCunrefNoCycle(LOC31);
					i_145481 += ((NI) 1);
				} LA30: ;
			}
		}
	}
	LA17: ;
	pid = 0;
	sysargs = alloccstringarray_14201(sysargsraw->data, sysargsraw->Sup.len);
	pushSafePoint(&TMP2889);
	TMP2889.status = _setjmp(TMP2889.context);
	if (TMP2889.status == 0) {
		NCSTRING* sysenv;
		TSafePoint TMP2891;
		{
			if (!(env == NIM_NIL)) goto LA35;
			sysenv = envtocstringarray_144854();
		}
		goto LA33;
		LA35: ;
		{
			sysenv = envtocstringarray_144806(env);
		}
		LA33: ;
		pushSafePoint(&TMP2891);
		TMP2891.status = _setjmp(TMP2891.context);
		if (TMP2891.status == 0) {
			Tstartprocessdata144948 data;
			memset((void*)(&data), 0, sizeof(data));
			data.syscommand = syscommand->data;
			data.sysargs = sysargs;
			data.sysenv = sysenv;
			memcpy((void*)data.pstdin, (NIM_CONST void*)pstdin, sizeof(data.pstdin));
			memcpy((void*)data.pstdout, (NIM_CONST void*)pstdout, sizeof(data.pstdout));
			memcpy((void*)data.pstderr, (NIM_CONST void*)pstderr, sizeof(data.pstderr));
			data.optionpoparentstreams = ((options &(1<<((((NU8) 4))&7)))!=0);
			data.optionpousepath = ((options &(1<<((((NU8) 1))&7)))!=0);
			data.optionpostderrtostdout = ((options &(1<<((((NU8) 3))&7)))!=0);
			data.workingdir = workingdir->data;
			pid = startprocessauxspawn_145001((&data));
			{
				NimStringDesc* LOC43;
				if (!((options &(1<<((((NU8) 0))&7)))!=0)) goto LA41;
				LOC43 = 0;
				LOC43 = nsuJoinSep(args, argsLen0, ((NimStringDesc*) &TMP2892));
				printf("%s%s%s\012", command? (command)->data:"nil", ((NimStringDesc*) &TMP2892)? (((NimStringDesc*) &TMP2892))->data:"nil", LOC43? (LOC43)->data:"nil");
			}
			LA41: ;
			(*result).id = pid;
			{
				if (!((options &(1<<((((NU8) 4))&7)))!=0)) goto LA46;
				(*result).inhandle = ((int) 0);
				(*result).outhandle = ((int) 1);
				{
					if (!((options &(1<<((((NU8) 3))&7)))!=0)) goto LA50;
					(*result).errhandle = (*result).outhandle;
				}
				goto LA48;
				LA50: ;
				{
					(*result).errhandle = ((int) 2);
				}
				LA48: ;
			}
			goto LA44;
			LA46: ;
			{
				int LOC60;
				int LOC61;
				int LOC62;
				(*result).inhandle = pstdin[(((NI) 1))- 0];
				(*result).outhandle = pstdout[(((NI) 0))- 0];
				{
					int LOC58;
					if (!((options &(1<<((((NU8) 3))&7)))!=0)) goto LA56;
					(*result).errhandle = (*result).outhandle;
					LOC58 = 0;
					LOC58 = close(pstderr[(((NI) 0))- 0]);
				}
				goto LA54;
				LA56: ;
				{
					(*result).errhandle = pstderr[(((NI) 0))- 0];
				}
				LA54: ;
				LOC60 = 0;
				LOC60 = close(pstderr[(((NI) 1))- 0]);
				LOC61 = 0;
				LOC61 = close(pstdin[(((NI) 0))- 0]);
				LOC62 = 0;
				LOC62 = close(pstdout[(((NI) 1))- 0]);
			}
			LA44: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			dealloccstringarray_14450(sysenv);
		}
		if (TMP2891.status != 0) reraiseException();
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		dealloccstringarray_14450(sysargs);
	}
	if (TMP2889.status != 0) reraiseException();
	return result;
}
Ejemplo n.º 9
0
N_NIMCALL(NIM_BOOL, equalsfile_173403)(Ropeobj172006* r, FILE* f) {
	NIM_BOOL result;
	TY173409 buf;
	NI bpos;
	NI blen;
	NI LOC26;
{	result = 0;
	memset((void*)buf, 0, sizeof(buf));
	bpos = ((NI) 1024);
	blen = ((NI) 1024);
	{
		NimStringDesc* s_173431;
		s_173431 = 0;
		{
			TY184350* stack_173480;
			TY172507 LOC6;
			if (!!((r == NIM_NIL))) goto LA4;
			stack_173480 = (TY184350*) newSeq((&NTI184350), 1);
			memset((void*)LOC6, 0, sizeof(LOC6));
			LOC6[0] = r;
			asgnRefNoCycle((void**) (&stack_173480->data[0]), LOC6[0]);
			{
				while (1) {
					Ropeobj172006* it_173482;
					NI spos;
					NI slen;
					if (!(((NI) 0) < (stack_173480 ? stack_173480->Sup.len : 0))) goto LA8;
					it_173482 = pop_172530((&stack_173480));
					{
						while (1) {
							if (!(*it_173482).data == 0) goto LA10;
							stack_173480 = (TY184350*) incrSeqV2(&(stack_173480)->Sup, sizeof(Ropeobj172006*));
							asgnRefNoCycle((void**) (&stack_173480->data[stack_173480->Sup.len]), (*it_173482).right);
							++stack_173480->Sup.len;
							it_173482 = (*it_173482).left;
						} LA10: ;
					}
					s_173431 = (*it_173482).data;
					spos = ((NI) 0);
					slen = (s_173431 ? s_173431->Sup.len : 0);
					{
						while (1) {
							NI n;
							if (!(spos < slen)) goto LA12;
							{
								if (!(bpos == blen)) goto LA15;
								bpos = ((NI) 0);
								blen = readbuffer_15554(f, ((void*) ((&buf[(((NI) 0))- 0]))), ((NI) 1024));
								{
									if (!(blen == ((NI) 0))) goto LA19;
									result = NIM_FALSE;
									goto BeforeRet;
								}
								LA19: ;
							}
							LA15: ;
							n = (((NI)(blen - bpos) <= (NI)(slen - spos)) ? (NI)(blen - bpos) : (NI)(slen - spos));
							{
								NIM_BOOL LOC23;
								LOC23 = 0;
								LOC23 = equalMem(((void*) ((&buf[(bpos)- 0]))), ((void*) ((NI)(((NI) (s_173431->data)) + spos))), ((NI) (n)));
								if (!!(LOC23)) goto LA24;
								result = NIM_FALSE;
								goto BeforeRet;
							}
							LA24: ;
							spos += n;
							bpos += n;
						} LA12: ;
					}
				} LA8: ;
			}
		}
		LA4: ;
	}
	LOC26 = 0;
	LOC26 = readbuffer_15554(f, ((void*) ((&buf[(((NI) 0))- 0]))), ((NI) 1));
	result = (LOC26 == ((NI) 0));
	}BeforeRet: ;
	return result;
}
Ejemplo n.º 10
0
N_NIMCALL(void, iitableput_299156_2984716966)(Tiitable299142* t0, NI key0, NI val0) {
	NI index0;
	index0 = iitablerawget_304562_2984716966((*t0), key0);
	{
		if (!(((NI) 0) <= index0)) goto LA3;
		(*t0).data->data[index0].val = val0;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tiipairseq299140* n0;
			Tiipairseq299140* LOC21;
			LOC8 = (NIM_BOOL)0;
			LOC8 = mustrehash_299126_2984716966(((*t0).data ? (*t0).data->Sup.len : 0), (*t0).counter);
			if (!LOC8) goto LA9;
			n0 = (Tiipairseq299140*)0;
			n0 = (Tiipairseq299140*) newSeq((&NTI299140), ((NI) ((NI)(((*t0).data ? (*t0).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_305039_2984716966;
				NI HEX3Atmp_305075_2984716966;
				NI res_305078_2984716966;
				i_305039_2984716966 = (NI)0;
				HEX3Atmp_305075_2984716966 = (NI)0;
				HEX3Atmp_305075_2984716966 = (n0 ? (n0->Sup.len-1) : -1);
				res_305078_2984716966 = ((NI) 0);
				{
					while (1) {
						if (!(res_305078_2984716966 <= HEX3Atmp_305075_2984716966)) goto LA13;
						i_305039_2984716966 = res_305078_2984716966;
						n0->data[i_305039_2984716966].key = ((NI) (IL64(-9223372036854775807) - IL64(1)));
						res_305078_2984716966 += ((NI) 1);
					} LA13: ;
				}
			}
			{
				NI i_305051_2984716966;
				NI HEX3Atmp_305083_2984716966;
				NI res_305086_2984716966;
				i_305051_2984716966 = (NI)0;
				HEX3Atmp_305083_2984716966 = (NI)0;
				HEX3Atmp_305083_2984716966 = ((*t0).data ? ((*t0).data->Sup.len-1) : -1);
				res_305086_2984716966 = ((NI) 0);
				{
					while (1) {
						if (!(res_305086_2984716966 <= HEX3Atmp_305083_2984716966)) goto LA16;
						i_305051_2984716966 = res_305086_2984716966;
						{
							if (!!(((*t0).data->data[i_305051_2984716966].key == ((NI) (IL64(-9223372036854775807) - IL64(1)))))) goto LA19;
							iitablerawinsert_304576_2984716966((&n0), (*t0).data->data[i_305051_2984716966].key, (*t0).data->data[i_305051_2984716966].val);
						}
						LA19: ;
						res_305086_2984716966 += ((NI) 1);
					} LA16: ;
				}
			}
			LOC21 = (Tiipairseq299140*)0;
			LOC21 = (*t0).data;
			unsureAsgnRef((void**) (&(*t0).data), n0);
			n0 = LOC21;
		}
		LA9: ;
		iitablerawinsert_304576_2984716966((&(*t0).data), key0, val0);
		(*t0).counter += ((NI) 1);
	}
	LA1: ;
}
Ejemplo n.º 11
0
N_NIMCALL(NI, nospexecProcesses)(NimStringDesc** cmds, NI cmdsLen0, NU8 options_143795, NI n, TY171656 beforerunevent) {
	NI result;
	NU8 options;
	result = 0;
	options = (options_143795 & ~ 16);
	{
		TY144201* q;
		NI m;
		NI i;
		if (!(((NI) 1) < n)) goto LA3;
		q = 0;
		q = (TY144201*) newSeq((&NTI144201), ((NI) (n)));
		m = ((n <= cmdsLen0) ? n : cmdsLen0);
		{
			NI i_144235;
			NI HEX3Atmp_144536;
			NI res_144539;
			i_144235 = 0;
			HEX3Atmp_144536 = 0;
			HEX3Atmp_144536 = (NI)(m - ((NI) 1));
			res_144539 = ((NI) 0);
			{
				while (1) {
					TY219714 LOC12;
					if (!(res_144539 <= HEX3Atmp_144536)) goto LA7;
					i_144235 = res_144539;
					{
						if (!!((beforerunevent.ClPrc == TMP4336.ClPrc && beforerunevent.ClEnv == TMP4336.ClEnv))) goto LA10;
						beforerunevent.ClEnv? beforerunevent.ClPrc(i_144235, beforerunevent.ClEnv):((TMP4337)(beforerunevent.ClPrc))(i_144235);
					}
					LA10: ;
					memset((void*)LOC12, 0, sizeof(LOC12));
					asgnRef((void**) (&q->data[i_144235]), nospstartProcess(cmds[i_144235], ((NimStringDesc*) &TMP4338), LOC12, 0, NIM_NIL, (options | 4)));
					res_144539 += ((NI) 1);
				} LA7: ;
			}
		}
		i = m;
		{
			while (1) {
				if (!(i <= (cmdsLen0-1))) goto LA14;
				nossleep(((NI) 50));
				{
					NI r_144413;
					NI HEX3Atmp_144545;
					NI res_144548;
					r_144413 = 0;
					HEX3Atmp_144545 = 0;
					HEX3Atmp_144545 = (NI)(n - ((NI) 1));
					res_144548 = ((NI) 0);
					{
						while (1) {
							if (!(res_144548 <= HEX3Atmp_144545)) goto LA17;
							r_144413 = res_144548;
							{
								NIM_BOOL LOC20;
								NI LOC23;
								TY219714 LOC32;
								LOC20 = 0;
								LOC20 = nosprunning(q->data[r_144413]);
								if (!!(LOC20)) goto LA21;
								LOC23 = 0;
								LOC23 = nospwaitForExit(q->data[r_144413], ((NI) -1));
								result = ((LOC23 >= result) ? LOC23 : result);
								{
									if (!!((q->data[r_144413] == NIM_NIL))) goto LA26;
									nospclose(q->data[r_144413]);
								}
								LA26: ;
								{
									if (!!((beforerunevent.ClPrc == TMP4336.ClPrc && beforerunevent.ClEnv == TMP4336.ClEnv))) goto LA30;
									beforerunevent.ClEnv? beforerunevent.ClPrc(i, beforerunevent.ClEnv):((TMP4339)(beforerunevent.ClPrc))(i);
								}
								LA30: ;
								memset((void*)LOC32, 0, sizeof(LOC32));
								asgnRef((void**) (&q->data[r_144413]), nospstartProcess(cmds[i], ((NimStringDesc*) &TMP4338), LOC32, 0, NIM_NIL, (options | 4)));
								i += ((NI) 1);
								{
									if (!((cmdsLen0-1) < i)) goto LA35;
									goto LA15;
								}
								LA35: ;
							}
							LA21: ;
							res_144548 += ((NI) 1);
						} LA17: ;
					}
				} LA15: ;
			} LA14: ;
		}
		{
			NI j_144475;
			NI HEX3Atmp_144553;
			NI res_144556;
			j_144475 = 0;
			HEX3Atmp_144553 = 0;
			HEX3Atmp_144553 = (NI)(m - ((NI) 1));
			res_144556 = ((NI) 0);
			{
				while (1) {
					NI LOC40;
					if (!(res_144556 <= HEX3Atmp_144553)) goto LA39;
					j_144475 = res_144556;
					LOC40 = 0;
					LOC40 = nospwaitForExit(q->data[j_144475], ((NI) -1));
					result = ((LOC40 >= result) ? LOC40 : result);
					{
						if (!!((q->data[j_144475] == NIM_NIL))) goto LA43;
						nospclose(q->data[j_144475]);
					}
					LA43: ;
					res_144556 += ((NI) 1);
				} LA39: ;
			}
		}
	}
	goto LA1;
	LA3: ;
	{
		{
			NI i_144502;
			NI HEX3Atmp_144561;
			NI res_144564;
			i_144502 = 0;
			HEX3Atmp_144561 = 0;
			HEX3Atmp_144561 = (cmdsLen0-1);
			res_144564 = ((NI) 0);
			{
				while (1) {
					Processobj143402* p;
					TY219714 LOC53;
					NI LOC54;
					if (!(res_144564 <= HEX3Atmp_144561)) goto LA48;
					i_144502 = res_144564;
					{
						if (!!((beforerunevent.ClPrc == TMP4336.ClPrc && beforerunevent.ClEnv == TMP4336.ClEnv))) goto LA51;
						beforerunevent.ClEnv? beforerunevent.ClPrc(i_144502, beforerunevent.ClEnv):((TMP4340)(beforerunevent.ClPrc))(i_144502);
					}
					LA51: ;
					memset((void*)LOC53, 0, sizeof(LOC53));
					p = nospstartProcess(cmds[i_144502], ((NimStringDesc*) &TMP4338), LOC53, 0, NIM_NIL, (options | 4));
					LOC54 = 0;
					LOC54 = nospwaitForExit(p, ((NI) -1));
					result = ((LOC54 >= result) ? LOC54 : result);
					nospclose(p);
					res_144564 += ((NI) 1);
				} LA48: ;
			}
		}
	}
	LA1: ;
	return result;
}
Ejemplo n.º 12
0
N_NIMCALL(void, bitsetinit_340008_3966472399)(Tbitset340004** b0, NI length0) {
	unsureAsgnRef((void**) (&(*b0)), (Tbitset340004*) newSeq((&NTI340004), ((NI) (length0))));
}
Ejemplo n.º 13
0
N_NIMCALL(void, methoddef_433628_3853300031)(Tsym294834* s0, NIM_BOOL fromcache0) {
	NI L0;
	Tsym294834* witness0;
	TY433227 LOC19;
	TY346318 LOC20;
{	L0 = (gmethods_433246_3853300031 ? gmethods_433246_3853300031->Sup.len : 0);
	witness0 = (Tsym294834*)0;
	{
		NI i_433653_3853300031;
		NI HEX3Atmp_433889_3853300031;
		NI res_433892_3853300031;
		i_433653_3853300031 = (NI)0;
		HEX3Atmp_433889_3853300031 = (NI)0;
		HEX3Atmp_433889_3853300031 = (NI)(L0 - ((NI) 1));
		res_433892_3853300031 = ((NI) 0);
		{
			while (1) {
				Tsym294834* disp0;
				Methodresult433249 LOC4;
				if (!(res_433892_3853300031 <= HEX3Atmp_433889_3853300031)) goto LA3;
				i_433653_3853300031 = res_433892_3853300031;
				disp0 = gmethods_433246_3853300031->data[i_433653_3853300031].Field1;
				LOC4 = (Methodresult433249)0;
				LOC4 = samemethodbucket_433253_3853300031(disp0, s0);
				switch (LOC4) {
				case ((Methodresult433249) 2):
				{
					Tnode294802* LOC6;
					gmethods_433246_3853300031->data[i_433653_3853300031].Field0 = (Tsymseq294804*) incrSeqV2(&(gmethods_433246_3853300031->data[i_433653_3853300031].Field0)->Sup, sizeof(Tsym294834*));
					asgnRefNoCycle((void**) (&gmethods_433246_3853300031->data[i_433653_3853300031].Field0->data[gmethods_433246_3853300031->data[i_433653_3853300031].Field0->Sup.len]), s0);
					++gmethods_433246_3853300031->data[i_433653_3853300031].Field0->Sup.len;
					LOC6 = (Tnode294802*)0;
					LOC6 = lastson_297364_850551059((*disp0).ast);
					attachdispatcher_433362_3853300031(s0, LOC6);
					fixupdispatcher_433466_3853300031(s0, disp0);
					checkmethodeffects_405033_422813333(disp0, s0);
					{
						NIM_BOOL LOC9;
						LOC9 = (NIM_BOOL)0;
						LOC9 = (((*s0).flags &(1U<<((NU)(((Tsymflag294184) 18))&31U)))!=0);
						if (!(LOC9)) goto LA10;
						LOC9 = !((gmethods_433246_3853300031->data[i_433653_3853300031].Field0->data[((NI) 0)] == s0));
						LA10: ;
						if (!LOC9) goto LA11;
						localerror_198085_155036129((*s0).info, ((NimStringDesc*) &T3853300031_6));
					}
					LA11: ;
					goto BeforeRet;
				}
				break;
				case ((Methodresult433249) 0):
				{
				}
				break;
				case ((Methodresult433249) 1):
				{
					{
						if (!witness0 == 0) goto LA17;
						witness0 = gmethods_433246_3853300031->data[i_433653_3853300031].Field0->data[((NI) 0)];
					}
					LA17: ;
				}
				break;
				}
				res_433892_3853300031 += ((NI) 1);
			} LA3: ;
		}
	}
	memset((void*)(&LOC19), 0, sizeof(LOC19));
	LOC19.Field0 = (Tsymseq294804*) newSeq((&NTI294804), 1);
	memset((void*)LOC20, 0, sizeof(LOC20));
	LOC20[0] = s0;
	asgnRefNoCycle((void**) (&LOC19.Field0->data[0]), LOC20[0]);
	LOC19.Field1 = createdispatcher_433397_3853300031(s0);
	gmethods_433246_3853300031 = (TY433226*) incrSeqV2(&(gmethods_433246_3853300031)->Sup, sizeof(TY433227));
	genericSeqAssign((&gmethods_433246_3853300031->data[gmethods_433246_3853300031->Sup.len].Field0), LOC19.Field0, (&NTI294804));
	asgnRefNoCycle((void**) (&gmethods_433246_3853300031->data[gmethods_433246_3853300031->Sup.len].Field1), LOC19.Field1);
	++gmethods_433246_3853300031->Sup.len;
	{
		if (!fromcache0) goto LA23;
		internalerror_198100_155036129((*s0).info, ((NimStringDesc*) &T3853300031_7));
	}
	LA23: ;
	{
		NimStringDesc* LOC29;
		NimStringDesc* LOC30;
		if (!!((witness0 == NIM_NIL))) goto LA27;
		LOC29 = (NimStringDesc*)0;
		LOC30 = (NimStringDesc*)0;
		LOC30 = HEX24_194431_155036129((*witness0).info);
		LOC29 = rawNewString((*(*s0).name).s->Sup.len + LOC30->Sup.len + 68);
appendString(LOC29, ((NimStringDesc*) &T3853300031_8));
appendString(LOC29, (*(*s0).name).s);
appendString(LOC29, ((NimStringDesc*) &T3853300031_9));
appendString(LOC29, LOC30);
		localerror_198085_155036129((*s0).info, LOC29);
	}
	goto LA25;
	LA27: ;
	{
		if (!!((((*s0).flags &(1U<<((NU)(((Tsymflag294184) 18))&31U)))!=0))) goto LA32;
		message_198095_155036129((*s0).info, ((Tmsgkind193002) 252), ((NimStringDesc*) &T3853300031_10));
	}
	goto LA25;
	LA32: ;
	LA25: ;
	}BeforeRet: ;
}
Ejemplo n.º 14
0
N_NIMCALL(NIM_BOOL, equalsfile_162809)(Ropeobj161009* r, FILE* f) {
	NIM_BOOL result;
	TY162814 buf;
	NI bpos;
	NI blen;
	NI LOC26;
{	result = 0;
	memset((void*)buf, 0, sizeof(buf));
	bpos = ((NI) 1024);
	blen = ((NI) 1024);
	{
		NimStringDesc* s_162837;
		s_162837 = 0;
		{
			TY163351* stack_162886;
			TY161585 LOC6;
			if (!!((r == NIM_NIL))) goto LA4;
			stack_162886 = (TY163351*) newSeq((&NTI163351), 1);
			memset((void*)LOC6, 0, sizeof(LOC6));
			LOC6[0] = r;
			asgnRefNoCycle((void**) (&stack_162886->data[0]), LOC6[0]);
			{
				while (1) {
					Ropeobj161009* it_162888;
					NI spos;
					NI slen;
					if (!(((NI) 0) < (stack_162886 ? stack_162886->Sup.len : 0))) goto LA8;
					it_162888 = pop_161597((&stack_162886));
					{
						while (1) {
							if (!(*it_162888).data == 0) goto LA10;
							stack_162886 = (TY163351*) incrSeq(&(stack_162886)->Sup, sizeof(Ropeobj161009*));
							asgnRefNoCycle((void**) (&stack_162886->data[stack_162886->Sup.len-1]), (*it_162888).right);
							it_162888 = (*it_162888).left;
						} LA10: ;
					}
					s_162837 = (*it_162888).data;
					spos = ((NI) 0);
					slen = (s_162837 ? s_162837->Sup.len : 0);
					{
						while (1) {
							NI n;
							if (!(spos < slen)) goto LA12;
							{
								if (!(bpos == blen)) goto LA15;
								bpos = ((NI) 0);
								blen = readbuffer_13515(f, ((void*) ((&buf[(((NI) 0))- 0]))), ((NI) 1024));
								{
									if (!(blen == ((NI) 0))) goto LA19;
									result = NIM_FALSE;
									goto BeforeRet;
								}
								LA19: ;
							}
							LA15: ;
							n = (((NI)(blen - bpos) <= (NI)(slen - spos)) ? (NI)(blen - bpos) : (NI)(slen - spos));
							{
								NIM_BOOL LOC23;
								LOC23 = 0;
								LOC23 = equalMem(((void*) ((&buf[(bpos)- 0]))), ((void*) ((NI)(((NI) (s_162837->data)) + spos))), ((NI) (n)));
								if (!!(LOC23)) goto LA24;
								result = NIM_FALSE;
								goto BeforeRet;
							}
							LA24: ;
							spos += n;
							bpos += n;
						} LA12: ;
					}
				} LA8: ;
			}
		}
		LA4: ;
	}
	LOC26 = 0;
	LOC26 = readbuffer_13515(f, ((void*) ((&buf[(((NI) 0))- 0]))), ((NI) 1));
	result = (LOC26 == ((NI) 0));
	}BeforeRet: ;
	return result;
}
Ejemplo n.º 15
0
N_NIMCALL(void, inittable_383471)(NI initialsize, Table382650* Result) {
    (*Result).counter = ((NI) 0);
    unsureAsgnRef((void**) (&(*Result).data), (Keyvaluepairseq382653*) newSeq((&NTI382653), ((NI) (initialsize))));
}
Ejemplo n.º 16
0
N_NOINLINE(void, mainInit)(void) {
asgnRefNoCycle((void**) &Compmods_191227, (TY191208*) newSeq(NTI191208, 0));
}
Ejemplo n.º 17
0
N_NIMCALL(NI32, newcrcfromropeaux_146063)(trope144007* r, NI32 startval) {
    NI32 result;
    tropeseq144009* stack;
    TY144497 LOC1;
    nimfr("newCrcFromRopeAux", "ropes.nim")
    result = 0;
    nimln(337, "ropes.nim");
    nimln(337, "ropes.nim");
    stack = (tropeseq144009*) newSeq((&NTI144009), 1);
    memset((void*)LOC1, 0, sizeof(LOC1));
    LOC1[0] = r;
    asgnRefNoCycle((void**) &stack->data[0], LOC1[0]);
    nimln(338, "ropes.nim");
    result = startval;
    nimln(339, "ropes.nim");
    while (1) {
        trope144007* it;
        NI i;
        NI l;
        nimln(339, "ropes.nim");
        nimln(339, "ropes.nim");
        if (!(0 < stack->Sup.len)) goto LA2;
        nimln(340, "ropes.nim");
        it = pop_144515(&stack);
        nimln(341, "ropes.nim");
        while (1) {
            nimln(341, "ropes.nim");
            if (!((*it).Data == NIM_NIL)) goto LA3;
            nimln(342, "ropes.nim");
            stack = (tropeseq144009*) incrSeq(&(stack)->Sup, sizeof(trope144007*));
            asgnRefNoCycle((void**) &stack->data[stack->Sup.len-1], (*it).Right);
            nimln(343, "ropes.nim");
            it = (*it).Left;
        }
LA3:
        ;
        nimln(344, "ropes.nim");
        {
            nimln(344, "ropes.nim");
            nimln(344, "ropes.nim");
            nimln(344, "ropes.nim");
            if (!!(!(((*it).Data == NIM_NIL)))) goto LA6;
            nimln(344, "ropes.nim");
            failedassertimpl_79821(((NimStringDesc*) &TMP548));
        }
LA6:
        ;
        nimln(345, "ropes.nim");
        i = 0;
        nimln(346, "ropes.nim");
        nimln(346, "ropes.nim");
        l = (*it).Data->Sup.len;
        nimln(347, "ropes.nim");
        while (1) {
            nimln(347, "ropes.nim");
            if (!(i < l)) goto LA8;
            nimln(348, "ropes.nim");
            if ((NU)(i) > (NU)((*it).Data->Sup.len)) raiseIndexError();
            result = updatecrc32_143017((*it).Data->data[i], result);
            nimln(349, "ropes.nim");
            i = addInt(i, 1);
        }
LA8:
        ;
    }
LA2:
    ;
    popFrame();
    return result;
}
Ejemplo n.º 18
0
N_NIMCALL(void, inittable_302063)(NI initialsize, Table300371* Result) {
	(*Result).counter = ((NI) 0);
	unsureAsgnRef((void**) (&(*Result).data), (Keyvaluepairseq300374*) newSeq((&NTI300374), ((NI) (initialsize))));
}
Ejemplo n.º 19
0
N_NOINLINE(void, nimconfInit)(void) {
asgnRefNoCycle((void**) &Condstack_80133, (TY80132*) newSeq(NTI80132, 0));
}
Ejemplo n.º 20
0
N_NIMCALL(void, inittable_321061)(NI initialsize, Table321033* Result) {
	(*Result).counter = ((NI) 0);
	unsureAsgnRef((void**) (&(*Result).data), (Keyvaluepairseq321036*) newSeq((&NTI321036), ((NI) (initialsize))));
}
Ejemplo n.º 21
0
N_NIMCALL(void, bitsetinit_238021)(Tbitset238012** b, NI length) {
	nimfr("bitSetInit", "bitsets.nim")
	nimln(47, "bitsets.nim");
	unsureAsgnRef((void**) (&(*b)), (Tbitset238012*) newSeq((&NTI238012), ((NI)chckRange(length, ((NI) 0), ((NI) IL64(9223372036854775807))))));
	popFrame();
}
Ejemplo n.º 22
0
N_NIMCALL(void, bitsetinit_218015)(tbitset218010** b, NI length) {
	nimfr("BitSetInit", "bitsets.nim")
	nimln(47, "bitsets.nim");
	unsureAsgnRef((void**) &(*b), (tbitset218010*) newSeq((&NTI218010), length));
	popFrame();
}
Ejemplo n.º 23
0
N_NIMCALL(NI, nodetabletestorset_223881)(tnodetable171717* t, tnode171659* key, NI val) {
	NI result;
	tnodepairseq171715* n;
	NI k;
	NI index;
	nimfr("NodeTableTestOrSet", "treetab.nim")
	result = 0;
	n = 0;
	nimln(96, "treetab.nim");
	k = hashtree_223018(key);
	nimln(97, "treetab.nim");
	index = nodetablerawget_223378((*t), k, key);
	nimln(98, "treetab.nim");
	{
		nimln(702, "system.nim");
		if (!(0 <= index)) goto LA3;
		nimln(99, "treetab.nim");
		{
			nimln(99, "treetab.nim");
			nimln(99, "treetab.nim");
			nimln(99, "treetab.nim");
			if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			if (!!(!(((*t).Data->data[index].Key == NIM_NIL)))) goto LA7;
			nimln(99, "treetab.nim");
			hiddenraiseassert_76017(((NimStringDesc*) &TMP3155));		}		LA7: ;
		nimln(100, "treetab.nim");
		if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
		result = (*t).Data->data[index].Val;
	}	goto LA1;
	LA3: ;
	{
		nimln(102, "treetab.nim");
		{
			NIM_BOOL LOC12;
			NI TMP3157;
			NI i_224036;
			NI HEX3Atmp_224074;
			NI res_224076;
			tnodepairseq171715* LOC20;
			nimln(102, "treetab.nim");
			nimln(102, "treetab.nim");
			LOC12 = 0;
			LOC12 = mustrehash_178191((*t).Data->Sup.len, (*t).Counter);
			if (!LOC12) goto LA13;
			nimln(103, "treetab.nim");
			nimln(103, "treetab.nim");
			nimln(103, "treetab.nim");
			TMP3157 = mulInt((*t).Data->Sup.len, 2);
			n = (tnodepairseq171715*) newSeq((&NTI171715), (NI64)(TMP3157));
			i_224036 = 0;
			HEX3Atmp_224074 = 0;
			nimln(104, "treetab.nim");
			nimln(104, "treetab.nim");
			HEX3Atmp_224074 = ((*t).Data->Sup.len-1);
			nimln(1301, "system.nim");
			res_224076 = 0;
			nimln(1302, "system.nim");
			while (1) {
				nimln(1302, "system.nim");
				if (!(res_224076 <= HEX3Atmp_224074)) goto LA15;
				nimln(1301, "system.nim");
				i_224036 = res_224076;
				nimln(105, "treetab.nim");
				{
					nimln(698, "system.nim");
					nimln(698, "system.nim");
					if ((NU)(i_224036) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if (!!(((*t).Data->data[i_224036].Key == NIM_NIL))) goto LA18;
					nimln(106, "treetab.nim");
					if ((NU)(i_224036) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_224036) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_224036) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					nodetablerawinsert_223412(&n, (*t).Data->data[i_224036].H, (*t).Data->data[i_224036].Key, (*t).Data->data[i_224036].Val);				}				LA18: ;
				nimln(1304, "system.nim");
				res_224076 = addInt(res_224076, 1);
			} LA15: ;
			nimln(107, "treetab.nim");
			LOC20 = 0;
			LOC20 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC20;
		}		LA13: ;
		nimln(108, "treetab.nim");
		nodetablerawinsert_223412(&(*t).Data, k, key, val);		nimln(109, "treetab.nim");
		result = val;
		nimln(110, "treetab.nim");
		(*t).Counter = addInt((*t).Counter, 1);
	}	LA1: ;
	popFrame();
	return result;
}N_NOINLINE(void, compilertreetabInit)(void) {
Ejemplo n.º 24
0
N_NIMCALL(void, bitsetinit_9bKA1DbmAErHy3uIMkQY9bUQ)(TY_pxbIse2JUQkJU0n9blV9bY5g** b0, NI length0) {
	unsureAsgnRef((void**) (&(*b0)), (TY_pxbIse2JUQkJU0n9blV9bY5g*) newSeq((&NTI_pxbIse2JUQkJU0n9blV9bY5g), ((NI) (length0))));
}
Ejemplo n.º 25
0
N_NIMCALL(void, Initsymtab_60103)(TY60099* Tab_60106) {
(*Tab_60106).Tos = 0;
unsureAsgnRef((void**) &(*Tab_60106).Stack, (TY60101*) newSeq(NTI60101, 0));
}
Ejemplo n.º 26
0
N_NIMCALL(void, inittable_315732)(NI initialsize, Table313411* Result) {
    (*Result).counter = ((NI) 0);
    unsureAsgnRef((void**) (&(*Result).data), (Keyvaluepairseq313414*) newSeq((&NTI313414), ((NI) (initialsize))));
}
Ejemplo n.º 27
0
N_NIMCALL(NI, nospexecProcesses)(NimStringDesc** Cmds_68686, NI Cmds_68686Len0, NU8 Options_68688, NI N_68689) {
NI Result_68690;
TY68699* Q_68700;
NI M_68725;
NI I_68734;
NI HEX3Atmp_68824;
NI Res_68826;
NI I_68735;
NI R_68746;
NI HEX3Atmp_68827;
NI Res_68829;
NIM_BOOL LOC8;
NI LOC11;
NI I_68809;
NI HEX3Atmp_68830;
NI Res_68832;
NI LOC16;
NI I_68820;
NI HEX3Atmp_68833;
NI Res_68835;
TY68202* P_68821;
NI LOC18;
Result_68690 = 0;
if (!(1 < N_68689)) goto LA2;
Q_68700 = 0;
Q_68700 = (TY68699*) newSeq(NTI68699, N_68689);
M_68725 = 0;
M_68725 = ((N_68689 <= Cmds_68686Len0) ? N_68689 : Cmds_68686Len0);
I_68734 = 0;
HEX3Atmp_68824 = 0;
HEX3Atmp_68824 = (NI32)(M_68725 - 1);
Res_68826 = 0;
Res_68826 = 0;
while (1) {
if (!(Res_68826 <= HEX3Atmp_68824)) goto LA4;
I_68734 = Res_68826;
asgnRefNoCycle((void**) &Q_68700->data[I_68734], Startprocessaux_68603(Cmds_68686[I_68734], Options_68688));
Res_68826 += 1;
} LA4: ;
I_68735 = 0;
I_68735 = M_68725;
while (1) {
if (!(I_68735 <= (Cmds_68686Len0-1))) goto LA5;
nossleep(50);
R_68746 = 0;
HEX3Atmp_68827 = 0;
HEX3Atmp_68827 = (NI32)(N_68689 - 1);
Res_68829 = 0;
Res_68829 = 0;
while (1) {
if (!(Res_68829 <= HEX3Atmp_68827)) goto LA6;
R_68746 = Res_68829;
LOC8 = nosprunning(Q_68700->data[R_68746]);
if (!!(LOC8)) goto LA9;
LOC11 = nospwaitForExit(Q_68700->data[R_68746]);
Result_68690 = ((LOC11 >= Result_68690) ? LOC11 : Result_68690);
asgnRefNoCycle((void**) &Q_68700->data[R_68746], Startprocessaux_68603(Cmds_68686[I_68735], Options_68688));
I_68735 += 1;
if (!((Cmds_68686Len0-1) < I_68735)) goto LA13;
goto LA6;
LA13: ;
LA9: ;
Res_68829 += 1;
} LA6: ;
} LA5: ;
I_68809 = 0;
HEX3Atmp_68830 = 0;
HEX3Atmp_68830 = (NI32)(M_68725 - 1);
Res_68832 = 0;
Res_68832 = 0;
while (1) {
if (!(Res_68832 <= HEX3Atmp_68830)) goto LA15;
I_68809 = Res_68832;
LOC16 = nospwaitForExit(Q_68700->data[I_68809]);
Result_68690 = ((LOC16 >= Result_68690) ? LOC16 : Result_68690);
Res_68832 += 1;
} LA15: ;
goto LA1;
LA2: ;
I_68820 = 0;
HEX3Atmp_68833 = 0;
HEX3Atmp_68833 = (Cmds_68686Len0-1);
Res_68835 = 0;
Res_68835 = 0;
while (1) {
if (!(Res_68835 <= HEX3Atmp_68833)) goto LA17;
I_68820 = Res_68835;
P_68821 = 0;
P_68821 = Startprocessaux_68603(Cmds_68686[I_68820], Options_68688);
LOC18 = nospwaitForExit(P_68821);
Result_68690 = ((LOC18 >= Result_68690) ? LOC18 : Result_68690);
Res_68835 += 1;
} LA17: ;
LA1: ;
return Result_68690;
}
Ejemplo n.º 28
0
N_NIMCALL(void, inittable_164368)(NI initialsize, Table164376* Result) {
    (*Result).counter = ((NI) 0);
    unsureAsgnRef((void**) (&(*Result).data), (Keyvaluepairseq164379*) newSeq((&NTI164379), ((NI) (initialsize))));
}
Ejemplo n.º 29
0
N_NOINLINE(void, semdataInit)(void) {
asgnRef((void**) &Gowners_107116, (TY55528*) newSeq(NTI55528, 0));
Initidtable_55755(&Ginsttypes_107045);
}
Ejemplo n.º 30
0
N_NIMCALL(void, nodetableput_252622)(tnodetable192871* t, tnode192813* key, NI val) {
	tnodepairseq192869* n;
	NI k;
	NI index;
	nimfr("nodeTablePut", "treetab.nim")
	n = 0;
	nimln(79, "treetab.nim");
	k = hashtree_252022(key);
	nimln(80, "treetab.nim");
	index = nodetablerawget_252475((*t), k, key);
	nimln(81, "treetab.nim");
	{
		nimln(81, "treetab.nim");
		if (!(0 <= index)) goto LA3;
		nimln(82, "treetab.nim");
		{
			nimln(82, "treetab.nim");
			nimln(82, "treetab.nim");
			nimln(82, "treetab.nim");
			if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			if (!!(!(((*t).Data->data[index].Key == NIM_NIL)))) goto LA7;
			nimln(82, "treetab.nim");
			failedassertimpl_80421(((NimStringDesc*) &TMP3217));
		}
		LA7: ;
		nimln(83, "treetab.nim");
		if ((NU)(index) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
		(*t).Data->data[index].Val = val;
	}
	goto LA1;
	LA3: ;
	{
		nimln(85, "treetab.nim");
		{
			NIM_BOOL LOC12;
			NI TMP3218;
			NI i_252868;
			NI HEX3Atmp_252921;
			NI res_252923;
			tnodepairseq192869* LOC20;
			nimln(85, "treetab.nim");
			nimln(85, "treetab.nim");
			LOC12 = 0;
			LOC12 = mustrehash_201187((*t).Data->Sup.len, (*t).Counter);
			if (!LOC12) goto LA13;
			nimln(86, "treetab.nim");
			nimln(86, "treetab.nim");
			nimln(86, "treetab.nim");
			TMP3218 = mulInt((*t).Data->Sup.len, 2);
			n = (tnodepairseq192869*) newSeq((&NTI192869), (NI32)(TMP3218));
			i_252868 = 0;
			HEX3Atmp_252921 = 0;
			nimln(87, "treetab.nim");
			nimln(87, "treetab.nim");
			HEX3Atmp_252921 = ((*t).Data->Sup.len-1);
			nimln(1451, "system.nim");
			res_252923 = 0;
			nimln(1452, "system.nim");
			while (1) {
				nimln(1452, "system.nim");
				if (!(res_252923 <= HEX3Atmp_252921)) goto LA15;
				nimln(1451, "system.nim");
				i_252868 = res_252923;
				nimln(88, "treetab.nim");
				{
					nimln(88, "treetab.nim");
					nimln(88, "treetab.nim");
					if ((NU)(i_252868) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if (!!(((*t).Data->data[i_252868].Key == NIM_NIL))) goto LA18;
					nimln(89, "treetab.nim");
					if ((NU)(i_252868) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_252868) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					if ((NU)(i_252868) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
					nodetablerawinsert_252514(&n, (*t).Data->data[i_252868].H, (*t).Data->data[i_252868].Key, (*t).Data->data[i_252868].Val);
				}
				LA18: ;
				nimln(1454, "system.nim");
				res_252923 = addInt(res_252923, 1);
			} LA15: ;
			nimln(90, "treetab.nim");
			LOC20 = 0;
			LOC20 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC20;
		}
		LA13: ;
		nimln(91, "treetab.nim");
		nodetablerawinsert_252514(&(*t).Data, k, key, val);
		nimln(92, "treetab.nim");
		(*t).Counter = addInt((*t).Counter, 1);
	}
	LA1: ;
	popFrame();
}