papermario/asm/nonmatchings/battle/area_tik3/618A00/func_80218310_618A00.s
2021-01-13 00:42:27 +09:00

316 lines
15 KiB
ArmAsm
Generated

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218310_618A00
/* 618A00 80218310 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 618A04 80218314 AFB40020 */ sw $s4, 0x20($sp)
/* 618A08 80218318 0080A02D */ daddu $s4, $a0, $zero
/* 618A0C 8021831C AFBF0028 */ sw $ra, 0x28($sp)
/* 618A10 80218320 AFB50024 */ sw $s5, 0x24($sp)
/* 618A14 80218324 AFB3001C */ sw $s3, 0x1c($sp)
/* 618A18 80218328 AFB20018 */ sw $s2, 0x18($sp)
/* 618A1C 8021832C AFB10014 */ sw $s1, 0x14($sp)
/* 618A20 80218330 AFB00010 */ sw $s0, 0x10($sp)
/* 618A24 80218334 F7BA0048 */ sdc1 $f26, 0x48($sp)
/* 618A28 80218338 F7B80040 */ sdc1 $f24, 0x40($sp)
/* 618A2C 8021833C F7B60038 */ sdc1 $f22, 0x38($sp)
/* 618A30 80218340 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 618A34 80218344 8E82000C */ lw $v0, 0xc($s4)
/* 618A38 80218348 0C0B1EAF */ jal get_variable
/* 618A3C 8021834C 8C450000 */ lw $a1, ($v0)
/* 618A40 80218350 0C046C04 */ jal get_model_list_index_from_tree_index
/* 618A44 80218354 0040202D */ daddu $a0, $v0, $zero
/* 618A48 80218358 0C046B4C */ jal get_model_from_list_index
/* 618A4C 8021835C 0040202D */ daddu $a0, $v0, $zero
/* 618A50 80218360 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 618A54 80218364 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 618A58 80218368 AE80008C */ sw $zero, 0x8c($s4)
/* 618A5C 8021836C 8E5000D8 */ lw $s0, 0xd8($s2)
/* 618A60 80218370 1200003C */ beqz $s0, .L80218464
/* 618A64 80218374 0040882D */ daddu $s1, $v0, $zero
/* 618A68 80218378 C6020144 */ lwc1 $f2, 0x144($s0)
/* 618A6C 8021837C C6200098 */ lwc1 $f0, 0x98($s1)
/* 618A70 80218380 46001081 */ sub.s $f2, $f2, $f0
/* 618A74 80218384 46021182 */ mul.s $f6, $f2, $f2
/* 618A78 80218388 00000000 */ nop
/* 618A7C 8021838C C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 618A80 80218390 C602014C */ lwc1 $f2, 0x14c($s0)
/* 618A84 80218394 46001081 */ sub.s $f2, $f2, $f0
/* 618A88 80218398 46021102 */ mul.s $f4, $f2, $f2
/* 618A8C 8021839C 00000000 */ nop
/* 618A90 802183A0 92020191 */ lbu $v0, 0x191($s0)
/* 618A94 802183A4 C6020148 */ lwc1 $f2, 0x148($s0)
/* 618A98 802183A8 44820000 */ mtc1 $v0, $f0
/* 618A9C 802183AC 00000000 */ nop
/* 618AA0 802183B0 46800020 */ cvt.s.w $f0, $f0
/* 618AA4 802183B4 46001080 */ add.s $f2, $f2, $f0
/* 618AA8 802183B8 3C013FC0 */ lui $at, 0x3fc0
/* 618AAC 802183BC 44810000 */ mtc1 $at, $f0
/* 618AB0 802183C0 00000000 */ nop
/* 618AB4 802183C4 46001081 */ sub.s $f2, $f2, $f0
/* 618AB8 802183C8 46043300 */ add.s $f12, $f6, $f4
/* 618ABC 802183CC C620009C */ lwc1 $f0, 0x9c($s1)
/* 618AC0 802183D0 46001501 */ sub.s $f20, $f2, $f0
/* 618AC4 802183D4 46006084 */ sqrt.s $f2, $f12
/* 618AC8 802183D8 46021032 */ c.eq.s $f2, $f2
/* 618ACC 802183DC 00000000 */ nop
/* 618AD0 802183E0 45010004 */ bc1t .L802183F4
/* 618AD4 802183E4 00000000 */ nop
/* 618AD8 802183E8 0C0187BC */ jal sqrtf
/* 618ADC 802183EC 00000000 */ nop
/* 618AE0 802183F0 46000086 */ mov.s $f2, $f0
.L802183F4:
/* 618AE4 802183F4 44800000 */ mtc1 $zero, $f0
/* 618AE8 802183F8 00000000 */ nop
/* 618AEC 802183FC 4614003C */ c.lt.s $f0, $f20
/* 618AF0 80218400 00000000 */ nop
/* 618AF4 80218404 45000017 */ bc1f .L80218464
/* 618AF8 80218408 46001106 */ mov.s $f4, $f2
/* 618AFC 8021840C 92020191 */ lbu $v0, 0x191($s0)
/* 618B00 80218410 44820000 */ mtc1 $v0, $f0
/* 618B04 80218414 00000000 */ nop
/* 618B08 80218418 46800020 */ cvt.s.w $f0, $f0
/* 618B0C 8021841C 4600A03C */ c.lt.s $f20, $f0
/* 618B10 80218420 00000000 */ nop
/* 618B14 80218424 4500000F */ bc1f .L80218464
/* 618B18 80218428 00000000 */ nop
/* 618B1C 8021842C 92020190 */ lbu $v0, 0x190($s0)
/* 618B20 80218430 3C013F00 */ lui $at, 0x3f00
/* 618B24 80218434 44811000 */ mtc1 $at, $f2
/* 618B28 80218438 44820000 */ mtc1 $v0, $f0
/* 618B2C 8021843C 00000000 */ nop
/* 618B30 80218440 46800020 */ cvt.s.w $f0, $f0
/* 618B34 80218444 46020002 */ mul.s $f0, $f0, $f2
/* 618B38 80218448 00000000 */ nop
/* 618B3C 8021844C 4600203C */ c.lt.s $f4, $f0
/* 618B40 80218450 00000000 */ nop
/* 618B44 80218454 45000003 */ bc1f .L80218464
/* 618B48 80218458 24020001 */ addiu $v0, $zero, 1
/* 618B4C 8021845C 080861DB */ j .L8021876C
/* 618B50 80218460 AE82008C */ sw $v0, 0x8c($s4)
.L80218464:
/* 618B54 80218464 8E5000DC */ lw $s0, 0xdc($s2)
/* 618B58 80218468 12000041 */ beqz $s0, .L80218570
/* 618B5C 8021846C 0000982D */ daddu $s3, $zero, $zero
/* 618B60 80218470 C6020144 */ lwc1 $f2, 0x144($s0)
/* 618B64 80218474 C6200098 */ lwc1 $f0, 0x98($s1)
/* 618B68 80218478 46001081 */ sub.s $f2, $f2, $f0
/* 618B6C 8021847C 46021182 */ mul.s $f6, $f2, $f2
/* 618B70 80218480 00000000 */ nop
/* 618B74 80218484 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 618B78 80218488 C602014C */ lwc1 $f2, 0x14c($s0)
/* 618B7C 8021848C 46001081 */ sub.s $f2, $f2, $f0
/* 618B80 80218490 46021102 */ mul.s $f4, $f2, $f2
/* 618B84 80218494 00000000 */ nop
/* 618B88 80218498 92020191 */ lbu $v0, 0x191($s0)
/* 618B8C 8021849C C6020148 */ lwc1 $f2, 0x148($s0)
/* 618B90 802184A0 44820000 */ mtc1 $v0, $f0
/* 618B94 802184A4 00000000 */ nop
/* 618B98 802184A8 46800020 */ cvt.s.w $f0, $f0
/* 618B9C 802184AC 46001080 */ add.s $f2, $f2, $f0
/* 618BA0 802184B0 3C013FC0 */ lui $at, 0x3fc0
/* 618BA4 802184B4 44810000 */ mtc1 $at, $f0
/* 618BA8 802184B8 00000000 */ nop
/* 618BAC 802184BC 46001081 */ sub.s $f2, $f2, $f0
/* 618BB0 802184C0 46043300 */ add.s $f12, $f6, $f4
/* 618BB4 802184C4 C620009C */ lwc1 $f0, 0x9c($s1)
/* 618BB8 802184C8 46001501 */ sub.s $f20, $f2, $f0
/* 618BBC 802184CC 46006084 */ sqrt.s $f2, $f12
/* 618BC0 802184D0 46021032 */ c.eq.s $f2, $f2
/* 618BC4 802184D4 00000000 */ nop
/* 618BC8 802184D8 45010004 */ bc1t .L802184EC
/* 618BCC 802184DC 00000000 */ nop
/* 618BD0 802184E0 0C0187BC */ jal sqrtf
/* 618BD4 802184E4 00000000 */ nop
/* 618BD8 802184E8 46000086 */ mov.s $f2, $f0
.L802184EC:
/* 618BDC 802184EC 44800000 */ mtc1 $zero, $f0
/* 618BE0 802184F0 00000000 */ nop
/* 618BE4 802184F4 4614003C */ c.lt.s $f0, $f20
/* 618BE8 802184F8 00000000 */ nop
/* 618BEC 802184FC 4500001B */ bc1f .L8021856C
/* 618BF0 80218500 46001106 */ mov.s $f4, $f2
/* 618BF4 80218504 92020191 */ lbu $v0, 0x191($s0)
/* 618BF8 80218508 44820000 */ mtc1 $v0, $f0
/* 618BFC 8021850C 00000000 */ nop
/* 618C00 80218510 46800020 */ cvt.s.w $f0, $f0
/* 618C04 80218514 4600A03C */ c.lt.s $f20, $f0
/* 618C08 80218518 00000000 */ nop
/* 618C0C 8021851C 45000014 */ bc1f .L80218570
/* 618C10 80218520 0000982D */ daddu $s3, $zero, $zero
/* 618C14 80218524 92020190 */ lbu $v0, 0x190($s0)
/* 618C18 80218528 3C013F00 */ lui $at, 0x3f00
/* 618C1C 8021852C 44811000 */ mtc1 $at, $f2
/* 618C20 80218530 44820000 */ mtc1 $v0, $f0
/* 618C24 80218534 00000000 */ nop
/* 618C28 80218538 46800020 */ cvt.s.w $f0, $f0
/* 618C2C 8021853C 46020002 */ mul.s $f0, $f0, $f2
/* 618C30 80218540 00000000 */ nop
/* 618C34 80218544 4600203C */ c.lt.s $f4, $f0
/* 618C38 80218548 00000000 */ nop
/* 618C3C 8021854C 45000008 */ bc1f .L80218570
/* 618C40 80218550 24020001 */ addiu $v0, $zero, 1
/* 618C44 80218554 080861DB */ j .L8021876C
/* 618C48 80218558 AE82008C */ sw $v0, 0x8c($s4)
.L8021855C:
/* 618C4C 8021855C 080861DB */ j .L8021876C
/* 618C50 80218560 AE82008C */ sw $v0, 0x8c($s4)
.L80218564:
/* 618C54 80218564 080861DB */ j .L8021876C
/* 618C58 80218568 AE82008C */ sw $v0, 0x8c($s4)
.L8021856C:
/* 618C5C 8021856C 0000982D */ daddu $s3, $zero, $zero
.L80218570:
/* 618C60 80218570 3C150010 */ lui $s5, 0x10
/* 618C64 80218574 3C013FC0 */ lui $at, 0x3fc0
/* 618C68 80218578 4481D000 */ mtc1 $at, $f26
/* 618C6C 8021857C 4480C000 */ mtc1 $zero, $f24
/* 618C70 80218580 3C013F00 */ lui $at, 0x3f00
/* 618C74 80218584 4481B000 */ mtc1 $at, $f22
.L80218588:
/* 618C78 80218588 8E5000E0 */ lw $s0, 0xe0($s2)
/* 618C7C 8021858C 52000074 */ beql $s0, $zero, .L80218760
/* 618C80 80218590 26730001 */ addiu $s3, $s3, 1
/* 618C84 80218594 8E020000 */ lw $v0, ($s0)
/* 618C88 80218598 30420001 */ andi $v0, $v0, 1
/* 618C8C 8021859C 54400070 */ bnel $v0, $zero, .L80218760
/* 618C90 802185A0 26730001 */ addiu $s3, $s3, 1
/* 618C94 802185A4 C6020144 */ lwc1 $f2, 0x144($s0)
/* 618C98 802185A8 C6200098 */ lwc1 $f0, 0x98($s1)
/* 618C9C 802185AC 46001081 */ sub.s $f2, $f2, $f0
/* 618CA0 802185B0 46021182 */ mul.s $f6, $f2, $f2
/* 618CA4 802185B4 00000000 */ nop
/* 618CA8 802185B8 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 618CAC 802185BC C602014C */ lwc1 $f2, 0x14c($s0)
/* 618CB0 802185C0 46001081 */ sub.s $f2, $f2, $f0
/* 618CB4 802185C4 46021102 */ mul.s $f4, $f2, $f2
/* 618CB8 802185C8 00000000 */ nop
/* 618CBC 802185CC 92020191 */ lbu $v0, 0x191($s0)
/* 618CC0 802185D0 C6020148 */ lwc1 $f2, 0x148($s0)
/* 618CC4 802185D4 44820000 */ mtc1 $v0, $f0
/* 618CC8 802185D8 00000000 */ nop
/* 618CCC 802185DC 46800020 */ cvt.s.w $f0, $f0
/* 618CD0 802185E0 46001080 */ add.s $f2, $f2, $f0
/* 618CD4 802185E4 461A1081 */ sub.s $f2, $f2, $f26
/* 618CD8 802185E8 46043300 */ add.s $f12, $f6, $f4
/* 618CDC 802185EC C620009C */ lwc1 $f0, 0x9c($s1)
/* 618CE0 802185F0 46001501 */ sub.s $f20, $f2, $f0
/* 618CE4 802185F4 46006004 */ sqrt.s $f0, $f12
/* 618CE8 802185F8 46000032 */ c.eq.s $f0, $f0
/* 618CEC 802185FC 00000000 */ nop
/* 618CF0 80218600 45010003 */ bc1t .L80218610
/* 618CF4 80218604 00000000 */ nop
/* 618CF8 80218608 0C0187BC */ jal sqrtf
/* 618CFC 8021860C 00000000 */ nop
.L80218610:
/* 618D00 80218610 4614C03C */ c.lt.s $f24, $f20
/* 618D04 80218614 00000000 */ nop
/* 618D08 80218618 45000013 */ bc1f .L80218668
/* 618D0C 8021861C 46000106 */ mov.s $f4, $f0
/* 618D10 80218620 92020191 */ lbu $v0, 0x191($s0)
/* 618D14 80218624 44820000 */ mtc1 $v0, $f0
/* 618D18 80218628 00000000 */ nop
/* 618D1C 8021862C 46800020 */ cvt.s.w $f0, $f0
/* 618D20 80218630 4600A03C */ c.lt.s $f20, $f0
/* 618D24 80218634 00000000 */ nop
/* 618D28 80218638 4500000B */ bc1f .L80218668
/* 618D2C 8021863C 00000000 */ nop
/* 618D30 80218640 92020190 */ lbu $v0, 0x190($s0)
/* 618D34 80218644 44820000 */ mtc1 $v0, $f0
/* 618D38 80218648 00000000 */ nop
/* 618D3C 8021864C 46800020 */ cvt.s.w $f0, $f0
/* 618D40 80218650 46160002 */ mul.s $f0, $f0, $f22
/* 618D44 80218654 00000000 */ nop
/* 618D48 80218658 4600203C */ c.lt.s $f4, $f0
/* 618D4C 8021865C 00000000 */ nop
/* 618D50 80218660 4501FFBE */ bc1t .L8021855C
/* 618D54 80218664 24020001 */ addiu $v0, $zero, 1
.L80218668:
/* 618D58 80218668 8E1001F4 */ lw $s0, 0x1f4($s0)
/* 618D5C 8021866C 5200003C */ beql $s0, $zero, .L80218760
/* 618D60 80218670 26730001 */ addiu $s3, $s3, 1
.L80218674:
/* 618D64 80218674 8E030000 */ lw $v1, ($s0)
/* 618D68 80218678 30620001 */ andi $v0, $v1, 1
/* 618D6C 8021867C 14400034 */ bnez $v0, .L80218750
/* 618D70 80218680 00751024 */ and $v0, $v1, $s5
/* 618D74 80218684 10400032 */ beqz $v0, .L80218750
/* 618D78 80218688 00000000 */ nop
/* 618D7C 8021868C C6020058 */ lwc1 $f2, 0x58($s0)
/* 618D80 80218690 C6200098 */ lwc1 $f0, 0x98($s1)
/* 618D84 80218694 46001081 */ sub.s $f2, $f2, $f0
/* 618D88 80218698 46021182 */ mul.s $f6, $f2, $f2
/* 618D8C 8021869C 00000000 */ nop
/* 618D90 802186A0 C62000A0 */ lwc1 $f0, 0xa0($s1)
/* 618D94 802186A4 C6020060 */ lwc1 $f2, 0x60($s0)
/* 618D98 802186A8 46001081 */ sub.s $f2, $f2, $f0
/* 618D9C 802186AC 46021102 */ mul.s $f4, $f2, $f2
/* 618DA0 802186B0 00000000 */ nop
/* 618DA4 802186B4 92020073 */ lbu $v0, 0x73($s0)
/* 618DA8 802186B8 C600005C */ lwc1 $f0, 0x5c($s0)
/* 618DAC 802186BC 44821000 */ mtc1 $v0, $f2
/* 618DB0 802186C0 00000000 */ nop
/* 618DB4 802186C4 468010A0 */ cvt.s.w $f2, $f2
/* 618DB8 802186C8 46020000 */ add.s $f0, $f0, $f2
/* 618DBC 802186CC 461A0001 */ sub.s $f0, $f0, $f26
/* 618DC0 802186D0 46043300 */ add.s $f12, $f6, $f4
/* 618DC4 802186D4 C622009C */ lwc1 $f2, 0x9c($s1)
/* 618DC8 802186D8 46020501 */ sub.s $f20, $f0, $f2
/* 618DCC 802186DC 46006004 */ sqrt.s $f0, $f12
/* 618DD0 802186E0 46000032 */ c.eq.s $f0, $f0
/* 618DD4 802186E4 00000000 */ nop
/* 618DD8 802186E8 45010003 */ bc1t .L802186F8
/* 618DDC 802186EC 00000000 */ nop
/* 618DE0 802186F0 0C0187BC */ jal sqrtf
/* 618DE4 802186F4 00000000 */ nop
.L802186F8:
/* 618DE8 802186F8 4614C03C */ c.lt.s $f24, $f20
/* 618DEC 802186FC 00000000 */ nop
/* 618DF0 80218700 45000013 */ bc1f .L80218750
/* 618DF4 80218704 46000106 */ mov.s $f4, $f0
/* 618DF8 80218708 92020073 */ lbu $v0, 0x73($s0)
/* 618DFC 8021870C 44820000 */ mtc1 $v0, $f0
/* 618E00 80218710 00000000 */ nop
/* 618E04 80218714 46800020 */ cvt.s.w $f0, $f0
/* 618E08 80218718 4600A03C */ c.lt.s $f20, $f0
/* 618E0C 8021871C 00000000 */ nop
/* 618E10 80218720 4500000B */ bc1f .L80218750
/* 618E14 80218724 00000000 */ nop
/* 618E18 80218728 92020072 */ lbu $v0, 0x72($s0)
/* 618E1C 8021872C 44820000 */ mtc1 $v0, $f0
/* 618E20 80218730 00000000 */ nop
/* 618E24 80218734 46800020 */ cvt.s.w $f0, $f0
/* 618E28 80218738 46160002 */ mul.s $f0, $f0, $f22
/* 618E2C 8021873C 00000000 */ nop
/* 618E30 80218740 4600203C */ c.lt.s $f4, $f0
/* 618E34 80218744 00000000 */ nop
/* 618E38 80218748 4501FF86 */ bc1t .L80218564
/* 618E3C 8021874C 24020001 */ addiu $v0, $zero, 1
.L80218750:
/* 618E40 80218750 8E10000C */ lw $s0, 0xc($s0)
/* 618E44 80218754 1600FFC7 */ bnez $s0, .L80218674
/* 618E48 80218758 00000000 */ nop
/* 618E4C 8021875C 26730001 */ addiu $s3, $s3, 1
.L80218760:
/* 618E50 80218760 2A620018 */ slti $v0, $s3, 0x18
/* 618E54 80218764 1440FF88 */ bnez $v0, .L80218588
/* 618E58 80218768 26520004 */ addiu $s2, $s2, 4
.L8021876C:
/* 618E5C 8021876C 24020002 */ addiu $v0, $zero, 2
/* 618E60 80218770 8FBF0028 */ lw $ra, 0x28($sp)
/* 618E64 80218774 8FB50024 */ lw $s5, 0x24($sp)
/* 618E68 80218778 8FB40020 */ lw $s4, 0x20($sp)
/* 618E6C 8021877C 8FB3001C */ lw $s3, 0x1c($sp)
/* 618E70 80218780 8FB20018 */ lw $s2, 0x18($sp)
/* 618E74 80218784 8FB10014 */ lw $s1, 0x14($sp)
/* 618E78 80218788 8FB00010 */ lw $s0, 0x10($sp)
/* 618E7C 8021878C D7BA0048 */ ldc1 $f26, 0x48($sp)
/* 618E80 80218790 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 618E84 80218794 D7B60038 */ ldc1 $f22, 0x38($sp)
/* 618E88 80218798 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 618E8C 8021879C 03E00008 */ jr $ra
/* 618E90 802187A0 27BD0050 */ addiu $sp, $sp, 0x50
/* 618E94 802187A4 00000000 */ nop
/* 618E98 802187A8 00000000 */ nop
/* 618E9C 802187AC 00000000 */ nop