#ifndef z #include #include static int x; static int instruction_start; static int program_start; static int return_state = 1; static int stack[540] = {1 << 30}, sp = 0; static int length; static jmp_buf j; #define next (void)(instruction_start = __LINE__ + 1) #define z \ case __LINE__: \ return_state % 2 \ ? /* Unconditionally move to next instruction after branch. */ \ (return_state--, \ (x = 0), \ next) \ : (__LINE__ - program_start) % 9 \ ? /* Accumulate. */ \ (void)(x |= 1 << (__LINE__ - instruction_start)) \ : __LINE__ - instruction_start - 17 \ ? /* Output. */ \ (putchar(x), \ (x = 0), \ --stack[sp]) \ ? /* Keep going if there are more bytes to print. */ \ next \ : /* Pop stack when we have printed enough bytes. */ \ (return_state = 3, \ sp--, \ longjmp(j, stack[sp--])) \ : /* Branch. */ \ ((length = x % 256 + 3), \ (x = x / 512 + 3), \ return_state) \ ? (stack[sp] -= length) <= 0 \ ? /* Recursive return. */ \ (return_state = 3, \ sp--, \ longjmp(j, stack[sp--])) \ : /* Completed return chain. */ \ ((x = return_state = 0), \ next) \ : /* Initiate branch. */ \ ((stack[sp + 1] = instruction_start - 1), \ (stack[sp + 2] = \ stack[sp] < length ? stack[sp] : length), \ (return_state = 1), \ (sp += 2), \ longjmp(j, __LINE__ - x * 9)); int main(int argc, char **argv) { switch(setjmp(j)) { default: return_state--; x = 0; program_start = __LINE__ + 8; instruction_start = program_start + 1; #include __FILE__ #undef z #define z } return 0; } #endif /* 1 */ /* 2 */ /* 3 */ z /* 4 */ z /* 5 */ /* 6 */ z /* 7 */ /* 8 */ z /* 0 -> "X" */ z /* 1 */ /* 2 */ /* 3 */ z /* 4 */ z /* 5 */ /* 6 */ z /* 7 */ /* 8 */ z /* 0 -> "Y" */ /* 1 */ z /* 2 */ /* 3 */ z /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ z /* 0 -> "\n" */ z /* 1 */ /* 2 */ /* 3 */ z /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* 10 */ z /* 11 */ /* 12 */ /* 13 */ /* 14 */ /* 15 */ /* 16 */ /* 17 */ z /* 0 -> repeat 12, offset = -3 */ /* 1 */ z /* 2 */ /* 3 */ z /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ z /* 0 -> "\n" */