The first occurrence.
Oh, let the wickedness of the wicked come to an end; but establish the righteous: for the righteous God tries the hearts and minds. Psa 7:9
The primitive root.
Strong’s H1584 גמר gamar, a primitive root meaning, “To complete, finish, accomplish, perfect.”
gimel ג = foot, thus foot, walk, gather
mem מ ם = the water, thus chaos, mighty, blood
resh ר = head of man, thus head, first, top, beginning, man
The story: To walk (gimel) through the highs and lows (mem, as expressed in waves of the sea) of a man (resh), to his end is implied, that is, to complete from beginning to end. The Ancient Hebrew Lexicon says:
To come to an end in [either] perfection or failure.