INNER CODE UNIT · Python
build
2akouwu/reverify · benchmarks/build_reconstructions.py:64
def build():
records = []
for name, cat, nargs, ref, correct, wrong in SPECS:
records.append({
"name": name,
"category": cat,
"nargs": nargs,
"reference": {"c": c_prog(ref[0], nargs), "python": py_prog(ref[1], nargs)},
"candidates": [
{"label": "correct", "note": "faithful reconstruction (different form, same behaviour)",
"c": c_prog(correct[0], nargs), "python": py_prog(correct[1], nargs)},
{"label": "wrong", "note": "plausible decompilation mistake",
"c": c_prog(wrong[0], nargs), "python": py_prog(wrong[1], nargs)},
],
})
out = os.path.join(os.path.dirname(__file__), "corpus", "reconstructions.jsonl")
with open(out, "w", encoding="utf-8") as f:
for r in records: