Cocktailer: Analyzing and Optimizing Dynamic Control Flow in Deep Learning