{
    "Function": "_brutalizeMemory",
    "File": "contracts/lib/solady/test/utils/TestPlus.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "codecopy(uint256,uint256,uint256)",
        "mstore(uint256,uint256)",
        "keccak256(uint256,uint256)",
        "codecopy(uint256,uint256,uint256)",
        "mload(uint256)",
        "gas()",
        "calldatasize()",
        "mload(uint256)",
        "codesize()",
        "codesize()",
        "calldatasize()",
        "mstore(uint256,uint256)",
        "mload(uint256)",
        "mstore(uint256,uint256)",
        "calldatacopy(uint256,uint256,uint256)",
        "mstore(uint256,uint256)",
        "mload(uint256)",
        "mstore(uint256,uint256)",
        "mload(uint256)",
        "keccak256(uint256,uint256)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _brutalizeMemory() private view {\n        // To prevent a solidity 0.8.13 bug.\n        // See: https://blog.soliditylang.org/2022/06/15/inline-assembly-memory-side-effects-bug\n        // Basically, we need to access a solidity variable from the assembly to\n        // tell the compiler that this assembly block is not in isolation.\n        uint256 zero;\n        /// @solidity memory-safe-assembly\n        assembly {\n            let offset := mload(0x40) // Start the offset at the free memory pointer.\n            calldatacopy(offset, zero, calldatasize())\n\n            // Fill the 64 bytes of scratch space with garbage.\n            mstore(zero, add(caller(), gas()))\n            mstore(0x20, keccak256(offset, calldatasize()))\n            mstore(zero, keccak256(zero, 0x40))\n\n            let r0 := mload(zero)\n            let r1 := mload(0x20)\n\n            let cSize := add(codesize(), iszero(codesize()))\n            if iszero(lt(cSize, 32)) { cSize := sub(cSize, and(mload(0x02), 0x1f)) }\n            let start := mod(mload(0x10), cSize)\n            let size := mul(sub(cSize, start), gt(cSize, start))\n            let times := div(0x7ffff, cSize)\n            if iszero(lt(times, 128)) { times := 128 }\n\n            // Occasionally offset the offset by a pseudorandom large amount.\n            // Can't be too large, or we will easily get out-of-gas errors.\n            offset := add(offset, mul(iszero(and(r1, 0xf)), and(r0, 0xfffff)))\n\n            // Fill the free memory with garbage.\n            // prettier-ignore\n            for { let w := not(0) } 1 {} {\n                mstore(offset, r0)\n                mstore(add(offset, 0x20), r1)\n                offset := add(offset, 0x40)\n                // We use codecopy instead of the identity precompile\n                // to avoid polluting the `forge test -vvvv` output with tons of junk.\n                codecopy(offset, start, size)\n                codecopy(add(offset, size), 0, start)\n                offset := add(offset, cSize)\n                times := add(times, w) // `sub(times, 1)`.\n                if iszero(times) { break }\n            }\n        }\n    }"
}