// Contract: MBMSFY
// Target function: function _toString(uint256 value) internal pure returns (string memory ptr)
6 result) {
				assembly {
						result := value
				}
		}

		/**
		 * @dev See {IERC721-approve}.
		 */
		function approve(address to, uint256 tokenId) public override {
				address owner = address(uint160(_packedOwnershipOf(tokenId)));
				if (to == owner) revert ApprovalToCurrentOwner();

				if (_msgSenderERC721A() != owner)
						if (!isApprovedForAll(owner, _msgSenderERC721A())) {
								revert ApprovalCallerNotOwnerNorApproved();
						}

				_tokenApprovals[tokenId] = to;
				emit Approval(owner, to, tokenId);
		}

		/**
		 * @dev See {IERC721-getApproved}.
		 */
		function getApproved(uint256 tokenId) public view override returns (address) {
				if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

				return _tokenApprovals[tokenId];
		}

		/**
		 * @dev See {IERC721-setApprovalForAll}.
		 */
		function setApprovalForAll(address operator, bool approved) public virtual override {
				if (operator == _msgSenderERC721A()) revert ApproveToCaller();

				_operatorApprovals[_msgSenderERC721A()][operator] = approved;
				emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
		}

		/**
		 * @dev See {IERC721-isApprovedForAll}.
		 */
		function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
				return _operatorApprovals[owner][operator];
		}

		/**
		 * @dev See {IERC721-transferFrom}.
		 */
		function transferFrom(
				address from,
				address to,
				uint256 tokenId
		) public virtual override {
				_transfer(from, to, tokenId);
		}

		/**
		 * @dev See {IERC721-safeTransferFrom}.
		 */
		function safeTransferFrom(
				address from,
				address to,
				uint256 tokenId
		) public virtual override {
				safeTransferFrom(from, to, tokenId, '');
		}

		/**
		 * @dev See {IERC721-safeTransferFrom}.
		 */
		function safeTransferFrom(
				address from,
				address to,
				uint256 tokenId,
				bytes memory _data
		) public virtual override {
				_transfer(from, to, tokenId);
				if (to.code.length != 0)
						if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
								revert TransferToNonERC721ReceiverImplementer();
						}
		}

		/**
		 * @dev Returns whether `tokenId` exists.
		 *
		 * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
		 *
		 * Tokens start existing when they are minted (`_mint`),
		 */
		function _exists(uint256 tokenId) internal view returns (bool) {
				return
						_startTokenId() <= tokenId &&
						tokenId < _currentIndex && // If within bounds,
						_packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned.
		}

		/**
		 * @dev Equivalent to `_safeMint(to, quantity, '')`.
		 */
		function _safeMint(address to, uint256 quantity) internal {
				_safeMint(to, quantity, '');
		}

		/**
		 * @dev Safely mints `quantity` tokens and transfers them to `to`.
		 *
		 * Requirements:
		 *
		 * - If `to` refers to a smart contract, it must implement
		 *	 {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
		 * - `quantity` must be greater than 0.
		 *
		 * Emits a {Transfer} event.
		 */
		function _safeMint(
				address to,
				uint256 quantity,
				bytes memory _data
		) internal {
				uint256 startTokenId = _currentIndex;
				if (to == address(0)) revert MintToZeroAddress();
				if (quantity == 0) revert MintZeroQuantity();

				_beforeTokenTransfers(address(0), to, startTokenId, quantity);

				// Overflows are incredibly unrealistic.
				// balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
				// updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
				unchecked {
						// Updates:
						// - `balance += quantity`.
						// - `numberMinted += quantity`.
						//
						// We can directly add to the balance and number minted.
						_packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

						// Updates:
						// - `address` to the owner.
						// - `startTimestamp` to the timestamp of minting.
						// - `burned` to `false`.
						// - `nextInitialized` to `quantity == 1`.
						_packedOwnerships[startTokenId] =
								_addressToUint256(to) |
								(block.timestamp << BITPOS_START_TIMESTAMP) |
								(_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);

						uint256 updatedIndex = startTokenId;
						uint256 end = updatedIndex + quantity;

						if (to.code.length != 0) {
								do {
										emit Transfer(address(0), to, updatedIndex);
										if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
												revert TransferToNonERC721ReceiverImplementer();
										}
								} while (updatedIndex < end);
								// Reentrancy protection
								if (_currentIndex != startTokenId) revert();
						} else {
								do {
										emit Transfer(address(0), to, updatedIndex++);
								} while (updatedIndex < end);
						}
						_currentIndex = updatedIndex;
				}
				_afterTokenTransfers(address(0), to, startTokenId, quantity);
		}

		/**
		 * @dev Mints `quantity` tokens and transfers them to `to`.
		 *
		 * Requirements:
		 *
		 * - `to` cannot be the zero address.
		 * - `quantity` must be greater than 0.
		 *
		 * Emits a {Transfer} event.
		 */
		function _mint(address to, uint256 quantity) internal {
				uint256 startTokenId = _currentIndex;
				if (to == address(0)) revert MintToZeroAddress();
				if (quantity == 0) revert MintZeroQuantity();

				_beforeTokenTransfers(address(0), to, startTokenId, quantity);

				// Overflows are incredibly unrealistic.
				// balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
				// updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
				unchecked {
						// Updates:
						// - `balance += quantity`.
						// - `numberMinted += quantity`.
						//
						// We can directly add to the balance and number minted.
						_packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

						// Updates:
						// - `address` to the owner.
						// - `startTimestamp` to the timestamp of minting.
						// - `burned` to `false`.
						// - `nextInitialized` to `quantity == 1`.
						_packedOwnerships[startTokenId] =
								_addressToUint256(to) |
								(block.timestamp << BITPOS_START_TIMESTAMP) |
								(_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);

						uint256 updatedIndex = startTokenId;
						uint256 end = updatedIndex + quantity;

						do {
								emit Transfer(address(0), to, updatedIndex++);
						} while (updatedIndex < end);

						_currentIndex = updatedIndex;
				}
				_afterTokenTransfers(address(0), to, startTokenId, quantity);
		}

		/**
		 * @dev Transfers `tokenId` from `from` to `to`.
		 *
		 * Requirements:
		 *
		 * - `to` cannot be the zero address.
		 * - `tokenId` token must be owned by `from`.
		 *
		 * Emits a {Transfer} event.
		 */
		function _transfer(
				address from,
				address to,
				uint256 tokenId
		) private {
				uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

				if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

				bool isApprovedOrOwner = (_msgSenderERC721A() == from ||
						isApprovedForAll(from, _msgSenderERC721A()) ||
						getApproved(tokenId) == _msgSenderERC721A());

				if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
				if (to == address(0)) revert TransferToZeroAddress();

				_beforeTokenTransfers(from, to, tokenId, 1);

				// Clear approvals from the previous owner.
				delete _tokenApprovals[tokenId];

				// Underflow of the sender's balance is impossible because we check for
				// ownership above and the recipient's balance can't realistically overflow.
				// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
				unchecked {
						// We can directly increment and decrement the balances.
						--_packedAddressData[from]; // Updates: `balance -= 1`.
						++_packedAddressData[to]; // Updates: `balance += 1`.

						// Updates:
						// - `address` to the next owner.
						// - `startTimestamp` to the timestamp of transfering.
						// - `burned` to `false`.
						// - `nextInitialized` to `true`.
						_packedOwnerships[tokenId] =
								_addressToUint256(to) |
								(block.timestamp << BITPOS_START_TIMESTAMP) |
								BITMASK_NEXT_INITIALIZED;

						// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
						if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
								uint256 nextTokenId = tokenId + 1;
								// If the next slot's address is zero and not burned (i.e. packed value is zero).
								if (_packedOwnerships[nextTokenId] == 0) {
										// If the next slot is within bounds.
										if (nextTokenId != _currentIndex) {
												// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
												_packedOwnerships[nextTokenId] = prevOwnershipPacked;
										}
								}
						}
				}

				emit Transfer(from, to, tokenId);
				_afterTokenTransfers(from, to, tokenId, 1);
		}

		/**
		 * @dev Equivalent to `_burn(tokenId, false)`.
		 */
		function _burn(uint256 tokenId) internal virtual {
				_burn(tokenId, false);
		}

		/**
		 * @dev Destroys `tokenId`.
		 * The approval is cleared when the token is burned.
		 *
		 * Requirements:
		 *
		 * - `tokenId` must exist.
		 *
		 * Emits a {Transfer} event.
		 */
		function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
				uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

				address from = address(uint160(prevOwnershipPacked));

				if (approvalCheck) {
						bool isApprovedOrOwner = (_msgSenderERC721A() == from ||
								isApprovedForAll(from, _msgSenderERC721A()) ||
								getApproved(tokenId) == _msgSenderERC721A());

						if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
				}

				_beforeTokenTransfers(from, address(0), tokenId, 1);

				// Clear approvals from the previous owner.
				delete _tokenApprovals[tokenId];

				// Underflow of the sender's balance is impossible because we check for
				// ownership above and the recipient's balance can't realistically overflow.
				// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
				unchecked {
						// Updates:
						// - `balance -= 1`.
						// - `numberBurned += 1`.
						//
						// We can directly decrement the balance, and increment the number burned.
						// This is equivalent to `packed -= 1; packed += 1 << BITPOS_NUMBER_BURNED;`.
						_packedAddressData[from] += (1 << BITPOS_NUMBER_BURNED) - 1;

						// Updates:
						// - `address` to the last owner.
						// - `startTimestamp` to the timestamp of burning.
						// - `burned` to `true`.
						// - `nextInitialized` to `true`.
						_packedOwnerships[tokenId] =
								_addressToUint256(from) |
								(block.timestamp << BITPOS_START_TIMESTAMP) |
								BITMASK_BURNED | 
								BITMASK_NEXT_INITIALIZED;

						// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
						if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
								uint256 nextTokenId = tokenId + 1;
								// If the next slot's address is zero and not burned (i.e. packed value is zero).
								if (_packedOwnerships[nextTokenId] == 0) {
										// If the next slot is within bounds.
										if (nextTokenId != _currentIndex) {
												// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
												_packedOwnerships[nextTokenId] = prevOwnershipPacked;
										}
								}
						}
				}

				emit Transfer(from, address(0), tokenId);
				_afterTokenTransfers(from, address(0), tokenId, 1);

				// Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
				unchecked {
						_burnCounter++;
				}
		}

		/**
		 * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
		 *
		 * @param from address representing the previous owner of the given token ID
		 * @param to target address that will receive the tokens
		 * @param tokenId uint256 ID of the token to be transferred
		 * @param _data bytes optional data to send along with the call
		 * @return bool whether the call correctly returned the expected magic value
		 */
		function _checkContractOnERC721Received(
				address from,
				address to,
				uint256 tokenId,
				bytes memory _data
		) private returns (bool) {
				try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
						bytes4 retval
				) {
						return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
				} catch (bytes memory reason) {
						if (reason.length == 0) {
								revert TransferToNonERC721ReceiverImplementer();
						} else {
								assembly {
										revert(add(32, reason), mload(reason))
								}
						}
				}
		}

		/**
		 * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
		 * And also called before burning one token.
		 *
		 * startTokenId - the first token id to be transferred
		 * quantity - the amount to be transferred
		 *
		 * Calling conditions:
		 *
		 * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
		 * transferred to `to`.
		 * - When `from` is zero, `tokenId` will be minted for `to`.
		 * - When `to` is zero, `tokenId` will be burned by `from`.
		 * - `from` and `to` are never both zero.
		 */
		function _beforeTokenTransfers(
				address from,
				address to,
				uint256 startTokenId,
				uint256 quantity
		) internal virtual {}

		/**
		 * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
		 * minting.
		 * And also called after one token has been burned.
		 *
		 * startTokenId - the first token id to be transferred
		 * quantity - the amount to be transferred
		 *
		 * Calling conditions:
		 *
		 * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
		 * transferred to `to`.
		 * - When `from` is zero, `tokenId` has been minted for `to`.
		 * - When `to` is zero, `tokenId` has been burned by `from`.
		 * - `from` and `to` are never both zero.
		 */
		function _afterTokenTransfers(
				address from,
				address to,
				uint256 startTokenId,
				uint256 quantity
		) internal virtual {}

		/**
		 * @dev Returns the message sender (defaults to `msg.sender`).
		 *
		 * If you are writing GSN compatible contracts, you need to override this function.
		 */
		function _msgSenderERC721A() internal view virtual returns (address) {
				return msg.sender;
		}