Rory McIlroy coughed his guts up, broke a club mid-shot and putted backwards but somehow worked the tribulations of a strange day to his advantage.