put assertions in performance-sensitive code behind ASSERTIONS flag