#include <stdio.h>
int main(){char * s =
"#include <stdio.h>\n"
"int main(){char * s =z\n"
"FILE * b = fopen(\"b.c\", \"w\"); char * x;\n"
"for(x = s; *x -1 != 'y'; ++x) putc(*x, b);\n"
"fprintf(b, \"\\n\\\"\");\n"
"for(char * x = s; *x; ++x) if(*x==10) fprintf(b, \"\\\\n\\\"\\n\\\"\");\n"
" else if(*x=='\\\\' || *x=='\\\"') fprintf(b, \"\\\\%c\", *x);\n"
" else putc(*x, b);\n"
"fprintf(b, \"\\\";\");\n"
"for(++x; *x; ++x) putc(*x, b);\n"
"putc(10, b);\n"
"fclose(b); return 0;}";
FILE * b = fopen("b.c", "w"); char * x;
for(x = s; *x -1 != 'y'; ++x) putc(*x, b);
fprintf(b, "\n\"");
for(char * x = s; *x; ++x) if(*x==10) fprintf(b, "\\n\"\n\"");
else if(*x=='\\' || *x=='\"') fprintf(b, "\\%c", *x);
else putc(*x, b);
fprintf(b, "\";");
for(++x; *x; ++x) putc(*x, b);
putc(10, b);
fclose(b); return 0;}
clang a.c
./a.out
diff a.c b.c