From M. Smith “The structure of Psalm lxxxvii”, VT 38 (1988), pp. 357-358, quoted by https://www.labuschagne.nl/ps087.pdf based on the Hebrew.
A Psalm or Song for the sons of Korah.
A. 1 His foundation is in the holy mountains.
2 The LORD loveth the gates of Zion more than all the dwellings of Jacob. 3 Glorious things are spoken of thee (בָּֽךְ׃), O city of God. Selah.
B. 4 I will make mention of Rahab and Babylon to them that know me: behold Philistia, and Tyre, with Ethiopia; this man was born there (שָֽׁם).
C’. 5 And of Zion it shall be said, This and that man was born in her (בָּ֑הּ) and the highest himself shall establish her.
B’. 6 The LORD shall count, when he writeth up the people,
that this man was born there (שָֽׁם). Selah.
A’. 7 As well the singers as the players on instruments shall be there:
all my springs are in thee ( בָּֽךְ׃).