 
     /// Removes the least significant bit and returns its index, if any.
     public mutating func popLSB() -> Int? {
-        let lsb = self.lsb
-        rawValue -= lsb.rawValue
-        return lsb.lsbIndex
+        let lsb = self.lsb.rawValue
+        rawValue -= lsb
+        return _index(lsb: lsb)
     }
 
     /// Removes the least significant bit and returns its square, if any.

                         47, 56, 27, 60, 41, 37, 16, 54, 35, 52, 21,
                         44, 32, 23, 11, 46, 26, 40, 15, 34, 20, 31,
                         10, 25, 14, 19, 09, 13, 08, 07, 06]

/// A lookup table of all king attack bitboards.
internal let _kingAttackTable: [Bitboard] = Square.all.map { square in


    /// The least significant bit index of `self`.
    public var lsbIndex: Int? {
        return _index(lsb: lsb.rawValue)
    }

    /// The square of the least significant bit of `self`.
