Sorry I shouldn't have been so vague and actually explain. This is my thought process so far.
So y is assigned a value, then that value is used as an argument for pointer x.
test(&(y)) //What I think y is getting treated as at the moment.
In the function, pointer x gets dereference and is assigned the value of 5.
Since y is the address of pointer x, and when a pointer is dereferenced it is also accessing the object which it is pointing to, y is also assigned (overwritten) the value of 5 (what I understand about pointers, address and dereference from vlad's code).