public boolean specializes(PatternBlock op2) {
		int length = 8 * op2.getLength();
		int tmplength;
		int mask1, mask2, value1, value2;
		int sbit = 0;
		while (sbit < length) {
			tmplength = length - sbit;
			if (tmplength > 32) {
				tmplength = 32;
			}
			mask1 = getMask(sbit, tmplength);
			value1 = getValue(sbit, tmplength);
			mask2 = op2.getMask(sbit, tmplength);
			value2 = op2.getValue(sbit, tmplength);
			if ((mask1 & mask2) != mask2) {
				return false;
			}
			if ((value1 & mask2) != (value2 & mask2)) {
				return false;
			}
			sbit += tmplength;
		}
		return true;
	}
A mask/value pair viewed as two bitstreams
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/pattern/PatternBlock.java