Rewrite & optimize memcpy() & memset()