#include <stdlib.h>
#include <stdio.h>
#define INIT_DODO unsigned char buf[100]; unsigned char* stack = buf; int label = l_init; while(1) switch (label)
#define STOR(type, ofs, val) (*(type*)(stack + ofs) = val)
#define READ(type, ofs) (*(type*)(stack + ofs))
#define PUSH(type, val) (*(type*)stack = val, stack += sizeof(type))
#define POP(type) (*(type*)(stack -= sizeof(type)))
#define STORJ(ofs, label) STOR(int, ofs, label)
#define READJ(ofs) READ(int, ofs)
#define PUSHJ(label) PUSH(int, label)
#define POPJ POP(int)
#define JUMP(ofs) (label = READ(int, ofs)); break
#define LABEL(num) case num
#define GOTO(num) (label = num); break
int main(int argc, char* args[])
{
enum labels {l_init, l_Start, l_Start_return, l_loop, l_loop_return, l_exit};
INIT_DODO
{
LABEL(l_init): PUSHJ(l_exit); GOTO(l_Start); LABEL(l_exit):
exit(0); #define loop_return sizeof(int)
#define loop_out (loop_return + sizeof(FILE*))
#define loop_n (loop_out + sizeof(int))
LABEL(l_loop): if (READ(int, -loop_n) < 7)
{ fprintf(READ(FILE*, -loop_out), "%s\n", "Hello World!"); STOR(int, -loop_n , READ(int, -loop_n) + 1); GOTO(l_loop);
}
else
{ GOTO(l_loop_return);
} LABEL(l_loop_return): label = POPJ; POP(FILE*); POP(int); GOTO(label); LABEL(l_Start): PUSH(int, 0); PUSH(FILE*, stdout); PUSHJ(l_Start_return); GOTO(l_loop); LABEL(l_Start_return): label = POPJ; GOTO(label);
}
}