Model-driven search-based loop fusion optimization for handwritten code