deduplication in C