public MaskedLong shiftCircular(long n, int size, int dir) {
		if (dir == 1) {
			n = (size - n) % size;
		}
		if (n == 0 | size == 0) {
			return this;
		}
		final long unaffected = size == 64 ? 0 : (-1L) << size;
		final long umsk = unaffected & msk;
		final long uval = unaffected & val;
		final long affected = ~unaffected;
		final long amsk = affected & msk;
		final long aval = affected & val;

		final long newMsk = (amsk >>> (size - n) | amsk << n | umsk) & affected;
		final long newVal = aval >>> (size - n) | aval << n | uval;
		return fromMaskAndValue(newMsk, newVal);
	}
Shift {@code size} bits @{code n) positions circularly in a given direction

<p>
The shifted bits are the least significant {@code size} bits. The remaining bits are
unaffected.

@param n the number of positions
@param size the number of bits (least significant) to include in the shift
@param dir the direction to shift (0 for left, 1 for right)
@return the result
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/expr/MaskedLong.java