int jsShift(int value, int shift) { int sc = shift % 32; if (sc < 0) { sc += 32; } return value >> sc; }