Merging and sorting (recursive) (C) source code