optimizing g++ output