Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/* Generated by Nim Compiler v0.18.1 */
/* (c) 2018 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
gcc -c -w -O3 -fno-strict-aliasing -I/home/kmodi/stow/pkgs/nim/devel/lib -o /home/kmodi/sandbox/nim/noinit/nimcache/noinit_global_local.o /home/kmodi/sandbox/nim/noinit/nimcache/noinit_global_local.c */
#define NIM_NEW_MANGLING_RULES
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef powerpc
#undef unix
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* tyArray_Re75IspeoxXy2oCZHwcRrA[2];
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, foo_Ye5ZMhVNobnVQY9aJAVUuyQ)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_NOINLINE(void, setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE N_NIMCALL(void, noinit_global_localDatInit000)(void);
NI a_global_nKNA5KkJyG5TaA0geqN0RQ;
STRING_LITERAL(TM_5p9cPJYy9aij133bkKgd2i7g_2, "Value of auto-initialized global variable \'a_global\': ", 54);
STRING_LITERAL(TM_5p9cPJYy9aij133bkKgd2i7g_3, "Value of auto-initialized local variable \'a_local_auto_init\': ", 62);
STRING_LITERAL(TM_5p9cPJYy9aij133bkKgd2i7g_4, "Value of uninitialized local variable \'a_local_noinit\': ", 56);
N_LIB_PRIVATE N_NIMCALL(void, foo_Ye5ZMhVNobnVQY9aJAVUuyQ)(void) {
NI a_local_auto_init;
NI a_local_noinit;
tyArray_Re75IspeoxXy2oCZHwcRrA T1_;
tyArray_Re75IspeoxXy2oCZHwcRrA T2_;
a_local_auto_init = (NI)0;
memset((void*)T1_, 0, sizeof(tyArray_Re75IspeoxXy2oCZHwcRrA));
T1_[0] = copyString(((NimStringDesc*) &TM_5p9cPJYy9aij133bkKgd2i7g_3));
T1_[1] = nimIntToStr(a_local_auto_init);
echoBinSafe(T1_, 2);
memset((void*)T2_, 0, sizeof(tyArray_Re75IspeoxXy2oCZHwcRrA));
T2_[0] = copyString(((NimStringDesc*) &TM_5p9cPJYy9aij133bkKgd2i7g_4));
T2_[1] = nimIntToStr(a_local_noinit);
echoBinSafe(T2_, 2);
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
setStackBottom(locals);
}
void PreMainInner(void) {
systemInit000();
noinit_global_localDatInit000();
}
void PreMain(void) {
void (*volatile inner)(void);
systemDatInit000();
inner = PreMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int cmdCount;
char** cmdLine;
char** gEnv;
N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
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;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
tyArray_Re75IspeoxXy2oCZHwcRrA T1_;
memset((void*)T1_, 0, sizeof(tyArray_Re75IspeoxXy2oCZHwcRrA));
T1_[0] = copyString(((NimStringDesc*) &TM_5p9cPJYy9aij133bkKgd2i7g_2));
T1_[1] = nimIntToStr(a_global_nKNA5KkJyG5TaA0geqN0RQ);
echoBinSafe(T1_, 2);
foo_Ye5ZMhVNobnVQY9aJAVUuyQ();
}
N_LIB_PRIVATE N_NIMCALL(void, noinit_global_localDatInit000)(void) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.