def make_inst(g, addr, dest, op, *args):
    def make_arg(a):
        if a is None:
            return None
        if isinstance(a, int):
            return VALUE(a)
        if isinstance(a, str):
            return REG(a)
        return a
    b = BBlock(addr)
    args = [make_arg(a) for a in args]
    b.add(Inst(make_arg(dest), op, args, addr))
    g.add_node(addr, val=b)