It's a nice idea, but is very fragile. The exact registers that are used are very sensitive to every detail, and hard to predict. The best options are: 1. write the whole dang thing in assembler 2. write a recognizer for it and custom code generation