.include "macros.inc"
.section .init, "ax"
.global TRK_memcpy
TRK_memcpy:
addi r4, r4, -1
addi r6, r3, -1
addi r5, r5, 1
b lbl_8000325C
lbl_80003254:
lbzu r0, 1(r4)
stbu r0, 1(r6)
lbl_8000325C:
addic. r5, r5, -1
bne lbl_80003254
blr
.global TRK_memset
TRK_memset:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stw r31, 0xc(r1)
mr r31, r3
bl TRK_fill_mem
mr r3, r31
lwz r31, 0xc(r1)
addi r1, r1, 0x10
lwz r0, 4(r1)
mtlr r0
blr
.section .text, "ax"
.global TRK_fill_mem
TRK_fill_mem:
cmplwi r5, 0x20
addi r6, r3, -1
clrlwi r0, r4, 0x18
mr r7, r0
blt lbl_8008A41C
nor r0, r6, r6
clrlwi. r0, r0, 0x1e
mr r3, r0
beq lbl_8008A3AC
subf r5, r3, r5
clrlwi r0, r7, 0x18
lbl_8008A3A0:
addic. r3, r3, -1
stbu r0, 1(r6)
bne lbl_8008A3A0
lbl_8008A3AC:
cmplwi r7, 0
beq lbl_8008A3CC
slwi r3, r7, 0x18
slwi r0, r7, 0x10
slwi r4, r7, 8
or r0, r3, r0
or r0, r4, r0
or r7, r7, r0
lbl_8008A3CC:
rlwinm. r0, r5, 0x1b, 5, 0x1f
addi r3, r6, -3
beq lbl_8008A400
lbl_8008A3D8:
stw r7, 4(r3)
addic. r0, r0, -1
stw r7, 8(r3)
stw r7, 0xc(r3)
stw r7, 0x10(r3)
stw r7, 0x14(r3)
stw r7, 0x18(r3)
stw r7, 0x1c(r3)
stwu r7, 0x20(r3)
bne lbl_8008A3D8
lbl_8008A400:
rlwinm. r0, r5, 0x1e, 0x1d, 0x1f
beq lbl_8008A414
lbl_8008A408:
addic. r0, r0, -1
stwu r7, 4(r3)
bne lbl_8008A408
lbl_8008A414:
addi r6, r3, 3
clrlwi r5, r5, 0x1e
lbl_8008A41C:
cmplwi r5, 0
beqlr
clrlwi r0, r7, 0x18
lbl_8008A428:
addic. r5, r5, -1
stbu r0, 1(r6)
bne lbl_8008A428
blr