function intersectMasks(masks) {
	let result = masks[0];
	for (let i = masks.length - 1; i >= 1; i--) {
		result &= masks[i];
	}
	return result;
}
Intersects multiple masks represented as bigints
@param {bigint[]} masks The module masks to intersect
@returns {bigint} The intersection of all masks