Energy Form of the Balog-Szemerédi-Gowers Theorem