"long pole on a ship to support the sail," Old English mæst, from Proto-Germanic *mastaz (cf. Old Norse mastr, Middle Dutch maste, Dutch, Danish mast, German Mast), from PIE *mazdo- "a pole, rod" (cf. Latin malus "mast," Old Irish matan "club," Irish maide "a stick," Old Church Slavonic mostu "bridge"). The single mast of an old ship was the boundary between quarters of officers and crew, hence before the mast in the title of Dana's book, etc.
"fallen nuts; food for swine," Old English mæst, from Proto-Germanic *masto (cf. Dutch, Old High German, German mast "mast;" Old English verb mæsten "to fatten, feed"), perhaps from PIE *mad-sta-, from root *mad- "moist, wet," also used of various qualities of food (cf. Sanskrit madati "it bubbles, gladdens," medah "fat, marrow;" Latin madere "be sodden, be drunk;" Middle Persian mast "drunk;" Old English mete "food," Old High German muos "meal, mushlike food," Gothic mats "food").