Finding main method and performing a DFS search for instructions