GATO: an MHD stability code for axisymmetric plasmas with internal separatrices. The GATO code computes the growth rate of ideal magnetohydrodynamic instabilities in axisymmetric geometries with internal separatrices such as doublet and expanded spheromak. The basic method, which uses a variational principle and a Galerkin procedure to obtain a matrix eigenvalue problem, is common to the ERATO and PEST codes. A new coordinate system has been developed to handle the internal separatrix. Efficient algorithms have been developed to solve the matrix eigenvalue problem for matrices of rank as large as 40 000. Further improvement is expected using graph theoretical techniques to reorder the matrices. Using judicious mesh repartition, the marginal point can be determined with great precision. The code has been extensively used to optimize doublet and general tokamak plasmas