{
    "Function": "_unsort",
    "File": "contracts/RubiconMarket.sol",
    "Parent Contracts": [
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol",
        "contracts/RubiconMarket.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "require(bool)",
        "isOfferSorted",
        "require(bool)",
        "require(bool)",
        "require(bool)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _unsort(\n        uint256 id //id of maker (ask) offer to remove from sorted list\n    ) internal returns (bool) {\n        address buy_gem = address(offers[id].buy_gem);\n        address pay_gem = address(offers[id].pay_gem);\n        require(_span[pay_gem][buy_gem] > 0);\n\n        require(\n            _rank[id].delb == 0 && //assert id is in the sorted list\n                isOfferSorted(id)\n        );\n\n        if (id != _best[pay_gem][buy_gem]) {\n            // offers[id] is not the highest offer\n            require(_rank[_rank[id].next].prev == id);\n            _rank[_rank[id].next].prev = _rank[id].prev;\n        } else {\n            //offers[id] is the highest offer\n            _best[pay_gem][buy_gem] = _rank[id].prev;\n        }\n\n        if (_rank[id].prev != 0) {\n            //offers[id] is not the lowest offer\n            require(_rank[_rank[id].prev].next == id);\n            _rank[_rank[id].prev].next = _rank[id].next;\n        }\n\n        _span[pay_gem][buy_gem]--;\n        _rank[id].delb = block.number; //mark _rank[id] for deletion\n        return true;\n    }"
}