def METHOD_NAME(
    comp, group, mem_a, mem_b, mem_c, mem_d, i, tree, ans_reg
):
    """Orchestrates the use of the component `tree`.
    Adds wiring for a new group called {group}.
    In {group}, assumes that `tree` exists and is set up as above.
    Puts into the tree's four leaves the values the values a[i], b[i], c[i], and d[i].
    Runs the tree, waits for the tree to be done, and stores the answer in {ans_reg}.
    Finally, returns a handle to {group}.
    """
    # i.e., much like the above, but instead of getting the ports as arguments,
    # it must first calculate them.
    # It also stores the answer in a register, rather than a memory.
    with comp.group(group) as tree_use:
        mem_a.addr0 = mem_b.addr0 = mem_c.addr0 = mem_d.addr0 = i
        tree.leaf0 = mem_a.read_data
        tree.leaf1 = mem_b.read_data
        tree.leaf2 = mem_c.read_data
        tree.leaf3 = mem_d.read_data
        tree.go = cb.HI
        ans_reg.write_en = tree.done @ 1
        ans_reg.in_ = tree.done @ tree.sum
        tree_use.done = ans_reg.done
    return tree_use