Textbooks… Mine one is categorizing it as a painkiller, but then again, it is depending how you categorize it, or what for it was used in the first place.
You wondered how Ibuprofen could contribute a diving fatally. Well, I didn’t state that Ibuprofen does. Problems with medications like these are that they often aren’t the cause of an incident, but more a complication.
A general example would be that a diver misdiagnoses an arising pain after a dive. You don’t want to miss a DCS hit caused by medication that dulled the pain enough to make it feel harmless. Ibuprofen won’t be a substitute of oxygen and hyperbaric therapy.
Another example is that of aspirin. Aspirin is mainly used as a painkiller, but also has a well known blood thinning effect. It effect in combination with peoples own constitution is severe enough that some dentist won’t perform a tooth distraction due of the complications that can arise.
Now think of a freediver using aspirin as a painkiller and getting a severe enough contraction that causes a lung squeeze on a relative shallow depth. Combine that with a physician who knows nothing of hyperbaric medicine and isn’t informed about the aspirin use (The over-the-counter isn't a real medicine syndrome).
Impossible? Not quite, that’s the way how you get a classic case of a patient with complication after complication.
How less medicine you use and how healthier you are during your dives, how easier things are when you need to be treated by a physician.
Needing medication? Ask a well-informed physician or think if you really need to dive in your situation. (And write down your experiences for us

)
Rik