.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel func_800490B4 /* 244B4 800490B4 27BDFFA0 */ addiu $sp, $sp, -0x60 /* 244B8 800490B8 F7B60050 */ sdc1 $f22, 0x50($sp) /* 244BC 800490BC 4486B000 */ mtc1 $a2, $f22 /* 244C0 800490C0 F7B80058 */ sdc1 $f24, 0x58($sp) /* 244C4 800490C4 4487C000 */ mtc1 $a3, $f24 /* 244C8 800490C8 AFB10034 */ sw $s1, 0x34($sp) /* 244CC 800490CC 0080882D */ daddu $s1, $a0, $zero /* 244D0 800490D0 AFB3003C */ sw $s3, 0x3c($sp) /* 244D4 800490D4 00A0982D */ daddu $s3, $a1, $zero /* 244D8 800490D8 AFBF0044 */ sw $ra, 0x44($sp) /* 244DC 800490DC AFB40040 */ sw $s4, 0x40($sp) /* 244E0 800490E0 AFB20038 */ sw $s2, 0x38($sp) /* 244E4 800490E4 AFB00030 */ sw $s0, 0x30($sp) /* 244E8 800490E8 F7B40048 */ sdc1 $f20, 0x48($sp) /* 244EC 800490EC 86640008 */ lh $a0, 8($s3) /* 244F0 800490F0 0C00EABB */ jal get_npc_unsafe /* 244F4 800490F4 93B40073 */ lbu $s4, 0x73($sp) /* 244F8 800490F8 0040802D */ daddu $s0, $v0, $zero /* 244FC 800490FC 8E6200B0 */ lw $v0, 0xb0($s3) /* 24500 80049100 3C128011 */ lui $s2, %hi(gPlayerStatus) /* 24504 80049104 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus) /* 24508 80049108 30420002 */ andi $v0, $v0, 2 /* 2450C 8004910C 144000AC */ bnez $v0, .L800493C0 /* 24510 80049110 0000102D */ daddu $v0, $zero, $zero /* 24514 80049114 3C048011 */ lui $a0, %hi(D_8010EBB0) /* 24518 80049118 2484EBB0 */ addiu $a0, $a0, %lo(D_8010EBB0) /* 2451C 8004911C 80830003 */ lb $v1, 3($a0) /* 24520 80049120 24020009 */ addiu $v0, $zero, 9 /* 24524 80049124 14620008 */ bne $v1, $v0, .L80049148 /* 24528 80049128 24020007 */ addiu $v0, $zero, 7 /* 2452C 8004912C 80820000 */ lb $v0, ($a0) /* 24530 80049130 10400005 */ beqz $v0, .L80049148 /* 24534 80049134 24020007 */ addiu $v0, $zero, 7 /* 24538 80049138 9622001C */ lhu $v0, 0x1c($s1) /* 2453C 8004913C 30420001 */ andi $v0, $v0, 1 /* 24540 80049140 1040009E */ beqz $v0, .L800493BC /* 24544 80049144 24020007 */ addiu $v0, $zero, 7 .L80049148: /* 24548 80049148 14620008 */ bne $v1, $v0, .L8004916C /* 2454C 8004914C 00000000 */ nop /* 24550 80049150 80820000 */ lb $v0, ($a0) /* 24554 80049154 10400005 */ beqz $v0, .L8004916C /* 24558 80049158 00000000 */ nop /* 2455C 8004915C 9622001C */ lhu $v0, 0x1c($s1) /* 24560 80049160 30420001 */ andi $v0, $v0, 1 /* 24564 80049164 10400096 */ beqz $v0, .L800493C0 /* 24568 80049168 0000102D */ daddu $v0, $zero, $zero .L8004916C: /* 2456C 8004916C 8E220000 */ lw $v0, ($s1) /* 24570 80049170 04400093 */ bltz $v0, .L800493C0 /* 24574 80049174 0000102D */ daddu $v0, $zero, $zero /* 24578 80049178 C600003C */ lwc1 $f0, 0x3c($s0) /* 2457C 8004917C C642002C */ lwc1 $f2, 0x2c($s2) /* 24580 80049180 46020001 */ sub.s $f0, $f0, $f2 /* 24584 80049184 C6220018 */ lwc1 $f2, 0x18($s1) /* 24588 80049188 46000005 */ abs.s $f0, $f0 /* 2458C 8004918C 4600103E */ c.le.s $f2, $f0 /* 24590 80049190 00000000 */ nop /* 24594 80049194 45000005 */ bc1f .L800491AC /* 24598 80049198 00000000 */ nop /* 2459C 8004919C 9622001C */ lhu $v0, 0x1c($s1) /* 245A0 800491A0 30420002 */ andi $v0, $v0, 2 /* 245A4 800491A4 10400086 */ beqz $v0, .L800493C0 /* 245A8 800491A8 0000102D */ daddu $v0, $zero, $zero .L800491AC: /* 245AC 800491AC 8E220010 */ lw $v0, 0x10($s1) /* 245B0 800491B0 8E230014 */ lw $v1, 0x14($s1) /* 245B4 800491B4 00431025 */ or $v0, $v0, $v1 /* 245B8 800491B8 10400014 */ beqz $v0, .L8004920C /* 245BC 800491BC 00000000 */ nop /* 245C0 800491C0 C6200008 */ lwc1 $f0, 8($s1) /* 245C4 800491C4 46800020 */ cvt.s.w $f0, $f0 /* 245C8 800491C8 44050000 */ mfc1 $a1, $f0 /* 245CC 800491CC C620000C */ lwc1 $f0, 0xc($s1) /* 245D0 800491D0 46800020 */ cvt.s.w $f0, $f0 /* 245D4 800491D4 44060000 */ mfc1 $a2, $f0 /* 245D8 800491D8 C6400030 */ lwc1 $f0, 0x30($s2) /* 245DC 800491DC 8E470028 */ lw $a3, 0x28($s2) /* 245E0 800491E0 E7A00010 */ swc1 $f0, 0x10($sp) /* 245E4 800491E4 C6200010 */ lwc1 $f0, 0x10($s1) /* 245E8 800491E8 46800020 */ cvt.s.w $f0, $f0 /* 245EC 800491EC E7A00014 */ swc1 $f0, 0x14($sp) /* 245F0 800491F0 C6200014 */ lwc1 $f0, 0x14($s1) /* 245F4 800491F4 46800020 */ cvt.s.w $f0, $f0 /* 245F8 800491F8 E7A00018 */ swc1 $f0, 0x18($sp) /* 245FC 800491FC 0C0123F5 */ jal is_point_within_region /* 24600 80049200 8E240004 */ lw $a0, 4($s1) /* 24604 80049204 1440006E */ bnez $v0, .L800493C0 /* 24608 80049208 0000102D */ daddu $v0, $zero, $zero .L8004920C: /* 2460C 8004920C 824300B4 */ lb $v1, 0xb4($s2) /* 24610 80049210 2402001D */ addiu $v0, $zero, 0x1d /* 24614 80049214 1062006A */ beq $v1, $v0, .L800493C0 /* 24618 80049218 0000102D */ daddu $v0, $zero, $zero /* 2461C 8004921C 926200AC */ lbu $v0, 0xac($s3) /* 24620 80049220 30420001 */ andi $v0, $v0, 1 /* 24624 80049224 1040002C */ beqz $v0, .L800492D8 /* 24628 80049228 00000000 */ nop /* 2462C 8004922C C60C0038 */ lwc1 $f12, 0x38($s0) /* 24630 80049230 860200A8 */ lh $v0, 0xa8($s0) /* 24634 80049234 3C013FE0 */ lui $at, 0x3fe0 /* 24638 80049238 44810800 */ mtc1 $at, $f1 /* 2463C 8004923C 44800000 */ mtc1 $zero, $f0 /* 24640 80049240 44821000 */ mtc1 $v0, $f2 /* 24644 80049244 00000000 */ nop /* 24648 80049248 468010A1 */ cvt.d.w $f2, $f2 /* 2464C 8004924C 46201082 */ mul.d $f2, $f2, $f0 /* 24650 80049250 00000000 */ nop /* 24654 80049254 C60E0040 */ lwc1 $f14, 0x40($s0) /* 24658 80049258 8E460028 */ lw $a2, 0x28($s2) /* 2465C 8004925C 8E470030 */ lw $a3, 0x30($s2) /* 24660 80049260 46006106 */ mov.s $f4, $f12 /* 24664 80049264 C600003C */ lwc1 $f0, 0x3c($s0) /* 24668 80049268 46007186 */ mov.s $f6, $f14 /* 2466C 8004926C 46000021 */ cvt.d.s $f0, $f0 /* 24670 80049270 46220000 */ add.d $f0, $f0, $f2 /* 24674 80049274 E7A40020 */ swc1 $f4, 0x20($sp) /* 24678 80049278 E7A60028 */ swc1 $f6, 0x28($sp) /* 2467C 8004927C 46200020 */ cvt.s.d $f0, $f0 /* 24680 80049280 0C00A7B5 */ jal dist2D /* 24684 80049284 E7A00024 */ swc1 $f0, 0x24($sp) /* 24688 80049288 C60C0038 */ lwc1 $f12, 0x38($s0) /* 2468C 8004928C C60E0040 */ lwc1 $f14, 0x40($s0) /* 24690 80049290 8E460028 */ lw $a2, 0x28($s2) /* 24694 80049294 8E470030 */ lw $a3, 0x30($s2) /* 24698 80049298 0C00A720 */ jal atan2 /* 2469C 8004929C 46000506 */ mov.s $f20, $f0 /* 246A0 800492A0 3C040005 */ lui $a0, 5 /* 246A4 800492A4 27A50020 */ addiu $a1, $sp, 0x20 /* 246A8 800492A8 27A60024 */ addiu $a2, $sp, 0x24 /* 246AC 800492AC 3C013DCC */ lui $at, 0x3dcc /* 246B0 800492B0 3421CCCD */ ori $at, $at, 0xcccd /* 246B4 800492B4 44811000 */ mtc1 $at, $f2 /* 246B8 800492B8 27A70028 */ addiu $a3, $sp, 0x28 /* 246BC 800492BC E7B40010 */ swc1 $f20, 0x10($sp) /* 246C0 800492C0 E7A00014 */ swc1 $f0, 0x14($sp) /* 246C4 800492C4 E7A20018 */ swc1 $f2, 0x18($sp) /* 246C8 800492C8 0C037711 */ jal func_800DDC44 /* 246CC 800492CC E7A2001C */ swc1 $f2, 0x1c($sp) /* 246D0 800492D0 1440003B */ bnez $v0, .L800493C0 /* 246D4 800492D4 0000102D */ daddu $v0, $zero, $zero .L800492D8: /* 246D8 800492D8 8E220000 */ lw $v0, ($s1) /* 246DC 800492DC 14400003 */ bnez $v0, .L800492EC /* 246E0 800492E0 00000000 */ nop /* 246E4 800492E4 080124BD */ j .L800492F4 /* 246E8 800492E8 0000102D */ daddu $v0, $zero, $zero .L800492EC: /* 246EC 800492EC 0C00A67F */ jal rand_int /* 246F0 800492F0 24440001 */ addiu $a0, $v0, 1 .L800492F4: /* 246F4 800492F4 14400032 */ bnez $v0, .L800493C0 /* 246F8 800492F8 0000102D */ daddu $v0, $zero, $zero /* 246FC 800492FC 926200AC */ lbu $v0, 0xac($s3) /* 24700 80049300 30420002 */ andi $v0, $v0, 2 /* 24704 80049304 10400010 */ beqz $v0, .L80049348 /* 24708 80049308 24020001 */ addiu $v0, $zero, 1 /* 2470C 8004930C 824300B4 */ lb $v1, 0xb4($s2) /* 24710 80049310 14620005 */ bne $v1, $v0, .L80049328 /* 24714 80049314 24020002 */ addiu $v0, $zero, 2 /* 24718 80049318 3C01800A */ lui $at, 0x800a /* 2471C 8004931C D4228710 */ ldc1 $f2, -0x78f0($at) /* 24720 80049320 080124CF */ j .L8004933C /* 24724 80049324 4600B021 */ cvt.d.s $f0, $f22 .L80049328: /* 24728 80049328 14620007 */ bne $v1, $v0, .L80049348 /* 2472C 8004932C 00000000 */ nop /* 24730 80049330 3C01800A */ lui $at, 0x800a /* 24734 80049334 D4228718 */ ldc1 $f2, -0x78e8($at) /* 24738 80049338 4600B021 */ cvt.d.s $f0, $f22 .L8004933C: /* 2473C 8004933C 46220002 */ mul.d $f0, $f0, $f2 /* 24740 80049340 00000000 */ nop /* 24744 80049344 462005A0 */ cvt.s.d $f22, $f0 .L80049348: /* 24748 80049348 C6000038 */ lwc1 $f0, 0x38($s0) /* 2474C 8004934C C6020040 */ lwc1 $f2, 0x40($s0) /* 24750 80049350 328200FF */ andi $v0, $s4, 0xff /* 24754 80049354 E7A00020 */ swc1 $f0, 0x20($sp) /* 24758 80049358 10400005 */ beqz $v0, .L80049370 /* 2475C 8004935C E7A20028 */ swc1 $f2, 0x28($sp) /* 24760 80049360 4406C000 */ mfc1 $a2, $f24 /* 24764 80049364 8E07000C */ lw $a3, 0xc($s0) /* 24768 80049368 080124E4 */ j .L80049390 /* 2476C 8004936C 27A40020 */ addiu $a0, $sp, 0x20 .L80049370: /* 24770 80049370 C6020034 */ lwc1 $f2, 0x34($s0) /* 24774 80049374 3C014387 */ lui $at, 0x4387 /* 24778 80049378 44810000 */ mtc1 $at, $f0 /* 2477C 8004937C 00000000 */ nop /* 24780 80049380 46020001 */ sub.s $f0, $f0, $f2 /* 24784 80049384 27A40020 */ addiu $a0, $sp, 0x20 /* 24788 80049388 4406C000 */ mfc1 $a2, $f24 /* 2478C 8004938C 44070000 */ mfc1 $a3, $f0 .L80049390: /* 24790 80049390 0C00A7E7 */ jal add_vec2D_polar /* 24794 80049394 27A50028 */ addiu $a1, $sp, 0x28 /* 24798 80049398 C7AC0020 */ lwc1 $f12, 0x20($sp) /* 2479C 8004939C C7AE0028 */ lwc1 $f14, 0x28($sp) /* 247A0 800493A0 8E460028 */ lw $a2, 0x28($s2) /* 247A4 800493A4 0C00A7B5 */ jal dist2D /* 247A8 800493A8 8E470030 */ lw $a3, 0x30($s2) /* 247AC 800493AC 4616003E */ c.le.s $f0, $f22 /* 247B0 800493B0 00000000 */ nop /* 247B4 800493B4 45010002 */ bc1t .L800493C0 /* 247B8 800493B8 24020001 */ addiu $v0, $zero, 1 .L800493BC: /* 247BC 800493BC 0000102D */ daddu $v0, $zero, $zero .L800493C0: /* 247C0 800493C0 8FBF0044 */ lw $ra, 0x44($sp) /* 247C4 800493C4 8FB40040 */ lw $s4, 0x40($sp) /* 247C8 800493C8 8FB3003C */ lw $s3, 0x3c($sp) /* 247CC 800493CC 8FB20038 */ lw $s2, 0x38($sp) /* 247D0 800493D0 8FB10034 */ lw $s1, 0x34($sp) /* 247D4 800493D4 8FB00030 */ lw $s0, 0x30($sp) /* 247D8 800493D8 D7B80058 */ ldc1 $f24, 0x58($sp) /* 247DC 800493DC D7B60050 */ ldc1 $f22, 0x50($sp) /* 247E0 800493E0 D7B40048 */ ldc1 $f20, 0x48($sp) /* 247E4 800493E4 03E00008 */ jr $ra /* 247E8 800493E8 27BD0060 */ addiu $sp, $sp, 0x60