papermario/asm/nonmatchings/battle/area_mac/464560/func_80218100_464590.s
2020-12-30 15:53:40 +09:00

145 lines
7.4 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218100_464590
/* 464590 80218100 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 464594 80218104 AFB50054 */ sw $s5, 0x54($sp)
/* 464598 80218108 0080A82D */ daddu $s5, $a0, $zero
/* 46459C 8021810C AFB40050 */ sw $s4, 0x50($sp)
/* 4645A0 80218110 3C148011 */ lui $s4, %hi(gPlayerData)
/* 4645A4 80218114 2694F290 */ addiu $s4, $s4, %lo(gPlayerData)
/* 4645A8 80218118 3C058023 */ lui $a1, %hi(D_80232C50)
/* 4645AC 8021811C 24A52C50 */ addiu $a1, $a1, %lo(D_80232C50)
/* 4645B0 80218120 AFBF0058 */ sw $ra, 0x58($sp)
/* 4645B4 80218124 AFB3004C */ sw $s3, 0x4c($sp)
/* 4645B8 80218128 AFB20048 */ sw $s2, 0x48($sp)
/* 4645BC 8021812C AFB10044 */ sw $s1, 0x44($sp)
/* 4645C0 80218130 AFB00040 */ sw $s0, 0x40($sp)
/* 4645C4 80218134 8CA20000 */ lw $v0, ($a1)
/* 4645C8 80218138 8EB30098 */ lw $s3, 0x98($s5)
/* 4645CC 8021813C 04410005 */ bgez $v0, .L80218154
/* 4645D0 80218140 24030001 */ addiu $v1, $zero, 1
/* 4645D4 80218144 24020002 */ addiu $v0, $zero, 2
/* 4645D8 80218148 00532004 */ sllv $a0, $s3, $v0
/* 4645DC 8021814C 080860B4 */ j .L802182D0
/* 4645E0 80218150 ACB30000 */ sw $s3, ($a1)
.L80218154:
/* 4645E4 80218154 1053000C */ beq $v0, $s3, .L80218188
/* 4645E8 80218158 00131880 */ sll $v1, $s3, 2
/* 4645EC 8021815C 3C028023 */ lui $v0, %hi(D_80232C20)
/* 4645F0 80218160 24422C20 */ addiu $v0, $v0, %lo(D_80232C20)
/* 4645F4 80218164 00622021 */ addu $a0, $v1, $v0
/* 4645F8 80218168 8C820000 */ lw $v0, ($a0)
/* 4645FC 8021816C 14400007 */ bnez $v0, .L8021818C
/* 464600 80218170 2411000B */ addiu $s1, $zero, 0xb
/* 464604 80218174 24020002 */ addiu $v0, $zero, 2
/* 464608 80218178 24030001 */ addiu $v1, $zero, 1
/* 46460C 8021817C ACB30000 */ sw $s3, ($a1)
/* 464610 80218180 080860B7 */ j .L802182DC
/* 464614 80218184 AC830000 */ sw $v1, ($a0)
.L80218188:
/* 464618 80218188 2411000B */ addiu $s1, $zero, 0xb
.L8021818C:
/* 46461C 8021818C 27A2003C */ addiu $v0, $sp, 0x3c
.L80218190:
/* 464620 80218190 AC510000 */ sw $s1, ($v0)
/* 464624 80218194 2631FFFF */ addiu $s1, $s1, -1
/* 464628 80218198 0621FFFD */ bgez $s1, .L80218190
/* 46462C 8021819C 2442FFFC */ addiu $v0, $v0, -4
/* 464630 802181A0 0000882D */ daddu $s1, $zero, $zero
/* 464634 802181A4 27B20010 */ addiu $s2, $sp, 0x10
.L802181A8:
/* 464638 802181A8 0C00A67F */ jal rand_int
/* 46463C 802181AC 2404000B */ addiu $a0, $zero, 0xb
/* 464640 802181B0 2404000B */ addiu $a0, $zero, 0xb
/* 464644 802181B4 0C00A67F */ jal rand_int
/* 464648 802181B8 0040802D */ daddu $s0, $v0, $zero
/* 46464C 802181BC 00108080 */ sll $s0, $s0, 2
/* 464650 802181C0 02508021 */ addu $s0, $s2, $s0
/* 464654 802181C4 00021080 */ sll $v0, $v0, 2
/* 464658 802181C8 02421021 */ addu $v0, $s2, $v0
/* 46465C 802181CC 8E040000 */ lw $a0, ($s0)
/* 464660 802181D0 8C430000 */ lw $v1, ($v0)
/* 464664 802181D4 26310001 */ addiu $s1, $s1, 1
/* 464668 802181D8 AE030000 */ sw $v1, ($s0)
/* 46466C 802181DC AC440000 */ sw $a0, ($v0)
/* 464670 802181E0 2A220064 */ slti $v0, $s1, 0x64
/* 464674 802181E4 1440FFF0 */ bnez $v0, .L802181A8
/* 464678 802181E8 24080005 */ addiu $t0, $zero, 5
/* 46467C 802181EC 0000882D */ daddu $s1, $zero, $zero
/* 464680 802181F0 2407000A */ addiu $a3, $zero, 0xa
/* 464684 802181F4 2406000B */ addiu $a2, $zero, 0xb
/* 464688 802181F8 3C058023 */ lui $a1, %hi(D_80232C20)
/* 46468C 802181FC 24A52C20 */ addiu $a1, $a1, %lo(D_80232C20)
/* 464690 80218200 27A30010 */ addiu $v1, $sp, 0x10
.L80218204:
/* 464694 80218204 8C640000 */ lw $a0, ($v1)
/* 464698 80218208 000410C0 */ sll $v0, $a0, 3
/* 46469C 8021820C 02821021 */ addu $v0, $s4, $v0
/* 4646A0 80218210 90420014 */ lbu $v0, 0x14($v0)
/* 4646A4 80218214 5040000F */ beql $v0, $zero, .L80218254
/* 4646A8 80218218 26310001 */ addiu $s1, $s1, 1
/* 4646AC 8021821C 5088000D */ beql $a0, $t0, .L80218254
/* 4646B0 80218220 26310001 */ addiu $s1, $s1, 1
/* 4646B4 80218224 5087000B */ beql $a0, $a3, .L80218254
/* 4646B8 80218228 26310001 */ addiu $s1, $s1, 1
/* 4646BC 8021822C 50860009 */ beql $a0, $a2, .L80218254
/* 4646C0 80218230 26310001 */ addiu $s1, $s1, 1
/* 4646C4 80218234 50930007 */ beql $a0, $s3, .L80218254
/* 4646C8 80218238 26310001 */ addiu $s1, $s1, 1
/* 4646CC 8021823C 00041080 */ sll $v0, $a0, 2
/* 4646D0 80218240 00451021 */ addu $v0, $v0, $a1
/* 4646D4 80218244 8C420000 */ lw $v0, ($v0)
/* 4646D8 80218248 10400006 */ beqz $v0, .L80218264
/* 4646DC 8021824C 2A22000C */ slti $v0, $s1, 0xc
/* 4646E0 80218250 26310001 */ addiu $s1, $s1, 1
.L80218254:
/* 4646E4 80218254 2A22000C */ slti $v0, $s1, 0xc
/* 4646E8 80218258 1440FFEA */ bnez $v0, .L80218204
/* 4646EC 8021825C 24630004 */ addiu $v1, $v1, 4
/* 4646F0 80218260 2A22000C */ slti $v0, $s1, 0xc
.L80218264:
/* 4646F4 80218264 1040000E */ beqz $v0, .L802182A0
/* 4646F8 80218268 00041880 */ sll $v1, $a0, 2
/* 4646FC 8021826C 24020001 */ addiu $v0, $zero, 1
/* 464700 80218270 3C018023 */ lui $at, %hi(D_80232C20)
/* 464704 80218274 00230821 */ addu $at, $at, $v1
/* 464708 80218278 AC222C20 */ sw $v0, %lo(D_80232C20)($at)
/* 46470C 8021827C 000410C0 */ sll $v0, $a0, 3
/* 464710 80218280 02821021 */ addu $v0, $s4, $v0
/* 464714 80218284 3C018023 */ lui $at, %hi(D_80232C50)
/* 464718 80218288 AC242C50 */ sw $a0, %lo(D_80232C50)($at)
/* 46471C 8021828C AEA40098 */ sw $a0, 0x98($s5)
/* 464720 80218290 80430015 */ lb $v1, 0x15($v0)
/* 464724 80218294 24020002 */ addiu $v0, $zero, 2
/* 464728 80218298 080860B7 */ j .L802182DC
/* 46472C 8021829C AEA3009C */ sw $v1, 0x9c($s5)
.L802182A0:
/* 464730 802182A0 2411000B */ addiu $s1, $zero, 0xb
/* 464734 802182A4 3C028023 */ lui $v0, %hi(D_80232C4C)
/* 464738 802182A8 24422C4C */ addiu $v0, $v0, %lo(D_80232C4C)
.L802182AC:
/* 46473C 802182AC AC400000 */ sw $zero, ($v0)
/* 464740 802182B0 2631FFFF */ addiu $s1, $s1, -1
/* 464744 802182B4 0621FFFD */ bgez $s1, .L802182AC
/* 464748 802182B8 2442FFFC */ addiu $v0, $v0, -4
/* 46474C 802182BC 24020002 */ addiu $v0, $zero, 2
/* 464750 802182C0 00532004 */ sllv $a0, $s3, $v0
/* 464754 802182C4 24030001 */ addiu $v1, $zero, 1
/* 464758 802182C8 3C018023 */ lui $at, %hi(D_80232C50)
/* 46475C 802182CC AC332C50 */ sw $s3, %lo(D_80232C50)($at)
.L802182D0:
/* 464760 802182D0 3C018023 */ lui $at, %hi(D_80232C20)
/* 464764 802182D4 00240821 */ addu $at, $at, $a0
/* 464768 802182D8 AC232C20 */ sw $v1, %lo(D_80232C20)($at)
.L802182DC:
/* 46476C 802182DC 8FBF0058 */ lw $ra, 0x58($sp)
/* 464770 802182E0 8FB50054 */ lw $s5, 0x54($sp)
/* 464774 802182E4 8FB40050 */ lw $s4, 0x50($sp)
/* 464778 802182E8 8FB3004C */ lw $s3, 0x4c($sp)
/* 46477C 802182EC 8FB20048 */ lw $s2, 0x48($sp)
/* 464780 802182F0 8FB10044 */ lw $s1, 0x44($sp)
/* 464784 802182F4 8FB00040 */ lw $s0, 0x40($sp)
/* 464788 802182F8 03E00008 */ jr $ra
/* 46478C 802182FC 27BD0060 */ addiu $sp, $sp, 0x60