Improve register print generated code.