The only thing I can tell is that you don't get the same result when you do (int *)& to a pointer. You get the address of the memory of the pointer. That address you store it at the same pointer. So the pointer points itself. That is all. Don't know why you want to do this...
EDIT: Hmm, you generally get a seemingly "random" number when you get the address of the pointer. But just guessing here, the programmer of this code might know that the return address of main is stored 2 memory blocks (each memory block stores one int) away from where p is stored. Why? Don't know, but p is the only local variable so you know, it is possible the program behaves like that. So you store the return variable on p. Then you change the value of the return address to what you want, and I assume main returns there.