papermario/asm/nonmatchings/battle/area_tik3/618EA0/func_802187B0_618EA0.s

316 lines
16 KiB
ArmAsm
Raw Normal View History

2020-12-28 06:34:30 +01:00
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802187B0_618EA0
/* 618EA0 802187B0 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 618EA4 802187B4 AFB40020 */ sw $s4, 0x20($sp)
/* 618EA8 802187B8 0080A02D */ daddu $s4, $a0, $zero
/* 618EAC 802187BC AFBF0028 */ sw $ra, 0x28($sp)
/* 618EB0 802187C0 AFB50024 */ sw $s5, 0x24($sp)
/* 618EB4 802187C4 AFB3001C */ sw $s3, 0x1c($sp)
/* 618EB8 802187C8 AFB20018 */ sw $s2, 0x18($sp)
/* 618EBC 802187CC AFB10014 */ sw $s1, 0x14($sp)
/* 618EC0 802187D0 AFB00010 */ sw $s0, 0x10($sp)
/* 618EC4 802187D4 F7BA0048 */ sdc1 $f26, 0x48($sp)
/* 618EC8 802187D8 F7B80040 */ sdc1 $f24, 0x40($sp)
/* 618ECC 802187DC F7B60038 */ sdc1 $f22, 0x38($sp)
/* 618ED0 802187E0 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 618ED4 802187E4 8E82000C */ lw $v0, 0xc($s4)
/* 618ED8 802187E8 0C0B1EAF */ jal get_variable
/* 618EDC 802187EC 8C450000 */ lw $a1, ($v0)
/* 618EE0 802187F0 0C046C04 */ jal get_model_list_index_from_tree_index
/* 618EE4 802187F4 0040202D */ daddu $a0, $v0, $zero
/* 618EE8 802187F8 0C046B4C */ jal get_model_from_list_index
/* 618EEC 802187FC 0040202D */ daddu $a0, $v0, $zero
/* 618EF0 80218800 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 618EF4 80218804 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 618EF8 80218808 AE80008C */ sw $zero, 0x8c($s4)
/* 618EFC 8021880C 8E5000D8 */ lw $s0, 0xd8($s2)
/* 618F00 80218810 1200003C */ beqz $s0, .L80218904
/* 618F04 80218814 0040882D */ daddu $s1, $v0, $zero
/* 618F08 80218818 C6020144 */ lwc1 $f2, 0x144($s0)
/* 618F0C 8021881C C6200098 */ lwc1 $f0, 0x98($s1)
/* 618F10 80218820 46001081 */ sub.s $f2, $f2, $f0
/* 618F14 80218824 46021182 */ mul.s $f6, $f2, $f2
/* 618F18 80218828 00000000 */ nop
/* 618F1C 8021882C C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 618F20 80218830 C602014C */ lwc1 $f2, 0x14c($s0)
/* 618F24 80218834 46001081 */ sub.s $f2, $f2, $f0
/* 618F28 80218838 46021102 */ mul.s $f4, $f2, $f2
/* 618F2C 8021883C 00000000 */ nop
/* 618F30 80218840 92020191 */ lbu $v0, 0x191($s0)
/* 618F34 80218844 C6020148 */ lwc1 $f2, 0x148($s0)
/* 618F38 80218848 44820000 */ mtc1 $v0, $f0
/* 618F3C 8021884C 00000000 */ nop
/* 618F40 80218850 46800020 */ cvt.s.w $f0, $f0
/* 618F44 80218854 46001080 */ add.s $f2, $f2, $f0
/* 618F48 80218858 3C013FC0 */ lui $at, 0x3fc0
/* 618F4C 8021885C 44810000 */ mtc1 $at, $f0
/* 618F50 80218860 00000000 */ nop
/* 618F54 80218864 46001081 */ sub.s $f2, $f2, $f0
/* 618F58 80218868 46043300 */ add.s $f12, $f6, $f4
/* 618F5C 8021886C C620009C */ lwc1 $f0, 0x9c($s1)
/* 618F60 80218870 46001501 */ sub.s $f20, $f2, $f0
/* 618F64 80218874 46006084 */ sqrt.s $f2, $f12
/* 618F68 80218878 46021032 */ c.eq.s $f2, $f2
/* 618F6C 8021887C 00000000 */ nop
/* 618F70 80218880 45010004 */ bc1t .L80218894
/* 618F74 80218884 00000000 */ nop
/* 618F78 80218888 0C0187BC */ jal sqrtf
/* 618F7C 8021888C 00000000 */ nop
/* 618F80 80218890 46000086 */ mov.s $f2, $f0
.L80218894:
/* 618F84 80218894 44800000 */ mtc1 $zero, $f0
/* 618F88 80218898 00000000 */ nop
/* 618F8C 8021889C 4614003C */ c.lt.s $f0, $f20
/* 618F90 802188A0 00000000 */ nop
/* 618F94 802188A4 45000017 */ bc1f .L80218904
/* 618F98 802188A8 46001106 */ mov.s $f4, $f2
/* 618F9C 802188AC 92020191 */ lbu $v0, 0x191($s0)
/* 618FA0 802188B0 44820000 */ mtc1 $v0, $f0
/* 618FA4 802188B4 00000000 */ nop
/* 618FA8 802188B8 46800020 */ cvt.s.w $f0, $f0
/* 618FAC 802188BC 4600A03C */ c.lt.s $f20, $f0
/* 618FB0 802188C0 00000000 */ nop
/* 618FB4 802188C4 4500000F */ bc1f .L80218904
/* 618FB8 802188C8 00000000 */ nop
/* 618FBC 802188CC 92020190 */ lbu $v0, 0x190($s0)
/* 618FC0 802188D0 3C013F00 */ lui $at, 0x3f00
/* 618FC4 802188D4 44811000 */ mtc1 $at, $f2
/* 618FC8 802188D8 44820000 */ mtc1 $v0, $f0
/* 618FCC 802188DC 00000000 */ nop
/* 618FD0 802188E0 46800020 */ cvt.s.w $f0, $f0
/* 618FD4 802188E4 46020002 */ mul.s $f0, $f0, $f2
/* 618FD8 802188E8 00000000 */ nop
/* 618FDC 802188EC 4600203C */ c.lt.s $f4, $f0
/* 618FE0 802188F0 00000000 */ nop
/* 618FE4 802188F4 45000003 */ bc1f .L80218904
/* 618FE8 802188F8 24020001 */ addiu $v0, $zero, 1
/* 618FEC 802188FC 08086303 */ j .L80218C0C
/* 618FF0 80218900 AE82008C */ sw $v0, 0x8c($s4)
.L80218904:
/* 618FF4 80218904 8E5000DC */ lw $s0, 0xdc($s2)
/* 618FF8 80218908 12000041 */ beqz $s0, .L80218A10
/* 618FFC 8021890C 0000982D */ daddu $s3, $zero, $zero
/* 619000 80218910 C6020144 */ lwc1 $f2, 0x144($s0)
/* 619004 80218914 C6200098 */ lwc1 $f0, 0x98($s1)
/* 619008 80218918 46001081 */ sub.s $f2, $f2, $f0
/* 61900C 8021891C 46021182 */ mul.s $f6, $f2, $f2
/* 619010 80218920 00000000 */ nop
/* 619014 80218924 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 619018 80218928 C602014C */ lwc1 $f2, 0x14c($s0)
/* 61901C 8021892C 46001081 */ sub.s $f2, $f2, $f0
/* 619020 80218930 46021102 */ mul.s $f4, $f2, $f2
/* 619024 80218934 00000000 */ nop
/* 619028 80218938 92020191 */ lbu $v0, 0x191($s0)
/* 61902C 8021893C C6020148 */ lwc1 $f2, 0x148($s0)
/* 619030 80218940 44820000 */ mtc1 $v0, $f0
/* 619034 80218944 00000000 */ nop
/* 619038 80218948 46800020 */ cvt.s.w $f0, $f0
/* 61903C 8021894C 46001080 */ add.s $f2, $f2, $f0
/* 619040 80218950 3C013FC0 */ lui $at, 0x3fc0
/* 619044 80218954 44810000 */ mtc1 $at, $f0
/* 619048 80218958 00000000 */ nop
/* 61904C 8021895C 46001081 */ sub.s $f2, $f2, $f0
/* 619050 80218960 46043300 */ add.s $f12, $f6, $f4
/* 619054 80218964 C620009C */ lwc1 $f0, 0x9c($s1)
/* 619058 80218968 46001501 */ sub.s $f20, $f2, $f0
/* 61905C 8021896C 46006084 */ sqrt.s $f2, $f12
/* 619060 80218970 46021032 */ c.eq.s $f2, $f2
/* 619064 80218974 00000000 */ nop
/* 619068 80218978 45010004 */ bc1t .L8021898C
/* 61906C 8021897C 00000000 */ nop
/* 619070 80218980 0C0187BC */ jal sqrtf
/* 619074 80218984 00000000 */ nop
/* 619078 80218988 46000086 */ mov.s $f2, $f0
.L8021898C:
/* 61907C 8021898C 44800000 */ mtc1 $zero, $f0
/* 619080 80218990 00000000 */ nop
/* 619084 80218994 4614003C */ c.lt.s $f0, $f20
/* 619088 80218998 00000000 */ nop
/* 61908C 8021899C 4500001B */ bc1f .L80218A0C
/* 619090 802189A0 46001106 */ mov.s $f4, $f2
/* 619094 802189A4 92020191 */ lbu $v0, 0x191($s0)
/* 619098 802189A8 44820000 */ mtc1 $v0, $f0
/* 61909C 802189AC 00000000 */ nop
/* 6190A0 802189B0 46800020 */ cvt.s.w $f0, $f0
/* 6190A4 802189B4 4600A03C */ c.lt.s $f20, $f0
/* 6190A8 802189B8 00000000 */ nop
/* 6190AC 802189BC 45000014 */ bc1f .L80218A10
/* 6190B0 802189C0 0000982D */ daddu $s3, $zero, $zero
/* 6190B4 802189C4 92020190 */ lbu $v0, 0x190($s0)
/* 6190B8 802189C8 3C013F00 */ lui $at, 0x3f00
/* 6190BC 802189CC 44811000 */ mtc1 $at, $f2
/* 6190C0 802189D0 44820000 */ mtc1 $v0, $f0
/* 6190C4 802189D4 00000000 */ nop
/* 6190C8 802189D8 46800020 */ cvt.s.w $f0, $f0
/* 6190CC 802189DC 46020002 */ mul.s $f0, $f0, $f2
/* 6190D0 802189E0 00000000 */ nop
/* 6190D4 802189E4 4600203C */ c.lt.s $f4, $f0
/* 6190D8 802189E8 00000000 */ nop
/* 6190DC 802189EC 45000008 */ bc1f .L80218A10
/* 6190E0 802189F0 24020001 */ addiu $v0, $zero, 1
/* 6190E4 802189F4 08086303 */ j .L80218C0C
/* 6190E8 802189F8 AE82008C */ sw $v0, 0x8c($s4)
.L802189FC:
/* 6190EC 802189FC 08086303 */ j .L80218C0C
/* 6190F0 80218A00 AE82008C */ sw $v0, 0x8c($s4)
.L80218A04:
/* 6190F4 80218A04 08086303 */ j .L80218C0C
/* 6190F8 80218A08 AE82008C */ sw $v0, 0x8c($s4)
.L80218A0C:
/* 6190FC 80218A0C 0000982D */ daddu $s3, $zero, $zero
.L80218A10:
/* 619100 80218A10 3C150010 */ lui $s5, 0x10
/* 619104 80218A14 3C013FC0 */ lui $at, 0x3fc0
/* 619108 80218A18 4481D000 */ mtc1 $at, $f26
/* 61910C 80218A1C 4480C000 */ mtc1 $zero, $f24
/* 619110 80218A20 3C013F00 */ lui $at, 0x3f00
/* 619114 80218A24 4481B000 */ mtc1 $at, $f22
.L80218A28:
/* 619118 80218A28 8E5000E0 */ lw $s0, 0xe0($s2)
/* 61911C 80218A2C 52000074 */ beql $s0, $zero, .L80218C00
/* 619120 80218A30 26730001 */ addiu $s3, $s3, 1
/* 619124 80218A34 8E020000 */ lw $v0, ($s0)
/* 619128 80218A38 30420001 */ andi $v0, $v0, 1
/* 61912C 80218A3C 54400070 */ bnel $v0, $zero, .L80218C00
/* 619130 80218A40 26730001 */ addiu $s3, $s3, 1
/* 619134 80218A44 C6020144 */ lwc1 $f2, 0x144($s0)
/* 619138 80218A48 C6200098 */ lwc1 $f0, 0x98($s1)
/* 61913C 80218A4C 46001081 */ sub.s $f2, $f2, $f0
/* 619140 80218A50 46021182 */ mul.s $f6, $f2, $f2
/* 619144 80218A54 00000000 */ nop
/* 619148 80218A58 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 61914C 80218A5C C602014C */ lwc1 $f2, 0x14c($s0)
/* 619150 80218A60 46001081 */ sub.s $f2, $f2, $f0
/* 619154 80218A64 46021102 */ mul.s $f4, $f2, $f2
/* 619158 80218A68 00000000 */ nop
/* 61915C 80218A6C 92020191 */ lbu $v0, 0x191($s0)
/* 619160 80218A70 C6020148 */ lwc1 $f2, 0x148($s0)
/* 619164 80218A74 44820000 */ mtc1 $v0, $f0
/* 619168 80218A78 00000000 */ nop
/* 61916C 80218A7C 46800020 */ cvt.s.w $f0, $f0
/* 619170 80218A80 46001080 */ add.s $f2, $f2, $f0
/* 619174 80218A84 461A1081 */ sub.s $f2, $f2, $f26
/* 619178 80218A88 46043300 */ add.s $f12, $f6, $f4
/* 61917C 80218A8C C620009C */ lwc1 $f0, 0x9c($s1)
/* 619180 80218A90 46001501 */ sub.s $f20, $f2, $f0
/* 619184 80218A94 46006004 */ sqrt.s $f0, $f12
/* 619188 80218A98 46000032 */ c.eq.s $f0, $f0
/* 61918C 80218A9C 00000000 */ nop
/* 619190 80218AA0 45010003 */ bc1t .L80218AB0
/* 619194 80218AA4 00000000 */ nop
/* 619198 80218AA8 0C0187BC */ jal sqrtf
/* 61919C 80218AAC 00000000 */ nop
.L80218AB0:
/* 6191A0 80218AB0 4614C03C */ c.lt.s $f24, $f20
/* 6191A4 80218AB4 00000000 */ nop
/* 6191A8 80218AB8 45000013 */ bc1f .L80218B08
/* 6191AC 80218ABC 46000106 */ mov.s $f4, $f0
/* 6191B0 80218AC0 92020191 */ lbu $v0, 0x191($s0)
/* 6191B4 80218AC4 44820000 */ mtc1 $v0, $f0
/* 6191B8 80218AC8 00000000 */ nop
/* 6191BC 80218ACC 46800020 */ cvt.s.w $f0, $f0
/* 6191C0 80218AD0 4600A03C */ c.lt.s $f20, $f0
/* 6191C4 80218AD4 00000000 */ nop
/* 6191C8 80218AD8 4500000B */ bc1f .L80218B08
/* 6191CC 80218ADC 00000000 */ nop
/* 6191D0 80218AE0 92020190 */ lbu $v0, 0x190($s0)
/* 6191D4 80218AE4 44820000 */ mtc1 $v0, $f0
/* 6191D8 80218AE8 00000000 */ nop
/* 6191DC 80218AEC 46800020 */ cvt.s.w $f0, $f0
/* 6191E0 80218AF0 46160002 */ mul.s $f0, $f0, $f22
/* 6191E4 80218AF4 00000000 */ nop
/* 6191E8 80218AF8 4600203C */ c.lt.s $f4, $f0
/* 6191EC 80218AFC 00000000 */ nop
/* 6191F0 80218B00 4501FFBE */ bc1t .L802189FC
/* 6191F4 80218B04 24020001 */ addiu $v0, $zero, 1
.L80218B08:
/* 6191F8 80218B08 8E1001F4 */ lw $s0, 0x1f4($s0)
/* 6191FC 80218B0C 5200003C */ beql $s0, $zero, .L80218C00
/* 619200 80218B10 26730001 */ addiu $s3, $s3, 1
.L80218B14:
/* 619204 80218B14 8E030000 */ lw $v1, ($s0)
/* 619208 80218B18 30620001 */ andi $v0, $v1, 1
/* 61920C 80218B1C 14400034 */ bnez $v0, .L80218BF0
/* 619210 80218B20 00751024 */ and $v0, $v1, $s5
/* 619214 80218B24 10400032 */ beqz $v0, .L80218BF0
/* 619218 80218B28 00000000 */ nop
/* 61921C 80218B2C C6020058 */ lwc1 $f2, 0x58($s0)
/* 619220 80218B30 C6200098 */ lwc1 $f0, 0x98($s1)
/* 619224 80218B34 46001081 */ sub.s $f2, $f2, $f0
/* 619228 80218B38 46021182 */ mul.s $f6, $f2, $f2
/* 61922C 80218B3C 00000000 */ nop
/* 619230 80218B40 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 619234 80218B44 C6020060 */ lwc1 $f2, 0x60($s0)
/* 619238 80218B48 46001081 */ sub.s $f2, $f2, $f0
/* 61923C 80218B4C 46021102 */ mul.s $f4, $f2, $f2
/* 619240 80218B50 00000000 */ nop
/* 619244 80218B54 92020073 */ lbu $v0, 0x73($s0)
/* 619248 80218B58 C600005C */ lwc1 $f0, 0x5c($s0)
/* 61924C 80218B5C 44821000 */ mtc1 $v0, $f2
/* 619250 80218B60 00000000 */ nop
/* 619254 80218B64 468010A0 */ cvt.s.w $f2, $f2
/* 619258 80218B68 46020000 */ add.s $f0, $f0, $f2
/* 61925C 80218B6C 461A0001 */ sub.s $f0, $f0, $f26
/* 619260 80218B70 46043300 */ add.s $f12, $f6, $f4
/* 619264 80218B74 C622009C */ lwc1 $f2, 0x9c($s1)
/* 619268 80218B78 46020501 */ sub.s $f20, $f0, $f2
/* 61926C 80218B7C 46006004 */ sqrt.s $f0, $f12
/* 619270 80218B80 46000032 */ c.eq.s $f0, $f0
/* 619274 80218B84 00000000 */ nop
/* 619278 80218B88 45010003 */ bc1t .L80218B98
/* 61927C 80218B8C 00000000 */ nop
/* 619280 80218B90 0C0187BC */ jal sqrtf
/* 619284 80218B94 00000000 */ nop
.L80218B98:
/* 619288 80218B98 4614C03C */ c.lt.s $f24, $f20
/* 61928C 80218B9C 00000000 */ nop
/* 619290 80218BA0 45000013 */ bc1f .L80218BF0
/* 619294 80218BA4 46000106 */ mov.s $f4, $f0
/* 619298 80218BA8 92020073 */ lbu $v0, 0x73($s0)
/* 61929C 80218BAC 44820000 */ mtc1 $v0, $f0
/* 6192A0 80218BB0 00000000 */ nop
/* 6192A4 80218BB4 46800020 */ cvt.s.w $f0, $f0
/* 6192A8 80218BB8 4600A03C */ c.lt.s $f20, $f0
/* 6192AC 80218BBC 00000000 */ nop
/* 6192B0 80218BC0 4500000B */ bc1f .L80218BF0
/* 6192B4 80218BC4 00000000 */ nop
/* 6192B8 80218BC8 92020072 */ lbu $v0, 0x72($s0)
/* 6192BC 80218BCC 44820000 */ mtc1 $v0, $f0
/* 6192C0 80218BD0 00000000 */ nop
/* 6192C4 80218BD4 46800020 */ cvt.s.w $f0, $f0
/* 6192C8 80218BD8 46160002 */ mul.s $f0, $f0, $f22
/* 6192CC 80218BDC 00000000 */ nop
/* 6192D0 80218BE0 4600203C */ c.lt.s $f4, $f0
/* 6192D4 80218BE4 00000000 */ nop
/* 6192D8 80218BE8 4501FF86 */ bc1t .L80218A04
/* 6192DC 80218BEC 24020001 */ addiu $v0, $zero, 1
.L80218BF0:
/* 6192E0 80218BF0 8E10000C */ lw $s0, 0xc($s0)
/* 6192E4 80218BF4 1600FFC7 */ bnez $s0, .L80218B14
/* 6192E8 80218BF8 00000000 */ nop
/* 6192EC 80218BFC 26730001 */ addiu $s3, $s3, 1
.L80218C00:
/* 6192F0 80218C00 2A620018 */ slti $v0, $s3, 0x18
/* 6192F4 80218C04 1440FF88 */ bnez $v0, .L80218A28
/* 6192F8 80218C08 26520004 */ addiu $s2, $s2, 4
.L80218C0C:
/* 6192FC 80218C0C 24020002 */ addiu $v0, $zero, 2
/* 619300 80218C10 8FBF0028 */ lw $ra, 0x28($sp)
/* 619304 80218C14 8FB50024 */ lw $s5, 0x24($sp)
/* 619308 80218C18 8FB40020 */ lw $s4, 0x20($sp)
/* 61930C 80218C1C 8FB3001C */ lw $s3, 0x1c($sp)
/* 619310 80218C20 8FB20018 */ lw $s2, 0x18($sp)
/* 619314 80218C24 8FB10014 */ lw $s1, 0x14($sp)
/* 619318 80218C28 8FB00010 */ lw $s0, 0x10($sp)
/* 61931C 80218C2C D7BA0048 */ ldc1 $f26, 0x48($sp)
/* 619320 80218C30 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 619324 80218C34 D7B60038 */ ldc1 $f22, 0x38($sp)
/* 619328 80218C38 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 61932C 80218C3C 03E00008 */ jr $ra
/* 619330 80218C40 27BD0050 */ addiu $sp, $sp, 0x50
/* 619334 80218C44 00000000 */ nop
/* 619338 80218C48 00000000 */ nop
/* 61933C 80218C4C 00000000 */ nop