cmp opt, fix condition handling