//Cut file determination///////////////////////////////
#include "descript.h"

int restrict(int buffer3[], long long int numP[], int Rout)
{
 int i;
 int counter=0;
 for (i=7;i<1017;i++)
 {
  if ((buffer3[i]==(int)(CODE1)&&buffer3[i+1]==(int)(CODE2)&& buffer3[i+2]==(int)(CODE3)&&buffer3[i+3]==Rout&&numP[2]==numP[1]+1)||
      (buffer3[i]==(int)(CODE1)&&buffer3[i+1]==(int)(CODE2)&& buffer3[i+2]==(int)(CODE3)&&buffer3[i+3]==Rout&&numP[2]==numP[0]+2)||
      (buffer3[i]==(int)(CODE1)&&buffer3[i+1]==(int)(CODE2)&& buffer3[i+2]==(int)(CODE3)&&numP[2]==1))
  {counter=i;}
 }
 return counter;
}
