CFun generation from LMS