Some old DOS programs that use a protected mode DOS extender and install their own interrupt handlers (usually games) use the CLI instruction in the handlers to disable interrupts and either POPF (after a corresponding PUSHF) or IRET (which restores the flags from the stack as part of its effects) to restore it.
Certain older DOS applications that operate within a shielded environment and embed their own interrupt handlers (typically games) utilize the CLI instruction in these handlers to temporarily disable interrupts and either POPF (following a corresponding PUSHF) or IRET (which reinstates the flags from the stack as part of its effects) to reactivate them.