Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Generated by Nim Compiler v0.12.1 */
- /* (c) 2015 Andreas Rumpf */
- /* The generated code is subject to the original license. */
- /* Compiled for: Linux, amd64, gcc */
- /* Command for C compiler:
- gcc -c -w -I/home/tchen2/.tools/bin/Nim/lib -I/home/tchen2/.tools/include/ -o /proj/hsi/tchen2/nim/nimcache/learn_uv2.o /proj/hsi/tchen2/nim/nimcache/learn_uv2.c */
- #define NIM_INTBITS 64
- #include "nimbase.h"
- #include <stdio.h>
- #include "uv.h"
- #include <string.h>
- typedef struct TGenericSeq TGenericSeq;
- typedef struct NimStringDesc NimStringDesc;
- struct TGenericSeq {
- NI len;
- NI reserved;
- };
- struct NimStringDesc {
- TGenericSeq Sup;
- NIM_CHAR data[SEQ_DECL_SIZE];
- };
- N_NIMCALL(void, waitforawhile_95072)(uv_idle_t* h);
- static N_INLINE(NI, addInt)(NI a, NI b);
- N_NOINLINE(void, raiseOverflow)(void);
- static N_INLINE(void, nimFrame)(TFrame* s);
- N_NOINLINE(void, stackoverflow_23601)(void);
- static N_INLINE(void, popFrame)(void);
- static N_INLINE(void, initStackBottomWith)(void* locals);
- N_NOINLINE(void, setStackBottom)(void* thestackbottom);
- NIM_EXTERNC N_NOINLINE(void, systemInit000)(void);
- NIM_EXTERNC N_NOINLINE(void, systemDatInit000)(void);
- NIM_EXTERNC N_NOINLINE(void, learn_uv2Init000)(void);
- NIM_EXTERNC N_NOINLINE(void, learn_uv2DatInit000)(void);
- STRING_LITERAL(TMP141, "done!", 5);
- NI counter_95075;
- extern NI counter_95075;
- extern TFrame* frameptr_20842;
- uv_idle_t idle_95086;
- uv_loop_t* ploop_95091;
- uv_idle_t* pidle_95099;
- static N_INLINE(NI, addInt)(NI a, NI b) {
- NI result;
- { result = 0;
- result = (NI)((NU64)(a) + (NU64)(b));
- {
- NIM_BOOL LOC3;
- LOC3 = 0;
- LOC3 = (((NI) 0) <= (NI)(result ^ a));
- if (LOC3) goto LA4;
- LOC3 = (((NI) 0) <= (NI)(result ^ b));
- LA4: ;
- if (!LOC3) goto LA5;
- goto BeforeRet;
- }
- LA5: ;
- raiseOverflow();
- }BeforeRet: ;
- return result;
- }
- static N_INLINE(void, nimFrame)(TFrame* s) {
- NI LOC1;
- LOC1 = 0;
- {
- if (!(frameptr_20842 == NIM_NIL)) goto LA4;
- LOC1 = ((NI) 0);
- }
- goto LA2;
- LA4: ;
- {
- LOC1 = ((NI) ((NI16)((*frameptr_20842).calldepth + ((NI16) 1))));
- }
- LA2: ;
- (*s).calldepth = ((NI16) (LOC1));
- (*s).prev = frameptr_20842;
- frameptr_20842 = s;
- {
- if (!((*s).calldepth == ((NI16) 2000))) goto LA9;
- stackoverflow_23601();
- }
- LA9: ;
- }
- static N_INLINE(void, popFrame)(void) {
- frameptr_20842 = (*frameptr_20842).prev;
- }
- N_NIMCALL(void, waitforawhile_95072)(uv_idle_t* h) {
- NI TMP140;
- nimfr("wait_for_a_while", "learn_uv2.nim")
- nimln(23, "learn_uv2.nim");
- TMP140 = addInt(counter_95075, ((NI) 1));
- counter_95075 = (NI)(TMP140);
- nimln(24, "learn_uv2.nim");
- {
- NI LOC5;
- nimln(353, "system.nim");
- if (!(((NI) 10000) <= counter_95075)) goto LA3;
- nimln(25, "learn_uv2.nim");
- printf("%s\012", ((NimStringDesc*) &TMP141)? (((NimStringDesc*) &TMP141))->data:"nil");
- nimln(26, "learn_uv2.nim");
- LOC5 = 0;
- LOC5 = uv_idle_stop(h);
- }
- LA3: ;
- popFrame();
- }
- static N_INLINE(void, initStackBottomWith)(void* locals) {
- setStackBottom(locals);
- }
- void PreMainInner() {
- systemInit000();
- learn_uv2DatInit000();
- }
- void PreMain() {
- void (*volatile inner)();
- systemDatInit000();
- inner = PreMainInner;
- initStackBottomWith((void *)&inner);
- (*inner)();
- }
- int cmdCount;
- char** cmdLine;
- char** gEnv;
- N_CDECL(void, NimMainInner)(void) {
- learn_uv2Init000();
- }
- N_CDECL(void, NimMain)(void) {
- void (*volatile inner)();
- PreMain();
- inner = NimMainInner;
- initStackBottomWith((void *)&inner);
- (*inner)();
- }
- int main(int argc, char** args, char** env) {
- cmdLine = args;
- cmdCount = argc;
- gEnv = env;
- NimMain();
- return nim_program_result;
- }
- NIM_EXTERNC N_NOINLINE(void, learn_uv2Init000)(void) {
- NI LOC1;
- uv_idle_cb LOC2;
- NI LOC3;
- NI LOC4;
- nimfr("learn_uv2", "learn_uv2.nim")
- nimln(22, "learn_uv2.nim");
- counter_95075 = ((NI) 0);
- nimln(30, "learn_uv2.nim");
- ploop_95091 = uv_default_loop();
- nimln(31, "learn_uv2.nim");
- pidle_95099 = (&idle_95086);
- nimln(33, "learn_uv2.nim");
- LOC1 = 0;
- LOC1 = uv_idle_init(ploop_95091, pidle_95099);
- nimln(34, "learn_uv2.nim");
- memset((void*)(&LOC2), 0, sizeof(LOC2));
- LOC2.ClPrc = ((TMP142) (waitforawhile_95072)); LOC2.ClEnv = NIM_NIL;
- LOC3 = 0;
- LOC3 = uv_idle_start(pidle_95099, LOC2);
- nimln(35, "learn_uv2.nim");
- LOC4 = 0;
- LOC4 = uv_run(ploop_95091, ((NI32) 0));
- nimln(36, "learn_uv2.nim");
- uv_loop_close(ploop_95091);
- popFrame();
- }
- NIM_EXTERNC N_NOINLINE(void, learn_uv2DatInit000)(void) {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement