papermario/asm/nonmatchings/battle/area_nok/48D700/func_80218560_48D700.s
2020-12-28 14:34:30 +09:00

112 lines
5.4 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218560_48D700
/* 48D700 80218560 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 48D704 80218564 F7B60020 */ sdc1 $f22, 0x20($sp)
/* 48D708 80218568 46006586 */ mov.s $f22, $f12
/* 48D70C 8021856C F7B40018 */ sdc1 $f20, 0x18($sp)
/* 48D710 80218570 AFBF0010 */ sw $ra, 0x10($sp)
/* 48D714 80218574 0C00A3FC */ jal length2D
/* 48D718 80218578 46007506 */ mov.s $f20, $f14
/* 48D71C 8021857C 4600A18D */ trunc.w.s $f6, $f20
/* 48D720 80218580 44023000 */ mfc1 $v0, $f6
/* 48D724 80218584 00000000 */ nop
/* 48D728 80218588 04420001 */ bltzl $v0, .L80218590
/* 48D72C 8021858C 00021023 */ negu $v0, $v0
.L80218590:
/* 48D730 80218590 44821000 */ mtc1 $v0, $f2
/* 48D734 80218594 00000000 */ nop
/* 48D738 80218598 468010A0 */ cvt.s.w $f2, $f2
/* 48D73C 8021859C 46001103 */ div.s $f4, $f2, $f0
/* 48D740 802185A0 0000202D */ daddu $a0, $zero, $zero
/* 48D744 802185A4 2406005A */ addiu $a2, $zero, 0x5a
/* 48D748 802185A8 0080282D */ daddu $a1, $a0, $zero
/* 48D74C 802185AC 3C078022 */ lui $a3, %hi(D_8021F050)
/* 48D750 802185B0 24E7F050 */ addiu $a3, $a3, %lo(D_8021F050)
/* 48D754 802185B4 30C2FFFF */ andi $v0, $a2, 0xffff
.L802185B8:
/* 48D758 802185B8 3083FFFF */ andi $v1, $a0, 0xffff
/* 48D75C 802185BC 00431023 */ subu $v0, $v0, $v1
/* 48D760 802185C0 00021FC2 */ srl $v1, $v0, 0x1f
/* 48D764 802185C4 00431021 */ addu $v0, $v0, $v1
/* 48D768 802185C8 00021043 */ sra $v0, $v0, 1
/* 48D76C 802185CC 00821821 */ addu $v1, $a0, $v0
/* 48D770 802185D0 3062FFFF */ andi $v0, $v1, 0xffff
/* 48D774 802185D4 00021080 */ sll $v0, $v0, 2
/* 48D778 802185D8 00471021 */ addu $v0, $v0, $a3
/* 48D77C 802185DC C4400000 */ lwc1 $f0, ($v0)
/* 48D780 802185E0 4604003C */ c.lt.s $f0, $f4
/* 48D784 802185E4 00000000 */ nop
/* 48D788 802185E8 45020002 */ bc1fl .L802185F4
/* 48D78C 802185EC 0060302D */ daddu $a2, $v1, $zero
/* 48D790 802185F0 0060202D */ daddu $a0, $v1, $zero
.L802185F4:
/* 48D794 802185F4 24A50001 */ addiu $a1, $a1, 1
/* 48D798 802185F8 30A2FFFF */ andi $v0, $a1, 0xffff
/* 48D79C 802185FC 2C420007 */ sltiu $v0, $v0, 7
/* 48D7A0 80218600 1440FFED */ bnez $v0, .L802185B8
/* 48D7A4 80218604 30C2FFFF */ andi $v0, $a2, 0xffff
/* 48D7A8 80218608 3082FFFF */ andi $v0, $a0, 0xffff
/* 48D7AC 8021860C 00021080 */ sll $v0, $v0, 2
/* 48D7B0 80218610 30C3FFFF */ andi $v1, $a2, 0xffff
/* 48D7B4 80218614 3C018022 */ lui $at, %hi(D_8021F050)
/* 48D7B8 80218618 00220821 */ addu $at, $at, $v0
/* 48D7BC 8021861C C422F050 */ lwc1 $f2, %lo(D_8021F050)($at)
/* 48D7C0 80218620 00031880 */ sll $v1, $v1, 2
/* 48D7C4 80218624 46041081 */ sub.s $f2, $f2, $f4
/* 48D7C8 80218628 3C018022 */ lui $at, %hi(D_8021F050)
/* 48D7CC 8021862C 00230821 */ addu $at, $at, $v1
/* 48D7D0 80218630 C420F050 */ lwc1 $f0, %lo(D_8021F050)($at)
/* 48D7D4 80218634 46040001 */ sub.s $f0, $f0, $f4
/* 48D7D8 80218638 46001085 */ abs.s $f2, $f2
/* 48D7DC 8021863C 46000005 */ abs.s $f0, $f0
/* 48D7E0 80218640 4600103C */ c.lt.s $f2, $f0
/* 48D7E4 80218644 00000000 */ nop
/* 48D7E8 80218648 45000002 */ bc1f .L80218654
/* 48D7EC 8021864C 00C0182D */ daddu $v1, $a2, $zero
/* 48D7F0 80218650 0080182D */ daddu $v1, $a0, $zero
.L80218654:
/* 48D7F4 80218654 44800000 */ mtc1 $zero, $f0
/* 48D7F8 80218658 00000000 */ nop
/* 48D7FC 8021865C 4600B03C */ c.lt.s $f22, $f0
/* 48D800 80218660 00000000 */ nop
/* 48D804 80218664 4500000A */ bc1f .L80218690
/* 48D808 80218668 00000000 */ nop
/* 48D80C 8021866C 4614003E */ c.le.s $f0, $f20
/* 48D810 80218670 00000000 */ nop
/* 48D814 80218674 45000004 */ bc1f .L80218688
/* 48D818 80218678 240200B4 */ addiu $v0, $zero, 0xb4
/* 48D81C 8021867C 00431823 */ subu $v1, $v0, $v1
/* 48D820 80218680 44800000 */ mtc1 $zero, $f0
/* 48D824 80218684 00000000 */ nop
.L80218688:
/* 48D828 80218688 4600B03C */ c.lt.s $f22, $f0
/* 48D82C 8021868C 00000000 */ nop
.L80218690:
/* 48D830 80218690 45000005 */ bc1f .L802186A8
/* 48D834 80218694 00000000 */ nop
/* 48D838 80218698 4600A03C */ c.lt.s $f20, $f0
/* 48D83C 8021869C 00000000 */ nop
/* 48D840 802186A0 45030001 */ bc1tl .L802186A8
/* 48D844 802186A4 246300B4 */ addiu $v1, $v1, 0xb4
.L802186A8:
/* 48D848 802186A8 44800000 */ mtc1 $zero, $f0
/* 48D84C 802186AC 00000000 */ nop
/* 48D850 802186B0 4616003E */ c.le.s $f0, $f22
/* 48D854 802186B4 00000000 */ nop
/* 48D858 802186B8 45000006 */ bc1f .L802186D4
/* 48D85C 802186BC 00000000 */ nop
/* 48D860 802186C0 4600A03C */ c.lt.s $f20, $f0
/* 48D864 802186C4 00000000 */ nop
/* 48D868 802186C8 45000002 */ bc1f .L802186D4
/* 48D86C 802186CC 24020168 */ addiu $v0, $zero, 0x168
/* 48D870 802186D0 00431823 */ subu $v1, $v0, $v1
.L802186D4:
/* 48D874 802186D4 8FBF0010 */ lw $ra, 0x10($sp)
/* 48D878 802186D8 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 48D87C 802186DC D7B40018 */ ldc1 $f20, 0x18($sp)
/* 48D880 802186E0 3062FFFF */ andi $v0, $v1, 0xffff
/* 48D884 802186E4 03E00008 */ jr $ra
/* 48D888 802186E8 27BD0028 */ addiu $sp, $sp, 0x28