"""Guarded native Hard decisions; bounded modules, no roster/physics edits."""
def install(data, assemble, patch, *, support, steering, cross, keeper, owner=False):
    def module(name, origin, limit):
        code = assemble(name, origin)
        assert 0 < len(code) <= limit, (name, len(code), hex(origin + limit))
        patch(origin, b'\xff' * len(code), code)
    if support:
        module('ai_support_spots', 0x2DC400, 0x400)
        patch(0x2D8996, bytes.fromhex('30063203082b00070062'),
              bytes.fromhex('4ef9002dc4004e714e71'))
    if steering:
        module('ai_steering', 0x2D8D40, 0xC0)
        patch(0x103D0, bytes.fromhex('062b000c0042'), bytes.fromhex('4ef9002d8d40'))
    if keeper or steering or owner:
        module('ai_pass_owner', 0x2DD680, 0x180)
    if keeper:
        module('ai_keeper_pass', 0x2DC280, 0x180)
        patch(0xDA58, bytes.fromhex('320248a7c000'), bytes.fromhex('4ef9002dc280'))
    if cross:
        module('ai_freecross', 0x2DD800, 0x600)
        patch(0xE292, bytes.fromhex('4ef9002d8808'), bytes.fromhex('4ef9002dd800'))
        patch(0xE444, bytes.fromhex('4a78bee466000014'), bytes.fromhex('4ef9002dd8044e71'))
