'Rewrite `var = call <print function>(...)` as a sequence of
`print(...)` and `var = const(None)`.'

def apply(self):

    new_block = self.block.copy()
    new_block.clear()
    for inst in self.block.body:
        if (inst in self.prints):
            expr = self.prints[inst]
            print_node = ir.Print(args=expr.args, vararg=expr.vararg, loc=expr.loc)
            new_block.append(print_node)
            assign_node = ir.Assign(value=ir.Const(None, loc=expr.loc), target=inst.target, loc=inst.loc)
            new_block.append(assign_node)
        else:
            new_block.append(inst)
    return new_block
