prime/asm/Runtime/alloc.s

1042 lines
48 KiB
ArmAsm
Raw Normal View History

2022-04-02 21:03:04 +00:00
.include "macros.inc"
2022-04-06 10:04:03 +00:00
.section .rodata
.global lbl_803D85C0
lbl_803D85C0:
.incbin "baserom.dol", 0x3D55C0, 0x18
.section .sbss
.balign 4
.global lbl_805A99C8
lbl_805A99C8:
.skip 0x8
2022-04-06 10:04:03 +00:00
2022-04-02 21:03:04 +00:00
.section .text, "ax"
.global calloc
calloc:
/* 8038A294 003871F4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8038A298 003871F8 7C 08 02 A6 */ mflr r0
/* 8038A29C 003871FC 90 01 00 14 */ stw r0, 0x14(r1)
/* 8038A2A0 00387200 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8038A2A4 00387204 7C 7F 1B 78 */ mr r31, r3
/* 8038A2A8 00387208 93 C1 00 08 */ stw r30, 8(r1)
/* 8038A2AC 0038720C 7C 9E 23 78 */ mr r30, r4
/* 8038A2B0 00387210 88 0D AE 08 */ lbz r0, lbl_805A99C8@sda21(r13)
/* 8038A2B4 00387214 28 00 00 00 */ cmplwi r0, 0
/* 8038A2B8 00387218 40 82 00 20 */ bne lbl_8038A2D8
/* 8038A2BC 0038721C 3C 60 80 54 */ lis r3, lbl_80542298@ha
/* 8038A2C0 00387220 38 80 00 00 */ li r4, 0
/* 8038A2C4 00387224 38 63 22 98 */ addi r3, r3, lbl_80542298@l
/* 8038A2C8 00387228 38 A0 00 34 */ li r5, 0x34
/* 8038A2CC 0038722C 4B C7 90 DD */ bl memset
/* 8038A2D0 00387230 38 00 00 01 */ li r0, 1
/* 8038A2D4 00387234 98 0D AE 08 */ stb r0, lbl_805A99C8@sda21(r13)
lbl_8038A2D8:
/* 8038A2D8 00387238 7F DE F9 D7 */ mullw. r30, r30, r31
/* 8038A2DC 0038723C 3C 60 80 54 */ lis r3, lbl_80542298@ha
/* 8038A2E0 00387240 38 63 22 98 */ addi r3, r3, lbl_80542298@l
/* 8038A2E4 00387244 40 82 00 0C */ bne lbl_8038A2F0
/* 8038A2E8 00387248 3B E0 00 00 */ li r31, 0
/* 8038A2EC 0038724C 48 00 00 38 */ b lbl_8038A324
lbl_8038A2F0:
/* 8038A2F0 00387250 38 00 FF CF */ li r0, -49
/* 8038A2F4 00387254 7C 1E 00 40 */ cmplw r30, r0
/* 8038A2F8 00387258 40 81 00 0C */ ble lbl_8038A304
/* 8038A2FC 0038725C 3B E0 00 00 */ li r31, 0
/* 8038A300 00387260 48 00 00 24 */ b lbl_8038A324
lbl_8038A304:
/* 8038A304 00387264 28 1E 00 44 */ cmplwi r30, 0x44
/* 8038A308 00387268 41 81 00 10 */ bgt lbl_8038A318
/* 8038A30C 0038726C 7F C4 F3 78 */ mr r4, r30
/* 8038A310 00387270 48 00 03 79 */ bl sub_8038a688
/* 8038A314 00387274 48 00 00 0C */ b lbl_8038A320
lbl_8038A318:
/* 8038A318 00387278 7F C4 F3 78 */ mr r4, r30
/* 8038A31C 0038727C 48 00 07 31 */ bl sub_8038aa4c
lbl_8038A320:
/* 8038A320 00387280 7C 7F 1B 78 */ mr r31, r3
lbl_8038A324:
/* 8038A324 00387284 28 1F 00 00 */ cmplwi r31, 0
/* 8038A328 00387288 41 82 00 14 */ beq lbl_8038A33C
/* 8038A32C 0038728C 7F E3 FB 78 */ mr r3, r31
/* 8038A330 00387290 7F C5 F3 78 */ mr r5, r30
/* 8038A334 00387294 38 80 00 00 */ li r4, 0
/* 8038A338 00387298 4B C7 90 71 */ bl memset
lbl_8038A33C:
/* 8038A33C 0038729C 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8038A340 003872A0 7F E3 FB 78 */ mr r3, r31
/* 8038A344 003872A4 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8038A348 003872A8 83 C1 00 08 */ lwz r30, 8(r1)
/* 8038A34C 003872AC 7C 08 03 A6 */ mtlr r0
/* 8038A350 003872B0 38 21 00 10 */ addi r1, r1, 0x10
/* 8038A354 003872B4 4E 80 00 20 */ blr
.global sub_8038a358
sub_8038a358:
/* 8038A358 003872B8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8038A35C 003872BC 7C 08 02 A6 */ mflr r0
/* 8038A360 003872C0 90 01 00 14 */ stw r0, 0x14(r1)
/* 8038A364 003872C4 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8038A368 003872C8 93 C1 00 08 */ stw r30, 8(r1)
/* 8038A36C 003872CC 7C 7E 1B 78 */ mr r30, r3
/* 8038A370 003872D0 88 0D AE 08 */ lbz r0, lbl_805A99C8@sda21(r13)
/* 8038A374 003872D4 28 00 00 00 */ cmplwi r0, 0
/* 8038A378 003872D8 40 82 00 20 */ bne lbl_8038A398
/* 8038A37C 003872DC 3C 60 80 54 */ lis r3, lbl_80542298@ha
/* 8038A380 003872E0 38 80 00 00 */ li r4, 0
/* 8038A384 003872E4 38 63 22 98 */ addi r3, r3, lbl_80542298@l
/* 8038A388 003872E8 38 A0 00 34 */ li r5, 0x34
/* 8038A38C 003872EC 4B C7 90 1D */ bl memset
/* 8038A390 003872F0 38 00 00 01 */ li r0, 1
/* 8038A394 003872F4 98 0D AE 08 */ stb r0, lbl_805A99C8@sda21(r13)
lbl_8038A398:
/* 8038A398 003872F8 28 1E 00 00 */ cmplwi r30, 0
/* 8038A39C 003872FC 3C 60 80 54 */ lis r3, lbl_80542298@ha
/* 8038A3A0 00387300 3B E3 22 98 */ addi r31, r3, lbl_80542298@l
/* 8038A3A4 00387304 41 82 00 D0 */ beq lbl_8038A474
/* 8038A3A8 00387308 80 7E FF FC */ lwz r3, -4(r30)
/* 8038A3AC 0038730C 54 60 07 FF */ clrlwi. r0, r3, 0x1f
/* 8038A3B0 00387310 40 82 00 0C */ bne lbl_8038A3BC
/* 8038A3B4 00387314 80 A3 00 08 */ lwz r5, 8(r3)
/* 8038A3B8 00387318 48 00 00 10 */ b lbl_8038A3C8
lbl_8038A3BC:
/* 8038A3BC 0038731C 80 1E FF F8 */ lwz r0, -8(r30)
/* 8038A3C0 00387320 54 03 00 38 */ rlwinm r3, r0, 0, 0, 0x1c
/* 8038A3C4 00387324 38 A3 FF F8 */ addi r5, r3, -8
lbl_8038A3C8:
/* 8038A3C8 00387328 28 05 00 44 */ cmplwi r5, 0x44
/* 8038A3CC 0038732C 41 81 00 14 */ bgt lbl_8038A3E0
/* 8038A3D0 00387330 7F E3 FB 78 */ mr r3, r31
/* 8038A3D4 00387334 7F C4 F3 78 */ mr r4, r30
/* 8038A3D8 00387338 48 00 00 B5 */ bl sub_8038a48c
/* 8038A3DC 0038733C 48 00 00 98 */ b lbl_8038A474
lbl_8038A3E0:
/* 8038A3E0 00387340 80 1E FF FC */ lwz r0, -4(r30)
/* 8038A3E4 00387344 38 9E FF F8 */ addi r4, r30, -8
/* 8038A3E8 00387348 54 1E 00 3C */ rlwinm r30, r0, 0, 0, 0x1e
/* 8038A3EC 0038734C 7F C3 F3 78 */ mr r3, r30
/* 8038A3F0 00387350 48 00 09 61 */ bl sub_8038ad50
/* 8038A3F4 00387354 80 7E 00 10 */ lwz r3, 0x10(r30)
/* 8038A3F8 00387358 38 A0 00 00 */ li r5, 0
/* 8038A3FC 0038735C 54 60 07 BD */ rlwinm. r0, r3, 0, 0x1e, 0x1e
/* 8038A400 00387360 40 82 00 20 */ bne lbl_8038A420
/* 8038A404 00387364 80 1E 00 0C */ lwz r0, 0xc(r30)
/* 8038A408 00387368 54 64 00 38 */ rlwinm r4, r3, 0, 0, 0x1c
/* 8038A40C 0038736C 54 03 00 38 */ rlwinm r3, r0, 0, 0, 0x1c
/* 8038A410 00387370 38 03 FF E8 */ addi r0, r3, -24
/* 8038A414 00387374 7C 04 00 40 */ cmplw r4, r0
/* 8038A418 00387378 40 82 00 08 */ bne lbl_8038A420
/* 8038A41C 0038737C 38 A0 00 01 */ li r5, 1
lbl_8038A420:
/* 8038A420 00387380 2C 05 00 00 */ cmpwi r5, 0
/* 8038A424 00387384 41 82 00 50 */ beq lbl_8038A474
/* 8038A428 00387388 80 9E 00 04 */ lwz r4, 4(r30)
/* 8038A42C 0038738C 7C 04 F0 40 */ cmplw r4, r30
/* 8038A430 00387390 40 82 00 08 */ bne lbl_8038A438
/* 8038A434 00387394 38 80 00 00 */ li r4, 0
lbl_8038A438:
/* 8038A438 00387398 80 1F 00 00 */ lwz r0, 0(r31)
/* 8038A43C 0038739C 7C 00 F0 40 */ cmplw r0, r30
/* 8038A440 003873A0 40 82 00 08 */ bne lbl_8038A448
/* 8038A444 003873A4 90 9F 00 00 */ stw r4, 0(r31)
lbl_8038A448:
/* 8038A448 003873A8 28 04 00 00 */ cmplwi r4, 0
/* 8038A44C 003873AC 41 82 00 14 */ beq lbl_8038A460
/* 8038A450 003873B0 80 1E 00 00 */ lwz r0, 0(r30)
/* 8038A454 003873B4 90 04 00 00 */ stw r0, 0(r4)
/* 8038A458 003873B8 80 64 00 00 */ lwz r3, 0(r4)
/* 8038A45C 003873BC 90 83 00 04 */ stw r4, 4(r3)
lbl_8038A460:
/* 8038A460 003873C0 38 00 00 00 */ li r0, 0
/* 8038A464 003873C4 7F C3 F3 78 */ mr r3, r30
/* 8038A468 003873C8 90 1E 00 04 */ stw r0, 4(r30)
/* 8038A46C 003873CC 90 1E 00 00 */ stw r0, 0(r30)
/* 8038A470 003873D0 4B C7 E0 15 */ bl sub_80008484
lbl_8038A474:
/* 8038A474 003873D4 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8038A478 003873D8 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8038A47C 003873DC 83 C1 00 08 */ lwz r30, 8(r1)
/* 8038A480 003873E0 7C 08 03 A6 */ mtlr r0
/* 8038A484 003873E4 38 21 00 10 */ addi r1, r1, 0x10
/* 8038A488 003873E8 4E 80 00 20 */ blr
.global sub_8038a48c
sub_8038a48c:
/* 8038A48C 003873EC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8038A490 003873F0 7C 08 02 A6 */ mflr r0
/* 8038A494 003873F4 3C C0 80 3E */ lis r6, lbl_803D85C0@ha
/* 8038A498 003873F8 90 01 00 14 */ stw r0, 0x14(r1)
/* 8038A49C 003873FC 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8038A4A0 00387400 7C 7F 1B 78 */ mr r31, r3
/* 8038A4A4 00387404 38 66 85 C0 */ addi r3, r6, lbl_803D85C0@l
/* 8038A4A8 00387408 38 C0 00 00 */ li r6, 0
/* 8038A4AC 0038740C 93 C1 00 08 */ stw r30, 8(r1)
/* 8038A4B0 00387410 48 00 00 0C */ b lbl_8038A4BC
lbl_8038A4B4:
/* 8038A4B4 00387414 38 63 00 04 */ addi r3, r3, 4
/* 8038A4B8 00387418 38 C6 00 01 */ addi r6, r6, 1
lbl_8038A4BC:
/* 8038A4BC 0038741C 80 03 00 00 */ lwz r0, 0(r3)
/* 8038A4C0 00387420 7C 05 00 40 */ cmplw r5, r0
/* 8038A4C4 00387424 41 81 FF F0 */ bgt lbl_8038A4B4
/* 8038A4C8 00387428 38 E4 FF FC */ addi r7, r4, -4
/* 8038A4CC 0038742C 54 C4 18 38 */ slwi r4, r6, 3
/* 8038A4D0 00387430 80 67 00 00 */ lwz r3, 0(r7)
/* 8038A4D4 00387434 38 84 00 04 */ addi r4, r4, 4
/* 8038A4D8 00387438 7C 9F 22 14 */ add r4, r31, r4
/* 8038A4DC 0038743C 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038A4E0 00387440 28 00 00 00 */ cmplwi r0, 0
/* 8038A4E4 00387444 40 82 00 74 */ bne lbl_8038A558
/* 8038A4E8 00387448 80 A4 00 04 */ lwz r5, 4(r4)
/* 8038A4EC 0038744C 7C 05 18 40 */ cmplw r5, r3
/* 8038A4F0 00387450 41 82 00 68 */ beq lbl_8038A558
/* 8038A4F4 00387454 80 04 00 00 */ lwz r0, 0(r4)
/* 8038A4F8 00387458 7C 00 18 40 */ cmplw r0, r3
/* 8038A4FC 0038745C 40 82 00 1C */ bne lbl_8038A518
/* 8038A500 00387460 80 05 00 00 */ lwz r0, 0(r5)
/* 8038A504 00387464 90 04 00 04 */ stw r0, 4(r4)
/* 8038A508 00387468 80 A4 00 00 */ lwz r5, 0(r4)
/* 8038A50C 0038746C 80 05 00 00 */ lwz r0, 0(r5)
/* 8038A510 00387470 90 04 00 00 */ stw r0, 0(r4)
/* 8038A514 00387474 48 00 00 44 */ b lbl_8038A558
lbl_8038A518:
/* 8038A518 00387478 80 03 00 04 */ lwz r0, 4(r3)
/* 8038A51C 0038747C 80 A3 00 00 */ lwz r5, 0(r3)
/* 8038A520 00387480 90 05 00 04 */ stw r0, 4(r5)
/* 8038A524 00387484 80 03 00 00 */ lwz r0, 0(r3)
/* 8038A528 00387488 80 A3 00 04 */ lwz r5, 4(r3)
/* 8038A52C 0038748C 90 05 00 00 */ stw r0, 0(r5)
/* 8038A530 00387490 80 04 00 04 */ lwz r0, 4(r4)
/* 8038A534 00387494 90 03 00 04 */ stw r0, 4(r3)
/* 8038A538 00387498 80 A3 00 04 */ lwz r5, 4(r3)
/* 8038A53C 0038749C 80 05 00 00 */ lwz r0, 0(r5)
/* 8038A540 003874A0 90 03 00 00 */ stw r0, 0(r3)
/* 8038A544 003874A4 80 A3 00 00 */ lwz r5, 0(r3)
/* 8038A548 003874A8 90 65 00 04 */ stw r3, 4(r5)
/* 8038A54C 003874AC 80 A3 00 04 */ lwz r5, 4(r3)
/* 8038A550 003874B0 90 65 00 00 */ stw r3, 0(r5)
/* 8038A554 003874B4 90 64 00 04 */ stw r3, 4(r4)
lbl_8038A558:
/* 8038A558 003874B8 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038A55C 003874BC 90 07 00 04 */ stw r0, 4(r7)
/* 8038A560 003874C0 90 E3 00 0C */ stw r7, 0xc(r3)
/* 8038A564 003874C4 80 A3 00 10 */ lwz r5, 0x10(r3)
/* 8038A568 003874C8 34 05 FF FF */ addic. r0, r5, -1
/* 8038A56C 003874CC 90 03 00 10 */ stw r0, 0x10(r3)
/* 8038A570 003874D0 40 82 01 00 */ bne lbl_8038A670
/* 8038A574 003874D4 80 04 00 04 */ lwz r0, 4(r4)
/* 8038A578 003874D8 7C 00 18 40 */ cmplw r0, r3
/* 8038A57C 003874DC 40 82 00 0C */ bne lbl_8038A588
/* 8038A580 003874E0 80 03 00 04 */ lwz r0, 4(r3)
/* 8038A584 003874E4 90 04 00 04 */ stw r0, 4(r4)
lbl_8038A588:
/* 8038A588 003874E8 80 04 00 00 */ lwz r0, 0(r4)
/* 8038A58C 003874EC 7C 00 18 40 */ cmplw r0, r3
/* 8038A590 003874F0 40 82 00 0C */ bne lbl_8038A59C
/* 8038A594 003874F4 80 03 00 00 */ lwz r0, 0(r3)
/* 8038A598 003874F8 90 04 00 00 */ stw r0, 0(r4)
lbl_8038A59C:
/* 8038A59C 003874FC 80 03 00 04 */ lwz r0, 4(r3)
/* 8038A5A0 00387500 80 A3 00 00 */ lwz r5, 0(r3)
/* 8038A5A4 00387504 90 05 00 04 */ stw r0, 4(r5)
/* 8038A5A8 00387508 80 03 00 00 */ lwz r0, 0(r3)
/* 8038A5AC 0038750C 80 A3 00 04 */ lwz r5, 4(r3)
/* 8038A5B0 00387510 90 05 00 00 */ stw r0, 0(r5)
/* 8038A5B4 00387514 80 04 00 04 */ lwz r0, 4(r4)
/* 8038A5B8 00387518 7C 00 18 40 */ cmplw r0, r3
/* 8038A5BC 0038751C 40 82 00 0C */ bne lbl_8038A5C8
/* 8038A5C0 00387520 38 00 00 00 */ li r0, 0
/* 8038A5C4 00387524 90 04 00 04 */ stw r0, 4(r4)
lbl_8038A5C8:
/* 8038A5C8 00387528 80 04 00 00 */ lwz r0, 0(r4)
/* 8038A5CC 0038752C 7C 00 18 40 */ cmplw r0, r3
/* 8038A5D0 00387530 40 82 00 0C */ bne lbl_8038A5DC
/* 8038A5D4 00387534 38 00 00 00 */ li r0, 0
/* 8038A5D8 00387538 90 04 00 00 */ stw r0, 0(r4)
lbl_8038A5DC:
/* 8038A5DC 0038753C 80 03 FF FC */ lwz r0, -4(r3)
/* 8038A5E0 00387540 38 83 FF F8 */ addi r4, r3, -8
/* 8038A5E4 00387544 54 1E 00 3C */ rlwinm r30, r0, 0, 0, 0x1e
/* 8038A5E8 00387548 7F C3 F3 78 */ mr r3, r30
/* 8038A5EC 0038754C 48 00 07 65 */ bl sub_8038ad50
/* 8038A5F0 00387550 80 7E 00 10 */ lwz r3, 0x10(r30)
/* 8038A5F4 00387554 38 A0 00 00 */ li r5, 0
/* 8038A5F8 00387558 54 60 07 BD */ rlwinm. r0, r3, 0, 0x1e, 0x1e
/* 8038A5FC 0038755C 40 82 00 20 */ bne lbl_8038A61C
/* 8038A600 00387560 80 1E 00 0C */ lwz r0, 0xc(r30)
/* 8038A604 00387564 54 64 00 38 */ rlwinm r4, r3, 0, 0, 0x1c
/* 8038A608 00387568 54 03 00 38 */ rlwinm r3, r0, 0, 0, 0x1c
/* 8038A60C 0038756C 38 03 FF E8 */ addi r0, r3, -24
/* 8038A610 00387570 7C 04 00 40 */ cmplw r4, r0
/* 8038A614 00387574 40 82 00 08 */ bne lbl_8038A61C
/* 8038A618 00387578 38 A0 00 01 */ li r5, 1
lbl_8038A61C:
/* 8038A61C 0038757C 2C 05 00 00 */ cmpwi r5, 0
/* 8038A620 00387580 41 82 00 50 */ beq lbl_8038A670
/* 8038A624 00387584 80 9E 00 04 */ lwz r4, 4(r30)
/* 8038A628 00387588 7C 04 F0 40 */ cmplw r4, r30
/* 8038A62C 0038758C 40 82 00 08 */ bne lbl_8038A634
/* 8038A630 00387590 38 80 00 00 */ li r4, 0
lbl_8038A634:
/* 8038A634 00387594 80 1F 00 00 */ lwz r0, 0(r31)
/* 8038A638 00387598 7C 00 F0 40 */ cmplw r0, r30
/* 8038A63C 0038759C 40 82 00 08 */ bne lbl_8038A644
/* 8038A640 003875A0 90 9F 00 00 */ stw r4, 0(r31)
lbl_8038A644:
/* 8038A644 003875A4 28 04 00 00 */ cmplwi r4, 0
/* 8038A648 003875A8 41 82 00 14 */ beq lbl_8038A65C
/* 8038A64C 003875AC 80 1E 00 00 */ lwz r0, 0(r30)
/* 8038A650 003875B0 90 04 00 00 */ stw r0, 0(r4)
/* 8038A654 003875B4 80 64 00 00 */ lwz r3, 0(r4)
/* 8038A658 003875B8 90 83 00 04 */ stw r4, 4(r3)
lbl_8038A65C:
/* 8038A65C 003875BC 38 00 00 00 */ li r0, 0
/* 8038A660 003875C0 7F C3 F3 78 */ mr r3, r30
/* 8038A664 003875C4 90 1E 00 04 */ stw r0, 4(r30)
/* 8038A668 003875C8 90 1E 00 00 */ stw r0, 0(r30)
/* 8038A66C 003875CC 4B C7 DE 19 */ bl sub_80008484
lbl_8038A670:
/* 8038A670 003875D0 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8038A674 003875D4 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8038A678 003875D8 83 C1 00 08 */ lwz r30, 8(r1)
/* 8038A67C 003875DC 7C 08 03 A6 */ mtlr r0
/* 8038A680 003875E0 38 21 00 10 */ addi r1, r1, 0x10
/* 8038A684 003875E4 4E 80 00 20 */ blr
.global sub_8038a688
sub_8038a688:
/* 8038A688 003875E8 94 21 FF D0 */ stwu r1, -0x30(r1)
/* 8038A68C 003875EC 7C 08 02 A6 */ mflr r0
/* 8038A690 003875F0 3C A0 80 3E */ lis r5, lbl_803D85C0@ha
/* 8038A694 003875F4 90 01 00 34 */ stw r0, 0x34(r1)
/* 8038A698 003875F8 BF 01 00 10 */ stmw r24, 0x10(r1)
/* 8038A69C 003875FC 7C 7B 1B 78 */ mr r27, r3
/* 8038A6A0 00387600 38 65 85 C0 */ addi r3, r5, lbl_803D85C0@l
/* 8038A6A4 00387604 3B E0 00 00 */ li r31, 0
/* 8038A6A8 00387608 48 00 00 0C */ b lbl_8038A6B4
lbl_8038A6AC:
/* 8038A6AC 0038760C 38 63 00 04 */ addi r3, r3, 4
/* 8038A6B0 00387610 3B FF 00 01 */ addi r31, r31, 1
lbl_8038A6B4:
/* 8038A6B4 00387614 80 03 00 00 */ lwz r0, 0(r3)
/* 8038A6B8 00387618 7C 04 00 40 */ cmplw r4, r0
/* 8038A6BC 0038761C 41 81 FF F0 */ bgt lbl_8038A6AC
/* 8038A6C0 00387620 57 E3 18 38 */ slwi r3, r31, 3
/* 8038A6C4 00387624 3B C3 00 04 */ addi r30, r3, 4
/* 8038A6C8 00387628 7F DB F2 14 */ add r30, r27, r30
/* 8038A6CC 0038762C 80 7E 00 04 */ lwz r3, 4(r30)
/* 8038A6D0 00387630 28 03 00 00 */ cmplwi r3, 0
/* 8038A6D4 00387634 41 82 00 10 */ beq lbl_8038A6E4
/* 8038A6D8 00387638 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038A6DC 0038763C 28 00 00 00 */ cmplwi r0, 0
/* 8038A6E0 00387640 40 82 01 10 */ bne lbl_8038A7F0
lbl_8038A6E4:
/* 8038A6E4 00387644 3C 60 80 3E */ lis r3, lbl_803D85C0@ha
/* 8038A6E8 00387648 57 F9 10 3A */ slwi r25, r31, 2
/* 8038A6EC 0038764C 3B 43 85 C0 */ addi r26, r3, lbl_803D85C0@l
/* 8038A6F0 00387650 38 80 0F EC */ li r4, 0xfec
/* 8038A6F4 00387654 7C 7A C8 2E */ lwzx r3, r26, r25
/* 8038A6F8 00387658 38 03 00 04 */ addi r0, r3, 4
/* 8038A6FC 0038765C 7F 04 03 96 */ divwu r24, r4, r0
/* 8038A700 00387660 28 18 01 00 */ cmplwi r24, 0x100
/* 8038A704 00387664 40 81 00 08 */ ble lbl_8038A70C
/* 8038A708 00387668 3B 00 01 00 */ li r24, 0x100
lbl_8038A70C:
/* 8038A70C 0038766C 7F 1C C3 78 */ mr r28, r24
/* 8038A710 00387670 48 00 00 4C */ b lbl_8038A75C
lbl_8038A714:
/* 8038A714 00387674 7C 9A C8 2E */ lwzx r4, r26, r25
/* 8038A718 00387678 7F 63 DB 78 */ mr r3, r27
/* 8038A71C 0038767C 38 A1 00 08 */ addi r5, r1, 8
/* 8038A720 00387680 38 04 00 04 */ addi r0, r4, 4
/* 8038A724 00387684 7C 98 01 D6 */ mullw r4, r24, r0
/* 8038A728 00387688 38 84 00 14 */ addi r4, r4, 0x14
/* 8038A72C 0038768C 48 00 02 49 */ bl soft_allocate_from_var_pools
/* 8038A730 00387690 7C 7D 1B 79 */ or. r29, r3, r3
/* 8038A734 00387694 40 82 00 30 */ bne lbl_8038A764
/* 8038A738 00387698 80 81 00 08 */ lwz r4, 8(r1)
/* 8038A73C 0038769C 28 04 00 14 */ cmplwi r4, 0x14
/* 8038A740 003876A0 40 81 00 18 */ ble lbl_8038A758
/* 8038A744 003876A4 7C 7A C8 2E */ lwzx r3, r26, r25
/* 8038A748 003876A8 38 84 FF EC */ addi r4, r4, -20
/* 8038A74C 003876AC 38 03 00 04 */ addi r0, r3, 4
/* 8038A750 003876B0 7F 04 03 96 */ divwu r24, r4, r0
/* 8038A754 003876B4 48 00 00 08 */ b lbl_8038A75C
lbl_8038A758:
/* 8038A758 003876B8 3B 00 00 00 */ li r24, 0
lbl_8038A75C:
/* 8038A75C 003876BC 28 18 00 0A */ cmplwi r24, 0xa
/* 8038A760 003876C0 40 80 FF B4 */ bge lbl_8038A714
lbl_8038A764:
/* 8038A764 003876C4 28 1D 00 00 */ cmplwi r29, 0
/* 8038A768 003876C8 40 82 00 34 */ bne lbl_8038A79C
/* 8038A76C 003876CC 7C 18 E0 40 */ cmplw r24, r28
/* 8038A770 003876D0 40 80 00 2C */ bge lbl_8038A79C
/* 8038A774 003876D4 7C 9A C8 2E */ lwzx r4, r26, r25
/* 8038A778 003876D8 7F 63 DB 78 */ mr r3, r27
/* 8038A77C 003876DC 38 04 00 04 */ addi r0, r4, 4
/* 8038A780 003876E0 7C 9C 01 D6 */ mullw r4, r28, r0
/* 8038A784 003876E4 38 84 00 14 */ addi r4, r4, 0x14
/* 8038A788 003876E8 48 00 02 C5 */ bl sub_8038aa4c
/* 8038A78C 003876EC 7C 7D 1B 79 */ or. r29, r3, r3
/* 8038A790 003876F0 40 82 00 0C */ bne lbl_8038A79C
/* 8038A794 003876F4 38 60 00 00 */ li r3, 0
/* 8038A798 003876F8 48 00 00 A0 */ b lbl_8038A838
lbl_8038A79C:
/* 8038A79C 003876FC 80 7D FF FC */ lwz r3, -4(r29)
/* 8038A7A0 00387700 54 60 07 FF */ clrlwi. r0, r3, 0x1f
/* 8038A7A4 00387704 40 82 00 0C */ bne lbl_8038A7B0
/* 8038A7A8 00387708 81 03 00 08 */ lwz r8, 8(r3)
/* 8038A7AC 0038770C 48 00 00 10 */ b lbl_8038A7BC
lbl_8038A7B0:
/* 8038A7B0 00387710 80 1D FF F8 */ lwz r0, -8(r29)
/* 8038A7B4 00387714 54 03 00 38 */ rlwinm r3, r0, 0, 0, 0x1c
/* 8038A7B8 00387718 39 03 FF F8 */ addi r8, r3, -8
lbl_8038A7BC:
/* 8038A7BC 0038771C 80 1E 00 04 */ lwz r0, 4(r30)
/* 8038A7C0 00387720 28 00 00 00 */ cmplwi r0, 0
/* 8038A7C4 00387724 40 82 00 0C */ bne lbl_8038A7D0
/* 8038A7C8 00387728 93 BE 00 04 */ stw r29, 4(r30)
/* 8038A7CC 0038772C 93 BE 00 00 */ stw r29, 0(r30)
lbl_8038A7D0:
/* 8038A7D0 00387730 80 9E 00 00 */ lwz r4, 0(r30)
/* 8038A7D4 00387734 7F A3 EB 78 */ mr r3, r29
/* 8038A7D8 00387738 80 BE 00 04 */ lwz r5, 4(r30)
/* 8038A7DC 0038773C 7F E6 FB 78 */ mr r6, r31
/* 8038A7E0 00387740 38 FD 00 14 */ addi r7, r29, 0x14
/* 8038A7E4 00387744 39 08 FF EC */ addi r8, r8, -20
/* 8038A7E8 00387748 48 00 00 65 */ bl sub_8038a84c
/* 8038A7EC 0038774C 93 BE 00 04 */ stw r29, 4(r30)
lbl_8038A7F0:
/* 8038A7F0 00387750 80 7E 00 04 */ lwz r3, 4(r30)
/* 8038A7F4 00387754 80 A3 00 0C */ lwz r5, 0xc(r3)
/* 8038A7F8 00387758 80 05 00 04 */ lwz r0, 4(r5)
/* 8038A7FC 0038775C 90 03 00 0C */ stw r0, 0xc(r3)
/* 8038A800 00387760 80 9E 00 04 */ lwz r4, 4(r30)
/* 8038A804 00387764 80 64 00 10 */ lwz r3, 0x10(r4)
/* 8038A808 00387768 38 03 00 01 */ addi r0, r3, 1
/* 8038A80C 0038776C 90 04 00 10 */ stw r0, 0x10(r4)
/* 8038A810 00387770 80 7E 00 04 */ lwz r3, 4(r30)
/* 8038A814 00387774 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038A818 00387778 28 00 00 00 */ cmplwi r0, 0
/* 8038A81C 0038777C 40 82 00 18 */ bne lbl_8038A834
/* 8038A820 00387780 80 03 00 04 */ lwz r0, 4(r3)
/* 8038A824 00387784 90 1E 00 04 */ stw r0, 4(r30)
/* 8038A828 00387788 80 7E 00 00 */ lwz r3, 0(r30)
/* 8038A82C 0038778C 80 03 00 04 */ lwz r0, 4(r3)
/* 8038A830 00387790 90 1E 00 00 */ stw r0, 0(r30)
lbl_8038A834:
/* 8038A834 00387794 38 65 00 04 */ addi r3, r5, 4
lbl_8038A838:
/* 8038A838 00387798 BB 01 00 10 */ lmw r24, 0x10(r1)
/* 8038A83C 0038779C 80 01 00 34 */ lwz r0, 0x34(r1)
/* 8038A840 003877A0 7C 08 03 A6 */ mtlr r0
/* 8038A844 003877A4 38 21 00 30 */ addi r1, r1, 0x30
/* 8038A848 003877A8 4E 80 00 20 */ blr
.global sub_8038a84c
sub_8038a84c:
/* 8038A84C 003877AC 3D 20 80 3E */ lis r9, lbl_803D85C0@ha
/* 8038A850 003877B0 54 C0 10 3A */ slwi r0, r6, 2
/* 8038A854 003877B4 38 C9 85 C0 */ addi r6, r9, lbl_803D85C0@l
/* 8038A858 003877B8 90 83 00 00 */ stw r4, 0(r3)
/* 8038A85C 003877BC 7C C6 00 2E */ lwzx r6, r6, r0
/* 8038A860 003877C0 7C E9 3B 78 */ mr r9, r7
/* 8038A864 003877C4 90 A3 00 04 */ stw r5, 4(r3)
/* 8038A868 003877C8 39 60 00 00 */ li r11, 0
/* 8038A86C 003877CC 39 46 00 04 */ addi r10, r6, 4
/* 8038A870 003877D0 7D 08 53 96 */ divwu r8, r8, r10
/* 8038A874 003877D4 90 64 00 04 */ stw r3, 4(r4)
/* 8038A878 003877D8 90 65 00 00 */ stw r3, 0(r5)
/* 8038A87C 003877DC 90 C3 00 08 */ stw r6, 8(r3)
/* 8038A880 003877E0 38 08 FF FF */ addi r0, r8, -1
/* 8038A884 003877E4 28 00 00 00 */ cmplwi r0, 0
/* 8038A888 003877E8 40 81 00 D4 */ ble lbl_8038A95C
/* 8038A88C 003877EC 28 00 00 08 */ cmplwi r0, 8
/* 8038A890 003877F0 38 88 FF F7 */ addi r4, r8, -9
/* 8038A894 003877F4 40 81 00 A0 */ ble lbl_8038A934
/* 8038A898 003877F8 38 04 00 07 */ addi r0, r4, 7
/* 8038A89C 003877FC 54 00 E8 FE */ srwi r0, r0, 3
/* 8038A8A0 00387800 7C 09 03 A6 */ mtctr r0
/* 8038A8A4 00387804 28 04 00 00 */ cmplwi r4, 0
/* 8038A8A8 00387808 40 81 00 8C */ ble lbl_8038A934
lbl_8038A8AC:
/* 8038A8AC 0038780C 90 69 00 00 */ stw r3, 0(r9)
/* 8038A8B0 00387810 7C 09 52 14 */ add r0, r9, r10
/* 8038A8B4 00387814 7C 04 03 78 */ mr r4, r0
/* 8038A8B8 00387818 39 6B 00 08 */ addi r11, r11, 8
/* 8038A8BC 0038781C 90 09 00 04 */ stw r0, 4(r9)
/* 8038A8C0 00387820 7C 00 52 14 */ add r0, r0, r10
/* 8038A8C4 00387824 7C 05 03 78 */ mr r5, r0
/* 8038A8C8 00387828 90 64 00 00 */ stw r3, 0(r4)
/* 8038A8CC 0038782C 90 04 00 04 */ stw r0, 4(r4)
/* 8038A8D0 00387830 7C 00 52 14 */ add r0, r0, r10
/* 8038A8D4 00387834 7C 04 03 78 */ mr r4, r0
/* 8038A8D8 00387838 90 65 00 00 */ stw r3, 0(r5)
/* 8038A8DC 0038783C 90 05 00 04 */ stw r0, 4(r5)
/* 8038A8E0 00387840 7C 00 52 14 */ add r0, r0, r10
/* 8038A8E4 00387844 7C 05 03 78 */ mr r5, r0
/* 8038A8E8 00387848 90 64 00 00 */ stw r3, 0(r4)
/* 8038A8EC 0038784C 90 04 00 04 */ stw r0, 4(r4)
/* 8038A8F0 00387850 7C 00 52 14 */ add r0, r0, r10
/* 8038A8F4 00387854 7C 04 03 78 */ mr r4, r0
/* 8038A8F8 00387858 90 65 00 00 */ stw r3, 0(r5)
/* 8038A8FC 0038785C 90 05 00 04 */ stw r0, 4(r5)
/* 8038A900 00387860 7C 00 52 14 */ add r0, r0, r10
/* 8038A904 00387864 7C 05 03 78 */ mr r5, r0
/* 8038A908 00387868 90 64 00 00 */ stw r3, 0(r4)
/* 8038A90C 0038786C 90 04 00 04 */ stw r0, 4(r4)
/* 8038A910 00387870 7C 00 52 14 */ add r0, r0, r10
/* 8038A914 00387874 7C 04 03 78 */ mr r4, r0
/* 8038A918 00387878 90 65 00 00 */ stw r3, 0(r5)
/* 8038A91C 0038787C 90 05 00 04 */ stw r0, 4(r5)
/* 8038A920 00387880 7C 00 52 14 */ add r0, r0, r10
/* 8038A924 00387884 7C 09 03 78 */ mr r9, r0
/* 8038A928 00387888 90 64 00 00 */ stw r3, 0(r4)
/* 8038A92C 0038788C 90 04 00 04 */ stw r0, 4(r4)
/* 8038A930 00387890 42 00 FF 7C */ bdnz lbl_8038A8AC
lbl_8038A934:
/* 8038A934 00387894 38 88 FF FF */ addi r4, r8, -1
/* 8038A938 00387898 7C 0B 20 50 */ subf r0, r11, r4
/* 8038A93C 0038789C 7C 09 03 A6 */ mtctr r0
/* 8038A940 003878A0 7C 0B 20 40 */ cmplw r11, r4
/* 8038A944 003878A4 40 80 00 18 */ bge lbl_8038A95C
lbl_8038A948:
/* 8038A948 003878A8 90 69 00 00 */ stw r3, 0(r9)
/* 8038A94C 003878AC 7C 09 52 14 */ add r0, r9, r10
/* 8038A950 003878B0 90 09 00 04 */ stw r0, 4(r9)
/* 8038A954 003878B4 7C 09 03 78 */ mr r9, r0
/* 8038A958 003878B8 42 00 FF F0 */ bdnz lbl_8038A948
lbl_8038A95C:
/* 8038A95C 003878BC 90 69 00 00 */ stw r3, 0(r9)
/* 8038A960 003878C0 38 00 00 00 */ li r0, 0
/* 8038A964 003878C4 90 09 00 04 */ stw r0, 4(r9)
/* 8038A968 003878C8 90 E3 00 0C */ stw r7, 0xc(r3)
/* 8038A96C 003878CC 90 03 00 10 */ stw r0, 0x10(r3)
/* 8038A970 003878D0 4E 80 00 20 */ blr
.global soft_allocate_from_var_pools
soft_allocate_from_var_pools:
/* 8038A974 003878D4 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8038A978 003878D8 7C 08 02 A6 */ mflr r0
/* 8038A97C 003878DC 90 01 00 24 */ stw r0, 0x24(r1)
/* 8038A980 003878E0 38 04 00 0F */ addi r0, r4, 0xf
/* 8038A984 003878E4 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 8038A988 003878E8 93 C1 00 18 */ stw r30, 0x18(r1)
/* 8038A98C 003878EC 7C BE 2B 78 */ mr r30, r5
/* 8038A990 003878F0 93 A1 00 14 */ stw r29, 0x14(r1)
/* 8038A994 003878F4 54 1D 00 38 */ rlwinm r29, r0, 0, 0, 0x1c
/* 8038A998 003878F8 28 1D 00 50 */ cmplwi r29, 0x50
/* 8038A99C 003878FC 93 81 00 10 */ stw r28, 0x10(r1)
/* 8038A9A0 00387900 7C 7C 1B 78 */ mr r28, r3
/* 8038A9A4 00387904 40 80 00 08 */ bge lbl_8038A9AC
/* 8038A9A8 00387908 3B A0 00 50 */ li r29, 0x50
lbl_8038A9AC:
/* 8038A9AC 0038790C 38 00 00 00 */ li r0, 0
/* 8038A9B0 00387910 90 1E 00 00 */ stw r0, 0(r30)
/* 8038A9B4 00387914 83 FC 00 00 */ lwz r31, 0(r28)
/* 8038A9B8 00387918 28 1F 00 00 */ cmplwi r31, 0
/* 8038A9BC 0038791C 40 82 00 0C */ bne lbl_8038A9C8
/* 8038A9C0 00387920 38 60 00 00 */ li r3, 0
/* 8038A9C4 00387924 48 00 00 68 */ b lbl_8038AA2C
lbl_8038A9C8:
/* 8038A9C8 00387928 80 1F 00 08 */ lwz r0, 8(r31)
/* 8038A9CC 0038792C 7C 1D 00 40 */ cmplw r29, r0
/* 8038A9D0 00387930 41 81 00 20 */ bgt lbl_8038A9F0
/* 8038A9D4 00387934 7F E3 FB 78 */ mr r3, r31
/* 8038A9D8 00387938 7F A4 EB 78 */ mr r4, r29
/* 8038A9DC 0038793C 48 00 04 F1 */ bl sub_8038aecc
/* 8038A9E0 00387940 28 03 00 00 */ cmplwi r3, 0
/* 8038A9E4 00387944 41 82 00 0C */ beq lbl_8038A9F0
/* 8038A9E8 00387948 93 FC 00 00 */ stw r31, 0(r28)
/* 8038A9EC 0038794C 48 00 00 3C */ b lbl_8038AA28
lbl_8038A9F0:
/* 8038A9F0 00387950 80 7F 00 08 */ lwz r3, 8(r31)
/* 8038A9F4 00387954 28 03 00 08 */ cmplwi r3, 8
/* 8038A9F8 00387958 40 81 00 18 */ ble lbl_8038AA10
/* 8038A9FC 0038795C 80 1E 00 00 */ lwz r0, 0(r30)
/* 8038AA00 00387960 38 63 FF F8 */ addi r3, r3, -8
/* 8038AA04 00387964 7C 00 18 40 */ cmplw r0, r3
/* 8038AA08 00387968 40 80 00 08 */ bge lbl_8038AA10
/* 8038AA0C 0038796C 90 7E 00 00 */ stw r3, 0(r30)
lbl_8038AA10:
/* 8038AA10 00387970 83 FF 00 04 */ lwz r31, 4(r31)
/* 8038AA14 00387974 80 1C 00 00 */ lwz r0, 0(r28)
/* 8038AA18 00387978 7C 1F 00 40 */ cmplw r31, r0
/* 8038AA1C 0038797C 40 82 FF AC */ bne lbl_8038A9C8
/* 8038AA20 00387980 38 60 00 00 */ li r3, 0
/* 8038AA24 00387984 48 00 00 08 */ b lbl_8038AA2C
lbl_8038AA28:
/* 8038AA28 00387988 38 63 00 08 */ addi r3, r3, 8
lbl_8038AA2C:
/* 8038AA2C 0038798C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8038AA30 00387990 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 8038AA34 00387994 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8038AA38 00387998 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 8038AA3C 0038799C 83 81 00 10 */ lwz r28, 0x10(r1)
/* 8038AA40 003879A0 7C 08 03 A6 */ mtlr r0
/* 8038AA44 003879A4 38 21 00 20 */ addi r1, r1, 0x20
/* 8038AA48 003879A8 4E 80 00 20 */ blr
.global sub_8038aa4c
sub_8038aa4c:
/* 8038AA4C 003879AC 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8038AA50 003879B0 7C 08 02 A6 */ mflr r0
/* 8038AA54 003879B4 90 01 00 24 */ stw r0, 0x24(r1)
/* 8038AA58 003879B8 38 04 00 0F */ addi r0, r4, 0xf
/* 8038AA5C 003879BC 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 8038AA60 003879C0 93 C1 00 18 */ stw r30, 0x18(r1)
/* 8038AA64 003879C4 54 1E 00 38 */ rlwinm r30, r0, 0, 0, 0x1c
/* 8038AA68 003879C8 28 1E 00 50 */ cmplwi r30, 0x50
/* 8038AA6C 003879CC 93 A1 00 14 */ stw r29, 0x14(r1)
/* 8038AA70 003879D0 7C 7D 1B 78 */ mr r29, r3
/* 8038AA74 003879D4 93 81 00 10 */ stw r28, 0x10(r1)
/* 8038AA78 003879D8 40 80 00 08 */ bge lbl_8038AA80
/* 8038AA7C 003879DC 3B C0 00 50 */ li r30, 0x50
lbl_8038AA80:
/* 8038AA80 003879E0 83 FD 00 00 */ lwz r31, 0(r29)
/* 8038AA84 003879E4 28 1F 00 00 */ cmplwi r31, 0
/* 8038AA88 003879E8 41 82 00 08 */ beq lbl_8038AA90
/* 8038AA8C 003879EC 48 00 00 C0 */ b lbl_8038AB4C
lbl_8038AA90:
/* 8038AA90 003879F0 38 7E 00 1F */ addi r3, r30, 0x1f
/* 8038AA94 003879F4 3C 00 00 01 */ lis r0, 1
/* 8038AA98 003879F8 54 7C 00 38 */ rlwinm r28, r3, 0, 0, 0x1c
/* 8038AA9C 003879FC 7C 1C 00 40 */ cmplw r28, r0
/* 8038AAA0 00387A00 40 80 00 08 */ bge lbl_8038AAA8
/* 8038AAA4 00387A04 7C 1C 03 78 */ mr r28, r0
lbl_8038AAA8:
/* 8038AAA8 00387A08 7F 83 E3 78 */ mr r3, r28
/* 8038AAAC 00387A0C 4B C7 D9 F9 */ bl sub_800084a4
/* 8038AAB0 00387A10 7C 7F 1B 79 */ or. r31, r3, r3
/* 8038AAB4 00387A14 40 82 00 0C */ bne lbl_8038AAC0
/* 8038AAB8 00387A18 3B E0 00 00 */ li r31, 0
/* 8038AABC 00387A1C 48 00 00 90 */ b lbl_8038AB4C
lbl_8038AAC0:
/* 8038AAC0 00387A20 63 80 00 03 */ ori r0, r28, 3
/* 8038AAC4 00387A24 38 9F 00 10 */ addi r4, r31, 0x10
/* 8038AAC8 00387A28 90 1F 00 0C */ stw r0, 0xc(r31)
/* 8038AACC 00387A2C 39 1C FF F8 */ addi r8, r28, -8
/* 8038AAD0 00387A30 63 E7 00 01 */ ori r7, r31, 1
/* 8038AAD4 00387A34 38 1C FF E8 */ addi r0, r28, -24
/* 8038AAD8 00387A38 81 3F 00 0C */ lwz r9, 0xc(r31)
/* 8038AADC 00387A3C 7C BC 22 14 */ add r5, r28, r4
/* 8038AAE0 00387A40 38 C0 00 00 */ li r6, 0
/* 8038AAE4 00387A44 7D 3F 41 2E */ stwx r9, r31, r8
/* 8038AAE8 00387A48 90 FF 00 14 */ stw r7, 0x14(r31)
/* 8038AAEC 00387A4C 90 1F 00 10 */ stw r0, 0x10(r31)
/* 8038AAF0 00387A50 90 05 FF E4 */ stw r0, -0x1c(r5)
/* 8038AAF4 00387A54 90 1F 00 08 */ stw r0, 8(r31)
/* 8038AAF8 00387A58 80 1F 00 0C */ lwz r0, 0xc(r31)
/* 8038AAFC 00387A5C 54 05 00 38 */ rlwinm r5, r0, 0, 0, 0x1c
/* 8038AB00 00387A60 38 05 FF FC */ addi r0, r5, -4
/* 8038AB04 00387A64 7C DF 01 2E */ stwx r6, r31, r0
/* 8038AB08 00387A68 48 00 02 49 */ bl sub_8038ad50
/* 8038AB0C 00387A6C 80 7D 00 00 */ lwz r3, 0(r29)
/* 8038AB10 00387A70 28 03 00 00 */ cmplwi r3, 0
/* 8038AB14 00387A74 41 82 00 2C */ beq lbl_8038AB40
/* 8038AB18 00387A78 80 03 00 00 */ lwz r0, 0(r3)
/* 8038AB1C 00387A7C 90 1F 00 00 */ stw r0, 0(r31)
/* 8038AB20 00387A80 80 7F 00 00 */ lwz r3, 0(r31)
/* 8038AB24 00387A84 93 E3 00 04 */ stw r31, 4(r3)
/* 8038AB28 00387A88 80 1D 00 00 */ lwz r0, 0(r29)
/* 8038AB2C 00387A8C 90 1F 00 04 */ stw r0, 4(r31)
/* 8038AB30 00387A90 80 7D 00 00 */ lwz r3, 0(r29)
/* 8038AB34 00387A94 93 E3 00 00 */ stw r31, 0(r3)
/* 8038AB38 00387A98 93 FD 00 00 */ stw r31, 0(r29)
/* 8038AB3C 00387A9C 48 00 00 10 */ b lbl_8038AB4C
lbl_8038AB40:
/* 8038AB40 00387AA0 93 FD 00 00 */ stw r31, 0(r29)
/* 8038AB44 00387AA4 93 FF 00 00 */ stw r31, 0(r31)
/* 8038AB48 00387AA8 93 FF 00 04 */ stw r31, 4(r31)
lbl_8038AB4C:
/* 8038AB4C 00387AAC 28 1F 00 00 */ cmplwi r31, 0
/* 8038AB50 00387AB0 7F FC FB 78 */ mr r28, r31
/* 8038AB54 00387AB4 40 82 00 0C */ bne lbl_8038AB60
/* 8038AB58 00387AB8 38 60 00 00 */ li r3, 0
/* 8038AB5C 00387ABC 48 00 01 18 */ b lbl_8038AC74
lbl_8038AB60:
/* 8038AB60 00387AC0 80 1C 00 08 */ lwz r0, 8(r28)
/* 8038AB64 00387AC4 7C 1E 00 40 */ cmplw r30, r0
/* 8038AB68 00387AC8 41 81 00 20 */ bgt lbl_8038AB88
/* 8038AB6C 00387ACC 7F 83 E3 78 */ mr r3, r28
/* 8038AB70 00387AD0 7F C4 F3 78 */ mr r4, r30
/* 8038AB74 00387AD4 48 00 03 59 */ bl sub_8038aecc
/* 8038AB78 00387AD8 28 03 00 00 */ cmplwi r3, 0
/* 8038AB7C 00387ADC 41 82 00 0C */ beq lbl_8038AB88
/* 8038AB80 00387AE0 93 9D 00 00 */ stw r28, 0(r29)
/* 8038AB84 00387AE4 48 00 00 EC */ b lbl_8038AC70
lbl_8038AB88:
/* 8038AB88 00387AE8 83 9C 00 04 */ lwz r28, 4(r28)
/* 8038AB8C 00387AEC 80 1D 00 00 */ lwz r0, 0(r29)
/* 8038AB90 00387AF0 7C 1C 00 40 */ cmplw r28, r0
/* 8038AB94 00387AF4 40 82 FF CC */ bne lbl_8038AB60
/* 8038AB98 00387AF8 38 7E 00 1F */ addi r3, r30, 0x1f
/* 8038AB9C 00387AFC 3C 00 00 01 */ lis r0, 1
/* 8038ABA0 00387B00 54 7F 00 38 */ rlwinm r31, r3, 0, 0, 0x1c
/* 8038ABA4 00387B04 7C 1F 00 40 */ cmplw r31, r0
/* 8038ABA8 00387B08 40 80 00 08 */ bge lbl_8038ABB0
/* 8038ABAC 00387B0C 7C 1F 03 78 */ mr r31, r0
lbl_8038ABB0:
/* 8038ABB0 00387B10 7F E3 FB 78 */ mr r3, r31
/* 8038ABB4 00387B14 4B C7 D8 F1 */ bl sub_800084a4
/* 8038ABB8 00387B18 7C 7C 1B 79 */ or. r28, r3, r3
/* 8038ABBC 00387B1C 40 82 00 0C */ bne lbl_8038ABC8
/* 8038ABC0 00387B20 3B 80 00 00 */ li r28, 0
/* 8038ABC4 00387B24 48 00 00 90 */ b lbl_8038AC54
lbl_8038ABC8:
/* 8038ABC8 00387B28 63 E0 00 03 */ ori r0, r31, 3
/* 8038ABCC 00387B2C 38 9C 00 10 */ addi r4, r28, 0x10
/* 8038ABD0 00387B30 90 1C 00 0C */ stw r0, 0xc(r28)
/* 8038ABD4 00387B34 39 1F FF F8 */ addi r8, r31, -8
/* 8038ABD8 00387B38 63 87 00 01 */ ori r7, r28, 1
/* 8038ABDC 00387B3C 38 1F FF E8 */ addi r0, r31, -24
/* 8038ABE0 00387B40 81 3C 00 0C */ lwz r9, 0xc(r28)
/* 8038ABE4 00387B44 7C BF 22 14 */ add r5, r31, r4
/* 8038ABE8 00387B48 38 C0 00 00 */ li r6, 0
/* 8038ABEC 00387B4C 7D 3C 41 2E */ stwx r9, r28, r8
/* 8038ABF0 00387B50 90 FC 00 14 */ stw r7, 0x14(r28)
/* 8038ABF4 00387B54 90 1C 00 10 */ stw r0, 0x10(r28)
/* 8038ABF8 00387B58 90 05 FF E4 */ stw r0, -0x1c(r5)
/* 8038ABFC 00387B5C 90 1C 00 08 */ stw r0, 8(r28)
/* 8038AC00 00387B60 80 1C 00 0C */ lwz r0, 0xc(r28)
/* 8038AC04 00387B64 54 05 00 38 */ rlwinm r5, r0, 0, 0, 0x1c
/* 8038AC08 00387B68 38 05 FF FC */ addi r0, r5, -4
/* 8038AC0C 00387B6C 7C DC 01 2E */ stwx r6, r28, r0
/* 8038AC10 00387B70 48 00 01 41 */ bl sub_8038ad50
/* 8038AC14 00387B74 80 7D 00 00 */ lwz r3, 0(r29)
/* 8038AC18 00387B78 28 03 00 00 */ cmplwi r3, 0
/* 8038AC1C 00387B7C 41 82 00 2C */ beq lbl_8038AC48
/* 8038AC20 00387B80 80 03 00 00 */ lwz r0, 0(r3)
/* 8038AC24 00387B84 90 1C 00 00 */ stw r0, 0(r28)
/* 8038AC28 00387B88 80 7C 00 00 */ lwz r3, 0(r28)
/* 8038AC2C 00387B8C 93 83 00 04 */ stw r28, 4(r3)
/* 8038AC30 00387B90 80 1D 00 00 */ lwz r0, 0(r29)
/* 8038AC34 00387B94 90 1C 00 04 */ stw r0, 4(r28)
/* 8038AC38 00387B98 80 7D 00 00 */ lwz r3, 0(r29)
/* 8038AC3C 00387B9C 93 83 00 00 */ stw r28, 0(r3)
/* 8038AC40 00387BA0 93 9D 00 00 */ stw r28, 0(r29)
/* 8038AC44 00387BA4 48 00 00 10 */ b lbl_8038AC54
lbl_8038AC48:
/* 8038AC48 00387BA8 93 9D 00 00 */ stw r28, 0(r29)
/* 8038AC4C 00387BAC 93 9C 00 00 */ stw r28, 0(r28)
/* 8038AC50 00387BB0 93 9C 00 04 */ stw r28, 4(r28)
lbl_8038AC54:
/* 8038AC54 00387BB4 28 1C 00 00 */ cmplwi r28, 0
/* 8038AC58 00387BB8 40 82 00 0C */ bne lbl_8038AC64
/* 8038AC5C 00387BBC 38 60 00 00 */ li r3, 0
/* 8038AC60 00387BC0 48 00 00 14 */ b lbl_8038AC74
lbl_8038AC64:
/* 8038AC64 00387BC4 7F 83 E3 78 */ mr r3, r28
/* 8038AC68 00387BC8 7F C4 F3 78 */ mr r4, r30
/* 8038AC6C 00387BCC 48 00 02 61 */ bl sub_8038aecc
lbl_8038AC70:
/* 8038AC70 00387BD0 38 63 00 08 */ addi r3, r3, 8
lbl_8038AC74:
/* 8038AC74 00387BD4 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8038AC78 00387BD8 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 8038AC7C 00387BDC 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8038AC80 00387BE0 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 8038AC84 00387BE4 83 81 00 10 */ lwz r28, 0x10(r1)
/* 8038AC88 00387BE8 7C 08 03 A6 */ mtlr r0
/* 8038AC8C 00387BEC 38 21 00 20 */ addi r1, r1, 0x20
/* 8038AC90 00387BF0 4E 80 00 20 */ blr
.global sub_8038ac94
sub_8038ac94:
/* 8038AC94 00387BF4 80 C3 00 00 */ lwz r6, 0(r3)
/* 8038AC98 00387BF8 54 C8 00 38 */ rlwinm r8, r6, 0, 0, 0x1c
/* 8038AC9C 00387BFC 7C A3 42 14 */ add r5, r3, r8
/* 8038ACA0 00387C00 80 E5 00 00 */ lwz r7, 0(r5)
/* 8038ACA4 00387C04 54 E0 07 BD */ rlwinm. r0, r7, 0, 0x1e, 0x1e
/* 8038ACA8 00387C08 4C 82 00 20 */ bnelr
/* 8038ACAC 00387C0C 54 C0 07 7E */ clrlwi r0, r6, 0x1d
/* 8038ACB0 00387C10 54 E6 00 38 */ rlwinm r6, r7, 0, 0, 0x1c
/* 8038ACB4 00387C14 90 03 00 00 */ stw r0, 0(r3)
/* 8038ACB8 00387C18 7C E8 32 14 */ add r7, r8, r6
/* 8038ACBC 00387C1C 54 E0 00 38 */ rlwinm r0, r7, 0, 0, 0x1c
/* 8038ACC0 00387C20 80 C3 00 00 */ lwz r6, 0(r3)
/* 8038ACC4 00387C24 7C C0 03 78 */ or r0, r6, r0
/* 8038ACC8 00387C28 90 03 00 00 */ stw r0, 0(r3)
/* 8038ACCC 00387C2C 80 03 00 00 */ lwz r0, 0(r3)
/* 8038ACD0 00387C30 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e
/* 8038ACD4 00387C34 40 82 00 0C */ bne lbl_8038ACE0
/* 8038ACD8 00387C38 38 07 FF FC */ addi r0, r7, -4
/* 8038ACDC 00387C3C 7C E3 01 2E */ stwx r7, r3, r0
lbl_8038ACE0:
/* 8038ACE0 00387C40 80 03 00 00 */ lwz r0, 0(r3)
/* 8038ACE4 00387C44 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e
/* 8038ACE8 00387C48 40 82 00 18 */ bne lbl_8038AD00
/* 8038ACEC 00387C4C 7C C3 38 2E */ lwzx r6, r3, r7
/* 8038ACF0 00387C50 38 00 FF FB */ li r0, -5
/* 8038ACF4 00387C54 7C C0 00 38 */ and r0, r6, r0
/* 8038ACF8 00387C58 7C 03 39 2E */ stwx r0, r3, r7
/* 8038ACFC 00387C5C 48 00 00 10 */ b lbl_8038AD0C
lbl_8038AD00:
/* 8038AD00 00387C60 7C 03 38 2E */ lwzx r0, r3, r7
/* 8038AD04 00387C64 60 00 00 04 */ ori r0, r0, 4
/* 8038AD08 00387C68 7C 03 39 2E */ stwx r0, r3, r7
lbl_8038AD0C:
/* 8038AD0C 00387C6C 80 64 00 00 */ lwz r3, 0(r4)
/* 8038AD10 00387C70 7C 03 28 40 */ cmplw r3, r5
/* 8038AD14 00387C74 40 82 00 0C */ bne lbl_8038AD20
/* 8038AD18 00387C78 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038AD1C 00387C7C 90 04 00 00 */ stw r0, 0(r4)
lbl_8038AD20:
/* 8038AD20 00387C80 80 04 00 00 */ lwz r0, 0(r4)
/* 8038AD24 00387C84 7C 00 28 40 */ cmplw r0, r5
/* 8038AD28 00387C88 40 82 00 0C */ bne lbl_8038AD34
/* 8038AD2C 00387C8C 38 00 00 00 */ li r0, 0
/* 8038AD30 00387C90 90 04 00 00 */ stw r0, 0(r4)
lbl_8038AD34:
/* 8038AD34 00387C94 80 05 00 08 */ lwz r0, 8(r5)
/* 8038AD38 00387C98 80 65 00 0C */ lwz r3, 0xc(r5)
/* 8038AD3C 00387C9C 90 03 00 08 */ stw r0, 8(r3)
/* 8038AD40 00387CA0 80 05 00 0C */ lwz r0, 0xc(r5)
/* 8038AD44 00387CA4 80 65 00 08 */ lwz r3, 8(r5)
/* 8038AD48 00387CA8 90 03 00 0C */ stw r0, 0xc(r3)
/* 8038AD4C 00387CAC 4E 80 00 20 */ blr
.global sub_8038ad50
sub_8038ad50:
/* 8038AD50 00387CB0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8038AD54 00387CB4 7C 08 02 A6 */ mflr r0
/* 8038AD58 00387CB8 38 A0 FF FD */ li r5, -3
/* 8038AD5C 00387CBC 90 01 00 14 */ stw r0, 0x14(r1)
/* 8038AD60 00387CC0 38 00 FF FB */ li r0, -5
/* 8038AD64 00387CC4 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8038AD68 00387CC8 93 C1 00 08 */ stw r30, 8(r1)
/* 8038AD6C 00387CCC 7C 7E 1B 78 */ mr r30, r3
/* 8038AD70 00387CD0 80 C4 00 00 */ lwz r6, 0(r4)
/* 8038AD74 00387CD4 7C C3 28 38 */ and r3, r6, r5
/* 8038AD78 00387CD8 54 C6 00 38 */ rlwinm r6, r6, 0, 0, 0x1c
/* 8038AD7C 00387CDC 90 64 00 00 */ stw r3, 0(r4)
/* 8038AD80 00387CE0 7C A4 32 14 */ add r5, r4, r6
/* 8038AD84 00387CE4 80 65 00 00 */ lwz r3, 0(r5)
/* 8038AD88 00387CE8 7C 60 00 38 */ and r0, r3, r0
/* 8038AD8C 00387CEC 90 05 00 00 */ stw r0, 0(r5)
/* 8038AD90 00387CF0 90 C5 FF FC */ stw r6, -4(r5)
/* 8038AD94 00387CF4 80 1E 00 0C */ lwz r0, 0xc(r30)
/* 8038AD98 00387CF8 54 03 00 38 */ rlwinm r3, r0, 0, 0, 0x1c
/* 8038AD9C 00387CFC 3B E3 FF FC */ addi r31, r3, -4
/* 8038ADA0 00387D00 7F FE FA 14 */ add r31, r30, r31
/* 8038ADA4 00387D04 80 7F 00 00 */ lwz r3, 0(r31)
/* 8038ADA8 00387D08 28 03 00 00 */ cmplwi r3, 0
/* 8038ADAC 00387D0C 41 82 00 E0 */ beq lbl_8038AE8C
/* 8038ADB0 00387D10 80 03 00 08 */ lwz r0, 8(r3)
/* 8038ADB4 00387D14 90 04 00 08 */ stw r0, 8(r4)
/* 8038ADB8 00387D18 80 64 00 08 */ lwz r3, 8(r4)
/* 8038ADBC 00387D1C 90 83 00 0C */ stw r4, 0xc(r3)
/* 8038ADC0 00387D20 80 1F 00 00 */ lwz r0, 0(r31)
/* 8038ADC4 00387D24 90 04 00 0C */ stw r0, 0xc(r4)
/* 8038ADC8 00387D28 80 7F 00 00 */ lwz r3, 0(r31)
/* 8038ADCC 00387D2C 90 83 00 08 */ stw r4, 8(r3)
/* 8038ADD0 00387D30 90 9F 00 00 */ stw r4, 0(r31)
/* 8038ADD4 00387D34 80 DF 00 00 */ lwz r6, 0(r31)
/* 8038ADD8 00387D38 80 06 00 00 */ lwz r0, 0(r6)
/* 8038ADDC 00387D3C 54 00 07 7B */ rlwinm. r0, r0, 0, 0x1d, 0x1d
/* 8038ADE0 00387D40 40 82 00 94 */ bne lbl_8038AE74
/* 8038ADE4 00387D44 80 A6 FF FC */ lwz r5, -4(r6)
/* 8038ADE8 00387D48 54 A0 07 BD */ rlwinm. r0, r5, 0, 0x1e, 0x1e
/* 8038ADEC 00387D4C 41 82 00 0C */ beq lbl_8038ADF8
/* 8038ADF0 00387D50 7C C4 33 78 */ mr r4, r6
/* 8038ADF4 00387D54 48 00 00 84 */ b lbl_8038AE78
lbl_8038ADF8:
/* 8038ADF8 00387D58 7C 85 30 50 */ subf r4, r5, r6
/* 8038ADFC 00387D5C 80 04 00 00 */ lwz r0, 0(r4)
/* 8038AE00 00387D60 54 00 07 7E */ clrlwi r0, r0, 0x1d
/* 8038AE04 00387D64 90 04 00 00 */ stw r0, 0(r4)
/* 8038AE08 00387D68 80 06 00 00 */ lwz r0, 0(r6)
/* 8038AE0C 00387D6C 80 64 00 00 */ lwz r3, 0(r4)
/* 8038AE10 00387D70 54 00 00 38 */ rlwinm r0, r0, 0, 0, 0x1c
/* 8038AE14 00387D74 7C 05 02 14 */ add r0, r5, r0
/* 8038AE18 00387D78 54 00 00 38 */ rlwinm r0, r0, 0, 0, 0x1c
/* 8038AE1C 00387D7C 7C 60 03 78 */ or r0, r3, r0
/* 8038AE20 00387D80 90 04 00 00 */ stw r0, 0(r4)
/* 8038AE24 00387D84 80 04 00 00 */ lwz r0, 0(r4)
/* 8038AE28 00387D88 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e
/* 8038AE2C 00387D8C 40 82 00 18 */ bne lbl_8038AE44
/* 8038AE30 00387D90 80 06 00 00 */ lwz r0, 0(r6)
/* 8038AE34 00387D94 54 00 00 38 */ rlwinm r0, r0, 0, 0, 0x1c
/* 8038AE38 00387D98 7C 65 02 14 */ add r3, r5, r0
/* 8038AE3C 00387D9C 38 03 FF FC */ addi r0, r3, -4
/* 8038AE40 00387DA0 7C 64 01 2E */ stwx r3, r4, r0
lbl_8038AE44:
/* 8038AE44 00387DA4 80 7F 00 00 */ lwz r3, 0(r31)
/* 8038AE48 00387DA8 7C 03 30 40 */ cmplw r3, r6
/* 8038AE4C 00387DAC 40 82 00 0C */ bne lbl_8038AE58
/* 8038AE50 00387DB0 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038AE54 00387DB4 90 1F 00 00 */ stw r0, 0(r31)
lbl_8038AE58:
/* 8038AE58 00387DB8 80 06 00 08 */ lwz r0, 8(r6)
/* 8038AE5C 00387DBC 80 66 00 0C */ lwz r3, 0xc(r6)
/* 8038AE60 00387DC0 90 03 00 08 */ stw r0, 8(r3)
/* 8038AE64 00387DC4 80 A6 00 0C */ lwz r5, 0xc(r6)
/* 8038AE68 00387DC8 80 65 00 08 */ lwz r3, 8(r5)
/* 8038AE6C 00387DCC 90 A3 00 0C */ stw r5, 0xc(r3)
/* 8038AE70 00387DD0 48 00 00 08 */ b lbl_8038AE78
lbl_8038AE74:
/* 8038AE74 00387DD4 7C C4 33 78 */ mr r4, r6
lbl_8038AE78:
/* 8038AE78 00387DD8 90 9F 00 00 */ stw r4, 0(r31)
/* 8038AE7C 00387DDC 7F E4 FB 78 */ mr r4, r31
/* 8038AE80 00387DE0 80 7F 00 00 */ lwz r3, 0(r31)
/* 8038AE84 00387DE4 4B FF FE 11 */ bl sub_8038ac94
/* 8038AE88 00387DE8 48 00 00 10 */ b lbl_8038AE98
lbl_8038AE8C:
/* 8038AE8C 00387DEC 90 9F 00 00 */ stw r4, 0(r31)
/* 8038AE90 00387DF0 90 84 00 08 */ stw r4, 8(r4)
/* 8038AE94 00387DF4 90 84 00 0C */ stw r4, 0xc(r4)
lbl_8038AE98:
/* 8038AE98 00387DF8 80 7F 00 00 */ lwz r3, 0(r31)
/* 8038AE9C 00387DFC 80 9E 00 08 */ lwz r4, 8(r30)
/* 8038AEA0 00387E00 80 03 00 00 */ lwz r0, 0(r3)
/* 8038AEA4 00387E04 54 00 00 38 */ rlwinm r0, r0, 0, 0, 0x1c
/* 8038AEA8 00387E08 7C 04 00 40 */ cmplw r4, r0
/* 8038AEAC 00387E0C 40 80 00 08 */ bge lbl_8038AEB4
/* 8038AEB0 00387E10 90 1E 00 08 */ stw r0, 8(r30)
lbl_8038AEB4:
/* 8038AEB4 00387E14 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8038AEB8 00387E18 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8038AEBC 00387E1C 83 C1 00 08 */ lwz r30, 8(r1)
/* 8038AEC0 00387E20 7C 08 03 A6 */ mtlr r0
/* 8038AEC4 00387E24 38 21 00 10 */ addi r1, r1, 0x10
/* 8038AEC8 00387E28 4E 80 00 20 */ blr
.global sub_8038aecc
sub_8038aecc:
/* 8038AECC 00387E2C 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038AED0 00387E30 54 05 00 38 */ rlwinm r5, r0, 0, 0, 0x1c
/* 8038AED4 00387E34 38 05 FF FC */ addi r0, r5, -4
/* 8038AED8 00387E38 7C A3 00 2E */ lwzx r5, r3, r0
/* 8038AEDC 00387E3C 28 05 00 00 */ cmplwi r5, 0
/* 8038AEE0 00387E40 40 82 00 0C */ bne lbl_8038AEEC
/* 8038AEE4 00387E44 38 60 00 00 */ li r3, 0
/* 8038AEE8 00387E48 4E 80 00 20 */ blr
lbl_8038AEEC:
/* 8038AEEC 00387E4C 80 05 00 00 */ lwz r0, 0(r5)
/* 8038AEF0 00387E50 7C A6 2B 78 */ mr r6, r5
/* 8038AEF4 00387E54 54 00 00 38 */ rlwinm r0, r0, 0, 0, 0x1c
/* 8038AEF8 00387E58 7C 07 03 78 */ mr r7, r0
/* 8038AEFC 00387E5C 48 00 00 30 */ b lbl_8038AF2C
lbl_8038AF00:
/* 8038AF00 00387E60 80 C6 00 0C */ lwz r6, 0xc(r6)
/* 8038AF04 00387E64 80 06 00 00 */ lwz r0, 0(r6)
/* 8038AF08 00387E68 54 00 00 38 */ rlwinm r0, r0, 0, 0, 0x1c
/* 8038AF0C 00387E6C 7C 07 00 40 */ cmplw r7, r0
/* 8038AF10 00387E70 40 80 00 08 */ bge lbl_8038AF18
/* 8038AF14 00387E74 7C 07 03 78 */ mr r7, r0
lbl_8038AF18:
/* 8038AF18 00387E78 7C 06 28 40 */ cmplw r6, r5
/* 8038AF1C 00387E7C 40 82 00 10 */ bne lbl_8038AF2C
/* 8038AF20 00387E80 90 E3 00 08 */ stw r7, 8(r3)
/* 8038AF24 00387E84 38 60 00 00 */ li r3, 0
/* 8038AF28 00387E88 4E 80 00 20 */ blr
lbl_8038AF2C:
/* 8038AF2C 00387E8C 7C 00 20 40 */ cmplw r0, r4
/* 8038AF30 00387E90 41 80 FF D0 */ blt lbl_8038AF00
/* 8038AF34 00387E94 7C 04 00 50 */ subf r0, r4, r0
/* 8038AF38 00387E98 28 00 00 50 */ cmplwi r0, 0x50
/* 8038AF3C 00387E9C 41 80 00 E0 */ blt lbl_8038B01C
/* 8038AF40 00387EA0 80 06 00 04 */ lwz r0, 4(r6)
/* 8038AF44 00387EA4 7C A6 22 14 */ add r5, r6, r4
/* 8038AF48 00387EA8 81 26 00 00 */ lwz r9, 0(r6)
/* 8038AF4C 00387EAC 54 07 00 3C */ rlwinm r7, r0, 0, 0, 0x1e
/* 8038AF50 00387EB0 60 EA 00 01 */ ori r10, r7, 1
/* 8038AF54 00387EB4 55 28 07 BC */ rlwinm r8, r9, 0, 0x1e, 0x1e
/* 8038AF58 00387EB8 55 20 07 7B */ rlwinm. r0, r9, 0, 0x1d, 0x1d
/* 8038AF5C 00387EBC 91 46 00 04 */ stw r10, 4(r6)
/* 8038AF60 00387EC0 7D 07 00 34 */ cntlzw r7, r8
/* 8038AF64 00387EC4 55 29 00 38 */ rlwinm r9, r9, 0, 0, 0x1c
/* 8038AF68 00387EC8 54 E8 D9 7E */ srwi r8, r7, 5
/* 8038AF6C 00387ECC 90 86 00 00 */ stw r4, 0(r6)
/* 8038AF70 00387ED0 7D 00 00 34 */ cntlzw r0, r8
/* 8038AF74 00387ED4 54 07 D9 7E */ srwi r7, r0, 5
/* 8038AF78 00387ED8 41 82 00 10 */ beq lbl_8038AF88
/* 8038AF7C 00387EDC 80 06 00 00 */ lwz r0, 0(r6)
/* 8038AF80 00387EE0 60 00 00 04 */ ori r0, r0, 4
/* 8038AF84 00387EE4 90 06 00 00 */ stw r0, 0(r6)
lbl_8038AF88:
/* 8038AF88 00387EE8 2C 07 00 00 */ cmpwi r7, 0
/* 8038AF8C 00387EEC 41 82 00 20 */ beq lbl_8038AFAC
/* 8038AF90 00387EF0 80 06 00 00 */ lwz r0, 0(r6)
/* 8038AF94 00387EF4 60 00 00 02 */ ori r0, r0, 2
/* 8038AF98 00387EF8 90 06 00 00 */ stw r0, 0(r6)
/* 8038AF9C 00387EFC 80 05 00 00 */ lwz r0, 0(r5)
/* 8038AFA0 00387F00 60 00 00 04 */ ori r0, r0, 4
/* 8038AFA4 00387F04 90 05 00 00 */ stw r0, 0(r5)
/* 8038AFA8 00387F08 48 00 00 08 */ b lbl_8038AFB0
lbl_8038AFAC:
/* 8038AFAC 00387F0C 90 85 FF FC */ stw r4, -4(r5)
lbl_8038AFB0:
/* 8038AFB0 00387F10 91 45 00 04 */ stw r10, 4(r5)
/* 8038AFB4 00387F14 7C 84 48 50 */ subf r4, r4, r9
/* 8038AFB8 00387F18 2C 07 00 00 */ cmpwi r7, 0
/* 8038AFBC 00387F1C 90 85 00 00 */ stw r4, 0(r5)
/* 8038AFC0 00387F20 41 82 00 10 */ beq lbl_8038AFD0
/* 8038AFC4 00387F24 80 05 00 00 */ lwz r0, 0(r5)
/* 8038AFC8 00387F28 60 00 00 04 */ ori r0, r0, 4
/* 8038AFCC 00387F2C 90 05 00 00 */ stw r0, 0(r5)
lbl_8038AFD0:
/* 8038AFD0 00387F30 2C 07 00 00 */ cmpwi r7, 0
/* 8038AFD4 00387F34 41 82 00 20 */ beq lbl_8038AFF4
/* 8038AFD8 00387F38 80 05 00 00 */ lwz r0, 0(r5)
/* 8038AFDC 00387F3C 60 00 00 02 */ ori r0, r0, 2
/* 8038AFE0 00387F40 90 05 00 00 */ stw r0, 0(r5)
/* 8038AFE4 00387F44 7C 05 20 2E */ lwzx r0, r5, r4
/* 8038AFE8 00387F48 60 00 00 04 */ ori r0, r0, 4
/* 8038AFEC 00387F4C 7C 05 21 2E */ stwx r0, r5, r4
/* 8038AFF0 00387F50 48 00 00 0C */ b lbl_8038AFFC
lbl_8038AFF4:
/* 8038AFF4 00387F54 38 04 FF FC */ addi r0, r4, -4
/* 8038AFF8 00387F58 7C 85 01 2E */ stwx r4, r5, r0
lbl_8038AFFC:
/* 8038AFFC 00387F5C 2C 08 00 00 */ cmpwi r8, 0
/* 8038B000 00387F60 41 82 00 1C */ beq lbl_8038B01C
/* 8038B004 00387F64 80 06 00 0C */ lwz r0, 0xc(r6)
/* 8038B008 00387F68 90 05 00 0C */ stw r0, 0xc(r5)
/* 8038B00C 00387F6C 80 85 00 0C */ lwz r4, 0xc(r5)
/* 8038B010 00387F70 90 A4 00 08 */ stw r5, 8(r4)
/* 8038B014 00387F74 90 C5 00 08 */ stw r6, 8(r5)
/* 8038B018 00387F78 90 A6 00 0C */ stw r5, 0xc(r6)
lbl_8038B01C:
/* 8038B01C 00387F7C 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038B020 00387F80 80 A6 00 0C */ lwz r5, 0xc(r6)
/* 8038B024 00387F84 54 04 00 38 */ rlwinm r4, r0, 0, 0, 0x1c
/* 8038B028 00387F88 38 04 FF FC */ addi r0, r4, -4
/* 8038B02C 00387F8C 7C A3 01 2E */ stwx r5, r3, r0
/* 8038B030 00387F90 80 86 00 00 */ lwz r4, 0(r6)
/* 8038B034 00387F94 60 80 00 02 */ ori r0, r4, 2
/* 8038B038 00387F98 54 84 00 38 */ rlwinm r4, r4, 0, 0, 0x1c
/* 8038B03C 00387F9C 90 06 00 00 */ stw r0, 0(r6)
/* 8038B040 00387FA0 7C 06 20 2E */ lwzx r0, r6, r4
/* 8038B044 00387FA4 60 00 00 04 */ ori r0, r0, 4
/* 8038B048 00387FA8 7C 06 21 2E */ stwx r0, r6, r4
/* 8038B04C 00387FAC 80 03 00 0C */ lwz r0, 0xc(r3)
/* 8038B050 00387FB0 54 04 00 38 */ rlwinm r4, r0, 0, 0, 0x1c
/* 8038B054 00387FB4 38 84 FF FC */ addi r4, r4, -4
/* 8038B058 00387FB8 7C 03 20 2E */ lwzx r0, r3, r4
/* 8038B05C 00387FBC 7C 00 30 40 */ cmplw r0, r6
/* 8038B060 00387FC0 40 82 00 0C */ bne lbl_8038B06C
/* 8038B064 00387FC4 80 06 00 0C */ lwz r0, 0xc(r6)
/* 8038B068 00387FC8 7C 03 21 2E */ stwx r0, r3, r4
lbl_8038B06C:
/* 8038B06C 00387FCC 7C 03 20 2E */ lwzx r0, r3, r4
/* 8038B070 00387FD0 7C 00 30 40 */ cmplw r0, r6
/* 8038B074 00387FD4 40 82 00 14 */ bne lbl_8038B088
/* 8038B078 00387FD8 38 00 00 00 */ li r0, 0
/* 8038B07C 00387FDC 7C 03 21 2E */ stwx r0, r3, r4
/* 8038B080 00387FE0 90 03 00 08 */ stw r0, 8(r3)
/* 8038B084 00387FE4 48 00 00 1C */ b lbl_8038B0A0
lbl_8038B088:
/* 8038B088 00387FE8 80 06 00 08 */ lwz r0, 8(r6)
/* 8038B08C 00387FEC 80 66 00 0C */ lwz r3, 0xc(r6)
/* 8038B090 00387FF0 90 03 00 08 */ stw r0, 8(r3)
/* 8038B094 00387FF4 80 06 00 0C */ lwz r0, 0xc(r6)
/* 8038B098 00387FF8 80 66 00 08 */ lwz r3, 8(r6)
/* 8038B09C 00387FFC 90 03 00 0C */ stw r0, 0xc(r3)
lbl_8038B0A0:
/* 8038B0A0 00388000 7C C3 33 78 */ mr r3, r6
/* 8038B0A4 00388004 4E 80 00 20 */ blr