Efficient and Safe Control Flow Recovery Using a Restricted Intermediate Language