import os
import csv

function_names = {}
with open(os.path.expanduser("/path/to/reverssg/first_call_analysis/ghidra_functions.csv")) as file:
    file = csv.reader(file)
    next(file)
    for addr_hex, name in file:
        function_names[int(addr_hex,16)] = name

call_counts = {}
while True:
	prefix, addr, _ = input().split(maxsplit=2)
	call_counts[int(addr,16)] = call_counts.get(int(addr,16), 0) + 1
	if call_counts[int(addr,16)] == 1:
		ghidra_name = function_names.get(int(addr,16))
		print(f"first call: {hex(int(addr,16))} {ghidra_name}")
