papermario/asm/nonmatchings/code_1776B0/func_8024BDA4.s
2020-10-14 23:49:49 -04:00

258 lines
13 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8024BDA4
/* 17A684 8024BDA4 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 17A688 8024BDA8 AFB00018 */ sw $s0, 0x18($sp)
/* 17A68C 8024BDAC 3C10800B */ lui $s0, 0x800b
/* 17A690 8024BDB0 261022D8 */ addiu $s0, $s0, 0x22d8
/* 17A694 8024BDB4 AFBF001C */ sw $ra, 0x1c($sp)
/* 17A698 8024BDB8 F7BE0048 */ sdc1 $f30, 0x48($sp)
/* 17A69C 8024BDBC F7BC0040 */ sdc1 $f28, 0x40($sp)
/* 17A6A0 8024BDC0 F7BA0038 */ sdc1 $f26, 0x38($sp)
/* 17A6A4 8024BDC4 F7B80030 */ sdc1 $f24, 0x30($sp)
/* 17A6A8 8024BDC8 F7B60028 */ sdc1 $f22, 0x28($sp)
/* 17A6AC 8024BDCC F7B40020 */ sdc1 $f20, 0x20($sp)
/* 17A6B0 8024BDD0 10A00037 */ beqz $a1, .L8024BEB0
/* 17A6B4 8024BDD4 24020008 */ addiu $v0, $zero, 8
/* 17A6B8 8024BDD8 86040026 */ lh $a0, 0x26($s0)
/* 17A6BC 8024BDDC 3C01420C */ lui $at, 0x420c
/* 17A6C0 8024BDE0 44810000 */ mtc1 $at, $f0
/* 17A6C4 8024BDE4 3C014270 */ lui $at, 0x4270
/* 17A6C8 8024BDE8 44811000 */ mtc1 $at, $f2
/* 17A6CC 8024BDEC 8603001E */ lh $v1, 0x1e($s0)
/* 17A6D0 8024BDF0 3C01802A */ lui $at, 0x802a
/* 17A6D4 8024BDF4 A422F284 */ sh $v0, -0xd7c($at)
/* 17A6D8 8024BDF8 86020022 */ lh $v0, 0x22($s0)
/* 17A6DC 8024BDFC 3C01802A */ lui $at, 0x802a
/* 17A6E0 8024BE00 E420F270 */ swc1 $f0, -0xd90($at)
/* 17A6E4 8024BE04 44830000 */ mtc1 $v1, $f0
/* 17A6E8 8024BE08 00000000 */ nop
/* 17A6EC 8024BE0C 46800020 */ cvt.s.w $f0, $f0
/* 17A6F0 8024BE10 86030024 */ lh $v1, 0x24($s0)
/* 17A6F4 8024BE14 3C01802A */ lui $at, 0x802a
/* 17A6F8 8024BE18 AC20F278 */ sw $zero, -0xd88($at)
/* 17A6FC 8024BE1C 3C01802A */ lui $at, 0x802a
/* 17A700 8024BE20 A420F282 */ sh $zero, -0xd7e($at)
/* 17A704 8024BE24 3C01802A */ lui $at, 0x802a
/* 17A708 8024BE28 E420F28C */ swc1 $f0, -0xd74($at)
/* 17A70C 8024BE2C 44820000 */ mtc1 $v0, $f0
/* 17A710 8024BE30 00000000 */ nop
/* 17A714 8024BE34 46800020 */ cvt.s.w $f0, $f0
/* 17A718 8024BE38 3C01802A */ lui $at, 0x802a
/* 17A71C 8024BE3C E422F274 */ swc1 $f2, -0xd8c($at)
/* 17A720 8024BE40 3C01802A */ lui $at, 0x802a
/* 17A724 8024BE44 E420F294 */ swc1 $f0, -0xd6c($at)
/* 17A728 8024BE48 44830000 */ mtc1 $v1, $f0
/* 17A72C 8024BE4C 00000000 */ nop
/* 17A730 8024BE50 46800020 */ cvt.s.w $f0, $f0
/* 17A734 8024BE54 3C01802A */ lui $at, 0x802a
/* 17A738 8024BE58 E420F290 */ swc1 $f0, -0xd70($at)
/* 17A73C 8024BE5C 04820001 */ bltzl $a0, .L8024BE64
/* 17A740 8024BE60 248400FF */ addiu $a0, $a0, 0xff
.L8024BE64:
/* 17A744 8024BE64 00041203 */ sra $v0, $a0, 8
/* 17A748 8024BE68 C6020054 */ lwc1 $f2, 0x54($s0)
/* 17A74C 8024BE6C C6040058 */ lwc1 $f4, 0x58($s0)
/* 17A750 8024BE70 C606005C */ lwc1 $f6, 0x5c($s0)
/* 17A754 8024BE74 3C03802A */ lui $v1, 0x802a
/* 17A758 8024BE78 9463F29E */ lhu $v1, -0xd62($v1)
/* 17A75C 8024BE7C 44820000 */ mtc1 $v0, $f0
/* 17A760 8024BE80 00000000 */ nop
/* 17A764 8024BE84 46800020 */ cvt.s.w $f0, $f0
/* 17A768 8024BE88 3C01802A */ lui $at, 0x802a
/* 17A76C 8024BE8C E420F298 */ swc1 $f0, -0xd68($at)
/* 17A770 8024BE90 3C01802A */ lui $at, 0x802a
/* 17A774 8024BE94 E422F2A8 */ swc1 $f2, -0xd58($at)
/* 17A778 8024BE98 3C01802A */ lui $at, 0x802a
/* 17A77C 8024BE9C E424F2AC */ swc1 $f4, -0xd54($at)
/* 17A780 8024BEA0 3C01802A */ lui $at, 0x802a
/* 17A784 8024BEA4 E426F2B0 */ swc1 $f6, -0xd50($at)
/* 17A788 8024BEA8 3C01802A */ lui $at, 0x802a
/* 17A78C 8024BEAC A423F2A0 */ sh $v1, -0xd60($at)
.L8024BEB0:
/* 17A790 8024BEB0 3C01802A */ lui $at, 0x802a
/* 17A794 8024BEB4 C43CF274 */ lwc1 $f28, -0xd8c($at)
/* 17A798 8024BEB8 3C01802A */ lui $at, 0x802a
/* 17A79C 8024BEBC C43AF270 */ lwc1 $f26, -0xd90($at)
/* 17A7A0 8024BEC0 3C02802A */ lui $v0, 0x802a
/* 17A7A4 8024BEC4 8042F2A5 */ lb $v0, -0xd5b($v0)
/* 17A7A8 8024BEC8 3C01802A */ lui $at, 0x802a
/* 17A7AC 8024BECC C43EF278 */ lwc1 $f30, -0xd88($at)
/* 17A7B0 8024BED0 14400027 */ bnez $v0, .L8024BF70
/* 17A7B4 8024BED4 E7BC0010 */ swc1 $f28, 0x10($sp)
/* 17A7B8 8024BED8 3C02802A */ lui $v0, 0x802a
/* 17A7BC 8024BEDC 8442F29E */ lh $v0, -0xd62($v0)
/* 17A7C0 8024BEE0 3C03802A */ lui $v1, 0x802a
/* 17A7C4 8024BEE4 8463F2A0 */ lh $v1, -0xd60($v1)
/* 17A7C8 8024BEE8 3C013F80 */ lui $at, 0x3f80
/* 17A7CC 8024BEEC 4481C000 */ mtc1 $at, $f24
/* 17A7D0 8024BEF0 44822000 */ mtc1 $v0, $f4
/* 17A7D4 8024BEF4 00000000 */ nop
/* 17A7D8 8024BEF8 46802120 */ cvt.s.w $f4, $f4
/* 17A7DC 8024BEFC 44830000 */ mtc1 $v1, $f0
/* 17A7E0 8024BF00 00000000 */ nop
/* 17A7E4 8024BF04 46800020 */ cvt.s.w $f0, $f0
/* 17A7E8 8024BF08 46002103 */ div.s $f4, $f4, $f0
/* 17A7EC 8024BF0C 4604C301 */ sub.s $f12, $f24, $f4
/* 17A7F0 8024BF10 3C014049 */ lui $at, 0x4049
/* 17A7F4 8024BF14 34210FD0 */ ori $at, $at, 0xfd0
/* 17A7F8 8024BF18 4481B000 */ mtc1 $at, $f22
/* 17A7FC 8024BF1C 00000000 */ nop
/* 17A800 8024BF20 46166302 */ mul.s $f12, $f12, $f22
/* 17A804 8024BF24 00000000 */ nop
/* 17A808 8024BF28 3C013F00 */ lui $at, 0x3f00
/* 17A80C 8024BF2C 4481A000 */ mtc1 $at, $f20
/* 17A810 8024BF30 00000000 */ nop
/* 17A814 8024BF34 46146302 */ mul.s $f12, $f12, $f20
/* 17A818 8024BF38 0C00A85B */ jal sin_rad
/* 17A81C 8024BF3C 00000000 */ nop
/* 17A820 8024BF40 46160002 */ mul.s $f0, $f0, $f22
/* 17A824 8024BF44 00000000 */ nop
/* 17A828 8024BF48 46140302 */ mul.s $f12, $f0, $f20
/* 17A82C 8024BF4C 0C00A85B */ jal sin_rad
/* 17A830 8024BF50 00000000 */ nop
/* 17A834 8024BF54 46160002 */ mul.s $f0, $f0, $f22
/* 17A838 8024BF58 00000000 */ nop
/* 17A83C 8024BF5C 46140302 */ mul.s $f12, $f0, $f20
/* 17A840 8024BF60 0C00A85B */ jal sin_rad
/* 17A844 8024BF64 00000000 */ nop
/* 17A848 8024BF68 08092FE7 */ j .L8024BF9C
/* 17A84C 8024BF6C 4600C101 */ sub.s $f4, $f24, $f0
.L8024BF70:
/* 17A850 8024BF70 3C02802A */ lui $v0, 0x802a
/* 17A854 8024BF74 8442F29E */ lh $v0, -0xd62($v0)
/* 17A858 8024BF78 3C03802A */ lui $v1, 0x802a
/* 17A85C 8024BF7C 8463F2A0 */ lh $v1, -0xd60($v1)
/* 17A860 8024BF80 44822000 */ mtc1 $v0, $f4
/* 17A864 8024BF84 00000000 */ nop
/* 17A868 8024BF88 46802120 */ cvt.s.w $f4, $f4
/* 17A86C 8024BF8C 44830000 */ mtc1 $v1, $f0
/* 17A870 8024BF90 00000000 */ nop
/* 17A874 8024BF94 46800020 */ cvt.s.w $f0, $f0
/* 17A878 8024BF98 46002103 */ div.s $f4, $f4, $f0
.L8024BF9C:
/* 17A87C 8024BF9C 3C01802A */ lui $at, 0x802a
/* 17A880 8024BFA0 C434F2A8 */ lwc1 $f20, -0xd58($at)
/* 17A884 8024BFA4 4604A502 */ mul.s $f20, $f20, $f4
/* 17A888 8024BFA8 00000000 */ nop
/* 17A88C 8024BFAC 3C01802A */ lui $at, 0x802a
/* 17A890 8024BFB0 C432F2AC */ lwc1 $f18, -0xd54($at)
/* 17A894 8024BFB4 46049482 */ mul.s $f18, $f18, $f4
/* 17A898 8024BFB8 00000000 */ nop
/* 17A89C 8024BFBC 3C01802A */ lui $at, 0x802a
/* 17A8A0 8024BFC0 C430F2B0 */ lwc1 $f16, -0xd50($at)
/* 17A8A4 8024BFC4 46048402 */ mul.s $f16, $f16, $f4
/* 17A8A8 8024BFC8 00000000 */ nop
/* 17A8AC 8024BFCC 3C01802A */ lui $at, 0x802a
/* 17A8B0 8024BFD0 C426F298 */ lwc1 $f6, -0xd68($at)
/* 17A8B4 8024BFD4 46043182 */ mul.s $f6, $f6, $f4
/* 17A8B8 8024BFD8 00000000 */ nop
/* 17A8BC 8024BFDC 3C01802A */ lui $at, 0x802a
/* 17A8C0 8024BFE0 C42CF28C */ lwc1 $f12, -0xd74($at)
/* 17A8C4 8024BFE4 46046302 */ mul.s $f12, $f12, $f4
/* 17A8C8 8024BFE8 00000000 */ nop
/* 17A8CC 8024BFEC 3C01802A */ lui $at, 0x802a
/* 17A8D0 8024BFF0 C428F290 */ lwc1 $f8, -0xd70($at)
/* 17A8D4 8024BFF4 46044202 */ mul.s $f8, $f8, $f4
/* 17A8D8 8024BFF8 00000000 */ nop
/* 17A8DC 8024BFFC 3C013F80 */ lui $at, 0x3f80
/* 17A8E0 8024C000 44811000 */ mtc1 $at, $f2
/* 17A8E4 8024C004 00000000 */ nop
/* 17A8E8 8024C008 46041081 */ sub.s $f2, $f2, $f4
/* 17A8EC 8024C00C 4602D682 */ mul.s $f26, $f26, $f2
/* 17A8F0 8024C010 00000000 */ nop
/* 17A8F4 8024C014 C7BC0010 */ lwc1 $f28, 0x10($sp)
/* 17A8F8 8024C018 4602E602 */ mul.s $f24, $f28, $f2
/* 17A8FC 8024C01C 00000000 */ nop
/* 17A900 8024C020 3C02802A */ lui $v0, 0x802a
/* 17A904 8024C024 8442F286 */ lh $v0, -0xd7a($v0)
/* 17A908 8024C028 44820000 */ mtc1 $v0, $f0
/* 17A90C 8024C02C 00000000 */ nop
/* 17A910 8024C030 46800020 */ cvt.s.w $f0, $f0
/* 17A914 8024C034 46020002 */ mul.s $f0, $f0, $f2
/* 17A918 8024C038 00000000 */ nop
/* 17A91C 8024C03C 4602F582 */ mul.s $f22, $f30, $f2
/* 17A920 8024C040 00000000 */ nop
/* 17A924 8024C044 3C02802A */ lui $v0, 0x802a
/* 17A928 8024C048 8442F280 */ lh $v0, -0xd80($v0)
/* 17A92C 8024C04C 44827000 */ mtc1 $v0, $f14
/* 17A930 8024C050 00000000 */ nop
/* 17A934 8024C054 468073A0 */ cvt.s.w $f14, $f14
/* 17A938 8024C058 46027382 */ mul.s $f14, $f14, $f2
/* 17A93C 8024C05C 00000000 */ nop
/* 17A940 8024C060 3C02802A */ lui $v0, 0x802a
/* 17A944 8024C064 8442F282 */ lh $v0, -0xd7e($v0)
/* 17A948 8024C068 44825000 */ mtc1 $v0, $f10
/* 17A94C 8024C06C 00000000 */ nop
/* 17A950 8024C070 468052A0 */ cvt.s.w $f10, $f10
/* 17A954 8024C074 46025282 */ mul.s $f10, $f10, $f2
/* 17A958 8024C078 00000000 */ nop
/* 17A95C 8024C07C 46003180 */ add.s $f6, $f6, $f0
/* 17A960 8024C080 3C014380 */ lui $at, 0x4380
/* 17A964 8024C084 44810000 */ mtc1 $at, $f0
/* 17A968 8024C088 00000000 */ nop
/* 17A96C 8024C08C 46003182 */ mul.s $f6, $f6, $f0
/* 17A970 8024C090 00000000 */ nop
/* 17A974 8024C094 3C01802A */ lui $at, 0x802a
/* 17A978 8024C098 C420F294 */ lwc1 $f0, -0xd6c($at)
/* 17A97C 8024C09C 46040002 */ mul.s $f0, $f0, $f4
/* 17A980 8024C0A0 00000000 */ nop
/* 17A984 8024C0A4 461AA500 */ add.s $f20, $f20, $f26
/* 17A988 8024C0A8 46189480 */ add.s $f18, $f18, $f24
/* 17A98C 8024C0AC 46168400 */ add.s $f16, $f16, $f22
/* 17A990 8024C0B0 460E6300 */ add.s $f12, $f12, $f14
/* 17A994 8024C0B4 3C04802A */ lui $a0, 0x802a
/* 17A998 8024C0B8 2484F29E */ addiu $a0, $a0, -0xd62
/* 17A99C 8024C0BC 3C02802A */ lui $v0, 0x802a
/* 17A9A0 8024C0C0 8442F284 */ lh $v0, -0xd7c($v0)
/* 17A9A4 8024C0C4 460A4200 */ add.s $f8, $f8, $f10
/* 17A9A8 8024C0C8 E6140054 */ swc1 $f20, 0x54($s0)
/* 17A9AC 8024C0CC 44822000 */ mtc1 $v0, $f4
/* 17A9B0 8024C0D0 00000000 */ nop
/* 17A9B4 8024C0D4 46802120 */ cvt.s.w $f4, $f4
/* 17A9B8 8024C0D8 46022102 */ mul.s $f4, $f4, $f2
/* 17A9BC 8024C0DC 00000000 */ nop
/* 17A9C0 8024C0E0 E6120058 */ swc1 $f18, 0x58($s0)
/* 17A9C4 8024C0E4 E610005C */ swc1 $f16, 0x5c($s0)
/* 17A9C8 8024C0E8 4600670D */ trunc.w.s $f28, $f12
/* 17A9CC 8024C0EC 4402E000 */ mfc1 $v0, $f28
/* 17A9D0 8024C0F0 00000000 */ nop
/* 17A9D4 8024C0F4 A602001E */ sh $v0, 0x1e($s0)
/* 17A9D8 8024C0F8 46040000 */ add.s $f0, $f0, $f4
/* 17A9DC 8024C0FC 4600470D */ trunc.w.s $f28, $f8
/* 17A9E0 8024C100 4402E000 */ mfc1 $v0, $f28
/* 17A9E4 8024C104 00000000 */ nop
/* 17A9E8 8024C108 A6020024 */ sh $v0, 0x24($s0)
/* 17A9EC 8024C10C 4600070D */ trunc.w.s $f28, $f0
/* 17A9F0 8024C110 4402E000 */ mfc1 $v0, $f28
/* 17A9F4 8024C114 00000000 */ nop
/* 17A9F8 8024C118 A6020022 */ sh $v0, 0x22($s0)
/* 17A9FC 8024C11C 4600370D */ trunc.w.s $f28, $f6
/* 17AA00 8024C120 4402E000 */ mfc1 $v0, $f28
/* 17AA04 8024C124 00000000 */ nop
/* 17AA08 8024C128 A6020026 */ sh $v0, 0x26($s0)
/* 17AA0C 8024C12C 84820000 */ lh $v0, ($a0)
/* 17AA10 8024C130 94830000 */ lhu $v1, ($a0)
/* 17AA14 8024C134 14400006 */ bnez $v0, .L8024C150
/* 17AA18 8024C138 2462FFFF */ addiu $v0, $v1, -1
/* 17AA1C 8024C13C 24020001 */ addiu $v0, $zero, 1
/* 17AA20 8024C140 3C01802A */ lui $at, 0x802a
/* 17AA24 8024C144 A022F29C */ sb $v0, -0xd64($at)
/* 17AA28 8024C148 08093055 */ j .L8024C154
/* 17AA2C 8024C14C 00000000 */ nop
.L8024C150:
/* 17AA30 8024C150 A4820000 */ sh $v0, ($a0)
.L8024C154:
/* 17AA34 8024C154 8FBF001C */ lw $ra, 0x1c($sp)
/* 17AA38 8024C158 8FB00018 */ lw $s0, 0x18($sp)
/* 17AA3C 8024C15C D7BE0048 */ ldc1 $f30, 0x48($sp)
/* 17AA40 8024C160 D7BC0040 */ ldc1 $f28, 0x40($sp)
/* 17AA44 8024C164 D7BA0038 */ ldc1 $f26, 0x38($sp)
/* 17AA48 8024C168 D7B80030 */ ldc1 $f24, 0x30($sp)
/* 17AA4C 8024C16C D7B60028 */ ldc1 $f22, 0x28($sp)
/* 17AA50 8024C170 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 17AA54 8024C174 0000102D */ daddu $v0, $zero, $zero
/* 17AA58 8024C178 03E00008 */ jr $ra
/* 17AA5C 8024C17C 27BD0050 */ addiu $sp, $sp, 0x50