.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel func_800395F0 /* 149F0 800395F0 27BDFFB0 */ addiu $sp, $sp, -0x50 /* 149F4 800395F4 3C02FFFF */ lui $v0, 0xffff /* 149F8 800395F8 34427FFF */ ori $v0, $v0, 0x7fff /* 149FC 800395FC AFB3003C */ sw $s3, 0x3c($sp) /* 14A00 80039600 3C138011 */ lui $s3, %hi(D_8010F188) /* 14A04 80039604 2673F188 */ addiu $s3, $s3, %lo(D_8010F188) /* 14A08 80039608 AFBF0040 */ sw $ra, 0x40($sp) /* 14A0C 8003960C AFB20038 */ sw $s2, 0x38($sp) /* 14A10 80039610 AFB10034 */ sw $s1, 0x34($sp) /* 14A14 80039614 AFB00030 */ sw $s0, 0x30($sp) /* 14A18 80039618 F7B40048 */ sdc1 $f20, 0x48($sp) /* 14A1C 8003961C 8E630004 */ lw $v1, 4($s3) /* 14A20 80039620 3C04800A */ lui $a0, %hi(D_8009A630) /* 14A24 80039624 8C84A630 */ lw $a0, %lo(D_8009A630)($a0) /* 14A28 80039628 00621824 */ and $v1, $v1, $v0 /* 14A2C 8003962C 30840C00 */ andi $a0, $a0, 0xc00 /* 14A30 80039630 14800104 */ bnez $a0, .L80039A44 /* 14A34 80039634 AE630004 */ sw $v1, 4($s3) /* 14A38 80039638 0000902D */ daddu $s2, $zero, $zero /* 14A3C 8003963C 4480A000 */ mtc1 $zero, $f20 .L80039640: /* 14A40 80039640 3C03800A */ lui $v1, %hi(D_8009E9A0) /* 14A44 80039644 8C63E9A0 */ lw $v1, %lo(D_8009E9A0)($v1) /* 14A48 80039648 00121080 */ sll $v0, $s2, 2 /* 14A4C 8003964C 00431021 */ addu $v0, $v0, $v1 /* 14A50 80039650 8C500000 */ lw $s0, ($v0) /* 14A54 80039654 520000F8 */ beql $s0, $zero, .L80039A38 /* 14A58 80039658 26520001 */ addiu $s2, $s2, 1 /* 14A5C 8003965C 8E030000 */ lw $v1, ($s0) /* 14A60 80039660 506000F5 */ beql $v1, $zero, .L80039A38 /* 14A64 80039664 26520001 */ addiu $s2, $s2, 1 /* 14A68 80039668 3C028000 */ lui $v0, 0x8000 /* 14A6C 8003966C 34420004 */ ori $v0, $v0, 4 /* 14A70 80039670 00621024 */ and $v0, $v1, $v0 /* 14A74 80039674 10400005 */ beqz $v0, .L8003968C /* 14A78 80039678 00000000 */ nop /* 14A7C 8003967C 0C00E1EF */ jal func_800387BC /* 14A80 80039680 0200202D */ daddu $a0, $s0, $zero /* 14A84 80039684 0800E68E */ j .L80039A38 /* 14A88 80039688 26520001 */ addiu $s2, $s2, 1 .L8003968C: /* 14A8C 8003968C 8E020004 */ lw $v0, 4($s0) /* 14A90 80039690 0040F809 */ jalr $v0 /* 14A94 80039694 0200202D */ daddu $a0, $s0, $zero /* 14A98 80039698 8E020000 */ lw $v0, ($s0) /* 14A9C 8003969C 30428000 */ andi $v0, $v0, 0x8000 /* 14AA0 800396A0 10400004 */ beqz $v0, .L800396B4 /* 14AA4 800396A4 3C030004 */ lui $v1, 4 /* 14AA8 800396A8 8E020080 */ lw $v0, 0x80($s0) /* 14AAC 800396AC 0800E5B1 */ j .L800396C4 /* 14AB0 800396B0 00431025 */ or $v0, $v0, $v1 .L800396B4: /* 14AB4 800396B4 3C03FFFB */ lui $v1, 0xfffb /* 14AB8 800396B8 8E020080 */ lw $v0, 0x80($s0) /* 14ABC 800396BC 3463FFFF */ ori $v1, $v1, 0xffff /* 14AC0 800396C0 00431024 */ and $v0, $v0, $v1 .L800396C4: /* 14AC4 800396C4 AE020080 */ sw $v0, 0x80($s0) /* 14AC8 800396C8 0200202D */ daddu $a0, $s0, $zero /* 14ACC 800396CC 2402FFFF */ addiu $v0, $zero, -1 /* 14AD0 800396D0 A6020084 */ sh $v0, 0x84($s0) /* 14AD4 800396D4 A6020086 */ sh $v0, 0x86($s0) /* 14AD8 800396D8 8E020000 */ lw $v0, ($s0) /* 14ADC 800396DC 24039FFF */ addiu $v1, $zero, -0x6001 /* 14AE0 800396E0 00431024 */ and $v0, $v0, $v1 /* 14AE4 800396E4 0C00E1EF */ jal func_800387BC /* 14AE8 800396E8 AE020000 */ sw $v0, ($s0) /* 14AEC 800396EC 0C00E4D2 */ jal func_80039348 /* 14AF0 800396F0 0200202D */ daddu $a0, $s0, $zero /* 14AF4 800396F4 4405A000 */ mfc1 $a1, $f20 /* 14AF8 800396F8 0C00E52A */ jal func_800394A8 /* 14AFC 800396FC 0200202D */ daddu $a0, $s0, $zero /* 14B00 80039700 0C00E3E6 */ jal func_80038F98 /* 14B04 80039704 0200202D */ daddu $a0, $s0, $zero /* 14B08 80039708 0C00E333 */ jal func_80038CCC /* 14B0C 8003970C 0200202D */ daddu $a0, $s0, $zero /* 14B10 80039710 8E020000 */ lw $v0, ($s0) /* 14B14 80039714 3C030010 */ lui $v1, 0x10 /* 14B18 80039718 00431024 */ and $v0, $v0, $v1 /* 14B1C 8003971C 10400003 */ beqz $v0, .L8003972C /* 14B20 80039720 00000000 */ nop /* 14B24 80039724 0C00EAAE */ jal func_8003AAB8 /* 14B28 80039728 0200202D */ daddu $a0, $s0, $zero .L8003972C: /* 14B2C 8003972C C602003C */ lwc1 $f2, 0x3c($s0) /* 14B30 80039730 3C01C4FA */ lui $at, 0xc4fa /* 14B34 80039734 44810000 */ mtc1 $at, $f0 /* 14B38 80039738 00000000 */ nop /* 14B3C 8003973C 4600103C */ c.lt.s $f2, $f0 /* 14B40 80039740 00000000 */ nop /* 14B44 80039744 4500000D */ bc1f .L8003977C /* 14B48 80039748 3C030400 */ lui $v1, 0x400 /* 14B4C 8003974C 8E020000 */ lw $v0, ($s0) /* 14B50 80039750 00431024 */ and $v0, $v0, $v1 /* 14B54 80039754 14400009 */ bnez $v0, .L8003977C /* 14B58 80039758 2403F7FF */ addiu $v1, $zero, -0x801 /* 14B5C 8003975C C660002C */ lwc1 $f0, 0x2c($s3) /* 14B60 80039760 8E020000 */ lw $v0, ($s0) /* 14B64 80039764 E614001C */ swc1 $f20, 0x1c($s0) /* 14B68 80039768 E6140018 */ swc1 $f20, 0x18($s0) /* 14B6C 8003976C E6140014 */ swc1 $f20, 0x14($s0) /* 14B70 80039770 00431024 */ and $v0, $v0, $v1 /* 14B74 80039774 E600003C */ swc1 $f0, 0x3c($s0) /* 14B78 80039778 AE020000 */ sw $v0, ($s0) .L8003977C: /* 14B7C 8003977C 8E030000 */ lw $v1, ($s0) /* 14B80 80039780 3C024000 */ lui $v0, 0x4000 /* 14B84 80039784 00621024 */ and $v0, $v1, $v0 /* 14B88 80039788 1440000E */ bnez $v0, .L800397C4 /* 14B8C 8003978C 3C020100 */ lui $v0, 0x100 /* 14B90 80039790 00621024 */ and $v0, $v1, $v0 /* 14B94 80039794 1440000F */ bnez $v0, .L800397D4 /* 14B98 80039798 00000000 */ nop /* 14B9C 8003979C 8E050028 */ lw $a1, 0x28($s0) /* 14BA0 800397A0 10A0000C */ beqz $a1, .L800397D4 /* 14BA4 800397A4 00000000 */ nop /* 14BA8 800397A8 8E040024 */ lw $a0, 0x24($s0) /* 14BAC 800397AC 04800009 */ bltz $a0, .L800397D4 /* 14BB0 800397B0 00000000 */ nop /* 14BB4 800397B4 0C04477F */ jal func_80111DFC /* 14BB8 800397B8 8E060030 */ lw $a2, 0x30($s0) /* 14BBC 800397BC 0800E5F5 */ j .L800397D4 /* 14BC0 800397C0 00000000 */ nop .L800397C4: /* 14BC4 800397C4 8E050028 */ lw $a1, 0x28($s0) /* 14BC8 800397C8 8E060030 */ lw $a2, 0x30($s0) /* 14BCC 800397CC 0C044577 */ jal func_801115DC /* 14BD0 800397D0 24040001 */ addiu $a0, $zero, 1 .L800397D4: /* 14BD4 800397D4 8E020000 */ lw $v0, ($s0) /* 14BD8 800397D8 30420010 */ andi $v0, $v0, 0x10 /* 14BDC 800397DC 10400072 */ beqz $v0, .L800399A8 /* 14BE0 800397E0 00000000 */ nop /* 14BE4 800397E4 0C045605 */ jal func_80115814 /* 14BE8 800397E8 8E040078 */ lw $a0, 0x78($s0) /* 14BEC 800397EC 84440008 */ lh $a0, 8($v0) /* 14BF0 800397F0 0C049FFB */ jal func_80127FEC /* 14BF4 800397F4 0040882D */ daddu $s1, $v0, $zero /* 14BF8 800397F8 0040202D */ daddu $a0, $v0, $zero /* 14BFC 800397FC 8C430000 */ lw $v1, ($v0) /* 14C00 80039800 2402FDFF */ addiu $v0, $zero, -0x201 /* 14C04 80039804 00622824 */ and $a1, $v1, $v0 /* 14C08 80039808 AC850000 */ sw $a1, ($a0) /* 14C0C 8003980C 8E020000 */ lw $v0, ($s0) /* 14C10 80039810 3C030002 */ lui $v1, 2 /* 14C14 80039814 00431024 */ and $v0, $v0, $v1 /* 14C18 80039818 10400002 */ beqz $v0, .L80039824 /* 14C1C 8003981C 34A20200 */ ori $v0, $a1, 0x200 /* 14C20 80039820 AC820000 */ sw $v0, ($a0) .L80039824: /* 14C24 80039824 C6020038 */ lwc1 $f2, 0x38($s0) /* 14C28 80039828 C604003C */ lwc1 $f4, 0x3c($s0) /* 14C2C 8003982C 8E030000 */ lw $v1, ($s0) /* 14C30 80039830 C6060040 */ lwc1 $f6, 0x40($s0) /* 14C34 80039834 30620020 */ andi $v0, $v1, 0x20 /* 14C38 80039838 E7A20018 */ swc1 $f2, 0x18($sp) /* 14C3C 8003983C E7A4001C */ swc1 $f4, 0x1c($sp) /* 14C40 80039840 1440004D */ bnez $v0, .L80039978 /* 14C44 80039844 E7A60020 */ swc1 $f6, 0x20($sp) /* 14C48 80039848 C600006C */ lwc1 $f0, 0x6c($s0) /* 14C4C 8003984C 46001032 */ c.eq.s $f2, $f0 /* 14C50 80039850 00000000 */ nop /* 14C54 80039854 4500000E */ bc1f .L80039890 /* 14C58 80039858 27A40018 */ addiu $a0, $sp, 0x18 /* 14C5C 8003985C C6000070 */ lwc1 $f0, 0x70($s0) /* 14C60 80039860 46002032 */ c.eq.s $f4, $f0 /* 14C64 80039864 00000000 */ nop /* 14C68 80039868 4502000A */ bc1fl .L80039894 /* 14C6C 8003986C 27A5001C */ addiu $a1, $sp, 0x1c /* 14C70 80039870 C6000074 */ lwc1 $f0, 0x74($s0) /* 14C74 80039874 46003032 */ c.eq.s $f6, $f0 /* 14C78 80039878 00000000 */ nop /* 14C7C 8003987C 45000004 */ bc1f .L80039890 /* 14C80 80039880 3C020001 */ lui $v0, 1 /* 14C84 80039884 00621024 */ and $v0, $v1, $v0 /* 14C88 80039888 10400047 */ beqz $v0, .L800399A8 /* 14C8C 8003988C 00000000 */ nop .L80039890: /* 14C90 80039890 27A5001C */ addiu $a1, $sp, 0x1c .L80039894: /* 14C94 80039894 27A60020 */ addiu $a2, $sp, 0x20 /* 14C98 80039898 27A70024 */ addiu $a3, $sp, 0x24 /* 14C9C 8003989C C6000038 */ lwc1 $f0, 0x38($s0) /* 14CA0 800398A0 960300A8 */ lhu $v1, 0xa8($s0) /* 14CA4 800398A4 3C01447A */ lui $at, 0x447a /* 14CA8 800398A8 44812000 */ mtc1 $at, $f4 /* 14CAC 800398AC 00031C00 */ sll $v1, $v1, 0x10 /* 14CB0 800398B0 00031403 */ sra $v0, $v1, 0x10 /* 14CB4 800398B4 00031FC2 */ srl $v1, $v1, 0x1f /* 14CB8 800398B8 00431021 */ addu $v0, $v0, $v1 /* 14CBC 800398BC 00021043 */ sra $v0, $v0, 1 /* 14CC0 800398C0 44823000 */ mtc1 $v0, $f6 /* 14CC4 800398C4 00000000 */ nop /* 14CC8 800398C8 468031A0 */ cvt.s.w $f6, $f6 /* 14CCC 800398CC 27A20028 */ addiu $v0, $sp, 0x28 /* 14CD0 800398D0 E7A00018 */ swc1 $f0, 0x18($sp) /* 14CD4 800398D4 C600003C */ lwc1 $f0, 0x3c($s0) /* 14CD8 800398D8 C6020040 */ lwc1 $f2, 0x40($s0) /* 14CDC 800398DC 46060000 */ add.s $f0, $f0, $f6 /* 14CE0 800398E0 E7A4002C */ swc1 $f4, 0x2c($sp) /* 14CE4 800398E4 E7A20020 */ swc1 $f2, 0x20($sp) /* 14CE8 800398E8 E7A0001C */ swc1 $f0, 0x1c($sp) /* 14CEC 800398EC AFA20010 */ sw $v0, 0x10($sp) /* 14CF0 800398F0 27A2002C */ addiu $v0, $sp, 0x2c /* 14CF4 800398F4 0C045DFE */ jal func_801177F8 /* 14CF8 800398F8 AFA20014 */ sw $v0, 0x14($sp) /* 14CFC 800398FC 860200A6 */ lh $v0, 0xa6($s0) /* 14D00 80039900 8FA5002C */ lw $a1, 0x2c($sp) /* 14D04 80039904 44824000 */ mtc1 $v0, $f8 /* 14D08 80039908 00000000 */ nop /* 14D0C 8003990C 46804220 */ cvt.s.w $f8, $f8 /* 14D10 80039910 44064000 */ mfc1 $a2, $f8 /* 14D14 80039914 0C045EC4 */ jal func_80117B10 /* 14D18 80039918 0220202D */ daddu $a0, $s1, $zero /* 14D1C 8003991C C7A00018 */ lwc1 $f0, 0x18($sp) /* 14D20 80039920 C7A2001C */ lwc1 $f2, 0x1c($sp) /* 14D24 80039924 C7A40020 */ lwc1 $f4, 0x20($sp) /* 14D28 80039928 C7A60024 */ lwc1 $f6, 0x24($sp) /* 14D2C 8003992C E6200010 */ swc1 $f0, 0x10($s1) /* 14D30 80039930 E6220014 */ swc1 $f2, 0x14($s1) /* 14D34 80039934 E6240018 */ swc1 $f4, 0x18($s1) /* 14D38 80039938 E6260028 */ swc1 $f6, 0x28($s1) /* 14D3C 8003993C C6020034 */ lwc1 $f2, 0x34($s0) /* 14D40 80039940 C7A00028 */ lwc1 $f0, 0x28($sp) /* 14D44 80039944 E622002C */ swc1 $f2, 0x2c($s1) /* 14D48 80039948 C622001C */ lwc1 $f2, 0x1c($s1) /* 14D4C 8003994C E6200030 */ swc1 $f0, 0x30($s1) /* 14D50 80039950 C600007C */ lwc1 $f0, 0x7c($s0) /* 14D54 80039954 46001082 */ mul.s $f2, $f2, $f0 /* 14D58 80039958 00000000 */ nop /* 14D5C 8003995C 3C03FFFE */ lui $v1, 0xfffe /* 14D60 80039960 E622001C */ swc1 $f2, 0x1c($s1) /* 14D64 80039964 8E020000 */ lw $v0, ($s0) /* 14D68 80039968 3463FFFF */ ori $v1, $v1, 0xffff /* 14D6C 8003996C 00431024 */ and $v0, $v0, $v1 /* 14D70 80039970 0800E66A */ j .L800399A8 /* 14D74 80039974 AE020000 */ sw $v0, ($s0) .L80039978: /* 14D78 80039978 30620400 */ andi $v0, $v1, 0x400 /* 14D7C 8003997C 10400004 */ beqz $v0, .L80039990 /* 14D80 80039980 00000000 */ nop /* 14D84 80039984 C6000038 */ lwc1 $f0, 0x38($s0) /* 14D88 80039988 0800E668 */ j .L800399A0 /* 14D8C 8003998C E6200010 */ swc1 $f0, 0x10($s1) .L80039990: /* 14D90 80039990 C6000038 */ lwc1 $f0, 0x38($s0) /* 14D94 80039994 E6200010 */ swc1 $f0, 0x10($s1) /* 14D98 80039998 C600003C */ lwc1 $f0, 0x3c($s0) /* 14D9C 8003999C E6200014 */ swc1 $f0, 0x14($s1) .L800399A0: /* 14DA0 800399A0 C6000040 */ lwc1 $f0, 0x40($s0) /* 14DA4 800399A4 E6200018 */ swc1 $f0, 0x18($s1) .L800399A8: /* 14DA8 800399A8 C6000038 */ lwc1 $f0, 0x38($s0) /* 14DAC 800399AC C602003C */ lwc1 $f2, 0x3c($s0) /* 14DB0 800399B0 C6040040 */ lwc1 $f4, 0x40($s0) /* 14DB4 800399B4 0200202D */ daddu $a0, $s0, $zero /* 14DB8 800399B8 E600006C */ swc1 $f0, 0x6c($s0) /* 14DBC 800399BC E6020070 */ swc1 $f2, 0x70($s0) /* 14DC0 800399C0 0C00F041 */ jal func_8003C104 /* 14DC4 800399C4 E6040074 */ swc1 $f4, 0x74($s0) /* 14DC8 800399C8 8E030000 */ lw $v1, ($s0) /* 14DCC 800399CC 3C024000 */ lui $v0, 0x4000 /* 14DD0 800399D0 00621024 */ and $v0, $v1, $v0 /* 14DD4 800399D4 54400018 */ bnel $v0, $zero, .L80039A38 /* 14DD8 800399D8 26520001 */ addiu $s2, $s2, 1 /* 14DDC 800399DC 3C020100 */ lui $v0, 0x100 /* 14DE0 800399E0 00621024 */ and $v0, $v1, $v0 /* 14DE4 800399E4 54400014 */ bnel $v0, $zero, .L80039A38 /* 14DE8 800399E8 26520001 */ addiu $s2, $s2, 1 /* 14DEC 800399EC 8E030024 */ lw $v1, 0x24($s0) /* 14DF0 800399F0 04630011 */ bgezl $v1, .L80039A38 /* 14DF4 800399F4 26520001 */ addiu $s2, $s2, 1 /* 14DF8 800399F8 24630001 */ addiu $v1, $v1, 1 /* 14DFC 800399FC 2402FFFF */ addiu $v0, $zero, -1 /* 14E00 80039A00 1462000C */ bne $v1, $v0, .L80039A34 /* 14E04 80039A04 AE030024 */ sw $v1, 0x24($s0) /* 14E08 80039A08 8E040028 */ lw $a0, 0x28($s0) /* 14E0C 80039A0C 0C04470F */ jal func_80111C3C /* 14E10 80039A10 8E0500B0 */ lw $a1, 0xb0($s0) /* 14E14 80039A14 04410003 */ bgez $v0, .L80039A24 /* 14E18 80039A18 AE020024 */ sw $v0, 0x24($s0) .L80039A1C: /* 14E1C 80039A1C 0800E687 */ j .L80039A1C /* 14E20 80039A20 00000000 */ nop .L80039A24: /* 14E24 80039A24 8E040024 */ lw $a0, 0x24($s0) /* 14E28 80039A28 8E050028 */ lw $a1, 0x28($s0) /* 14E2C 80039A2C 0C04477F */ jal func_80111DFC /* 14E30 80039A30 8E060030 */ lw $a2, 0x30($s0) .L80039A34: /* 14E34 80039A34 26520001 */ addiu $s2, $s2, 1 .L80039A38: /* 14E38 80039A38 2A420040 */ slti $v0, $s2, 0x40 /* 14E3C 80039A3C 1440FF00 */ bnez $v0, .L80039640 /* 14E40 80039A40 00000000 */ nop .L80039A44: /* 14E44 80039A44 8FBF0040 */ lw $ra, 0x40($sp) /* 14E48 80039A48 8FB3003C */ lw $s3, 0x3c($sp) /* 14E4C 80039A4C 8FB20038 */ lw $s2, 0x38($sp) /* 14E50 80039A50 8FB10034 */ lw $s1, 0x34($sp) /* 14E54 80039A54 8FB00030 */ lw $s0, 0x30($sp) /* 14E58 80039A58 D7B40048 */ ldc1 $f20, 0x48($sp) /* 14E5C 80039A5C 03E00008 */ jr $ra /* 14E60 80039A60 27BD0050 */ addiu $sp, $sp, 0x50