Rabbeinu Bahya (13th Century) wrote that in non-sacred usage the Nun of adonai has a Patah, and only with an Etnahta or Sof pasuk a Qamatz when the word stands on its own. ‘And for this reason in the vocalization of the sacred Name you will not find a Patah but only a Qamatz for the high and great level which indicates His being above all, and that He does not rest on another, as is the case with creatures. For this reason when the name Aleph Dalet is sacred, it has a Qamatz and when it is not it has a Patah.’ In the opinion of Rabbeinu Bahya the Qamatz of the Nun of the sacred Name is the same as the Qamatz of the pausal form. (See more here)
Looking at Bereshit 18:3 does this mean the word Adonai is refering to G-d, cause it's written with a qamats? Cause Adonai in Bereshit 19:2 is referring to two angels and is written with a patach.
I've once read somewhere this is indeed the case and that Avraham asks G-d to stay with him while he'll help the passengers (the three men).
So to whom is the word Adonai refering in Bereshit 18:3?