static int[] rewindReverse64(int hi, int lo, int len) {
    	int[] i = new int[2];
    	if(len<=32) {
    		i[0] = 0;
    		i[1] = rewindReverse32(lo, len);
    	}
    	else {
    		lo = ((lo>>S[0])&B[0])|((lo<<S[0])&~B[0]);
    		hi = ((hi>>S[0])&B[0])|((hi<<S[0])&~B[0]);
    		lo = ((lo>>S[1])&B[1])|((lo<<S[1])&~B[1]);
    		hi = ((hi>>S[1])&B[1])|((hi<<S[1])&~B[1]);
    		lo = ((lo>>S[2])&B[2])|((lo<<S[2])&~B[2]);
    		hi = ((hi>>S[2])&B[2])|((hi<<S[2])&~B[2]);
    		lo = ((lo>>S[3])&B[3])|((lo<<S[3])&~B[3]);
    		hi = ((hi>>S[3])&B[3])|((hi<<S[3])&~B[3]);
    		lo = ((lo>>S[4])&B[4])|((lo<<S[4])&~B[4]);
    		hi = ((hi>>S[4])&B[4])|((hi<<S[4])&~B[4]);
    
    		//shift off low bits
    		i[1] = (hi>>(64-len))|(lo<<(len-32));
    		i[1] = lo>>(64-len);
    	}
    	return i;
    }
static int[] rewindReverse64(int hi, int lo, int len) {
    	int[] i = new int[2];
    	if(len<=32) {
    		i[0] = 0;
    		i[1] = rewindReverse32(lo, len);
    	}
    	else {
    		lo = ((lo>>S[0])&B[0])|((lo<<S[0])&~B[0]);
    		hi = ((hi>>S[0])&B[0])|((hi<<S[0])&~B[0]);
    		lo = ((lo>>S[1])&B[1])|((lo<<S[1])&~B[1]);
    		hi = ((hi>>S[1])&B[1])|((hi<<S[1])&~B[1]);
    		lo = ((lo>>S[2])&B[2])|((lo<<S[2])&~B[2]);
    		hi = ((hi>>S[2])&B[2])|((hi<<S[2])&~B[2]);
    		lo = ((lo>>S[3])&B[3])|((lo<<S[3])&~B[3]);
    		hi = ((hi>>S[3])&B[3])|((hi<<S[3])&~B[3]);
    		lo = ((lo>>S[4])&B[4])|((lo<<S[4])&~B[4]);
    		hi = ((hi>>S[4])&B[4])|((hi<<S[4])&~B[4]);
    
    		
    		i[1] = (hi>>(64-len))|(lo<<(len-32));
    		i[1] = lo>>(64-len);
    	}
    	return i;
    }
static int [ ] rewindReverse64 ( int hi , int lo , int len ) { int [ ] i = new int [ 2 ] ; if ( len <= 32 ) { i [ 0 ] = 0 ; i [ 1 ] = rewindReverse32 ( lo , len ) ; } else { lo = ( ( lo >> S [ 0 ] ) & B [ 0 ] ) | ( ( lo << S [ 0 ] ) & ~ B [ 0 ] ) ; hi = ( ( hi >> S [ 0 ] ) & B [ 0 ] ) | ( ( hi << S [ 0 ] ) & ~ B [ 0 ] ) ; lo = ( ( lo >> S [ 1 ] ) & B [ 1 ] ) | ( ( lo << S [ 1 ] ) & ~ B [ 1 ] ) ; hi = ( ( hi >> S [ 1 ] ) & B [ 1 ] ) | ( ( hi << S [ 1 ] ) & ~ B [ 1 ] ) ; lo = ( ( lo >> S [ 2 ] ) & B [ 2 ] ) | ( ( lo << S [ 2 ] ) & ~ B [ 2 ] ) ; hi = ( ( hi >> S [ 2 ] ) & B [ 2 ] ) | ( ( hi << S [ 2 ] ) & ~ B [ 2 ] ) ; lo = ( ( lo >> S [ 3 ] ) & B [ 3 ] ) | ( ( lo << S [ 3 ] ) & ~ B [ 3 ] ) ; hi = ( ( hi >> S [ 3 ] ) & B [ 3 ] ) | ( ( hi << S [ 3 ] ) & ~ B [ 3 ] ) ; lo = ( ( lo >> S [ 4 ] ) & B [ 4 ] ) | ( ( lo << S [ 4 ] ) & ~ B [ 4 ] ) ; hi = ( ( hi >> S [ 4 ] ) & B [ 4 ] ) | ( ( hi << S [ 4 ] ) & ~ B [ 4 ] ) ; //shift off low bits i [ 1 ] = ( hi >> ( 64 - len ) ) | ( lo << ( len - 32 ) ) ; i [ 1 ] = lo >> ( 64 - len ) ; } return i ; }
64 bit rewind and reverse
64 bit rewind and reverse