Optimization of Reversible Circuits Using Gate Pair Classification