the composition of the sun is based on the original gasses (by far mostly hydrogen)
the age of the sun and the nuclear reactions going on in its core (fusion to helium)
it is a nuclear process not a chemical process
the sun is a third(?) generation star
first generation stars are essentially all primordial hydrogen and (a little) primordial lithium(?)
at the end of their life, a big enough star (which basically includes all first generation stars)
will explode and seed the next generation of stars with some helium and some heavier elements
each generation of stars follows the same pattern
stars are still primarily hydrogen and this is likely to be the case for ever, as hydrogen is their primary energy source
you would have to go through the nuclear processes that occur throughout star's life, including the catastrophic explosion,
to get a handle on theoretical compositions
if i remember correctly, there was a phd thesis at RPI around 1978(?) that dealt with this question