papermario/asm/nonmatchings/code_303c0_len_3e10/func_80058C6C.s
2020-08-12 22:37:16 -04:00

107 lines
4.3 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80058C6C
/* 03406C 80058C6C 8FA20010 */ lw $v0, 0x10($sp)
/* 034070 80058C70 1440000B */ bnez $v0, .L80058CA0
/* 034074 80058C74 8FA50014 */ lw $a1, 0x14($sp)
/* 034078 80058C78 462E603E */ c.le.d $f12, $f14
/* 03407C 80058C7C 00000000 */ nop
/* 034080 80058C80 45020005 */ bc1fl .L80058C98
/* 034084 80058C84 A4A00000 */ sh $zero, ($a1)
/* 034088 80058C88 3402FFFF */ ori $v0, $zero, 0xffff
/* 03408C 80058C8C A4A20000 */ sh $v0, ($a1)
/* 034090 80058C90 03E00008 */ jr $ra
/* 034094 80058C94 24027FFF */ addiu $v0, $zero, 0x7fff
.L80058C98:
/* 034098 80058C98 03E00008 */ jr $ra
/* 03409C 80058C9C 0000102D */ daddu $v0, $zero, $zero
.L80058CA0:
/* 0340A0 80058CA0 3C013FF0 */ lui $at, 0x3ff0
/* 0340A4 80058CA4 44812800 */ mtc1 $at, $f5
/* 0340A8 80058CA8 44802000 */ mtc1 $zero, $f4
/* 0340AC 80058CAC 44820000 */ mtc1 $v0, $f0
/* 0340B0 80058CB0 00000000 */ nop
/* 0340B4 80058CB4 46800021 */ cvt.d.w $f0, $f0
/* 0340B8 80058CB8 4624703C */ c.lt.d $f14, $f4
/* 0340BC 80058CBC 00000000 */ nop
/* 0340C0 80058CC0 45000002 */ bc1f .L80058CCC
/* 0340C4 80058CC4 46202083 */ div.d $f2, $f4, $f0
/* 0340C8 80058CC8 46202386 */ mov.d $f14, $f4
.L80058CCC:
/* 0340CC 80058CCC 44800000 */ mtc1 $zero, $f0
/* 0340D0 80058CD0 44800800 */ mtc1 $zero, $f1
/* 0340D4 80058CD4 00000000 */ nop
/* 0340D8 80058CD8 4620603E */ c.le.d $f12, $f0
/* 0340DC 80058CDC 00000000 */ nop
/* 0340E0 80058CE0 45030001 */ bc1tl .L80058CE8
/* 0340E4 80058CE4 46202306 */ mov.d $f12, $f4
.L80058CE8:
/* 0340E8 80058CE8 462C7001 */ sub.d $f0, $f14, $f12
/* 0340EC 80058CEC 46220002 */ mul.d $f0, $f0, $f2
/* 0340F0 80058CF0 00000000 */ nop
/* 0340F4 80058CF4 3C014020 */ lui $at, 0x4020
/* 0340F8 80058CF8 44811800 */ mtc1 $at, $f3
/* 0340FC 80058CFC 44801000 */ mtc1 $zero, $f2
/* 034100 80058D00 00000000 */ nop
/* 034104 80058D04 46220002 */ mul.d $f0, $f0, $f2
/* 034108 80058D08 00000000 */ nop
/* 03410C 80058D0C 4620018D */ trunc.w.d $f6, $f0
/* 034110 80058D10 44033000 */ mfc1 $v1, $f6
/* 034114 80058D14 00000000 */ nop
/* 034118 80058D18 00031400 */ sll $v0, $v1, 0x10
/* 03411C 80058D1C 00021403 */ sra $v0, $v0, 0x10
/* 034120 80058D20 44821000 */ mtc1 $v0, $f2
/* 034124 80058D24 00000000 */ nop
/* 034128 80058D28 468010A1 */ cvt.d.w $f2, $f2
/* 03412C 80058D2C 46220001 */ sub.d $f0, $f0, $f2
/* 034130 80058D30 46240000 */ add.d $f0, $f0, $f4
/* 034134 80058D34 4620018D */ trunc.w.d $f6, $f0
/* 034138 80058D38 44043000 */ mfc1 $a0, $f6
/* 03413C 80058D3C 00000000 */ nop
/* 034140 80058D40 00041400 */ sll $v0, $a0, 0x10
/* 034144 80058D44 00021403 */ sra $v0, $v0, 0x10
/* 034148 80058D48 44821000 */ mtc1 $v0, $f2
/* 03414C 80058D4C 00000000 */ nop
/* 034150 80058D50 468010A1 */ cvt.d.w $f2, $f2
/* 034154 80058D54 46220001 */ sub.d $f0, $f0, $f2
/* 034158 80058D58 3C01800A */ lui $at, 0x800a
/* 03415C 80058D5C D4228938 */ ldc1 $f2, -0x76c8($at)
/* 034160 80058D60 46220002 */ mul.d $f0, $f0, $f2
/* 034164 80058D64 00000000 */ nop
/* 034168 80058D68 2463FFFF */ addiu $v1, $v1, -1
/* 03416C 80058D6C 3C0141E0 */ lui $at, 0x41e0
/* 034170 80058D70 44811800 */ mtc1 $at, $f3
/* 034174 80058D74 44801000 */ mtc1 $zero, $f2
/* 034178 80058D78 00000000 */ nop
/* 03417C 80058D7C 4620103E */ c.le.d $f2, $f0
/* 034180 80058D80 00000000 */ nop
/* 034184 80058D84 45010005 */ bc1t .L80058D9C
/* 034188 80058D88 00641821 */ addu $v1, $v1, $a0
/* 03418C 80058D8C 4620018D */ trunc.w.d $f6, $f0
/* 034190 80058D90 44043000 */ mfc1 $a0, $f6
/* 034194 80058D94 0801636E */ j .L80058DB8
/* 034198 80058D98 A4A40000 */ sh $a0, ($a1)
.L80058D9C:
/* 03419C 80058D9C 46220001 */ sub.d $f0, $f0, $f2
/* 0341A0 80058DA0 3C028000 */ lui $v0, 0x8000
/* 0341A4 80058DA4 4620018D */ trunc.w.d $f6, $f0
/* 0341A8 80058DA8 44043000 */ mfc1 $a0, $f6
/* 0341AC 80058DAC 00000000 */ nop
/* 0341B0 80058DB0 00822025 */ or $a0, $a0, $v0
/* 0341B4 80058DB4 A4A40000 */ sh $a0, ($a1)
.L80058DB8:
/* 0341B8 80058DB8 00031400 */ sll $v0, $v1, 0x10
/* 0341BC 80058DBC 03E00008 */ jr $ra
/* 0341C0 80058DC0 00021403 */ sra $v0, $v0, 0x10
/* 0341C4 80058DC4 00000000 */ nop
/* 0341C8 80058DC8 00000000 */ nop
/* 0341CC 80058DCC 00000000 */ nop