The best answer is:
Cl; it takes much more energy to pull an electron away from a valence shell that is nearly full.
Chlorine has a higher ionization energy than magnesium because it is closer to having a full valence shell (with 7 valence electrons) and thus requires more energy to remove one of its electrons. In contrast, magnesium has only 2 valence electrons and is more willing to lose them to achieve a stable electron configuration, which results in a lower ionization energy.