.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel func_800F0248 /* 0896F8 800F0248 27BDFFB8 */ addiu $sp, $sp, -0x48 /* 0896FC 800F024C AFB00020 */ sw $s0, 0x20($sp) /* 089700 800F0250 3C108011 */ lui $s0, 0x8011 /* 089704 800F0254 2610EFC8 */ addiu $s0, $s0, -0x1038 /* 089708 800F0258 AFBF0028 */ sw $ra, 0x28($sp) /* 08970C 800F025C AFB10024 */ sw $s1, 0x24($sp) /* 089710 800F0260 F7B80040 */ sdc1 $f24, 0x40($sp) /* 089714 800F0264 F7B60038 */ sdc1 $f22, 0x38($sp) /* 089718 800F0268 F7B40030 */ sdc1 $f20, 0x30($sp) /* 08971C 800F026C 820300B4 */ lb $v1, 0xb4($s0) /* 089720 800F0270 24020003 */ addiu $v0, $zero, 3 /* 089724 800F0274 1462001B */ bne $v1, $v0, .L800F02E4 /* 089728 800F0278 24020001 */ addiu $v0, $zero, 1 /* 08972C 800F027C 860300C0 */ lh $v1, 0xc0($s0) /* 089730 800F0280 14620018 */ bne $v1, $v0, .L800F02E4 /* 089734 800F0284 24020005 */ addiu $v0, $zero, 5 /* 089738 800F0288 3C118011 */ lui $s1, 0x8011 /* 08973C 800F028C 26319492 */ addiu $s1, $s1, -0x6b6e /* 089740 800F0290 86230000 */ lh $v1, ($s1) /* 089744 800F0294 14620013 */ bne $v1, $v0, .L800F02E4 /* 089748 800F0298 00000000 */ nop /* 08974C 800F029C C60C0028 */ lwc1 $f12, 0x28($s0) /* 089750 800F02A0 8E060030 */ lw $a2, 0x30($s0) /* 089754 800F02A4 C600002C */ lwc1 $f0, 0x2c($s0) /* 089758 800F02A8 3C014160 */ lui $at, 0x4160 /* 08975C 800F02AC 44817000 */ mtc1 $at, $f14 /* 089760 800F02B0 3C108011 */ lui $s0, 0x8011 /* 089764 800F02B4 2610948C */ addiu $s0, $s0, -0x6b74 /* 089768 800F02B8 8E070000 */ lw $a3, ($s0) /* 08976C 800F02BC 0C01BEE4 */ jal func_8006FB90 /* 089770 800F02C0 460E0380 */ add.s $f14, $f0, $f14 /* 089774 800F02C4 C6000000 */ lwc1 $f0, ($s0) /* 089778 800F02C8 3C01420C */ lui $at, 0x420c /* 08977C 800F02CC 44816000 */ mtc1 $at, $f12 /* 089780 800F02D0 0C00A6C9 */ jal clamp_angle /* 089784 800F02D4 460C0300 */ add.s $f12, $f0, $f12 /* 089788 800F02D8 E6000000 */ swc1 $f0, ($s0) /* 08978C 800F02DC 0803C11C */ j .L800F0470 /* 089790 800F02E0 A6200000 */ sh $zero, ($s1) .L800F02E4: /* 089794 800F02E4 3C038011 */ lui $v1, 0x8011 /* 089798 800F02E8 24639492 */ addiu $v1, $v1, -0x6b6e /* 08979C 800F02EC 94620000 */ lhu $v0, ($v1) /* 0897A0 800F02F0 24420001 */ addiu $v0, $v0, 1 /* 0897A4 800F02F4 A4620000 */ sh $v0, ($v1) /* 0897A8 800F02F8 00021400 */ sll $v0, $v0, 0x10 /* 0897AC 800F02FC 00021403 */ sra $v0, $v0, 0x10 /* 0897B0 800F0300 28420006 */ slti $v0, $v0, 6 /* 0897B4 800F0304 14400002 */ bnez $v0, .L800F0310 /* 0897B8 800F0308 24020005 */ addiu $v0, $zero, 5 /* 0897BC 800F030C A4620000 */ sh $v0, ($v1) .L800F0310: /* 0897C0 800F0310 920200B4 */ lbu $v0, 0xb4($s0) /* 0897C4 800F0314 2442FFFF */ addiu $v0, $v0, -1 /* 0897C8 800F0318 2C420002 */ sltiu $v0, $v0, 2 /* 0897CC 800F031C 1440000A */ bnez $v0, .L800F0348 /* 0897D0 800F0320 3C02FF00 */ lui $v0, 0xff00 /* 0897D4 800F0324 8E0300B4 */ lw $v1, 0xb4($s0) /* 0897D8 800F0328 3442FF00 */ ori $v0, $v0, 0xff00 /* 0897DC 800F032C 00621824 */ and $v1, $v1, $v0 /* 0897E0 800F0330 3C021A00 */ lui $v0, 0x1a00 /* 0897E4 800F0334 10620004 */ beq $v1, $v0, .L800F0348 /* 0897E8 800F0338 00000000 */ nop /* 0897EC 800F033C 3C018011 */ lui $at, 0x8011 /* 0897F0 800F0340 0803C11C */ j .L800F0470 /* 0897F4 800F0344 A4209490 */ sh $zero, -0x6b70($at) .L800F0348: /* 0897F8 800F0348 3C048011 */ lui $a0, 0x8011 /* 0897FC 800F034C 24849490 */ addiu $a0, $a0, -0x6b70 /* 089800 800F0350 94820000 */ lhu $v0, ($a0) /* 089804 800F0354 24430001 */ addiu $v1, $v0, 1 /* 089808 800F0358 00021400 */ sll $v0, $v0, 0x10 /* 08980C 800F035C 18400044 */ blez $v0, .L800F0470 /* 089810 800F0360 A4830000 */ sh $v1, ($a0) /* 089814 800F0364 C60C0084 */ lwc1 $f12, 0x84($s0) /* 089818 800F0368 A4800000 */ sh $zero, ($a0) /* 08981C 800F036C 0C00A6C9 */ jal clamp_angle /* 089820 800F0370 46006307 */ neg.s $f12, $f12 /* 089824 800F0374 3C0140C9 */ lui $at, 0x40c9 /* 089828 800F0378 34210FD0 */ ori $at, $at, 0xfd0 /* 08982C 800F037C 44811000 */ mtc1 $at, $f2 /* 089830 800F0380 00000000 */ nop /* 089834 800F0384 46020002 */ mul.s $f0, $f0, $f2 /* 089838 800F0388 00000000 */ nop /* 08983C 800F038C 27A50018 */ addiu $a1, $sp, 0x18 /* 089840 800F0390 3C0143B4 */ lui $at, 0x43b4 /* 089844 800F0394 44816000 */ mtc1 $at, $f12 /* 089848 800F0398 27A6001C */ addiu $a2, $sp, 0x1c /* 08984C 800F039C 0C00A82D */ jal sin_cos_rad /* 089850 800F03A0 460C0303 */ div.s $f12, $f0, $f12 /* 089854 800F03A4 860200B2 */ lh $v0, 0xb2($s0) /* 089858 800F03A8 C7A20018 */ lwc1 $f2, 0x18($sp) /* 08985C 800F03AC 44822000 */ mtc1 $v0, $f4 /* 089860 800F03B0 00000000 */ nop /* 089864 800F03B4 46802120 */ cvt.s.w $f4, $f4 /* 089868 800F03B8 46022082 */ mul.s $f2, $f4, $f2 /* 08986C 800F03BC 00000000 */ nop /* 089870 800F03C0 C7A0001C */ lwc1 $f0, 0x1c($sp) /* 089874 800F03C4 46002102 */ mul.s $f4, $f4, $f0 /* 089878 800F03C8 00000000 */ nop /* 08987C 800F03CC 3C01BECC */ lui $at, 0xbecc /* 089880 800F03D0 3421CCCD */ ori $at, $at, 0xcccd /* 089884 800F03D4 44810000 */ mtc1 $at, $f0 /* 089888 800F03D8 00000000 */ nop /* 08988C 800F03DC 46001082 */ mul.s $f2, $f2, $f0 /* 089890 800F03E0 00000000 */ nop /* 089894 800F03E4 46002102 */ mul.s $f4, $f4, $f0 /* 089898 800F03E8 00000000 */ nop /* 08989C 800F03EC C6000028 */ lwc1 $f0, 0x28($s0) /* 0898A0 800F03F0 46020600 */ add.s $f24, $f0, $f2 /* 0898A4 800F03F4 C6000030 */ lwc1 $f0, 0x30($s0) /* 0898A8 800F03F8 C602002C */ lwc1 $f2, 0x2c($s0) /* 0898AC 800F03FC 46040580 */ add.s $f22, $f0, $f4 /* 0898B0 800F0400 3C014178 */ lui $at, 0x4178 /* 0898B4 800F0404 44810000 */ mtc1 $at, $f0 /* 0898B8 800F0408 2404000A */ addiu $a0, $zero, 0xa /* 0898BC 800F040C 0C00A67F */ jal rand_int /* 0898C0 800F0410 46001500 */ add.s $f20, $f2, $f0 /* 0898C4 800F0414 0000202D */ daddu $a0, $zero, $zero /* 0898C8 800F0418 44821000 */ mtc1 $v0, $f2 /* 0898CC 800F041C 00000000 */ nop /* 0898D0 800F0420 468010A0 */ cvt.s.w $f2, $f2 /* 0898D4 800F0424 C6000084 */ lwc1 $f0, 0x84($s0) /* 0898D8 800F0428 3C108011 */ lui $s0, 0x8011 /* 0898DC 800F042C 26109494 */ addiu $s0, $s0, -0x6b6c /* 0898E0 800F0430 4405C000 */ mfc1 $a1, $f24 /* 0898E4 800F0434 4407B000 */ mfc1 $a3, $f22 /* 0898E8 800F0438 46000007 */ neg.s $f0, $f0 /* 0898EC 800F043C 46020000 */ add.s $f0, $f0, $f2 /* 0898F0 800F0440 3C0140A0 */ lui $at, 0x40a0 /* 0898F4 800F0444 44811000 */ mtc1 $at, $f2 /* 0898F8 800F0448 4406A000 */ mfc1 $a2, $f20 /* 0898FC 800F044C 46020001 */ sub.s $f0, $f0, $f2 /* 089900 800F0450 C6020000 */ lwc1 $f2, ($s0) /* 089904 800F0454 468010A0 */ cvt.s.w $f2, $f2 /* 089908 800F0458 E7A20014 */ swc1 $f2, 0x14($sp) /* 08990C 800F045C 0C01BEFC */ jal func_8006FBF0 /* 089910 800F0460 E7A00010 */ swc1 $f0, 0x10($sp) /* 089914 800F0464 8E020000 */ lw $v0, ($s0) /* 089918 800F0468 2C420001 */ sltiu $v0, $v0, 1 /* 08991C 800F046C AE020000 */ sw $v0, ($s0) .L800F0470: /* 089920 800F0470 8FBF0028 */ lw $ra, 0x28($sp) /* 089924 800F0474 8FB10024 */ lw $s1, 0x24($sp) /* 089928 800F0478 8FB00020 */ lw $s0, 0x20($sp) /* 08992C 800F047C D7B80040 */ ldc1 $f24, 0x40($sp) /* 089930 800F0480 D7B60038 */ ldc1 $f22, 0x38($sp) /* 089934 800F0484 D7B40030 */ ldc1 $f20, 0x30($sp) /* 089938 800F0488 03E00008 */ jr $ra /* 08993C 800F048C 27BD0048 */ addiu $sp, $sp, 0x48