rcm/my.c
#include<stdio.h>
#include<stdlib.h>
unsigned W[]= { 
 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
unsigned u[]= { 
 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51, 
 59,67,83,99,115,131,163,195,227,258 };
unsigned P[]= { 
 0,0,0,0,0,0,0,0,1,1,1,1,2, 
 2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0 };
unsigned Q[]= { 
 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385, 
 513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577 };
unsigned L[]= { 
 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7, 
 8,8,9,9,10,10,11,11,12,12,13,13 };
unsigned y,C,t;
unsigned Z[320],b[17],G[17];
unsigned long j;
unsigned char S[32768];
struct x { 
 struct x*ll,*rr; 
 unsigned l;  };
struct x F,*V,*h,*I,**e;
unsigned B(unsigned l,unsigned rr) { 
unsigned w=0,ll,f,q; 
if(!rr) {
 B(24,1);  
 ll=B(8,1);  
 B(24,1);  
 B(24,1);  
 if(ll&4) for(q=B(16,1);  
 q--;  
 B(8,1));  
 for(;ll&8&&B(8,1););  
 for(;ll&16&&B(8,1););  
 ll&2&&B(16,1);  
 for(ll=0;!ll;) {   
  ll=B(1,1);   
  q=B(2,1);   
  if(q||B(8,7)) {    
   q&1&&B(7,8);    
   q&2&&B(3,9);    
   B(5,6);    
   I=V;    
   B(2,4);    
   I=h;    
   B(9,4); }; }  
 for(;(C%=32768)!=(t%=32768);  
 putchar(C++[S])); } 
else if(rr==6) {
 for(;(rr=B(6,(I=V,3)))!=256;)  
 if(rr>256||(B(rr,2),0)) {   
  rr-=257;   
  l=u[rr]+B(P[rr],1);   
  I=h;   
  rr=B(5,3);   
  rr=Q[rr]+B(L[rr],1);   
  rr=((rr<=t)?t-rr:32768-rr+t);   
  for(;l--;rr%=32768) B(S[rr++],2); }; } 
else if(rr==3) {  
 for(;I->ll;I=B(1,1)?I->rr:I->ll);  
 w=I->l; } 
else if(rr==5) {  
 for(rr=17;rr--;rr[b]=0);  
 for(rr++;rr<l;rr++[Z][b]++);  
 for(*b=*G=rr=0;rr<16;rr++) G[rr+1]=(rr[G]+b[rr])<<1;  
 for(I=0,rr=0;rr<l;rr++) if(Z[rr]) {   
  q=rr[Z][G];   
  Z[rr][G]++;   
  ll=Z[rr];   
  for(e=&I;(ll--&&(*e||((*(*e=malloc(sizeof(struct x)))=F),1)));   
   e=((q>>ll)&1)?&(*e)->rr:&(*e)->ll);   
  *(*e=malloc(sizeof(struct x)))=F;
  (*e)->l=rr; } } 
else if(rr==2) {  
 t++[S]=l;
 (t%=32768)==(C%=32768)&&putchar(C++[S]); } 
else if(rr==8) {  
 for(rr=288;rr--;Z[rr]=rr<144?8:rr<256?9:rr<280?7:8);  
 V=(B(288,5),I);  
 for(rr=32;rr--;Z[rr]=5);  
 h=(B(32,5),I); } 
else if(rr==1&&l) {  
 for(;y<l;y+=8) j|=0l+getchar()<<y;  
 w=j&(1<<l)-1;  
 j>>=l;  
 y-=l; } 
else if(rr==7) {  
 y%8&&B(y%8,1);  
 for(rr=B(16,1),B(16,1);  
 rr--;  
 B(B(8,1),2)); } 
else if(rr==9) {  
 unsigned p=B(5,1)+257,z=B(5,1)+1,v=B(4,1)+4;
 for(rr=0;rr<v;rr++[W][Z]=B(3,1));   
 for(;19>rr;W[rr++][Z]=0);   
 V=(B(19,5),I);    
 for(l=rr=0;rr<(p+z);) {     
  I=V;     
  ll=B(3,3);     
  f=ll==16     
  ?(ll=l),3+B(2,1)     
  :ll==17     
   ?(ll=0),3+B(3,1)     
   :ll==18     
    ?(ll=0),11+B(7,1)     
    :((l=ll),1);     
  for(q=f;q--; rr++[Z]=ll); }    
 I=V;
 B(9,4);    
 V=(B(p,5),I);    
 for(rr=z;rr--;Z[rr]=Z[rr+p]);    
 h=(B(z,5),I); }
else if(rr==4) { 
 struct x*   
 i=I;   
 i&&(
  I=i->ll,
  B(7,4),
  I=i->rr,   
  free(i),
  B(1,4)); } 
return w; }

main() { 
return B(3,0); }