Yes it is quite intricate...
There is the "intro", played once only,
then the A section, with ending 1 or 2 so I name A1 and A2
section B with ending 1 or 2 so B1 and B2 (when you have the ending mark, you play first the end named 1, and at the repeat, you dont play the 1 and jump to the end 2, clear ?)
and you have the "coda" or "fine" to play once at the end instead of the A1 ending.
Play : intro, A1, A2, B1, B2, A with ending directly in "fine" (my playing is intro A1, A2, B1, B2, A1, A2, B1, B2, A fine)
(this is to have all the tab on one page because it is not esay to read on three pages if you write in extenso)