Complex sentence: Perry wrote the song with Desmond Child and Andreas Carlsson, while production was done by Perry and Greg Wells, who is also credited for playing all the instruments on the song.
Split into simpler sentences: Perry wrote the song with Desmond Child and Andreas Carlsson. Wells is credited with playing all the instruments on the song.