#include <x86intrin.h>
#include <stdio.h>
int main(int argc,char **argv){int y;
//Get int from cmdline (tks stackoverflow for helping)
if(argc==2){char*q=argv[1];y=atoi(q);}
else{y=1;}
//Prepare vars
int i;long b=0;long a=0;long c=0;int d;int j;
for(j=0;j<y;j++){//Generates Y numbers
c = b;//Output
d = 0;//Cache
//main part
b -= __rdtsc();//Semi Old timer
for(i=0;i<64;i++){c=c*2;//Shift cache (to fill it)
a-=__rdtsc();//New timer
d=(a-b);//Get diff
c^=d;b=a;}//Add bits to cache, update old timer with new
//Fix even number bug on HP machine
c+=(__rdtsc()/2)%2;
//Output
printf("%ld",c);
printf("%s","\n");}
}