This is dumb. There's no reason for the genie to iterate though it in a loop.
Wish one is granted, which simply switches wish two. Wish two is granted (in reverse). Then wish one is ignored, restoring one wish.
If you wish to have a hotdog and then eat it, you were still given a hotdog. The wish was still granted.