+ bytes--;
+ }
+
+ idest = (int *)cdest;
+ isrc = (const int *)csrc;
+
+ nwords = bytes / 4;
+ bytes -= bytes & ~3;
+ if (nwords != 0)
+ switch(nwords % 8) /* They see me Duff'sin'. They hatin'. */
+ do {
+ case 0: nwords--; *(idest++) = *(isrc++);
+ case 7: nwords--; *(idest++) = *(isrc++);
+ case 6: nwords--; *(idest++) = *(isrc++);
+ case 5: nwords--; *(idest++) = *(isrc++);
+ case 4: nwords--; *(idest++) = *(isrc++);
+ case 3: nwords--; *(idest++) = *(isrc++);
+ case 2: nwords--; *(idest++) = *(isrc++);
+ case 1: nwords--; *(idest++) = *(isrc++);
+ } while (nwords);
+
+ cdest = (char *)idest;
+ csrc = (const char *)isrc;
+ while (bytes) /* Clean up the remainder */
+ {
+ *(cdest++) = *(csrc++);
+ bytes--;
+ }
+}
+
+void memcpy(void *dest, const void *src, int bytes)
+{
+ _memcpy(dest, src, bytes);
+}
+
+void memset(void *dest, int data, int bytes)
+{
+ unsigned char *cdest = dest;
+ while (bytes--)
+ *(cdest++) = (unsigned char)data;
+}
+
+void *memchr(const void *buf, char c, int maxlen)
+{
+ const char * cbuf = buf;
+ while (maxlen--)
+ {
+ if (*cbuf == c) return (void *)cbuf;
+ cbuf++;
+ }
+ return 0;