	.section	.text
	.global	memcpy
	.global	__aeabi_memcpy
	.type	memcpy, %function
memcpy:
__aeabi_memcpy:
	sub	sp, sp, #20
	str	r0, [sp, #12]	@ Save dst
	str	r1, [sp, #8]	@ Save src
	str	r2, [sp, #4]	@ Save length
	movs	r0, #0
	str	r0, [sp, #16]	@ index = zero
	b	begin
copy_byte:
	ldr	r0, [sp, #8]	@ Load src
	ldr	r1, [sp, #16]	@ Load index
	add	r0, r0, r1	@ r0 = src + index
	ldr	r2, [sp, #12]	@ Load dst
	add	r2, r2, r1	@ r1 = dst + index
	ldrb	r0, [r0]
	strb	r0, [r2]	@ *r0 = *r1
	adds	r0, r1, #1
	str	r0, [sp, #16]	@ index++
begin:
	ldr	r1, [sp, #4]	@ Load length
	cmp	r0, r1		@ index < length
	bcc	copy_byte
	add	sp, sp, #20
	mov	pc, lr		@ Return
