Real simple: if DNA tests show unambiguous XX chromosome, then the person competes with the women. Otherwise, the person competes with the men, period.
From what I understand is that the IOC doesn’t allow that kind of chromosomal testing, and hasn’t, since the late 1990s?
So, without that, what then?