Here's a link to an article about using ibuprofen for prevention of AMS.

There are some limitations to the study, considering the participants only went up to 11k.