.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel func_800392D8 /* 0146D8 800392D8 27BDFFA8 */ addiu $sp, $sp, -0x58 /* 0146DC 800392DC AFB1001C */ sw $s1, 0x1c($sp) /* 0146E0 800392E0 0080882D */ daddu $s1, $a0, $zero /* 0146E4 800392E4 AFBF0020 */ sw $ra, 0x20($sp) /* 0146E8 800392E8 AFB00018 */ sw $s0, 0x18($sp) /* 0146EC 800392EC F7BE0050 */ sdc1 $f30, 0x50($sp) /* 0146F0 800392F0 F7BC0048 */ sdc1 $f28, 0x48($sp) /* 0146F4 800392F4 F7BA0040 */ sdc1 $f26, 0x40($sp) /* 0146F8 800392F8 F7B80038 */ sdc1 $f24, 0x38($sp) /* 0146FC 800392FC F7B60030 */ sdc1 $f22, 0x30($sp) /* 014700 80039300 F7B40028 */ sdc1 $f20, 0x28($sp) /* 014704 80039304 8E230000 */ lw $v1, ($s1) /* 014708 80039308 3C108011 */ lui $s0, 0x8011 /* 01470C 8003930C 2610EFC8 */ addiu $s0, $s0, -0x1038 /* 014710 80039310 30620100 */ andi $v0, $v1, 0x100 /* 014714 80039314 144000D1 */ bnez $v0, .L8003965C /* 014718 80039318 0000102D */ daddu $v0, $zero, $zero /* 01471C 8003931C 3C020400 */ lui $v0, 0x400 /* 014720 80039320 00621024 */ and $v0, $v1, $v0 /* 014724 80039324 10400003 */ beqz $v0, .L80039334 /* 014728 80039328 00000000 */ nop .L8003932C: /* 01472C 8003932C 0800E597 */ j .L8003965C /* 014730 80039330 0000102D */ daddu $v0, $zero, $zero .L80039334: /* 014734 80039334 3C02800A */ lui $v0, 0x800a /* 014738 80039338 80420B94 */ lb $v0, 0xb94($v0) /* 01473C 8003933C 504000C7 */ beql $v0, $zero, .L8003965C /* 014740 80039340 0000102D */ daddu $v0, $zero, $zero /* 014744 80039344 860200B0 */ lh $v0, 0xb0($s0) /* 014748 80039348 C604002C */ lwc1 $f4, 0x2c($s0) /* 01474C 8003934C 44820000 */ mtc1 $v0, $f0 /* 014750 80039350 00000000 */ nop /* 014754 80039354 46800020 */ cvt.s.w $f0, $f0 /* 014758 80039358 46002000 */ add.s $f0, $f4, $f0 /* 01475C 8003935C C622003C */ lwc1 $f2, 0x3c($s1) /* 014760 80039360 4602003C */ c.lt.s $f0, $f2 /* 014764 80039364 00000000 */ nop /* 014768 80039368 450100BC */ bc1t .L8003965C /* 01476C 8003936C 0000102D */ daddu $v0, $zero, $zero /* 014770 80039370 862200A8 */ lh $v0, 0xa8($s1) /* 014774 80039374 44820000 */ mtc1 $v0, $f0 /* 014778 80039378 00000000 */ nop /* 01477C 8003937C 46800020 */ cvt.s.w $f0, $f0 /* 014780 80039380 46001000 */ add.s $f0, $f2, $f0 /* 014784 80039384 4604003C */ c.lt.s $f0, $f4 /* 014788 80039388 00000000 */ nop /* 01478C 8003938C 450100B3 */ bc1t .L8003965C /* 014790 80039390 0000102D */ daddu $v0, $zero, $zero /* 014794 80039394 C63A0038 */ lwc1 $f26, 0x38($s1) /* 014798 80039398 C61E0028 */ lwc1 $f30, 0x28($s0) /* 01479C 8003939C C61C0030 */ lwc1 $f28, 0x30($s0) /* 0147A0 800393A0 962200A6 */ lhu $v0, 0xa6($s1) /* 0147A4 800393A4 461AF581 */ sub.s $f22, $f30, $f26 /* 0147A8 800393A8 960300B2 */ lhu $v1, 0xb2($s0) /* 0147AC 800393AC 00021400 */ sll $v0, $v0, 0x10 /* 0147B0 800393B0 4616B082 */ mul.s $f2, $f22, $f22 /* 0147B4 800393B4 00000000 */ nop /* 0147B8 800393B8 00022403 */ sra $a0, $v0, 0x10 /* 0147BC 800393BC 000217C2 */ srl $v0, $v0, 0x1f /* 0147C0 800393C0 C6360040 */ lwc1 $f22, 0x40($s1) /* 0147C4 800393C4 00822021 */ addu $a0, $a0, $v0 /* 0147C8 800393C8 4616E501 */ sub.s $f20, $f28, $f22 /* 0147CC 800393CC 00042043 */ sra $a0, $a0, 1 /* 0147D0 800393D0 00031C00 */ sll $v1, $v1, 0x10 /* 0147D4 800393D4 4614A002 */ mul.s $f0, $f20, $f20 /* 0147D8 800393D8 00000000 */ nop /* 0147DC 800393DC 00031403 */ sra $v0, $v1, 0x10 /* 0147E0 800393E0 00031FC2 */ srl $v1, $v1, 0x1f /* 0147E4 800393E4 00431021 */ addu $v0, $v0, $v1 /* 0147E8 800393E8 00021043 */ sra $v0, $v0, 1 /* 0147EC 800393EC 46001300 */ add.s $f12, $f2, $f0 /* 0147F0 800393F0 4484B000 */ mtc1 $a0, $f22 /* 0147F4 800393F4 00000000 */ nop /* 0147F8 800393F8 4680B5A0 */ cvt.s.w $f22, $f22 /* 0147FC 800393FC 4482A000 */ mtc1 $v0, $f20 /* 014800 80039400 00000000 */ nop /* 014804 80039404 4680A520 */ cvt.s.w $f20, $f20 /* 014808 80039408 46006004 */ sqrt.s $f0, $f12 /* 01480C 8003940C 46000032 */ c.eq.s $f0, $f0 /* 014810 80039410 00000000 */ nop /* 014814 80039414 45010003 */ bc1t .L80039424 /* 014818 80039418 4614B580 */ add.s $f22, $f22, $f20 /* 01481C 8003941C 0C0187BC */ jal sqrtf /* 014820 80039420 00000000 */ nop .L80039424: /* 014824 80039424 4600B03C */ c.lt.s $f22, $f0 /* 014828 80039428 00000000 */ nop /* 01482C 8003942C 4501FFBF */ bc1t .L8003932C /* 014830 80039430 E7B60010 */ swc1 $f22, 0x10($sp) /* 014834 80039434 8E020004 */ lw $v0, 4($s0) /* 014838 80039438 34428000 */ ori $v0, $v0, 0x8000 /* 01483C 8003943C AE020004 */ sw $v0, 4($s0) /* 014840 80039440 C63A006C */ lwc1 $f26, 0x6c($s1) /* 014844 80039444 461AF581 */ sub.s $f22, $f30, $f26 /* 014848 80039448 4616B082 */ mul.s $f2, $f22, $f22 /* 01484C 8003944C 00000000 */ nop /* 014850 80039450 C6360074 */ lwc1 $f22, 0x74($s1) /* 014854 80039454 4616E501 */ sub.s $f20, $f28, $f22 /* 014858 80039458 4614A002 */ mul.s $f0, $f20, $f20 /* 01485C 8003945C 00000000 */ nop /* 014860 80039460 46001300 */ add.s $f12, $f2, $f0 /* 014864 80039464 46006004 */ sqrt.s $f0, $f12 /* 014868 80039468 46000032 */ c.eq.s $f0, $f0 /* 01486C 8003946C 00000000 */ nop /* 014870 80039470 45010004 */ bc1t .L80039484 /* 014874 80039474 46000606 */ mov.s $f24, $f0 /* 014878 80039478 0C0187BC */ jal sqrtf /* 01487C 8003947C 00000000 */ nop /* 014880 80039480 46000606 */ mov.s $f24, $f0 .L80039484: /* 014884 80039484 4600F306 */ mov.s $f12, $f30 /* 014888 80039488 4406D000 */ mfc1 $a2, $f26 /* 01488C 8003948C 4407B000 */ mfc1 $a3, $f22 /* 014890 80039490 0C00A720 */ jal atan2 /* 014894 80039494 4600E386 */ mov.s $f14, $f28 /* 014898 80039498 3C0140C9 */ lui $at, 0x40c9 /* 01489C 8003949C 34210FD0 */ ori $at, $at, 0xfd0 /* 0148A0 800394A0 4481A000 */ mtc1 $at, $f20 /* 0148A4 800394A4 46000686 */ mov.s $f26, $f0 /* 0148A8 800394A8 4614D502 */ mul.s $f20, $f26, $f20 /* 0148AC 800394AC 00000000 */ nop /* 0148B0 800394B0 3C0143B4 */ lui $at, 0x43b4 /* 0148B4 800394B4 44810000 */ mtc1 $at, $f0 /* 0148B8 800394B8 C7A80010 */ lwc1 $f8, 0x10($sp) /* 0148BC 800394BC C61C0080 */ lwc1 $f28, 0x80($s0) /* 0148C0 800394C0 46184601 */ sub.s $f24, $f8, $f24 /* 0148C4 800394C4 4600A503 */ div.s $f20, $f20, $f0 /* 0148C8 800394C8 0C00A85B */ jal sin_rad /* 0148CC 800394CC 4600A306 */ mov.s $f12, $f20 /* 0148D0 800394D0 4600C582 */ mul.s $f22, $f24, $f0 /* 0148D4 800394D4 00000000 */ nop /* 0148D8 800394D8 0C00A874 */ jal cos_rad /* 0148DC 800394DC 4600A306 */ mov.s $f12, $f20 /* 0148E0 800394E0 3C030040 */ lui $v1, 0x40 /* 0148E4 800394E4 8E020004 */ lw $v0, 4($s0) /* 0148E8 800394E8 4600C087 */ neg.s $f2, $f24 /* 0148EC 800394EC 46001502 */ mul.s $f20, $f2, $f0 /* 0148F0 800394F0 00000000 */ nop /* 0148F4 800394F4 00431024 */ and $v0, $v0, $v1 /* 0148F8 800394F8 1040002D */ beqz $v0, .L800395B0 /* 0148FC 800394FC 4600D306 */ mov.s $f12, $f26 /* 014900 80039500 0C00A70A */ jal get_clamped_angle_diff /* 014904 80039504 4600E386 */ mov.s $f14, $f28 /* 014908 80039508 3C014234 */ lui $at, 0x4234 /* 01490C 8003950C 44811000 */ mtc1 $at, $f2 /* 014910 80039510 46000005 */ abs.s $f0, $f0 /* 014914 80039514 4602003C */ c.lt.s $f0, $f2 /* 014918 80039518 00000000 */ nop /* 01491C 8003951C 4500000E */ bc1f .L80039558 /* 014920 80039520 00000000 */ nop /* 014924 80039524 C6020028 */ lwc1 $f2, 0x28($s0) /* 014928 80039528 46161081 */ sub.s $f2, $f2, $f22 /* 01492C 8003952C C6000030 */ lwc1 $f0, 0x30($s0) /* 014930 80039530 3C028011 */ lui $v0, 0x8011 /* 014934 80039534 8C42C930 */ lw $v0, -0x36d0($v0) /* 014938 80039538 46140001 */ sub.s $f0, $f0, $f20 /* 01493C 8003953C E6020028 */ swc1 $f2, 0x28($s0) /* 014940 80039540 E6000030 */ swc1 $f0, 0x30($s0) /* 014944 80039544 C4420038 */ lwc1 $f2, 0x38($v0) /* 014948 80039548 46161081 */ sub.s $f2, $f2, $f22 /* 01494C 8003954C C4400040 */ lwc1 $f0, 0x40($v0) /* 014950 80039550 0800E569 */ j .L800395A4 /* 014954 80039554 46140001 */ sub.s $f0, $f0, $f20 .L80039558: /* 014958 80039558 3C013F00 */ lui $at, 0x3f00 /* 01495C 8003955C 44812000 */ mtc1 $at, $f4 /* 014960 80039560 00000000 */ nop /* 014964 80039564 4604B182 */ mul.s $f6, $f22, $f4 /* 014968 80039568 00000000 */ nop /* 01496C 8003956C 4604A102 */ mul.s $f4, $f20, $f4 /* 014970 80039570 00000000 */ nop /* 014974 80039574 C6020028 */ lwc1 $f2, 0x28($s0) /* 014978 80039578 46061081 */ sub.s $f2, $f2, $f6 /* 01497C 8003957C C6000030 */ lwc1 $f0, 0x30($s0) /* 014980 80039580 3C028011 */ lui $v0, 0x8011 /* 014984 80039584 8C42C930 */ lw $v0, -0x36d0($v0) /* 014988 80039588 46040001 */ sub.s $f0, $f0, $f4 /* 01498C 8003958C E6020028 */ swc1 $f2, 0x28($s0) /* 014990 80039590 E6000030 */ swc1 $f0, 0x30($s0) /* 014994 80039594 C4420038 */ lwc1 $f2, 0x38($v0) /* 014998 80039598 46061081 */ sub.s $f2, $f2, $f6 /* 01499C 8003959C C4400040 */ lwc1 $f0, 0x40($v0) /* 0149A0 800395A0 46040001 */ sub.s $f0, $f0, $f4 .L800395A4: /* 0149A4 800395A4 E4420038 */ swc1 $f2, 0x38($v0) /* 0149A8 800395A8 0800E590 */ j .L80039640 /* 0149AC 800395AC E4400040 */ swc1 $f0, 0x40($v0) .L800395B0: /* 0149B0 800395B0 8E020000 */ lw $v0, ($s0) /* 0149B4 800395B4 30420006 */ andi $v0, $v0, 6 /* 0149B8 800395B8 10400006 */ beqz $v0, .L800395D4 /* 0149BC 800395BC 00000000 */ nop /* 0149C0 800395C0 3C013ECC */ lui $at, 0x3ecc /* 0149C4 800395C4 3421CCCD */ ori $at, $at, 0xcccd /* 0149C8 800395C8 44812000 */ mtc1 $at, $f4 /* 0149CC 800395CC 0800E586 */ j .L80039618 /* 0149D0 800395D0 00000000 */ nop .L800395D4: /* 0149D4 800395D4 0C00A70A */ jal get_clamped_angle_diff /* 0149D8 800395D8 4600E386 */ mov.s $f14, $f28 /* 0149DC 800395DC 3C014234 */ lui $at, 0x4234 /* 0149E0 800395E0 44811000 */ mtc1 $at, $f2 /* 0149E4 800395E4 46000005 */ abs.s $f0, $f0 /* 0149E8 800395E8 4602003C */ c.lt.s $f0, $f2 /* 0149EC 800395EC 00000000 */ nop /* 0149F0 800395F0 45000006 */ bc1f .L8003960C /* 0149F4 800395F4 00000000 */ nop /* 0149F8 800395F8 C6020028 */ lwc1 $f2, 0x28($s0) /* 0149FC 800395FC 46161081 */ sub.s $f2, $f2, $f22 /* 014A00 80039600 C6000030 */ lwc1 $f0, 0x30($s0) /* 014A04 80039604 0800E58E */ j .L80039638 /* 014A08 80039608 46140001 */ sub.s $f0, $f0, $f20 .L8003960C: /* 014A0C 8003960C 3C013F00 */ lui $at, 0x3f00 /* 014A10 80039610 44812000 */ mtc1 $at, $f4 /* 014A14 80039614 00000000 */ nop .L80039618: /* 014A18 80039618 4604B002 */ mul.s $f0, $f22, $f4 /* 014A1C 8003961C 00000000 */ nop /* 014A20 80039620 4604A102 */ mul.s $f4, $f20, $f4 /* 014A24 80039624 00000000 */ nop /* 014A28 80039628 C6020028 */ lwc1 $f2, 0x28($s0) /* 014A2C 8003962C 46001081 */ sub.s $f2, $f2, $f0 /* 014A30 80039630 C6000030 */ lwc1 $f0, 0x30($s0) /* 014A34 80039634 46040001 */ sub.s $f0, $f0, $f4 .L80039638: /* 014A38 80039638 E6020028 */ swc1 $f2, 0x28($s0) /* 014A3C 8003963C E6000030 */ swc1 $f0, 0x30($s0) .L80039640: /* 014A40 80039640 C620006C */ lwc1 $f0, 0x6c($s1) /* 014A44 80039644 C6220070 */ lwc1 $f2, 0x70($s1) /* 014A48 80039648 C6240074 */ lwc1 $f4, 0x74($s1) /* 014A4C 8003964C 24020001 */ addiu $v0, $zero, 1 /* 014A50 80039650 E6200038 */ swc1 $f0, 0x38($s1) /* 014A54 80039654 E622003C */ swc1 $f2, 0x3c($s1) /* 014A58 80039658 E6240040 */ swc1 $f4, 0x40($s1) .L8003965C: /* 014A5C 8003965C 8FBF0020 */ lw $ra, 0x20($sp) /* 014A60 80039660 8FB1001C */ lw $s1, 0x1c($sp) /* 014A64 80039664 8FB00018 */ lw $s0, 0x18($sp) /* 014A68 80039668 D7BE0050 */ ldc1 $f30, 0x50($sp) /* 014A6C 8003966C D7BC0048 */ ldc1 $f28, 0x48($sp) /* 014A70 80039670 D7BA0040 */ ldc1 $f26, 0x40($sp) /* 014A74 80039674 D7B80038 */ ldc1 $f24, 0x38($sp) /* 014A78 80039678 D7B60030 */ ldc1 $f22, 0x30($sp) /* 014A7C 8003967C D7B40028 */ ldc1 $f20, 0x28($sp) /* 014A80 80039680 03E00008 */ jr $ra /* 014A84 80039684 27BD0058 */ addiu $sp, $sp, 0x58