Help me with finding the output of the following recursive code.

Can anyone please explain what will be the output of the given below recursive function.

Please explain it in very detail with recursion tree.

set of vectors P.

void f(set S,vector v){
    if(S is empty){
        insert v into P;
    for(i = n to 1){
        if(i in S){
            f(S\{i},v);//S\{i} is S after removing i
            //erase last element

Can you let me know what’s the answer. According to me it should be initial vector v containing all the elements in S which are between 1 and n, in the set of vectors P.
If it’s so i can discuss my approach else i will try it again.
EDIT : I assumed that vector and set are call by value.