#!/usr/bin/ruby

def cppfilt(name)
  return IO.popen(["c++filt", name], "rb") do |io|
    return io.read.strip
  end
end

begin
  File.foreach("unused.txt") do |line|
    m = line.match(/\.\w+\.(?<sym>_\w+)\b/)
    if m then
      sym = m["sym"]
      undec = cppfilt(sym)
      printf("%s -> %s\n", sym, undec)
    end
  end
end


