The Gemora sometimes wants to discuss a side point from a previous text. It will introduce this as אמר מר or גופא for example the first page of Brachos says: אֲמַר מָר: ״מִשָּׁעָה שֶׁהַכֹּהֲנִים נִכְנָסִים לֶאֱכוֹל בִּתְרוּמָתָן״, מִכְּדִי, כֹּהֲנִים, אֵימַת קָא אָכְלִי תְּרוּמָה?
we use the word אמר מר in order to bring up a side point that was mentioned.
or גופא that seems to do the same thing for example גּוּפָא: אֲמַר רִבִּי תַּנְחוּם אֲמַר רַב אַסֵי: טָעָה וְלֹא הִזְכִּיר גְּבוּרוֹת גְּשָׁמִים בִּתְחִיַּית הַמֵּתִים, מַחֲזִירִין אוֹתוֹ;
it goes back to a previous mention
why sometimes does it use אמר מר and sometimes גופא? Is there a rule? The answer must include a source