Rewriting in C. Reimplementation of tail