egra: more strict checks before applying asm optimisations