#define RSHIFT(i,n) (i>=0?i>>n:(signed)~(((unsigned)~i)>>n))