add O3 optimizations