def METHOD_NAME(tree: ast.AST, defn_env: dict, phi_name: str = "phi"):
    # tree = MoveReturn().visit(tree)
    # tree.body.append(
    #     ast.Return(ast.Name("__magma_ssa_return_value", ast.Load())))
    ssa_visitor = SSAVisitor(phi_name)
    tree = ssa_visitor.visit(tree)
    return_transformer = TransformReturn()
    tree = return_transformer.visit(tree)
    num_return_values = len(ssa_visitor.return_values)
    for i in reversed(range(num_return_values)):
        conds = ssa_visitor.return_values[i]
        name = f"__magma_ssa_return_value_{i}"
        if i == num_return_values - 1 or not conds:
            if isinstance(tree.returns, ast.Tuple):
                tree.body.append(ast.Assign(
                    [ast.Tuple([ast.Name(f"O{i}", ast.Store())
                     for i in range(len(tree.returns.elts))], ast.Store())],
                    ast.Name(name, ast.Load())
                ))
            else:
                tree.body.append(ast.Assign([ast.Name("O", ast.Load)],
                                            ast.Name(name, ast.Load())))
        else:
            cond = conds[-1]
            for c in conds[:-1]:
                cond = ast.BinOp(cond, ast.BitAnd(), c)
            if isinstance(tree.returns, ast.Tuple):
                for i in range(len(tree.returns.elts)):
                    tree.body.append(ast.Assign(
                        [ast.Name(f"O{i}", ast.Store())],
                        ast.Call(ast.Name(phi_name, ast.Load()), [
                            ast.List([
                                ast.Name(f"O{i}", ast.Load()),
                                ast.Subscript(ast.Name(name, ast.Load()),
                                              ast.Index(ast.Num(i)),
                                              ast.Load())
                            ], ast.Load()),
                            cond], []))
                    )
            else:
                tree.body.append(ast.Assign(
                    [ast.Name("O", ast.Store())],
                    ast.Call(ast.Name(phi_name, ast.Load()), [
                        ast.List([ast.Name("O", ast.Load()), ast.Name(name, ast.Load())],
                                 ast.Load()), cond], []))
                )
    return tree, ssa_visitor.args