private int findLastNonZeroIndex() {

        for(int i=lastNonZeroIndex/8;i>=0;i--) {
            if (bytes[i] != 0) {
                for(int j=7;j>=0;j--) {
                    if ((bytes[i] & ONBITS[j]) != 0) {
                        return i*8 + j;
                    }
                }
            }
        }
        return -1;
    }
Puts the given boolean value in the boolean array at
the given index
@param index Index into the array.
@param value value to store
@throws IndexOutOfBoundsException if the index is negative
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/BooleanArray.java