I've been keeping my mouth shut, because I can't remember a similar expression or group of expressions "cock-up" may be punning on: "___-up" meaning, "a brawl." "Cock-up" would then be from cock fight, and the shambles would be the aftermath (presumeably of a brawl between men, as in a bar room brawl).

Anyway, in the days of Viagra, a cock-up need no longer be a shambles.

Sorry.