Look through the lines of the code, analyze the comments and see how the pointers are being using. Note that line 12 is the only one that modifies firstvalue, while line 13 and line 15 are modifying secondvalue.
Oh, I got it. Since p2 was copied to p1, any change to *p1 is no longer a change to firstvalue, but to secondvalue. Apparently, I had forgotten that the assignment operation worked from right to left. Thank you.