def main():
    import sys
    infile = sys.argv[1]
    attempts = int(sys.argv[2])
    outfile = sys.argv[3]
    with open(infile, "r", encoding="utf-8") as f:
        templates = read_opdata_file(f)

    buf = []
    for template in templates:
        for _ in range(attempts):
            buf.append(template.create_entry())

    with open(outfile, "w", encoding="utf-8") as f:
        for dynasm, gas in buf:
            f.write("{}\t{}\n".format(dynasm, gas))