papermario/asm/nonmatchings/battle/area_tik2/609FD0/func_80219520_609FD0.s
2020-12-28 14:34:30 +09:00

316 lines
16 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80219520_609FD0
/* 609FD0 80219520 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 609FD4 80219524 AFB40020 */ sw $s4, 0x20($sp)
/* 609FD8 80219528 0080A02D */ daddu $s4, $a0, $zero
/* 609FDC 8021952C AFBF0028 */ sw $ra, 0x28($sp)
/* 609FE0 80219530 AFB50024 */ sw $s5, 0x24($sp)
/* 609FE4 80219534 AFB3001C */ sw $s3, 0x1c($sp)
/* 609FE8 80219538 AFB20018 */ sw $s2, 0x18($sp)
/* 609FEC 8021953C AFB10014 */ sw $s1, 0x14($sp)
/* 609FF0 80219540 AFB00010 */ sw $s0, 0x10($sp)
/* 609FF4 80219544 F7BA0048 */ sdc1 $f26, 0x48($sp)
/* 609FF8 80219548 F7B80040 */ sdc1 $f24, 0x40($sp)
/* 609FFC 8021954C F7B60038 */ sdc1 $f22, 0x38($sp)
/* 60A000 80219550 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 60A004 80219554 8E82000C */ lw $v0, 0xc($s4)
/* 60A008 80219558 0C0B1EAF */ jal get_variable
/* 60A00C 8021955C 8C450000 */ lw $a1, ($v0)
/* 60A010 80219560 0C046C04 */ jal get_model_list_index_from_tree_index
/* 60A014 80219564 0040202D */ daddu $a0, $v0, $zero
/* 60A018 80219568 0C046B4C */ jal get_model_from_list_index
/* 60A01C 8021956C 0040202D */ daddu $a0, $v0, $zero
/* 60A020 80219570 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 60A024 80219574 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 60A028 80219578 AE80008C */ sw $zero, 0x8c($s4)
/* 60A02C 8021957C 8E5000D8 */ lw $s0, 0xd8($s2)
/* 60A030 80219580 1200003C */ beqz $s0, .L80219674
/* 60A034 80219584 0040882D */ daddu $s1, $v0, $zero
/* 60A038 80219588 C6020144 */ lwc1 $f2, 0x144($s0)
/* 60A03C 8021958C C6200098 */ lwc1 $f0, 0x98($s1)
/* 60A040 80219590 46001081 */ sub.s $f2, $f2, $f0
/* 60A044 80219594 46021182 */ mul.s $f6, $f2, $f2
/* 60A048 80219598 00000000 */ nop
/* 60A04C 8021959C C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 60A050 802195A0 C602014C */ lwc1 $f2, 0x14c($s0)
/* 60A054 802195A4 46001081 */ sub.s $f2, $f2, $f0
/* 60A058 802195A8 46021102 */ mul.s $f4, $f2, $f2
/* 60A05C 802195AC 00000000 */ nop
/* 60A060 802195B0 92020191 */ lbu $v0, 0x191($s0)
/* 60A064 802195B4 C6020148 */ lwc1 $f2, 0x148($s0)
/* 60A068 802195B8 44820000 */ mtc1 $v0, $f0
/* 60A06C 802195BC 00000000 */ nop
/* 60A070 802195C0 46800020 */ cvt.s.w $f0, $f0
/* 60A074 802195C4 46001080 */ add.s $f2, $f2, $f0
/* 60A078 802195C8 3C013FC0 */ lui $at, 0x3fc0
/* 60A07C 802195CC 44810000 */ mtc1 $at, $f0
/* 60A080 802195D0 00000000 */ nop
/* 60A084 802195D4 46001081 */ sub.s $f2, $f2, $f0
/* 60A088 802195D8 46043300 */ add.s $f12, $f6, $f4
/* 60A08C 802195DC C620009C */ lwc1 $f0, 0x9c($s1)
/* 60A090 802195E0 46001501 */ sub.s $f20, $f2, $f0
/* 60A094 802195E4 46006084 */ sqrt.s $f2, $f12
/* 60A098 802195E8 46021032 */ c.eq.s $f2, $f2
/* 60A09C 802195EC 00000000 */ nop
/* 60A0A0 802195F0 45010004 */ bc1t .L80219604
/* 60A0A4 802195F4 00000000 */ nop
/* 60A0A8 802195F8 0C0187BC */ jal sqrtf
/* 60A0AC 802195FC 00000000 */ nop
/* 60A0B0 80219600 46000086 */ mov.s $f2, $f0
.L80219604:
/* 60A0B4 80219604 44800000 */ mtc1 $zero, $f0
/* 60A0B8 80219608 00000000 */ nop
/* 60A0BC 8021960C 4614003C */ c.lt.s $f0, $f20
/* 60A0C0 80219610 00000000 */ nop
/* 60A0C4 80219614 45000017 */ bc1f .L80219674
/* 60A0C8 80219618 46001106 */ mov.s $f4, $f2
/* 60A0CC 8021961C 92020191 */ lbu $v0, 0x191($s0)
/* 60A0D0 80219620 44820000 */ mtc1 $v0, $f0
/* 60A0D4 80219624 00000000 */ nop
/* 60A0D8 80219628 46800020 */ cvt.s.w $f0, $f0
/* 60A0DC 8021962C 4600A03C */ c.lt.s $f20, $f0
/* 60A0E0 80219630 00000000 */ nop
/* 60A0E4 80219634 4500000F */ bc1f .L80219674
/* 60A0E8 80219638 00000000 */ nop
/* 60A0EC 8021963C 92020190 */ lbu $v0, 0x190($s0)
/* 60A0F0 80219640 3C013F00 */ lui $at, 0x3f00
/* 60A0F4 80219644 44811000 */ mtc1 $at, $f2
/* 60A0F8 80219648 44820000 */ mtc1 $v0, $f0
/* 60A0FC 8021964C 00000000 */ nop
/* 60A100 80219650 46800020 */ cvt.s.w $f0, $f0
/* 60A104 80219654 46020002 */ mul.s $f0, $f0, $f2
/* 60A108 80219658 00000000 */ nop
/* 60A10C 8021965C 4600203C */ c.lt.s $f4, $f0
/* 60A110 80219660 00000000 */ nop
/* 60A114 80219664 45000003 */ bc1f .L80219674
/* 60A118 80219668 24020001 */ addiu $v0, $zero, 1
/* 60A11C 8021966C 0808665F */ j .L8021997C
/* 60A120 80219670 AE82008C */ sw $v0, 0x8c($s4)
.L80219674:
/* 60A124 80219674 8E5000DC */ lw $s0, 0xdc($s2)
/* 60A128 80219678 12000041 */ beqz $s0, .L80219780
/* 60A12C 8021967C 0000982D */ daddu $s3, $zero, $zero
/* 60A130 80219680 C6020144 */ lwc1 $f2, 0x144($s0)
/* 60A134 80219684 C6200098 */ lwc1 $f0, 0x98($s1)
/* 60A138 80219688 46001081 */ sub.s $f2, $f2, $f0
/* 60A13C 8021968C 46021182 */ mul.s $f6, $f2, $f2
/* 60A140 80219690 00000000 */ nop
/* 60A144 80219694 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 60A148 80219698 C602014C */ lwc1 $f2, 0x14c($s0)
/* 60A14C 8021969C 46001081 */ sub.s $f2, $f2, $f0
/* 60A150 802196A0 46021102 */ mul.s $f4, $f2, $f2
/* 60A154 802196A4 00000000 */ nop
/* 60A158 802196A8 92020191 */ lbu $v0, 0x191($s0)
/* 60A15C 802196AC C6020148 */ lwc1 $f2, 0x148($s0)
/* 60A160 802196B0 44820000 */ mtc1 $v0, $f0
/* 60A164 802196B4 00000000 */ nop
/* 60A168 802196B8 46800020 */ cvt.s.w $f0, $f0
/* 60A16C 802196BC 46001080 */ add.s $f2, $f2, $f0
/* 60A170 802196C0 3C013FC0 */ lui $at, 0x3fc0
/* 60A174 802196C4 44810000 */ mtc1 $at, $f0
/* 60A178 802196C8 00000000 */ nop
/* 60A17C 802196CC 46001081 */ sub.s $f2, $f2, $f0
/* 60A180 802196D0 46043300 */ add.s $f12, $f6, $f4
/* 60A184 802196D4 C620009C */ lwc1 $f0, 0x9c($s1)
/* 60A188 802196D8 46001501 */ sub.s $f20, $f2, $f0
/* 60A18C 802196DC 46006084 */ sqrt.s $f2, $f12
/* 60A190 802196E0 46021032 */ c.eq.s $f2, $f2
/* 60A194 802196E4 00000000 */ nop
/* 60A198 802196E8 45010004 */ bc1t .L802196FC
/* 60A19C 802196EC 00000000 */ nop
/* 60A1A0 802196F0 0C0187BC */ jal sqrtf
/* 60A1A4 802196F4 00000000 */ nop
/* 60A1A8 802196F8 46000086 */ mov.s $f2, $f0
.L802196FC:
/* 60A1AC 802196FC 44800000 */ mtc1 $zero, $f0
/* 60A1B0 80219700 00000000 */ nop
/* 60A1B4 80219704 4614003C */ c.lt.s $f0, $f20
/* 60A1B8 80219708 00000000 */ nop
/* 60A1BC 8021970C 4500001B */ bc1f .L8021977C
/* 60A1C0 80219710 46001106 */ mov.s $f4, $f2
/* 60A1C4 80219714 92020191 */ lbu $v0, 0x191($s0)
/* 60A1C8 80219718 44820000 */ mtc1 $v0, $f0
/* 60A1CC 8021971C 00000000 */ nop
/* 60A1D0 80219720 46800020 */ cvt.s.w $f0, $f0
/* 60A1D4 80219724 4600A03C */ c.lt.s $f20, $f0
/* 60A1D8 80219728 00000000 */ nop
/* 60A1DC 8021972C 45000014 */ bc1f .L80219780
/* 60A1E0 80219730 0000982D */ daddu $s3, $zero, $zero
/* 60A1E4 80219734 92020190 */ lbu $v0, 0x190($s0)
/* 60A1E8 80219738 3C013F00 */ lui $at, 0x3f00
/* 60A1EC 8021973C 44811000 */ mtc1 $at, $f2
/* 60A1F0 80219740 44820000 */ mtc1 $v0, $f0
/* 60A1F4 80219744 00000000 */ nop
/* 60A1F8 80219748 46800020 */ cvt.s.w $f0, $f0
/* 60A1FC 8021974C 46020002 */ mul.s $f0, $f0, $f2
/* 60A200 80219750 00000000 */ nop
/* 60A204 80219754 4600203C */ c.lt.s $f4, $f0
/* 60A208 80219758 00000000 */ nop
/* 60A20C 8021975C 45000008 */ bc1f .L80219780
/* 60A210 80219760 24020001 */ addiu $v0, $zero, 1
/* 60A214 80219764 0808665F */ j .L8021997C
/* 60A218 80219768 AE82008C */ sw $v0, 0x8c($s4)
.L8021976C:
/* 60A21C 8021976C 0808665F */ j .L8021997C
/* 60A220 80219770 AE82008C */ sw $v0, 0x8c($s4)
.L80219774:
/* 60A224 80219774 0808665F */ j .L8021997C
/* 60A228 80219778 AE82008C */ sw $v0, 0x8c($s4)
.L8021977C:
/* 60A22C 8021977C 0000982D */ daddu $s3, $zero, $zero
.L80219780:
/* 60A230 80219780 3C150010 */ lui $s5, 0x10
/* 60A234 80219784 3C013FC0 */ lui $at, 0x3fc0
/* 60A238 80219788 4481D000 */ mtc1 $at, $f26
/* 60A23C 8021978C 4480C000 */ mtc1 $zero, $f24
/* 60A240 80219790 3C013F00 */ lui $at, 0x3f00
/* 60A244 80219794 4481B000 */ mtc1 $at, $f22
.L80219798:
/* 60A248 80219798 8E5000E0 */ lw $s0, 0xe0($s2)
/* 60A24C 8021979C 52000074 */ beql $s0, $zero, .L80219970
/* 60A250 802197A0 26730001 */ addiu $s3, $s3, 1
/* 60A254 802197A4 8E020000 */ lw $v0, ($s0)
/* 60A258 802197A8 30420001 */ andi $v0, $v0, 1
/* 60A25C 802197AC 54400070 */ bnel $v0, $zero, .L80219970
/* 60A260 802197B0 26730001 */ addiu $s3, $s3, 1
/* 60A264 802197B4 C6020144 */ lwc1 $f2, 0x144($s0)
/* 60A268 802197B8 C6200098 */ lwc1 $f0, 0x98($s1)
/* 60A26C 802197BC 46001081 */ sub.s $f2, $f2, $f0
/* 60A270 802197C0 46021182 */ mul.s $f6, $f2, $f2
/* 60A274 802197C4 00000000 */ nop
/* 60A278 802197C8 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 60A27C 802197CC C602014C */ lwc1 $f2, 0x14c($s0)
/* 60A280 802197D0 46001081 */ sub.s $f2, $f2, $f0
/* 60A284 802197D4 46021102 */ mul.s $f4, $f2, $f2
/* 60A288 802197D8 00000000 */ nop
/* 60A28C 802197DC 92020191 */ lbu $v0, 0x191($s0)
/* 60A290 802197E0 C6020148 */ lwc1 $f2, 0x148($s0)
/* 60A294 802197E4 44820000 */ mtc1 $v0, $f0
/* 60A298 802197E8 00000000 */ nop
/* 60A29C 802197EC 46800020 */ cvt.s.w $f0, $f0
/* 60A2A0 802197F0 46001080 */ add.s $f2, $f2, $f0
/* 60A2A4 802197F4 461A1081 */ sub.s $f2, $f2, $f26
/* 60A2A8 802197F8 46043300 */ add.s $f12, $f6, $f4
/* 60A2AC 802197FC C620009C */ lwc1 $f0, 0x9c($s1)
/* 60A2B0 80219800 46001501 */ sub.s $f20, $f2, $f0
/* 60A2B4 80219804 46006004 */ sqrt.s $f0, $f12
/* 60A2B8 80219808 46000032 */ c.eq.s $f0, $f0
/* 60A2BC 8021980C 00000000 */ nop
/* 60A2C0 80219810 45010003 */ bc1t .L80219820
/* 60A2C4 80219814 00000000 */ nop
/* 60A2C8 80219818 0C0187BC */ jal sqrtf
/* 60A2CC 8021981C 00000000 */ nop
.L80219820:
/* 60A2D0 80219820 4614C03C */ c.lt.s $f24, $f20
/* 60A2D4 80219824 00000000 */ nop
/* 60A2D8 80219828 45000013 */ bc1f .L80219878
/* 60A2DC 8021982C 46000106 */ mov.s $f4, $f0
/* 60A2E0 80219830 92020191 */ lbu $v0, 0x191($s0)
/* 60A2E4 80219834 44820000 */ mtc1 $v0, $f0
/* 60A2E8 80219838 00000000 */ nop
/* 60A2EC 8021983C 46800020 */ cvt.s.w $f0, $f0
/* 60A2F0 80219840 4600A03C */ c.lt.s $f20, $f0
/* 60A2F4 80219844 00000000 */ nop
/* 60A2F8 80219848 4500000B */ bc1f .L80219878
/* 60A2FC 8021984C 00000000 */ nop
/* 60A300 80219850 92020190 */ lbu $v0, 0x190($s0)
/* 60A304 80219854 44820000 */ mtc1 $v0, $f0
/* 60A308 80219858 00000000 */ nop
/* 60A30C 8021985C 46800020 */ cvt.s.w $f0, $f0
/* 60A310 80219860 46160002 */ mul.s $f0, $f0, $f22
/* 60A314 80219864 00000000 */ nop
/* 60A318 80219868 4600203C */ c.lt.s $f4, $f0
/* 60A31C 8021986C 00000000 */ nop
/* 60A320 80219870 4501FFBE */ bc1t .L8021976C
/* 60A324 80219874 24020001 */ addiu $v0, $zero, 1
.L80219878:
/* 60A328 80219878 8E1001F4 */ lw $s0, 0x1f4($s0)
/* 60A32C 8021987C 5200003C */ beql $s0, $zero, .L80219970
/* 60A330 80219880 26730001 */ addiu $s3, $s3, 1
.L80219884:
/* 60A334 80219884 8E030000 */ lw $v1, ($s0)
/* 60A338 80219888 30620001 */ andi $v0, $v1, 1
/* 60A33C 8021988C 14400034 */ bnez $v0, .L80219960
/* 60A340 80219890 00751024 */ and $v0, $v1, $s5
/* 60A344 80219894 10400032 */ beqz $v0, .L80219960
/* 60A348 80219898 00000000 */ nop
/* 60A34C 8021989C C6020058 */ lwc1 $f2, 0x58($s0)
/* 60A350 802198A0 C6200098 */ lwc1 $f0, 0x98($s1)
/* 60A354 802198A4 46001081 */ sub.s $f2, $f2, $f0
/* 60A358 802198A8 46021182 */ mul.s $f6, $f2, $f2
/* 60A35C 802198AC 00000000 */ nop
/* 60A360 802198B0 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 60A364 802198B4 C6020060 */ lwc1 $f2, 0x60($s0)
/* 60A368 802198B8 46001081 */ sub.s $f2, $f2, $f0
/* 60A36C 802198BC 46021102 */ mul.s $f4, $f2, $f2
/* 60A370 802198C0 00000000 */ nop
/* 60A374 802198C4 92020073 */ lbu $v0, 0x73($s0)
/* 60A378 802198C8 C600005C */ lwc1 $f0, 0x5c($s0)
/* 60A37C 802198CC 44821000 */ mtc1 $v0, $f2
/* 60A380 802198D0 00000000 */ nop
/* 60A384 802198D4 468010A0 */ cvt.s.w $f2, $f2
/* 60A388 802198D8 46020000 */ add.s $f0, $f0, $f2
/* 60A38C 802198DC 461A0001 */ sub.s $f0, $f0, $f26
/* 60A390 802198E0 46043300 */ add.s $f12, $f6, $f4
/* 60A394 802198E4 C622009C */ lwc1 $f2, 0x9c($s1)
/* 60A398 802198E8 46020501 */ sub.s $f20, $f0, $f2
/* 60A39C 802198EC 46006004 */ sqrt.s $f0, $f12
/* 60A3A0 802198F0 46000032 */ c.eq.s $f0, $f0
/* 60A3A4 802198F4 00000000 */ nop
/* 60A3A8 802198F8 45010003 */ bc1t .L80219908
/* 60A3AC 802198FC 00000000 */ nop
/* 60A3B0 80219900 0C0187BC */ jal sqrtf
/* 60A3B4 80219904 00000000 */ nop
.L80219908:
/* 60A3B8 80219908 4614C03C */ c.lt.s $f24, $f20
/* 60A3BC 8021990C 00000000 */ nop
/* 60A3C0 80219910 45000013 */ bc1f .L80219960
/* 60A3C4 80219914 46000106 */ mov.s $f4, $f0
/* 60A3C8 80219918 92020073 */ lbu $v0, 0x73($s0)
/* 60A3CC 8021991C 44820000 */ mtc1 $v0, $f0
/* 60A3D0 80219920 00000000 */ nop
/* 60A3D4 80219924 46800020 */ cvt.s.w $f0, $f0
/* 60A3D8 80219928 4600A03C */ c.lt.s $f20, $f0
/* 60A3DC 8021992C 00000000 */ nop
/* 60A3E0 80219930 4500000B */ bc1f .L80219960
/* 60A3E4 80219934 00000000 */ nop
/* 60A3E8 80219938 92020072 */ lbu $v0, 0x72($s0)
/* 60A3EC 8021993C 44820000 */ mtc1 $v0, $f0
/* 60A3F0 80219940 00000000 */ nop
/* 60A3F4 80219944 46800020 */ cvt.s.w $f0, $f0
/* 60A3F8 80219948 46160002 */ mul.s $f0, $f0, $f22
/* 60A3FC 8021994C 00000000 */ nop
/* 60A400 80219950 4600203C */ c.lt.s $f4, $f0
/* 60A404 80219954 00000000 */ nop
/* 60A408 80219958 4501FF86 */ bc1t .L80219774
/* 60A40C 8021995C 24020001 */ addiu $v0, $zero, 1
.L80219960:
/* 60A410 80219960 8E10000C */ lw $s0, 0xc($s0)
/* 60A414 80219964 1600FFC7 */ bnez $s0, .L80219884
/* 60A418 80219968 00000000 */ nop
/* 60A41C 8021996C 26730001 */ addiu $s3, $s3, 1
.L80219970:
/* 60A420 80219970 2A620018 */ slti $v0, $s3, 0x18
/* 60A424 80219974 1440FF88 */ bnez $v0, .L80219798
/* 60A428 80219978 26520004 */ addiu $s2, $s2, 4
.L8021997C:
/* 60A42C 8021997C 24020002 */ addiu $v0, $zero, 2
/* 60A430 80219980 8FBF0028 */ lw $ra, 0x28($sp)
/* 60A434 80219984 8FB50024 */ lw $s5, 0x24($sp)
/* 60A438 80219988 8FB40020 */ lw $s4, 0x20($sp)
/* 60A43C 8021998C 8FB3001C */ lw $s3, 0x1c($sp)
/* 60A440 80219990 8FB20018 */ lw $s2, 0x18($sp)
/* 60A444 80219994 8FB10014 */ lw $s1, 0x14($sp)
/* 60A448 80219998 8FB00010 */ lw $s0, 0x10($sp)
/* 60A44C 8021999C D7BA0048 */ ldc1 $f26, 0x48($sp)
/* 60A450 802199A0 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 60A454 802199A4 D7B60038 */ ldc1 $f22, 0x38($sp)
/* 60A458 802199A8 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 60A45C 802199AC 03E00008 */ jr $ra
/* 60A460 802199B0 27BD0050 */ addiu $sp, $sp, 0x50
/* 60A464 802199B4 00000000 */ nop
/* 60A468 802199B8 00000000 */ nop
/* 60A46C 802199BC 00000000 */ nop