Respiratory depression (the slowing down of breathing) can be caused by various medications, and may be a problem at altitude. The following medications can do this, and should never be used by someone who has symptoms of altitude illness (these may be safe in persons who are not ill, although this remains controversial)
The key to avoiding AMS is a gradual ascent that gives your body time to acclimatize. People acclimatize at different rates, so no absolute statements are possible, but in general, the following recommendations will keep most people from getting AMS
The dose of acetazolamide for prophylaxis is 125-250 mg twice a day starting 24 hours before ascent, and discontinuing after the second or third night at the maximum altitude (or with descent if that occurs earlier). Sustained release acetazolamide, 500 mg, is also available and may be taken once per day instead of the shorter acting form, though side effects will be more prominent with this dose.
Remember, it's how high you sleep each night that really counts; climbers have understood this for years, and have a maxim "climb high, sleep low". The day hikes to higher elevations that you take on your "rest days" (when you spend a second night at the same altitude) help your acclimatization by exposing you to higher elevations, then you return to a lower (safer) elevation to sleep. This second night also ensures that you are fully acclimatized and ready for further ascent.
These studies used a standardized Ginkgo biloba extract (24% flavonoid glycosides, 6% terpenoids). The dose used was 80 - 120 mg twice a day, starting 5 days before a rapid ascent or at the beginning of a gradual ascent. ConsumerLab.com is an independent lab that tests herbal products to ensure that they contain what the label promises; they have a page evaluating Ginkgo products available in the USA.
This simply cannot be emphasized too much. If you have symptoms of AMS, DO NOT ASCEND ANY HIGHER. Violating this simple rule has resulted in many tragic deaths
If you ascend with AMS you will get worse, and you might die. This is extremely important - even a day hike to a higher elevation is a great risk. In many cases of High Altitude Cerebral Edema, this rule was violated. Stay at the same altitude (or descend) until your symptoms completely go away. Once your symptoms are completely gone, you have acclimatized and then it is OK to continue ascending. It is always OK to descend, you will get better faster.