import json
import sys
import json
audit_path = sys.argv[1] if len(sys.argv) > 1 else 'C:/tmp/audit_after_l7208.json'
with open(audit_path, 'rb') as f:
    raw = f.read()
if raw.startswith(b'\xff\xfe'):
    raw = raw.decode('utf-16-le')[1:]
else:
    raw = raw.decode('utf-8')
data = json.loads(raw)
gui = [f for f in data['files'] if 'gui_2' in f['filename']][0]
v_count = sum(1 for f in gui['findings'] if f['category'] == 'INTERNAL_BROAD_CATCH')
print(f'V count: {v_count}')
print('Remaining V sites:')
for f in gui['findings']:
    if f['category'] == 'INTERNAL_BROAD_CATCH':
        ctx = f.get('context', '')[:80]
        line = f['line']
        print(f'  L{line}: [{f["category"]}] {ctx}')