Codpiece

A codpiece (< Middle English codpece = cod 'bag, scrotum' + pece 'piece') is a flap or pouch that attaches to the front of the crotch of men's trousers to provide a covering for the genitals. It would be held closed by string ties, buttons, or other methods.

It was an important item of European clothing in the 15th and 16th centuries.