What is the primary function of an anti-two-block (ATB) device, and which crane movements does it typically arrest when activated?