#!/usr/bin/sh

perl -pi.bak -e's!
    (?:
       \w+   # pmc
    |
       \w+\s*->\s*\w+(?:\.\w+)* # pmc->member [.mem]
    |
       \(    # cast
       \s*\(\s*PMC\s*\*\s*\)\s*\w+
       (?:\s*(?:\.|->)\w+)*\s*
       \)
    )
    \s*->\s*vtable\s*->\s*(\w+)\s*\(
    !VTABLE_$1(!sgx' $@
