#!/usr/bin/python

import sys
import subprocess

fl = sys.argv[1]
fd = open(fl)
for ln in fd:
    if ln.strip().startswith("n"):
        ln = ln.strip()
        rgst = ln.split()
        inp = rgst[6] # magic # 
        if "whitebox" in ln:
            wbBB = "wb"
        else:
            wbBB = "bb"
        print rgst[0] + " $1 < " + inp + " &> out; diff out original-" + wbBB + rgst[0][:-1] +" || exit 0 ;;",
        subprocess.call(["./original-runner.sh", inp[5:], "original-" + wbBB + rgst[0][:-1]])
    else:
        print ln,
