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

private let _bitboardTable = (0 ..< 64).map { Bitboard(rawValue: 1 << $0) }

/// Returns the index of the lsb value.
private func _index(lsb value: UInt64) -> Int? {
    guard value != 0 else {
        return nil
    }
    return _lsbTable[Int((value &* 0x03f79d71b4cb0a89) >> 58)]
}

/// Returns the pawn attack table for `color`.

        (self[first], self[second]) = (self[second], self[first])
    }

    /// Removes the least significant bit and returns it.
    public mutating func popLSB() -> Bitboard {
        let lsb = self.lsb
        rawValue -= lsb.rawValue
        return lsb
    }

    /// Removes the least significant bit and returns its square, if any.
    public mutating func popLSBSquare() -> Square? {
        return _index(lsb: popLSB()).flatMap({ Square(rawValue: $0) })
    }

    /// Returns moves from `square` to the squares in `self`.
