KIRIKA.C   

<

^

>


                                          #include/*c2001     */<stdio.h>
                                     #define/**/Y(X)/*tmode(fileno(X),O_BINAR*/
                                  typedef/**/unsigned/**/char/**/b;b/**/r[1<<15],B
                               [1<<14],H[128][16];int/**/L[]={1,2,3,-116,-108,6,7,8,-
                             68,-62,-2,12,-20,14,-26,16,-70,18,19,20,21,-84,23,-107,25
                           ,-64,27,28,-69,30,-113,-75,-125,-61,35,36,-46,38,39,40,41,42,
                         43,44,45,46,47,-25,-12,-48,51,52,53,-57,55,56,57,58,59,-81,-127,
                       -126,-106,-77,-91,66,67,-14,69,-29,71,-114,-117,-121,75,-51,-111,78,
                     79,80,-115,-100,-97,84,-105,86,87,88,-52,-85,-76,-35,-37,-33,95,96,-45,
                   98,-78,100,-60,-65,103,-122,105,106,-31,-01,109,-07,111,-118,-82,-119,-34,
                  116,-92,118,119,-18,121,-27,0,124,-96,-58,-4},R[]={77,37,17,4,5,-112,15,-50,
                9,10,11,13,-28,-19,-30,-83,-56,34,26,22,-41,-120,-40,24,-54,-53,-95,33,29,32,31
               ,-3,-123,-59,-10,-109,-98,70,-101,49,-102,-39,-36,-79,-88,48,-5,-74,-9,50,54,-73,
             -47,-66,-49,63,62,-93,61,60,-11,-13,-89,64,65,68,-24,-21,-90,-22,76,72,73,74,-42,-80
            ,-8,-32,83,82,81,-99,-110,94,85,-104,-103,90,89,-72,+91,92,93,-38,122,110,97,101,99,-
           71,-86,102,107,104,-16,-63,-23,108,-124,-17,113,112,-67,114,115,117,-43,-87,120,-94,-6,
          -15,123,-44,125,126,-55},C[128],_[1<<14],c,d,e,*f,h,i,j,k,l,m,n,o,p,q,s,t[1<<14],u,v,x,y
         [256],z[256];FILE*I,*O;int/**/g(int/**/a){for(;a>=h;u^=r[(h++)&32767]=(b)k)if((k=fgetc(I))
        ==EOF){s=h++;return-1;}return(a<s)?r[a&32767]:-1;}int/**/G(){if((j=fgetc(I))==EOF||(k=fgetc
      (I))==EOF){u=j;return-1;}return(k<<8)|j;}void/**/w(int/**/a){v^=a;fputc(a,O);}void/**/W(int a)
     {v^=a&255;v^=a>>8;fputc(a&255,O);fputc(a>>8,O);}void/**/A(){k=r[p&32767];for(n=0;n<256;n++)if(y[
    n])if((p-t[y[n]])>16380)break;if(!(y[n]=_[m=y[ n]]))z[n]=0;t[z[ k]=  z[k]?(_[z[k]]=m):(y[k]=m)]=p
    ++; _[m]=0;}void/**/E(){C[-k]=x;for(i=0 ;i<x;i  ++)H[-k][i]=B[i ];}   void/**/T(int/**/a){B[x++]=0
   ;if ((k=L[a])<1)E();else/**/T(k);B[x-1] =1; if(   (k=R[a])<1)E() ;/*   */else/**/T(k);B[--x]=0;}void
   M() {for(i=x=j=k=0;i<l&&x<l;i++){n=r[(  p-   l+    i)&32767];if  (n    &+  128 )x=l;else{for(m=0;m<C[
   n]  ;m++){k|=((int)H[n][m])<<(j ++); if(j>7){B[x++  ]=(b)k;j=k=0;}}}}if(j>0)B[  x++]=(b)k;if(x<l){W(/*
   */  16384|l);for(i=0;i<x;w(B[i ++]));  {;     }     }else{W(l    )     ;;   for (i=0;i<l;i++)w(r[(p-l+i
   )&  32767 ]);}l=0x0;}int main( int   a,char          **S){I=           a     >2  ?fopen(S[2],"rb"):stdin;
   O=  a>3?  fopen(S[3],"wb+")/*  */ :stdout;if          (!I||      !O)return+1  ;  Y(I);Y(O);for(i=u=v  =p=h=
   0;  (i)<   32768;r[i++]=0);s=   1<<30;if(*            S[1            ]-120){{;   }for(i=0;i<256;i++)y     [i]
    =   z[i   ]=0;o=-16381;for(y  [i=0]=q=1;i<           +              16381;i++){  _[q]=q+1;t[q]=o++;;
     q  ++;    }z[B[x=_[q-1]=0]=0]     =q-1;for                       (T(l=0);g(  p)+1;){m=n=0;for(q=y[r
     [   p&    32767]];q;q=_[q]){o  =t[q];e=p-o                       ;if(e<n){;  break;} for(i=1;i<e;++
          i)    if(g(p+i )-g(o+i))  break;if(i                        >n){m=o;n=  i ;}}d=  n;c=p-m;if(d>
          4)    {if(l)M  ();if(d  < 256){;  W(                         32768 |c      );w(  d);}else {W(c
           |(   49152))  ;W(d);;}    for(i=0x0                        ;i<d;i++)      A();  continue  ;}A
            (   );l++;;  if(16381     <                                             l)M()  ;}if(l>0  )M(
                );fputc( u,O);;}                                                    else{for(;(i=G(  ))
               +1;){if(i&32768){;                                                   if(i&16384)e=G(   )
             ;else{e=fgetc(I);}o=                                                  i&16383;for( i=0
                 ;i<e;i++){w(r[p&+                                                 32767]=r[(p-  o)
                &32767]);p++;}h=p;                                                }else{e=16383   &i
                ;if(i &16384){j=8;;                                               for(i=x=k=0;     i
                <e;) {if(j>7){if((k                     =fgetc(I)                )==EOF)break
                 ;j=   0;}f=(k&(1<<j                                             ))?R:L;if(f[x
                  ]     <=0){r[32767&(                                         p+i)]=(b)(-f  [
                  x      ]);i++;x=0;}else                                    x=f[x ];j++;}
                       for (i=0;i <e;i++)w(                               r[32767& (p+i )
                            ]);h=p +=e;}else{;                          for(i=0;i< e;i++
                             ) {w(  g( p));p++;}}                     }}if(u-v  )
                                      fputs("Checksu"               "m failed"   "\n",
                                    stderr    );} fclose         (I); fclose       (O
                                               )       ;return/**/0     ;}

  NFO RAR ZIP DETAILS /
2016-11-24