Skip to content

Instantly share code, notes, and snippets.

@def-
Created January 23, 2015 14:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save def-/0fe87bf1d35102c62d3b to your computer and use it in GitHub Desktop.
Save def-/0fe87bf1d35102c62d3b to your computer and use it in GitHub Desktop.
/* Generated by Nim Compiler v0.10.3 */
/* (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 -O3 -fno-strict-aliasing -I/media/nim/lib -o /home/deen/nimcache/asd.o /home/deen/nimcache/asd.c */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <stdio.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, a_89003)(void);
N_NIMCALL(void, b_89005)(void);
N_NIMCALL(void, c_89007)(void);
N_NIMCALL(void, d_89009)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
NIM_EXTERNC N_NOINLINE(void, systemInit)(void);
NIM_EXTERNC N_NOINLINE(void, systemDatInit)(void);
NIM_EXTERNC N_NOINLINE(void, asdInit)(void);
NIM_EXTERNC N_NOINLINE(void, asdDatInit)(void);
STRING_LITERAL(TMP5, "Hello World", 11);
N_NIMCALL(void, d_89009)(void) {
printf("%s\012", (((NimStringDesc*) &TMP5))->data);
}
N_NIMCALL(void, c_89007)(void) {
d_89009();
}
N_NIMCALL(void, b_89005)(void) {
c_89007();
}
N_NIMCALL(void, a_89003)(void) {
b_89005();
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
setStackBottom(locals);
}
void PreMainInner() {
systemInit();
asdDatInit();
}
void PreMain() {
void (*volatile inner)();
systemDatInit();
inner = PreMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int cmdCount;
char** cmdLine;
char** gEnv;
N_CDECL(void, NimMainInner)(void) {
asdInit();
}
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, asdInit)(void) {
a_89003();
}
NIM_EXTERNC N_NOINLINE(void, asdDatInit)(void) {
}
proc a =
proc b =
proc c =
proc d = echo "Hello World"
d()
c()
b()
a()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment