#!/bin/sh
valgrind -q --track-origins=yes --error-exitcode=1 --malloc-fill=0xcd ./toc test.toc || exit 1
if [ "$1" = "c" ]; then
	gcc out.c && ./a.out
elif [ "$1" = "pc" ]; then
	cat out.c
fi
rm vgcore* 2> /dev/null