Complete code generation for AmGraph