In the 2022 Northern Ireland Assembly election, Sinn Féin increased their vote share from 27.9% to 29.0% and became (for the first time) the largest party, amidst a split in the unionist vote between DUP, UUP, and TUV (in total there are still more unionist than nationalist votes). In the 2020 Irish general election, Sinn Féin got the highest share of the vote (24.5%) and the second-highest share of the seats. In opinion polls for the next Irish general election, Sinn Féin is currently (May 2022) polling at 34%, a 13-percentage-point lead over the number two, raising speculation that a future Taoiseach will be from Sinn Féin as well.
Political issues aside (Stormont power-sharing partner may not like the idea), would it be legally possible for the same person to be both Taoiseach in Dublin and First Minister in Stormont?