def to_brig(self, mod, opt=3):
        bufptr = c_void_p(0)
        size = self.hlc.HLC_ModuleEmitBRIG(mod, int(opt), byref(bufptr))
        if not size:
            raise Error("Failed to emit BRIG")
        buf = (c_byte * size).from_address(bufptr.value)
        try:
            buffer
        except __HOLE__:
            ret = bytes(buf)
        else:
            ret = bytes(buffer(buf))
        self.hlc.HLC_DisposeString(buf)
        return ret
dataset/ETHPy150Open numba/numba/numba/hsa/hlc/libhlc.py/HLC.to_brig