AS_OPTIMIZATIONS_STAGE1

port of AS_OPTIMIZATIONS_STAGE1 changes without the #ifdef