transforms.py: Implement optimization name selection based on used LLVM version
transforms.py: Implement optimization name selection based on used LLVM version

... and refactor the surrounding code a bit.

staticafi/symbiotic,staticafi/symbiotic,staticafi/symbiotic,staticafi/symbiotic