{
    "Function": "sub",
    "File": "contracts/types/LeftRight.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "LeftRight",
        "LeftRight",
        "LeftRight",
        "LeftRight",
        "LeftRight",
        "LeftRight"
    ],
    "Internal Calls": [
        "revert UnderOverFlow()"
    ],
    "Library Calls": [
        "rightSlot",
        "toLeftSlot",
        "rightSlot",
        "toRightSlot",
        "leftSlot",
        "leftSlot"
    ],
    "Low-Level Calls": [],
    "Code": "function sub(int256 x, int256 y) internal pure returns (int256 z) {\n        unchecked {\n            int256 left256 = int256(x.leftSlot()) - y.leftSlot();\n            int128 left128 = int128(left256);\n\n            int256 right256 = int256(x.rightSlot()) - y.rightSlot();\n            int128 right128 = int128(right256);\n\n            if (left128 != left256 || right128 != right256) revert Errors.UnderOverFlow();\n\n            return z.toRightSlot(right128).toLeftSlot(left128);\n        }\n    }"
}