Generating IR Code: basic framework