mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-09 05:27:56 -05:00
28 lines
567 B
Python
Executable File
28 lines
567 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys, os
|
|
import collections
|
|
|
|
sys.path.append('.')
|
|
|
|
from Compiler.program import *
|
|
from Compiler.instructions_base import *
|
|
|
|
if len(sys.argv) <= 1:
|
|
print('Usage: %s <program>' % sys.argv[0])
|
|
|
|
res = collections.defaultdict(lambda: 0)
|
|
m = 0
|
|
|
|
if os.path.isfile(sys.argv[1]):
|
|
tapename = re.sub(r'\.bc', '', os.path.basename(sys.argv[1]))
|
|
else:
|
|
tapename = next(Program.read_tapes(sys.argv[1]))
|
|
|
|
res = Tape.ReqNum()
|
|
for inst in Tape.read_instructions(tapename):
|
|
res.update(inst.get_usage())
|
|
|
|
for x in res.pretty():
|
|
print(x)
|