{
    "Function": "getMSB",
    "File": "contracts/math/Bitmap.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "require(bool)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function getMSB(uint256 x) internal pure returns (uint256 msb) {\n        // If x == 0 then there is no MSB and this method will return zero. That would\n        // be the same as the return value when x == 1 (MSB is zero indexed), so instead\n        // we have this require here to ensure that the values don't get mixed up.\n        require(x != 0); // dev: get msb zero value\n        if (x >= 0x100000000000000000000000000000000) {\n            x >>= 128;\n            msb += 128;\n        }\n        if (x >= 0x10000000000000000) {\n            x >>= 64;\n            msb += 64;\n        }\n        if (x >= 0x100000000) {\n            x >>= 32;\n            msb += 32;\n        }\n        if (x >= 0x10000) {\n            x >>= 16;\n            msb += 16;\n        }\n        if (x >= 0x100) {\n            x >>= 8;\n            msb += 8;\n        }\n        if (x >= 0x10) {\n            x >>= 4;\n            msb += 4;\n        }\n        if (x >= 0x4) {\n            x >>= 2;\n            msb += 2;\n        }\n        if (x >= 0x2) msb += 1; // No need to shift xc anymore\n    }"
}