The curve of compactified 6D gauge theories and integrable systems