mirror of https://github.com/PrimeDecomp/prime.git
238 lines
11 KiB
ArmAsm
238 lines
11 KiB
ArmAsm
|
.include "macros.inc"
|
||
|
|
||
|
.section .text, "ax" # 0x80003640 - 0x803CB1C0
|
||
|
|
||
|
.global Free__15CSmallAllocPoolFPCv
|
||
|
Free__15CSmallAllocPoolFPCv:
|
||
|
/* 80350E24 0034DD84 80 03 00 00 */ lwz r0, 0(r3)
|
||
|
/* 80350E28 0034DD88 38 C0 00 04 */ li r6, 4
|
||
|
/* 80350E2C 0034DD8C 80 A3 00 04 */ lwz r5, 4(r3)
|
||
|
/* 80350E30 0034DD90 7C 80 20 50 */ subf r4, r0, r4
|
||
|
/* 80350E34 0034DD94 80 03 00 18 */ lwz r0, 0x18(r3)
|
||
|
/* 80350E38 0034DD98 7C 84 16 70 */ srawi r4, r4, 2
|
||
|
/* 80350E3C 0034DD9C 7D 04 01 94 */ addze r8, r4
|
||
|
/* 80350E40 0034DDA0 55 04 07 FE */ clrlwi r4, r8, 0x1f
|
||
|
/* 80350E44 0034DDA4 55 09 F8 7E */ srwi r9, r8, 1
|
||
|
/* 80350E48 0034DDA8 7C E4 00 D0 */ neg r7, r4
|
||
|
/* 80350E4C 0034DDAC 7C 85 48 AE */ lbzx r4, r5, r9
|
||
|
/* 80350E50 0034DDB0 7C C5 38 78 */ andc r5, r6, r7
|
||
|
/* 80350E54 0034DDB4 7C 84 2E 30 */ sraw r4, r4, r5
|
||
|
/* 80350E58 0034DDB8 54 84 07 3E */ clrlwi r4, r4, 0x1c
|
||
|
/* 80350E5C 0034DDBC 7C 00 22 14 */ add r0, r0, r4
|
||
|
/* 80350E60 0034DDC0 90 03 00 18 */ stw r0, 0x18(r3)
|
||
|
/* 80350E64 0034DDC4 7C 85 23 78 */ mr r5, r4
|
||
|
/* 80350E68 0034DDC8 80 83 00 1C */ lwz r4, 0x1c(r3)
|
||
|
/* 80350E6C 0034DDCC 38 04 FF FF */ addi r0, r4, -1
|
||
|
/* 80350E70 0034DDD0 90 03 00 1C */ stw r0, 0x1c(r3)
|
||
|
/* 80350E74 0034DDD4 91 03 00 14 */ stw r8, 0x14(r3)
|
||
|
/* 80350E78 0034DDD8 80 03 00 10 */ lwz r0, 0x10(r3)
|
||
|
/* 80350E7C 0034DDDC 7C 08 00 40 */ cmplw r8, r0
|
||
|
/* 80350E80 0034DDE0 40 82 00 0C */ bne lbl_80350E8C
|
||
|
/* 80350E84 0034DDE4 38 00 FF FF */ li r0, -1
|
||
|
/* 80350E88 0034DDE8 90 03 00 10 */ stw r0, 0x10(r3)
|
||
|
lbl_80350E8C:
|
||
|
/* 80350E8C 0034DDEC 80 63 00 04 */ lwz r3, 4(r3)
|
||
|
/* 80350E90 0034DDF0 38 00 00 00 */ li r0, 0
|
||
|
/* 80350E94 0034DDF4 7C 63 4A 14 */ add r3, r3, r9
|
||
|
/* 80350E98 0034DDF8 48 00 00 10 */ b lbl_80350EA8
|
||
|
lbl_80350E9C:
|
||
|
/* 80350E9C 0034DDFC 98 03 00 00 */ stb r0, 0(r3)
|
||
|
/* 80350EA0 0034DE00 38 A5 FF FE */ addi r5, r5, -2
|
||
|
/* 80350EA4 0034DE04 38 63 00 01 */ addi r3, r3, 1
|
||
|
lbl_80350EA8:
|
||
|
/* 80350EA8 0034DE08 2C 05 00 00 */ cmpwi r5, 0
|
||
|
/* 80350EAC 0034DE0C 40 82 FF F0 */ bne lbl_80350E9C
|
||
|
/* 80350EB0 0034DE10 38 60 00 01 */ li r3, 1
|
||
|
/* 80350EB4 0034DE14 4E 80 00 20 */ blr
|
||
|
|
||
|
.global Alloc__15CSmallAllocPoolFUi
|
||
|
Alloc__15CSmallAllocPoolFUi:
|
||
|
/* 80350EB8 0034DE18 94 21 FF F0 */ stwu r1, -0x10(r1)
|
||
|
/* 80350EBC 0034DE1C 7C 08 02 A6 */ mflr r0
|
||
|
/* 80350EC0 0034DE20 28 04 00 04 */ cmplwi r4, 4
|
||
|
/* 80350EC4 0034DE24 90 01 00 14 */ stw r0, 0x14(r1)
|
||
|
/* 80350EC8 0034DE28 93 E1 00 0C */ stw r31, 0xc(r1)
|
||
|
/* 80350ECC 0034DE2C 7C 7F 1B 78 */ mr r31, r3
|
||
|
/* 80350ED0 0034DE30 38 60 00 01 */ li r3, 1
|
||
|
/* 80350ED4 0034DE34 93 C1 00 08 */ stw r30, 8(r1)
|
||
|
/* 80350ED8 0034DE38 41 80 00 0C */ blt lbl_80350EE4
|
||
|
/* 80350EDC 0034DE3C 38 04 00 03 */ addi r0, r4, 3
|
||
|
/* 80350EE0 0034DE40 54 03 F0 BE */ srwi r3, r0, 2
|
||
|
lbl_80350EE4:
|
||
|
/* 80350EE4 0034DE44 54 60 07 FF */ clrlwi. r0, r3, 0x1f
|
||
|
/* 80350EE8 0034DE48 7C 7E 1B 78 */ mr r30, r3
|
||
|
/* 80350EEC 0034DE4C 41 82 00 08 */ beq lbl_80350EF4
|
||
|
/* 80350EF0 0034DE50 3B C3 00 01 */ addi r30, r3, 1
|
||
|
lbl_80350EF4:
|
||
|
/* 80350EF4 0034DE54 7F E3 FB 78 */ mr r3, r31
|
||
|
/* 80350EF8 0034DE58 7F C4 F3 78 */ mr r4, r30
|
||
|
/* 80350EFC 0034DE5C 48 00 00 D5 */ bl FindFree__15CSmallAllocPoolFi
|
||
|
/* 80350F00 0034DE60 28 03 00 00 */ cmplwi r3, 0
|
||
|
/* 80350F04 0034DE64 40 82 00 0C */ bne lbl_80350F10
|
||
|
/* 80350F08 0034DE68 38 60 00 00 */ li r3, 0
|
||
|
/* 80350F0C 0034DE6C 48 00 00 AC */ b lbl_80350FB8
|
||
|
lbl_80350F10:
|
||
|
/* 80350F10 0034DE70 38 9E FF FE */ addi r4, r30, -2
|
||
|
/* 80350F14 0034DE74 80 DF 00 04 */ lwz r6, 4(r31)
|
||
|
/* 80350F18 0034DE78 54 80 0F FE */ srwi r0, r4, 0x1f
|
||
|
/* 80350F1C 0034DE7C 57 C5 20 36 */ slwi r5, r30, 4
|
||
|
/* 80350F20 0034DE80 7C 00 22 14 */ add r0, r0, r4
|
||
|
/* 80350F24 0034DE84 7C 86 18 50 */ subf r4, r6, r3
|
||
|
/* 80350F28 0034DE88 7C 07 0E 71 */ srawi. r7, r0, 1
|
||
|
/* 80350F2C 0034DE8C 80 DF 00 00 */ lwz r6, 0(r31)
|
||
|
/* 80350F30 0034DE90 60 A0 00 0F */ ori r0, r5, 0xf
|
||
|
/* 80350F34 0034DE94 54 85 18 38 */ slwi r5, r4, 3
|
||
|
/* 80350F38 0034DE98 98 03 00 00 */ stb r0, 0(r3)
|
||
|
/* 80350F3C 0034DE9C 7C A6 2A 14 */ add r5, r6, r5
|
||
|
/* 80350F40 0034DEA0 38 C3 00 01 */ addi r6, r3, 1
|
||
|
/* 80350F44 0034DEA4 7C E4 3B 78 */ mr r4, r7
|
||
|
/* 80350F48 0034DEA8 38 60 00 FF */ li r3, 0xff
|
||
|
/* 80350F4C 0034DEAC 41 82 00 50 */ beq lbl_80350F9C
|
||
|
/* 80350F50 0034DEB0 54 E0 E8 FF */ rlwinm. r0, r7, 0x1d, 3, 0x1f
|
||
|
/* 80350F54 0034DEB4 7C 09 03 A6 */ mtctr r0
|
||
|
/* 80350F58 0034DEB8 41 82 00 34 */ beq lbl_80350F8C
|
||
|
lbl_80350F5C:
|
||
|
/* 80350F5C 0034DEBC 98 66 00 00 */ stb r3, 0(r6)
|
||
|
/* 80350F60 0034DEC0 98 66 00 01 */ stb r3, 1(r6)
|
||
|
/* 80350F64 0034DEC4 98 66 00 02 */ stb r3, 2(r6)
|
||
|
/* 80350F68 0034DEC8 98 66 00 03 */ stb r3, 3(r6)
|
||
|
/* 80350F6C 0034DECC 98 66 00 04 */ stb r3, 4(r6)
|
||
|
/* 80350F70 0034DED0 98 66 00 05 */ stb r3, 5(r6)
|
||
|
/* 80350F74 0034DED4 98 66 00 06 */ stb r3, 6(r6)
|
||
|
/* 80350F78 0034DED8 98 66 00 07 */ stb r3, 7(r6)
|
||
|
/* 80350F7C 0034DEDC 38 C6 00 08 */ addi r6, r6, 8
|
||
|
/* 80350F80 0034DEE0 42 00 FF DC */ bdnz lbl_80350F5C
|
||
|
/* 80350F84 0034DEE4 70 84 00 07 */ andi. r4, r4, 7
|
||
|
/* 80350F88 0034DEE8 41 82 00 14 */ beq lbl_80350F9C
|
||
|
lbl_80350F8C:
|
||
|
/* 80350F8C 0034DEEC 7C 89 03 A6 */ mtctr r4
|
||
|
lbl_80350F90:
|
||
|
/* 80350F90 0034DEF0 98 66 00 00 */ stb r3, 0(r6)
|
||
|
/* 80350F94 0034DEF4 38 C6 00 01 */ addi r6, r6, 1
|
||
|
/* 80350F98 0034DEF8 42 00 FF F8 */ bdnz lbl_80350F90
|
||
|
lbl_80350F9C:
|
||
|
/* 80350F9C 0034DEFC 80 1F 00 18 */ lwz r0, 0x18(r31)
|
||
|
/* 80350FA0 0034DF00 7C A3 2B 78 */ mr r3, r5
|
||
|
/* 80350FA4 0034DF04 7C 1E 00 50 */ subf r0, r30, r0
|
||
|
/* 80350FA8 0034DF08 90 1F 00 18 */ stw r0, 0x18(r31)
|
||
|
/* 80350FAC 0034DF0C 80 9F 00 1C */ lwz r4, 0x1c(r31)
|
||
|
/* 80350FB0 0034DF10 38 04 00 01 */ addi r0, r4, 1
|
||
|
/* 80350FB4 0034DF14 90 1F 00 1C */ stw r0, 0x1c(r31)
|
||
|
lbl_80350FB8:
|
||
|
/* 80350FB8 0034DF18 80 01 00 14 */ lwz r0, 0x14(r1)
|
||
|
/* 80350FBC 0034DF1C 83 E1 00 0C */ lwz r31, 0xc(r1)
|
||
|
/* 80350FC0 0034DF20 83 C1 00 08 */ lwz r30, 8(r1)
|
||
|
/* 80350FC4 0034DF24 7C 08 03 A6 */ mtlr r0
|
||
|
/* 80350FC8 0034DF28 38 21 00 10 */ addi r1, r1, 0x10
|
||
|
/* 80350FCC 0034DF2C 4E 80 00 20 */ blr
|
||
|
|
||
|
.global FindFree__15CSmallAllocPoolFi
|
||
|
FindFree__15CSmallAllocPoolFi:
|
||
|
/* 80350FD0 0034DF30 80 03 00 0C */ lwz r0, 0xc(r3)
|
||
|
/* 80350FD4 0034DF34 54 85 0F FE */ srwi r5, r4, 0x1f
|
||
|
/* 80350FD8 0034DF38 7C 85 22 14 */ add r4, r5, r4
|
||
|
/* 80350FDC 0034DF3C 28 00 00 00 */ cmplwi r0, 0
|
||
|
/* 80350FE0 0034DF40 7C 86 0E 70 */ srawi r6, r4, 1
|
||
|
/* 80350FE4 0034DF44 40 82 00 0C */ bne lbl_80350FF0
|
||
|
/* 80350FE8 0034DF48 80 03 00 04 */ lwz r0, 4(r3)
|
||
|
/* 80350FEC 0034DF4C 90 03 00 0C */ stw r0, 0xc(r3)
|
||
|
lbl_80350FF0:
|
||
|
/* 80350FF0 0034DF50 80 03 00 08 */ lwz r0, 8(r3)
|
||
|
/* 80350FF4 0034DF54 80 E3 00 0C */ lwz r7, 0xc(r3)
|
||
|
/* 80350FF8 0034DF58 80 A3 00 04 */ lwz r5, 4(r3)
|
||
|
/* 80350FFC 0034DF5C 54 00 F8 7E */ srwi r0, r0, 1
|
||
|
/* 80351000 0034DF60 7C E9 3B 78 */ mr r9, r7
|
||
|
/* 80351004 0034DF64 7D 05 02 14 */ add r8, r5, r0
|
||
|
lbl_80351008:
|
||
|
/* 80351008 0034DF68 88 09 00 00 */ lbz r0, 0(r9)
|
||
|
/* 8035100C 0034DF6C 28 00 00 00 */ cmplwi r0, 0
|
||
|
/* 80351010 0034DF70 40 82 00 0C */ bne lbl_8035101C
|
||
|
/* 80351014 0034DF74 7C 09 40 40 */ cmplw r9, r8
|
||
|
/* 80351018 0034DF78 40 82 00 2C */ bne lbl_80351044
|
||
|
lbl_8035101C:
|
||
|
/* 8035101C 0034DF7C 7C 09 40 40 */ cmplw r9, r8
|
||
|
/* 80351020 0034DF80 40 82 00 0C */ bne lbl_8035102C
|
||
|
/* 80351024 0034DF84 7C A9 2B 78 */ mr r9, r5
|
||
|
/* 80351028 0034DF88 48 00 00 98 */ b lbl_803510C0
|
||
|
lbl_8035102C:
|
||
|
/* 8035102C 0034DF8C 7C 04 26 70 */ srawi r4, r0, 4
|
||
|
/* 80351030 0034DF90 54 80 0F FE */ srwi r0, r4, 0x1f
|
||
|
/* 80351034 0034DF94 7C 00 22 14 */ add r0, r0, r4
|
||
|
/* 80351038 0034DF98 7C 00 0E 70 */ srawi r0, r0, 1
|
||
|
/* 8035103C 0034DF9C 7D 29 02 14 */ add r9, r9, r0
|
||
|
/* 80351040 0034DFA0 48 00 00 80 */ b lbl_803510C0
|
||
|
lbl_80351044:
|
||
|
/* 80351044 0034DFA4 7C 89 32 14 */ add r4, r9, r6
|
||
|
/* 80351048 0034DFA8 39 49 00 01 */ addi r10, r9, 1
|
||
|
/* 8035104C 0034DFAC 48 00 00 14 */ b lbl_80351060
|
||
|
lbl_80351050:
|
||
|
/* 80351050 0034DFB0 88 0A 00 00 */ lbz r0, 0(r10)
|
||
|
/* 80351054 0034DFB4 28 00 00 00 */ cmplwi r0, 0
|
||
|
/* 80351058 0034DFB8 40 82 00 20 */ bne lbl_80351078
|
||
|
/* 8035105C 0034DFBC 39 4A 00 01 */ addi r10, r10, 1
|
||
|
lbl_80351060:
|
||
|
/* 80351060 0034DFC0 7C 0A 38 40 */ cmplw r10, r7
|
||
|
/* 80351064 0034DFC4 41 82 00 14 */ beq lbl_80351078
|
||
|
/* 80351068 0034DFC8 7C 0A 40 40 */ cmplw r10, r8
|
||
|
/* 8035106C 0034DFCC 41 82 00 0C */ beq lbl_80351078
|
||
|
/* 80351070 0034DFD0 7C 0A 20 40 */ cmplw r10, r4
|
||
|
/* 80351074 0034DFD4 40 82 FF DC */ bne lbl_80351050
|
||
|
lbl_80351078:
|
||
|
/* 80351078 0034DFD8 7C 0A 20 40 */ cmplw r10, r4
|
||
|
/* 8035107C 0034DFDC 40 82 00 20 */ bne lbl_8035109C
|
||
|
/* 80351080 0034DFE0 7C 0A 40 40 */ cmplw r10, r8
|
||
|
/* 80351084 0034DFE4 40 82 00 0C */ bne lbl_80351090
|
||
|
/* 80351088 0034DFE8 90 A3 00 0C */ stw r5, 0xc(r3)
|
||
|
/* 8035108C 0034DFEC 48 00 00 08 */ b lbl_80351094
|
||
|
lbl_80351090:
|
||
|
/* 80351090 0034DFF0 91 23 00 0C */ stw r9, 0xc(r3)
|
||
|
lbl_80351094:
|
||
|
/* 80351094 0034DFF4 7D 23 4B 78 */ mr r3, r9
|
||
|
/* 80351098 0034DFF8 4E 80 00 20 */ blr
|
||
|
lbl_8035109C:
|
||
|
/* 8035109C 0034DFFC 7C 0A 38 40 */ cmplw r10, r7
|
||
|
/* 803510A0 0034E000 40 82 00 0C */ bne lbl_803510AC
|
||
|
/* 803510A4 0034E004 38 60 00 00 */ li r3, 0
|
||
|
/* 803510A8 0034E008 4E 80 00 20 */ blr
|
||
|
lbl_803510AC:
|
||
|
/* 803510AC 0034E00C 7C 0A 40 40 */ cmplw r10, r8
|
||
|
/* 803510B0 0034E010 40 82 00 0C */ bne lbl_803510BC
|
||
|
/* 803510B4 0034E014 7C A9 2B 78 */ mr r9, r5
|
||
|
/* 803510B8 0034E018 48 00 00 08 */ b lbl_803510C0
|
||
|
lbl_803510BC:
|
||
|
/* 803510BC 0034E01C 7D 49 53 78 */ mr r9, r10
|
||
|
lbl_803510C0:
|
||
|
/* 803510C0 0034E020 7C 09 38 40 */ cmplw r9, r7
|
||
|
/* 803510C4 0034E024 40 82 FF 44 */ bne lbl_80351008
|
||
|
/* 803510C8 0034E028 38 60 00 00 */ li r3, 0
|
||
|
/* 803510CC 0034E02C 4E 80 00 20 */ blr
|
||
|
|
||
|
.global __ct__15CSmallAllocPoolFUiPvPv
|
||
|
__ct__15CSmallAllocPoolFUiPvPv:
|
||
|
/* 803510D0 0034E030 94 21 FF F0 */ stwu r1, -0x10(r1)
|
||
|
/* 803510D4 0034E034 7C 08 02 A6 */ mflr r0
|
||
|
/* 803510D8 0034E038 7C 88 23 78 */ mr r8, r4
|
||
|
/* 803510DC 0034E03C 38 E0 00 00 */ li r7, 0
|
||
|
/* 803510E0 0034E040 90 01 00 14 */ stw r0, 0x14(r1)
|
||
|
/* 803510E4 0034E044 38 00 FF FF */ li r0, -1
|
||
|
/* 803510E8 0034E048 93 E1 00 0C */ stw r31, 0xc(r1)
|
||
|
/* 803510EC 0034E04C 7C 7F 1B 78 */ mr r31, r3
|
||
|
/* 803510F0 0034E050 90 A3 00 00 */ stw r5, 0(r3)
|
||
|
/* 803510F4 0034E054 54 85 F8 7E */ srwi r5, r4, 1
|
||
|
/* 803510F8 0034E058 38 80 00 00 */ li r4, 0
|
||
|
/* 803510FC 0034E05C 90 C3 00 04 */ stw r6, 4(r3)
|
||
|
/* 80351100 0034E060 7C C3 33 78 */ mr r3, r6
|
||
|
/* 80351104 0034E064 91 1F 00 08 */ stw r8, 8(r31)
|
||
|
/* 80351108 0034E068 90 FF 00 0C */ stw r7, 0xc(r31)
|
||
|
/* 8035110C 0034E06C 90 1F 00 10 */ stw r0, 0x10(r31)
|
||
|
/* 80351110 0034E070 90 1F 00 14 */ stw r0, 0x14(r31)
|
||
|
/* 80351114 0034E074 91 1F 00 18 */ stw r8, 0x18(r31)
|
||
|
/* 80351118 0034E078 90 FF 00 1C */ stw r7, 0x1c(r31)
|
||
|
/* 8035111C 0034E07C 4B CB 22 8D */ bl memset
|
||
|
/* 80351120 0034E080 80 01 00 14 */ lwz r0, 0x14(r1)
|
||
|
/* 80351124 0034E084 7F E3 FB 78 */ mr r3, r31
|
||
|
/* 80351128 0034E088 83 E1 00 0C */ lwz r31, 0xc(r1)
|
||
|
/* 8035112C 0034E08C 7C 08 03 A6 */ mtlr r0
|
||
|
/* 80351130 0034E090 38 21 00 10 */ addi r1, r1, 0x10
|
||
|
/* 80351134 0034E094 4E 80 00 20 */ blr
|