Convert whack-run-with-whack-root to C program