#include #define BUFFER_SIZE 0x10000 /* Input byte. */ static int c; /* Ring buffer of input bytes. */ static char input[BUFFER_SIZE]; static int i_begin, i_end; /* Define a single header dictionary entry. */ #define D(d) ,#d /* Header text: - Uppercase letters causes a dictionary entry to be expanded recursively. - Tilde (~) causes the next letter to be copied as is. - Everything else is copied as is. */ static char *header_data[] = { /*M*/ ",", /*N*/ "Pzoltraak" /*O*/ D( ZifWUUQjmp_bufPj;XmMIMi=1MlMk[999]={1<<30}M*o=k; Xmain(XdMchar**a){switch(S(j)){default:Yi;I=14; VP_P__LI~NE__VPpPT(I=_+1)VPqP(i=3M--R(jM*o--)):VNPcaseP_:i%2?YiMp: (_-4)%9?T(m|=1<<(_-I)):_-I-17?(putchar(m^32)MY*o)?p:q(l=m%256+3Mm=m/512+3Mi) ?(*o-=l)>0?m=i=0Mp:q((o[2]=*o 32 ) c >= 'M' && c <= 'Z' ? Expand(header_data[c - 'M']) : (void)putchar(c != '~' ? c : *++s); } } /* Output a set of lines. */ static void OutputInstruction(int i) { for(; i; i /= 2) puts(header_data[i & 1] + 1); } int main(int argc, char **argv) { Expand(header_data[2]); for(;;) { /* Fill ring buffer. */ while( i_end - i_begin < BUFFER_SIZE ) { if( (c = getchar()) == EOF ) break; input[i_end++ % BUFFER_SIZE] = c; } if( i_begin == i_end ) break; /* Consume ring buffer. */ while( i_begin != i_end ) { OutputInstruction((input[i_begin++ % BUFFER_SIZE] & 0xff) ^ 0x120); } } return 0; }