Automated Synthesis of Nanoscale Crossbars from C Programs