mirror of
https://github.com/pmret/papermario.git
synced 2024-11-10 13:02:41 +01:00
79 lines
3.3 KiB
ArmAsm
79 lines
3.3 KiB
ArmAsm
|
.set noat # allow manual use of $at
|
||
|
.set noreorder # don't insert nops after branches
|
||
|
|
||
|
|
||
|
glabel _heap_malloc
|
||
|
/* 00446C 8002906C 24A5000F */ addiu $a1, $a1, 0xf
|
||
|
/* 004470 80029070 2402FFF0 */ addiu $v0, $zero, -0x10
|
||
|
/* 004474 80029074 00A22824 */ and $a1, $a1, $v0
|
||
|
/* 004478 80029078 14A00003 */ bnez $a1, .L80029088
|
||
|
/* 00447C 8002907C 0000382D */ daddu $a3, $zero, $zero
|
||
|
/* 004480 80029080 03E00008 */ jr $ra
|
||
|
/* 004484 80029084 00E0102D */ daddu $v0, $a3, $zero
|
||
|
|
||
|
.L80029088:
|
||
|
/* 004488 80029088 0000402D */ daddu $t0, $zero, $zero
|
||
|
/* 00448C 8002908C 0100502D */ daddu $t2, $t0, $zero
|
||
|
/* 004490 80029090 0080302D */ daddu $a2, $a0, $zero
|
||
|
.L80029094:
|
||
|
/* 004494 80029094 94C20008 */ lhu $v0, 8($a2)
|
||
|
/* 004498 80029098 1440000C */ bnez $v0, .L800290CC
|
||
|
/* 00449C 8002909C 00000000 */ nop
|
||
|
/* 0044A0 800290A0 8CC30004 */ lw $v1, 4($a2)
|
||
|
/* 0044A4 800290A4 0065102B */ sltu $v0, $v1, $a1
|
||
|
/* 0044A8 800290A8 14400008 */ bnez $v0, .L800290CC
|
||
|
/* 0044AC 800290AC 0068102B */ sltu $v0, $v1, $t0
|
||
|
/* 0044B0 800290B0 54400004 */ bnel $v0, $zero, .L800290C4
|
||
|
/* 0044B4 800290B4 00C0382D */ daddu $a3, $a2, $zero
|
||
|
/* 0044B8 800290B8 15000004 */ bnez $t0, .L800290CC
|
||
|
/* 0044BC 800290BC 00000000 */ nop
|
||
|
/* 0044C0 800290C0 00C0382D */ daddu $a3, $a2, $zero
|
||
|
.L800290C4:
|
||
|
/* 0044C4 800290C4 0060402D */ daddu $t0, $v1, $zero
|
||
|
/* 0044C8 800290C8 8CEA0000 */ lw $t2, ($a3)
|
||
|
.L800290CC:
|
||
|
/* 0044CC 800290CC 8CC40000 */ lw $a0, ($a2)
|
||
|
/* 0044D0 800290D0 5480FFF0 */ bnel $a0, $zero, .L80029094
|
||
|
/* 0044D4 800290D4 0080302D */ daddu $a2, $a0, $zero
|
||
|
/* 0044D8 800290D8 11000020 */ beqz $t0, .L8002915C
|
||
|
/* 0044DC 800290DC 24A90010 */ addiu $t1, $a1, 0x10
|
||
|
/* 0044E0 800290E0 0109102B */ sltu $v0, $t0, $t1
|
||
|
/* 0044E4 800290E4 54400012 */ bnel $v0, $zero, .L80029130
|
||
|
/* 0044E8 800290E8 ACEA0000 */ sw $t2, ($a3)
|
||
|
/* 0044EC 800290EC 00E91021 */ addu $v0, $a3, $t1
|
||
|
/* 0044F0 800290F0 ACE20000 */ sw $v0, ($a3)
|
||
|
/* 0044F4 800290F4 0040302D */ daddu $a2, $v0, $zero
|
||
|
/* 0044F8 800290F8 3C038007 */ lui $v1, 0x8007
|
||
|
/* 0044FC 800290FC 24634270 */ addiu $v1, $v1, 0x4270
|
||
|
/* 004500 80029100 ACE50004 */ sw $a1, 4($a3)
|
||
|
/* 004504 80029104 94640000 */ lhu $a0, ($v1)
|
||
|
/* 004508 80029108 24020001 */ addiu $v0, $zero, 1
|
||
|
/* 00450C 8002910C A4E20008 */ sh $v0, 8($a3)
|
||
|
/* 004510 80029110 24820001 */ addiu $v0, $a0, 1
|
||
|
/* 004514 80029114 A4620000 */ sh $v0, ($v1)
|
||
|
/* 004518 80029118 01091023 */ subu $v0, $t0, $t1
|
||
|
/* 00451C 8002911C A4E4000A */ sh $a0, 0xa($a3)
|
||
|
/* 004520 80029120 ACCA0000 */ sw $t2, ($a2)
|
||
|
/* 004524 80029124 ACC20004 */ sw $v0, 4($a2)
|
||
|
/* 004528 80029128 0800A455 */ j .L80029154
|
||
|
/* 00452C 8002912C A4C00008 */ sh $zero, 8($a2)
|
||
|
|
||
|
.L80029130:
|
||
|
/* 004530 80029130 3C038007 */ lui $v1, 0x8007
|
||
|
/* 004534 80029134 24634270 */ addiu $v1, $v1, 0x4270
|
||
|
/* 004538 80029138 ACE80004 */ sw $t0, 4($a3)
|
||
|
/* 00453C 8002913C 94640000 */ lhu $a0, ($v1)
|
||
|
/* 004540 80029140 24020001 */ addiu $v0, $zero, 1
|
||
|
/* 004544 80029144 A4E20008 */ sh $v0, 8($a3)
|
||
|
/* 004548 80029148 24820001 */ addiu $v0, $a0, 1
|
||
|
/* 00454C 8002914C A4620000 */ sh $v0, ($v1)
|
||
|
/* 004550 80029150 A4E4000A */ sh $a0, 0xa($a3)
|
||
|
.L80029154:
|
||
|
/* 004554 80029154 03E00008 */ jr $ra
|
||
|
/* 004558 80029158 24E20010 */ addiu $v0, $a3, 0x10
|
||
|
|
||
|
.L8002915C:
|
||
|
/* 00455C 8002915C 03E00008 */ jr $ra
|
||
|
/* 004560 80029160 0000102D */ daddu $v0, $zero, $zero
|
||
|
|