You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Ephedrine and explain in detail?
Ephedrine is a central nervous system (CNS) stimulant that is often used to prevent low blood pressure during anesthesia. It has also been used for asthma, narcolepsy, and obesity but is not the preferred treatment. It is of unclear benefit in nasal congestion. It can be taken by mouth or by injection into a muscle, vein, or just under the skin. Onset with intravenous use is fast, while injection into a muscle can take 20 minutes, and by mouth can take an hour for effect. When given by injection it lasts about an hour and when taken by mouth it can last up to four hours.Common side effects include trouble sleeping, anxiety, headache, hallucinations, high blood pressure, fast heart rate, loss of appetite, and inability to urinate. Serious side effects include stroke and heart attack. While likely safe in pregnancy, its use in this population is poorly studied. Use during breastfeeding is not recommended. Ephedrine works by increasing the activity of the α and β adrenergic receptors.Ephedrine was first isolated in 1885 and came into commercial use in 1926. It is on the World Health Organizations List of Essential Medicines. It is available as a generic medication.  It can normally be found in plants of the Ephedra genus. Dietary supplements containing ephedrine are illegal in the United States, with the exception of those used in traditional Chinese medicine, where its presence is noted by má huáng.

Medical use
Both ephedrine and pseudoephedrine increase blood pressure and act as bronchodilators, with pseudoephedrine having considerably less effect.Ephedrine may decrease motion sickness, but it has mainly been used to decrease the sedating effects of other medications used for motion sickness.Ephedrine is also found to have quick and long-lasting responsiveness in congenital myasthenic syndrome in early childhood and also even in the adults with a novel COLQ mutation.

Weight loss
Ephedrine promotes modest short-term weight loss, specifically fat loss, but its long-term effects are unknown. In mice, ephedrine is known to stimulate thermogenesis in the brown adipose tissue, but because adult humans have only small amounts of brown fat, thermogenesis is assumed  to take place mostly in the skeletal muscle. Ephedrine also decreases gastric emptying. Methylxanthines such as caffeine and theophylline have a synergistic effect with ephedrine with respect to weight loss.  This led to creation and marketing of compound products.  One of them, known as the ECA stack, contains ephedrine with caffeine and aspirin. It is a popular supplement taken by bodybuilders seeking to cut body fat before a competition.

Recreational use
As a phenethylamine, ephedrine has a similar chemical structure to amphetamines and is a methamphetamine analogue having the methamphetamine structure with a hydroxyl group at the β position. Because of ephedrines structural similarity to methamphetamine, it can be used to create methamphetamine using chemical reduction in which ephedrines hydroxyl group is removed; this has made ephedrine a highly sought-after chemical precursor in the illicit manufacture of methamphetamine.
The most popular method for reducing ephedrine to methamphetamine is similar to the Birch reduction, in that it uses anhydrous ammonia and lithium metal in the reaction. The second-most popular method uses red phosphorus and iodine in the reaction with ephedrine. Moreover, ephedrine can be synthesized into methcathinone via simple oxidation. As such, ephedrine is listed as a table-I precursor under the United Nations Convention Against Illicit Traffic in Narcotic Drugs and Psychotropic Substances.

Detection of use
Ephedrine may be quantified in blood, plasma, or urine to monitor possible abuse by athletes, confirm a diagnosis of poisoning, or assist in a medicolegal death investigation. Many commercial immunoassay screening tests directed at the amphetamines cross-react appreciably with ephedrine, but chromatographic techniques can easily distinguish ephedrine from other phenethylamine derivatives. Blood or plasma ephedrine concentrations are typically in the 20–200 µg/L range in persons taking the drug therapeutically, 300–3000 µg/L in abusers or poisoned patients and 3–20 mg/L in cases of acute fatal overdosage. The current World Anti-Doping Agency (WADA) limit for ephedrine in an athletes urine is 10 µg/mL.

Contraindications
Ephedrine should not be used in conjunction with certain antidepressants, namely norepinephrine-dopamine reuptake inhibitors (NDRIs), as this increases the risk of symptoms due to excessive serum levels of norepinephrine.
Bupropion is an example of an antidepressant with an amphetamine-like structure similar to ephedrine, and it is an NDRI. Its action bears more resemblance to amphetamine than to fluoxetine in that its primary mode of therapeutic action involves norepinephrine and to a lesser degree dopamine, but it also releases some serotonin from presynaptic clefts. It should not be used with ephedrine, as it may increase the likelihood of side effects.
Ephedrine should be used with caution in patients with inadequate fluid replacement, impaired adrenal function, hypoxia, hypercapnia, acidosis, hypertension, hyperthyroidism, prostatic hypertrophy, diabetes mellitus, cardiovascular disease, during delivery if maternal blood pressure is >130/80 mmHg, and during lactation.Contraindications for the use of ephedrine include: closed-angle glaucoma, phaeochromocytoma, asymmetric septal hypertrophy (idiopathic hypertrophic subaortic stenosis), concomitant or recent (previous 14 days) monoamine oxidase inhibitor (MAOI) therapy, general anaesthesia with halogenated hydrocarbons (particularly halothane), tachyarrhythmias or ventricular fibrillation, or hypersensitivity to ephedrine or other stimulants.
Ephedrine should not be used at any time during pregnancy unless specifically indicated by a qualified physician and only when other options are unavailable.

Adverse effects
Ephedrine is a potentially dangerous natural compound; as of 2004 the US Food and Drug Administration had received over 18,000 reports of adverse effects in people using it.Adverse drug reactions (ADRs) are more common with systemic administration (e.g. injection or oral administration) compared to topical administration (e.g. nasal instillations). ADRs associated with ephedrine therapy include:
Cardiovascular: tachycardia, cardiac arrhythmias, angina pectoris, vasoconstriction with hypertension
Dermatological: flushing, sweating, acne vulgaris
Gastrointestinal: nausea
Genitourinary: decreased urination due to vasoconstriction of renal arteries, difficulty urinating is not uncommon, as alpha-agonists such as ephedrine constrict the internal urethral sphincter, mimicking the effects of sympathetic nervous system stimulation
Nervous system: restlessness, confusion, insomnia, mild euphoria, mania/hallucinations (rare except in previously existing psychiatric conditions), delusions, formication (may be possible, but lacks documented evidence) paranoia, hostility, panic, agitation
Respiratory: dyspnea, pulmonary edema
Miscellaneous: dizziness, headache, tremor, hyperglycemic reactions, dry mouthThe neurotoxicity of l-ephedrine is disputed.

Other uses
In chemical synthesis, ephedrine is used in bulk quantities as a chiral auxiliary group.
In saquinavir synthesis, the half-acid is resolved as its salt with l-ephedrine.

Chemistry and nomenclature
Ephedrine is a sympathomimetic amine and substituted amphetamine. It is similar in molecular structure to phenylpropanolamine, methamphetamine, and epinephrine (adrenaline). Chemically, it is an alkaloid with a phenethylamine skeleton found in various plants in the genus Ephedra (family Ephedraceae). It works mainly by increasing the activity of norepinephrine (noradrenaline) on adrenergic receptors. It is most usually marketed as the hydrochloride or sulfate salt.
Ephedrine exhibits optical isomerism and has two chiral centres, giving rise to four stereoisomers. By convention, the pair of enantiomers with the stereochemistry (1R,2S) and (1S,2R) is designated ephedrine, while the pair of enantiomers with the stereochemistry (1R,2R) and (1S,2S) is called pseudoephedrine.
Ephedrine is a substituted amphetamine and a structural methamphetamine analogue. It differs from methamphetamine only by the presence of a hydroxyl group (—OH).
The isomer which is marketed is (−)-(1R,2S)-ephedrine.Ephedrine hydrochloride has a melting point of 187−188 °C.In the outdated D/L system (+)-ephedrine is also referred to as D-ephedrine and (−)-ephedrine as L-ephedrine (in which case, in the Fisher projection, the phenyl ring is drawn at the bottom).Often, the D/L system (with small caps) and the d/l system (with lower-case) are confused. The result is that the levorotary l-ephedrine is wrongly named L-ephedrine and the dextrorotary d-pseudoephedrine (the diastereomer) wrongly D-pseudoephedrine.
The IUPAC names of the two enantiomers are (1R,2S)- respectively (1S,2R)-2-methylamino-1-phenylpropan-1-ol. A synonym is erythro-ephedrine.

Sources
Agricultural
Ephedrine is obtained from the plant Ephedra sinica and other members of the genus Ephedra, from which the name of the substance is derived. Raw materials for the manufacture of ephedrine and traditional Chinese medicines are produced in China on a large scale. As of 2007, companies produced for export US$13 million worth of ephedrine from 30,000 tons of ephedra annually, or about ten times the amount used in traditional Chinese medicine.

Synthetic
Most of the l-ephedrine produced today for official medical use is made synthetically as the extraction and isolation process from E. sinica is tedious and no longer cost effective.

Biosynthetic
Ephedrine was long thought to come from modifying the amino acid L-phenylalanine. L-Phenylalanine would be decarboxylated and subsequently attacked with ω-aminoacetophenone. Methylation of this product would then produce ephedrine. This pathway has since been disproven. A new pathway proposed suggests that phenylalanine first forms cinnamoyl-CoA via the enzymes phenylalanine ammonia-lyase and acyl CoA ligase. The cinnamoyl-CoA is then reacted with a hydratase to attach the alcohol functional group. The product is then reacted with a retro-aldolase, forming benzaldehyde. Benzaldehyde reacts with pyruvic acid to attach a 2 carbon unit. This product then undergoes transamination and methylation to form ephedrine and its stereoisomer, pseudoephedrine.

Mechanism of action
Ephedrine, a sympathomimetic amine, acts on part of the sympathetic nervous system (SNS). The principal mechanism of action relies on its indirect stimulation of the adrenergic receptor system by increasing the activity of norepinephrine at the postsynaptic α  and β receptors. The presence of direct interactions with α receptors is unlikely, but still controversial. L-ephedrine, and particularly its stereoisomer norpseudoephedrine (which is also present in Catha edulis) has indirect sympathomimetic effects and due to its ability to cross the blood-brain barrier, it is a CNS stimulant similar to amphetamines, but less pronounced, as it releases noradrenaline and dopamine in the substantia nigra.The presence of an N-methyl group decreases binding affinities at α receptors, compared with norephedrine. Ephedrine, though, binds better than N-methylephedrine, which has an additional methyl group at the nitrogen atom. Also the steric orientation of the hydroxyl group is important for receptor binding and functional activity.
Compounds with decreasing α-receptor affinity

History
Asia
Ephedrine in its natural form, known as máhuáng (麻黄) in traditional Chinese medicine, has been documented in China since the Han dynasty (206 BC – 220 AD) as an antiasthmatic and stimulant. In traditional Chinese medicine, máhuáng has been used as a treatment for asthma and bronchitis for centuries.In 1885, the chemical synthesis of ephedrine was first accomplished by Japanese organic chemist Nagai Nagayoshi based on his research on  traditional Japanese and Chinese herbal medicines.
The industrial manufacture of ephedrine in China began in the 1920s, when Merck began marketing and selling the drug as ephetonin. Ephedrine exports from China to the West grew from 4 to 216 tonnes between 1926 and 1928.

Western medicine
Introduced in 1948 Vicks Vatronol nose drops (now discontinued) contained ephedrine sulfate as the active ingredient for rapid nasal decongestion.

Legality
Canada
In January 2002, Health Canada issued a voluntary recall of all ephedrine products containing more than 8 mg per dose, all combinations of ephedrine with other stimulants such as caffeine, and all ephedrine products marketed for weight-loss or bodybuilding indications, citing a serious risk to health. Ephedrine is still sold as an oral nasal decongestant in 8 mg pills as a natural health product, with a limit of 0.4g per package, the limit established by the Controlled Drugs and Substances Act as it is considered as Class A Precursor.

United States
In 1997, the FDA proposed a regulation on ephedra (the herb from which ephedrine is obtained), which limited an ephedra dose to 8 mg (of active ephedrine) with no more than 24 mg per day. This proposed rule was withdrawn, in part, in 2000 because of "concerns regarding the agencys basis for proposing a certain dietary ingredient level and a duration of use limit for these products." In 2004, the FDA created a ban on ephedrine alkaloids marketed for reasons other than asthma, colds, allergies, other disease, or traditional Asian use. On April 14, 2005, the U.S. District Court for the District of Utah ruled the FDA did not have proper evidence that low dosages of ephedrine alkaloids are actually unsafe, but on August 17, 2006, the U.S. Court of Appeals for the Tenth Circuit in Denver upheld the FDAs final rule declaring all dietary supplements containing ephedrine alkaloids adulterated, and therefore illegal for marketing in the United States. Furthermore, ephedrine is banned by the NCAA, MLB, NFL, and PGA. Ephedrine is, however, still legal in many applications outside of dietary supplements. Purchasing is currently limited and monitored, with specifics varying from state to state.
The House passed the Combat Methamphetamine Epidemic Act of 2005 as an amendment to the renewal of the USA PATRIOT Act. Signed into law by President George W. Bush on March 6, 2006, the act amended the US Code (21 USC 830) concerning the sale of products containing ephedrine and the closely related drug pseudoephedrine. Both substances are used as precursors in the illicit production of methamphetamine, and to discourage that use the federal statute included the following requirements for merchants who sell these products:

A retrievable record of all purchases identifying the name and address of each party to be kept for two years
Required verification of proof of identity of all purchasers
Required protection and disclosure methods in the collection of personal information
Reports to the Attorney General of any suspicious payments or disappearances of the regulated products
Non-liquid dose form of regulated product may only be sold in unit-dose blister packs
Regulated products are to be sold behind the counter or in a locked cabinet in such a way as to restrict access
Daily sales of regulated products not to exceed 3.6 g to a single purchaser, without regard to the number of transactions
Monthly sales to a single purchaser not to exceed 9 g of pseudoephedrine base in regulated productsThe law gives similar regulations to mail-order purchases, except the monthly sales limit is 7.5 g.
As a pure herb or tea, má huáng, containing ephedrine, is still sold legally in the US.  The law restricts/prohibits its being sold as a dietary supplement (pill) or as an ingredient/additive to other products, like diet pills.

Australia
Ephedrine and all Ephedra species which contain it are considered Schedule 4 substances under the Poisons Standard (October 2015). A Schedule 4 drug is considered a Prescription Only Medicine, or Prescription Animal Remedy – Substances, the use or supply of which should be by or on the order of persons permitted by State or Territory legislation to prescribe and should be available from a pharmacist on prescription under the Poisons Standard (October 2015).

South Africa
In South Africa, ephedrine was moved to schedule 6 on 27 May 2008, which makes pure ephedrine tablets prescription only. Pills containing ephedrine up to 30mg per tablet in combination with other medications are still available OTC, schedule 1 and 2, for sinus, head colds and influenza.

Germany
Ephedrine was freely available in pharmacies in Germany until 2001.  Afterwards, access was restricted since it was mostly bought for unindicated uses. Similarly, ephedra can only be bought with a prescription