A C to Register Transfer Level Algorithm Using Structured Circuit Templates: A Case Study with Simulated Annealing