private static MaskedLong doRippleCarry(MaskedLong l, MaskedLong r, boolean subtract) {
		// Use ripple-carry method with unknowns
		// TODO: See if there's a faster way to go about this
		// NOTE: "bits" are represented with 2 bits: mask,val, e.g., 2 is known 0
		byte cmv = subtract ? (byte) 3 : 2; // carry: known 1 for subtract, known 0 for add
		long dmsk = 0;
		long dval = 0;
		for (long cur = 1; cur != 0; cur <<= 1) {
			byte lmv = 0;
			lmv |= (l.msk & cur) != 0 ? 2 : 0;
			lmv |= (l.val & cur) != 0 ? 1 : 0;

			byte rmv = 0;
			rmv |= (r.msk & cur) != 0 ? 2 : 0;
			rmv |= (r.val & cur) != 0 ^ subtract ? 1 : 0;

			byte nextcmv = or(and(cmv, lmv), and(cmv, rmv), and(lmv, rmv));
			byte dmv = xor(cmv, lmv, rmv);
			cmv = nextcmv;
			if ((dmv & 2) != 0) {
				dmsk |= cur;
				if ((dmv & 1) != 0) {
					dval |= cur;
				}
			}
		}
		return fromMaskAndValue(dmsk, dval);
	}
Compute the arithmetic difference: this masked long minus another

@param that the other masked long.
@return the result.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/expr/MaskedLong.java