Logic synthesis for fault-tolerant quantum computers