/	Copyright (c) 1984, 1986, 1987, 1988 AT&T
/	  All Rights Reserved

/	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
/	The copyright notice above does not evidence any
/	actual or intended publication of such source code.
	.file	"memcpy.s"

	.ident	"@(#)libc-i386:libc-i386/gen/memcpy.s	1.2"

	.globl	memcpy
	.align	4

memcpy:
	MCOUNT			/ profiling
	pushl	%edi
	pushl	%esi
	movl	12(%esp),%edi	/ %edi = dest address
	movl	16(%esp),%esi	/ %esi = source address
	movl	20(%esp),%ecx	/ %ecx = length of string
	movl	%edi,%eax	/ return value from the call

	movl	%ecx,%edx	/ %edx = number of bytes to move
	shrl	$2,%ecx		/ %ecx = number of words to move
	rep ; smovl		/ move the words

	movl	%edx,%ecx	/ %ecx = number of bytes to move
	andl	$0x3,%ecx	/ %ecx = number of bytes left to move
.bytemv:rep ; smovb		/ move the bytes

	popl	%esi
	popl	%edi
	ret
