def METHOD_NAME(s):
    res = []
    if isinstance(s, (LoopIR.Assign, LoopIR.Reduce)):
        res += [s.name]
        res += used_e(s.rhs)
    elif isinstance(s, LoopIR.WriteConfig):
        res += used_e(s.rhs)
    elif isinstance(s, LoopIR.If):
        res += used_e(s.cond)
        for b in s.body:
            res += METHOD_NAME(b)
        for b in s.orelse:
            res += METHOD_NAME(b)
    elif isinstance(s, LoopIR.Seq):
        for b in s.body:
            res += METHOD_NAME(b)
    elif isinstance(s, LoopIR.Alloc):
        res += [s.name]
    elif isinstance(s, LoopIR.Call):
        for e in s.args:
            res += used_e(e)
    elif isinstance(s, LoopIR.WindowStmt):
        res += used_e(s.rhs)
    return res