Flipped and now it wont run

I recently got a 2001 Sportsman 500 that had been flipped on its top while unloading it. It will start right up with no issue but after about a minute or 2 it shuts off like it ran out of gas or something. Anytime you put it in gear it shuts off. It has a lot of broken parts on the speedo and headlight assembly but I wouldnt think that would be the cause of it. What are some steps I should take considering it has been on its top and what could be causing it to shut off?