Files
MP-SPDZ/Scripts/decompile.py
2025-05-30 13:35:02 +10:00

19 lines
497 B
Python
Executable File

#!/usr/bin/env python3
import sys, os
sys.path.append('.')
from Compiler.instructions_base import Instruction
from Compiler.program import *
if len(sys.argv) <= 1:
print('Usage: %s <program>' % sys.argv[0])
for tapename in Program.read_tapes(sys.argv[1]):
filename = 'Programs/Bytecode/%s.asm' % tapename
print('Creating', filename)
with open(filename, 'w') as out:
for i, inst in enumerate(Tape.read_instructions(tapename)):
print(inst, '#', i, file=out)