upvote
Context-Sensitive Grammar Transform: Compression and Pattern-Matching (2011)

(web.archive.org)

.

   cd  repair110811/
   ed  Makefile <<__AAA__
   19c
   despair: main.c decoder.o bits.o  
   .
   9c
   CFLAGS = -O3 -DNDEBUG -static -s
   .
   w
   q
   __AAA__

   ed bits.c <<__BBB__
   140,143c
   if(b->bufend<b->buftop)exit(1);
   .
   121,125c
   if(rblen>W_BITS)exit (1);
   .
   56,60c
   if(wblen>W_BITS)exit(1); 
   .
   w
   q
   __BBB__

   ed decoder.c <<__CCC__
   115d
   87d
   68,69d
   w
   q
   __CCC__

   ed encoder.c <<__DDD__
   93,95d
   79d
   67d
   w
   q
   __DDD__

   ed main.c <<__EEE__
   101,109c
   input=fopen(argv[1],"rb");
   output=fopen(argv[2],"w");
   if(input==NULL||output==NULL)exit(1); 
   .
   95,99c
   if(argc!=3){fprintf(stderr,"usage: %s inputfile outputfile\n",argv[0]);exit(1);}
   .
   63,75c
   input=fopen(argv[1],"r");if(input==NULL)exit(1);
   output=fopen(argv[2],"wb");if(output==NULL)exit(1); 
   .
   55,61c
   if(argc!=3){fprintf(stderr,"usage: %s inputfille outputfile\n",argv[0]);exit(1);}
   .
   49,50d
   w
   q
   __EEE__

   ed repair.c <<__FFF__
   654,656d
   637c
   fflush(stdout);
   .
   628c
   fflush(stdout);
   .
   277,278d
   w
   q
   __FFF__
reply