#! /usr/bin/env python3
import sys
import subprocess

with open(sys.argv[1]) as f:
    string = f.read().strip()

c_code = f'''
#include <stdio.h>

int main()
{{
    for (int i = 0; i < 1000000; i++) {{
        printf("%7d %s\\n", i, "{string}");
    }}
}}
'''

subprocess.run(
    [ 'clang', '-Wall', '-O3', '-o', 'silly_executable', '-x', 'c', '-' ],
    input=c_code,
    text=True
)

