### RAW ASSEMBLY INSTRUCTIONS:

glabel MerleeUpdateFX
/* 1A4C4 8003F0C4 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 1A4C8 8003F0C8 AFB20020 */  sw        $s2, 0x20($sp)
/* 1A4CC 8003F0CC 0080902D */  daddu     $s2, $a0, $zero
/* 1A4D0 8003F0D0 AFB00018 */  sw        $s0, 0x18($sp)
/* 1A4D4 8003F0D4 00A0802D */  daddu     $s0, $a1, $zero
/* 1A4D8 8003F0D8 2404FFF6 */  addiu     $a0, $zero, -0xA
/* 1A4DC 8003F0DC AFBF0024 */  sw        $ra, 0x24($sp)
/* 1A4E0 8003F0E0 0C00EABB */  jal       get_npc_unsafe
/* 1A4E4 8003F0E4 AFB1001C */   sw       $s1, 0x1C($sp)
/* 1A4E8 8003F0E8 12000024 */  beqz      $s0, .L8003F17C
/* 1A4EC 8003F0EC 0040882D */   daddu    $s1, $v0, $zero
/* 1A4F0 8003F0F0 AE400074 */  sw        $zero, 0x74($s2)
/* 1A4F4 8003F0F4 C622003C */  lwc1      $f2, 0x3C($s1)
/* 1A4F8 8003F0F8 3C013ECC */  lui       $at, (0x3ECCCCCD >> 16)
/* 1A4FC 8003F0FC 3421CCCD */  ori       $at, $at, (0x3ECCCCCD & 0xFFFF)
/* 1A500 8003F100 44810000 */  mtc1      $at, $f0
/* 1A504 8003F104 AFA00014 */  sw        $zero, 0x14($sp)
/* 1A508 8003F108 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A50C 8003F10C 8E250038 */  lw        $a1, 0x38($s1)
/* 1A510 8003F110 8E26003C */  lw        $a2, 0x3C($s1)
/* 1A514 8003F114 8E270040 */  lw        $a3, 0x40($s1)
/* 1A518 8003F118 3C01800A */  lui       $at, %hi(D_800A0BA4)
/* 1A51C 8003F11C E4220BA4 */  swc1      $f2, %lo(D_800A0BA4)($at)
/* 1A520 8003F120 0C01C5D4 */  jal       fx_energy_orb_wave
/* 1A524 8003F124 0000202D */   daddu    $a0, $zero, $zero
/* 1A528 8003F128 3C013727 */  lui       $at, (0x3727C5AC >> 16)
/* 1A52C 8003F12C 3421C5AC */  ori       $at, $at, (0x3727C5AC & 0xFFFF)
/* 1A530 8003F130 44810000 */  mtc1      $at, $f0
/* 1A534 8003F134 AFA00014 */  sw        $zero, 0x14($sp)
/* 1A538 8003F138 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A53C 8003F13C 8E250038 */  lw        $a1, 0x38($s1)
/* 1A540 8003F140 8E26003C */  lw        $a2, 0x3C($s1)
/* 1A544 8003F144 8E270040 */  lw        $a3, 0x40($s1)
/* 1A548 8003F148 3C01800A */  lui       $at, %hi(WorldMerleeOrbEffect)
/* 1A54C 8003F14C AC220BA8 */  sw        $v0, %lo(WorldMerleeOrbEffect)($at)
/* 1A550 8003F150 0C01C5D4 */  jal       fx_energy_orb_wave
/* 1A554 8003F154 24040003 */   addiu    $a0, $zero, 0x3
/* 1A558 8003F158 3C01800A */  lui       $at, %hi(WorldMerleeWaveEffect)
/* 1A55C 8003F15C AC220BAC */  sw        $v0, %lo(WorldMerleeWaveEffect)($at)
/* 1A560 8003F160 2402000C */  addiu     $v0, $zero, 0xC
/* 1A564 8003F164 3C01800A */  lui       $at, %hi(D_800A0BB8)
/* 1A568 8003F168 A4200BB8 */  sh        $zero, %lo(D_800A0BB8)($at)
/* 1A56C 8003F16C 3C01800A */  lui       $at, %hi(D_800A0BA0)
/* 1A570 8003F170 AC220BA0 */  sw        $v0, %lo(D_800A0BA0)($at)
/* 1A574 8003F174 0C05272D */  jal       sfx_play_sound
/* 1A578 8003F178 24042074 */   addiu    $a0, $zero, 0x2074
.L8003F17C:
/* 1A57C 8003F17C 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1A580 8003F180 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1A584 8003F184 44810000 */  mtc1      $at, $f0
/* 1A588 8003F188 C64C0074 */  lwc1      $f12, 0x74($s2)
/* 1A58C 8003F18C 46806320 */  cvt.s.w   $f12, $f12
/* 1A590 8003F190 46006302 */  mul.s     $f12, $f12, $f0
/* 1A594 8003F194 00000000 */  nop
/* 1A598 8003F198 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1A59C 8003F19C 44810000 */  mtc1      $at, $f0
/* 1A5A0 8003F1A0 0C00A85B */  jal       sin_rad
/* 1A5A4 8003F1A4 46006303 */   div.s    $f12, $f12, $f0
/* 1A5A8 8003F1A8 3C014040 */  lui       $at, (0x40400000 >> 16)
/* 1A5AC 8003F1AC 44811000 */  mtc1      $at, $f2
/* 1A5B0 8003F1B0 00000000 */  nop
/* 1A5B4 8003F1B4 46020002 */  mul.s     $f0, $f0, $f2
/* 1A5B8 8003F1B8 00000000 */  nop
/* 1A5BC 8003F1BC 3C01800A */  lui       $at, %hi(D_800A0BA4)
/* 1A5C0 8003F1C0 C4220BA4 */  lwc1      $f2, %lo(D_800A0BA4)($at)
/* 1A5C4 8003F1C4 46001080 */  add.s     $f2, $f2, $f0
/* 1A5C8 8003F1C8 E622003C */  swc1      $f2, 0x3C($s1)
/* 1A5CC 8003F1CC 8E420074 */  lw        $v0, 0x74($s2)
/* 1A5D0 8003F1D0 2442000A */  addiu     $v0, $v0, 0xA
/* 1A5D4 8003F1D4 44826000 */  mtc1      $v0, $f12
/* 1A5D8 8003F1D8 00000000 */  nop
/* 1A5DC 8003F1DC 46806320 */  cvt.s.w   $f12, $f12
/* 1A5E0 8003F1E0 0C00A6C9 */  jal       clamp_angle
/* 1A5E4 8003F1E4 AE420074 */   sw       $v0, 0x74($s2)
/* 1A5E8 8003F1E8 4600018D */  trunc.w.s $f6, $f0
/* 1A5EC 8003F1EC E6460074 */  swc1      $f6, 0x74($s2)
/* 1A5F0 8003F1F0 3C05800A */  lui       $a1, %hi(WorldMerleeOrbEffect)
/* 1A5F4 8003F1F4 8CA50BA8 */  lw        $a1, %lo(WorldMerleeOrbEffect)($a1)
/* 1A5F8 8003F1F8 C6200038 */  lwc1      $f0, 0x38($s1)
/* 1A5FC 8003F1FC 3C014180 */  lui       $at, (0x41800000 >> 16)
/* 1A600 8003F200 44811000 */  mtc1      $at, $f2
/* 1A604 8003F204 8CA2000C */  lw        $v0, 0xC($a1)
/* 1A608 8003F208 E4400004 */  swc1      $f0, 0x4($v0)
/* 1A60C 8003F20C C620003C */  lwc1      $f0, 0x3C($s1)
/* 1A610 8003F210 46020000 */  add.s     $f0, $f0, $f2
/* 1A614 8003F214 3C08800A */  lui       $t0, %hi(WorldMerleeWaveEffect)
/* 1A618 8003F218 25080BAC */  addiu     $t0, $t0, %lo(WorldMerleeWaveEffect)
/* 1A61C 8003F21C E4400008 */  swc1      $f0, 0x8($v0)
/* 1A620 8003F220 C6200040 */  lwc1      $f0, 0x40($s1)
/* 1A624 8003F224 8D040000 */  lw        $a0, 0x0($t0)
/* 1A628 8003F228 E440000C */  swc1      $f0, 0xC($v0)
/* 1A62C 8003F22C 8C82000C */  lw        $v0, 0xC($a0)
/* 1A630 8003F230 C6200038 */  lwc1      $f0, 0x38($s1)
/* 1A634 8003F234 E4400004 */  swc1      $f0, 0x4($v0)
/* 1A638 8003F238 C620003C */  lwc1      $f0, 0x3C($s1)
/* 1A63C 8003F23C 46020000 */  add.s     $f0, $f0, $f2
/* 1A640 8003F240 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 1A644 8003F244 44811000 */  mtc1      $at, $f2
/* 1A648 8003F248 E4400008 */  swc1      $f0, 0x8($v0)
/* 1A64C 8003F24C C6200040 */  lwc1      $f0, 0x40($s1)
/* 1A650 8003F250 46020000 */  add.s     $f0, $f0, $f2
/* 1A654 8003F254 3C07800A */  lui       $a3, %hi(D_800A0BB8)
/* 1A658 8003F258 24E70BB8 */  addiu     $a3, $a3, %lo(D_800A0BB8)
/* 1A65C 8003F25C E440000C */  swc1      $f0, 0xC($v0)
/* 1A660 8003F260 84E30000 */  lh        $v1, 0x0($a3)
/* 1A664 8003F264 24060002 */  addiu     $a2, $zero, 0x2
/* 1A668 8003F268 14660011 */  bne       $v1, $a2, .L8003F2B0
/* 1A66C 8003F26C 24020001 */   addiu    $v0, $zero, 0x1
/* 1A670 8003F270 8CA2000C */  lw        $v0, 0xC($a1)
/* 1A674 8003F274 3C013727 */  lui       $at, (0x3727C5AC >> 16)
/* 1A678 8003F278 3421C5AC */  ori       $at, $at, (0x3727C5AC & 0xFFFF)
/* 1A67C 8003F27C 44810000 */  mtc1      $at, $f0
/* 1A680 8003F280 00000000 */  nop
/* 1A684 8003F284 E4400030 */  swc1      $f0, 0x30($v0)
/* 1A688 8003F288 8C82000C */  lw        $v0, 0xC($a0)
/* 1A68C 8003F28C E4400030 */  swc1      $f0, 0x30($v0)
/* 1A690 8003F290 8CA20000 */  lw        $v0, 0x0($a1)
/* 1A694 8003F294 34420010 */  ori       $v0, $v0, 0x10
/* 1A698 8003F298 ACA20000 */  sw        $v0, 0x0($a1)
/* 1A69C 8003F29C 8C830000 */  lw        $v1, 0x0($a0)
/* 1A6A0 8003F2A0 24020001 */  addiu     $v0, $zero, 0x1
/* 1A6A4 8003F2A4 34630010 */  ori       $v1, $v1, 0x10
/* 1A6A8 8003F2A8 0800FCDB */  j         .L8003F36C
/* 1A6AC 8003F2AC AC830000 */   sw       $v1, 0x0($a0)
.L8003F2B0:
/* 1A6B0 8003F2B0 1462002E */  bne       $v1, $v0, .L8003F36C
/* 1A6B4 8003F2B4 0000102D */   daddu    $v0, $zero, $zero
/* 1A6B8 8003F2B8 8CA2000C */  lw        $v0, 0xC($a1)
/* 1A6BC 8003F2BC C4400030 */  lwc1      $f0, 0x30($v0)
/* 1A6C0 8003F2C0 3C01800A */  lui       $at, %hi(D_800985F0)
/* 1A6C4 8003F2C4 D42285F0 */  ldc1      $f2, %lo(D_800985F0)($at)
/* 1A6C8 8003F2C8 46000021 */  cvt.d.s   $f0, $f0
/* 1A6CC 8003F2CC 46220000 */  add.d     $f0, $f0, $f2
/* 1A6D0 8003F2D0 3C01400C */  lui       $at, (0x400C0000 >> 16)
/* 1A6D4 8003F2D4 44812800 */  mtc1      $at, $f5
/* 1A6D8 8003F2D8 44802000 */  mtc1      $zero, $f4
/* 1A6DC 8003F2DC 46200020 */  cvt.s.d   $f0, $f0
/* 1A6E0 8003F2E0 460000A1 */  cvt.d.s   $f2, $f0
/* 1A6E4 8003F2E4 4622203C */  c.lt.d    $f4, $f2
/* 1A6E8 8003F2E8 00000000 */  nop
/* 1A6EC 8003F2EC 45000005 */  bc1f      .L8003F304
/* 1A6F0 8003F2F0 E4400030 */   swc1     $f0, 0x30($v0)
/* 1A6F4 8003F2F4 3C014060 */  lui       $at, (0x40600000 >> 16)
/* 1A6F8 8003F2F8 44810000 */  mtc1      $at, $f0
/* 1A6FC 8003F2FC 00000000 */  nop
/* 1A700 8003F300 E4400030 */  swc1      $f0, 0x30($v0)
.L8003F304:
/* 1A704 8003F304 3C03800A */  lui       $v1, %hi(D_800A0BA0)
/* 1A708 8003F308 24630BA0 */  addiu     $v1, $v1, %lo(D_800A0BA0)
/* 1A70C 8003F30C 8C620000 */  lw        $v0, 0x0($v1)
/* 1A710 8003F310 10400003 */  beqz      $v0, .L8003F320
/* 1A714 8003F314 2442FFFF */   addiu    $v0, $v0, -0x1
/* 1A718 8003F318 0800FCDA */  j         .L8003F368
/* 1A71C 8003F31C AC620000 */   sw       $v0, 0x0($v1)
.L8003F320:
/* 1A720 8003F320 8D020000 */  lw        $v0, 0x0($t0)
/* 1A724 8003F324 8C42000C */  lw        $v0, 0xC($v0)
/* 1A728 8003F328 C4400030 */  lwc1      $f0, 0x30($v0)
/* 1A72C 8003F32C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 1A730 8003F330 44811800 */  mtc1      $at, $f3
/* 1A734 8003F334 44801000 */  mtc1      $zero, $f2
/* 1A738 8003F338 46000021 */  cvt.d.s   $f0, $f0
/* 1A73C 8003F33C 46220000 */  add.d     $f0, $f0, $f2
/* 1A740 8003F340 3C014014 */  lui       $at, (0x40140000 >> 16)
/* 1A744 8003F344 44812800 */  mtc1      $at, $f5
/* 1A748 8003F348 44802000 */  mtc1      $zero, $f4
/* 1A74C 8003F34C 46200020 */  cvt.s.d   $f0, $f0
/* 1A750 8003F350 460000A1 */  cvt.d.s   $f2, $f0
/* 1A754 8003F354 4622203C */  c.lt.d    $f4, $f2
/* 1A758 8003F358 00000000 */  nop
/* 1A75C 8003F35C 45000002 */  bc1f      .L8003F368
/* 1A760 8003F360 E4400030 */   swc1     $f0, 0x30($v0)
/* 1A764 8003F364 A4E60000 */  sh        $a2, 0x0($a3)
.L8003F368:
/* 1A768 8003F368 0000102D */  daddu     $v0, $zero, $zero
.L8003F36C:
/* 1A76C 8003F36C 8FBF0024 */  lw        $ra, 0x24($sp)
/* 1A770 8003F370 8FB20020 */  lw        $s2, 0x20($sp)
/* 1A774 8003F374 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1A778 8003F378 8FB00018 */  lw        $s0, 0x18($sp)
/* 1A77C 8003F37C 03E00008 */  jr        $ra
/* 1A780 8003F380 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus MerleeUpdateFX(Evt* script, s32 isInitialCall) {
    Npc* merlee = get_npc_unsafe(NPC_BTL_MERLEE);
    EnergyOrbWaveFXData* effectData;

    if (isInitialCall) {
        script->functionTemp[1] = 0;
        D_800A0BA4 = merlee->pos.y;
        WorldMerleeOrbEffect = fx_energy_orb_wave(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0);
        WorldMerleeWaveEffect = fx_energy_orb_wave(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0);
        D_800A0BB8 = 0;
        D_800A0BA0 = 12;
        sfx_play_sound(SOUND_2074);
    }

    merlee->pos.y = D_800A0BA4 + sin_rad(DEG_TO_RAD(script->functionTemp[1])) * 3.0f;

    script->functionTemp[1] += 10;
    script->functionTemp[1] = clamp_angle(script->functionTemp[1]);

    effectData = WorldMerleeOrbEffect->data.energyOrbWave;
    effectData->pos.x = merlee->pos.x;
    effectData->pos.y = merlee->pos.y + 16.0f;
    effectData->pos.z = merlee->pos.z;

    effectData = WorldMerleeWaveEffect->data.energyOrbWave;
    effectData->pos.x = merlee->pos.x;
    effectData->pos.y = merlee->pos.y + 16.0f;
    effectData->pos.z = merlee->pos.z + 5.0f;

    if (D_800A0BB8 == 2) {
        WorldMerleeOrbEffect->data.energyOrbWave->scale = 0.00001f;
        WorldMerleeWaveEffect->data.energyOrbWave->scale = 0.00001f;
        WorldMerleeOrbEffect->flags |= FX_INSTANCE_FLAG_DISMISS;
        WorldMerleeWaveEffect->flags |= FX_INSTANCE_FLAG_DISMISS;
        return ApiStatus_DONE1;
    }

    if (D_800A0BB8 == 1) {
        effectData = WorldMerleeOrbEffect->data.energyOrbWave;
        effectData->scale += 0.35;
        if (effectData->scale > 3.5) {
            effectData->scale = 3.5f;
        }

        if (D_800A0BA0 != 0) {
            D_800A0BA0--;
        } else {
            effectData = WorldMerleeWaveEffect->data.energyOrbWave;
            effectData->scale += 0.5;
            if (effectData->scale > 5.0) {
                D_800A0BB8 = 2;
            }
        }
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel player_test_move_with_slipping
/* 78910 800DF460 27BDFF48 */  addiu     $sp, $sp, -0xB8
/* 78914 800DF464 AFB40078 */  sw        $s4, 0x78($sp)
/* 78918 800DF468 0080A02D */  daddu     $s4, $a0, $zero
/* 7891C 800DF46C AFB1006C */  sw        $s1, 0x6C($sp)
/* 78920 800DF470 00A0882D */  daddu     $s1, $a1, $zero
/* 78924 800DF474 AFB5007C */  sw        $s5, 0x7C($sp)
/* 78928 800DF478 00C0A82D */  daddu     $s5, $a2, $zero
/* 7892C 800DF47C AFB20070 */  sw        $s2, 0x70($sp)
/* 78930 800DF480 00E0902D */  daddu     $s2, $a3, $zero
/* 78934 800DF484 AFB30074 */  sw        $s3, 0x74($sp)
/* 78938 800DF488 AFBF0080 */  sw        $ra, 0x80($sp)
/* 7893C 800DF48C AFB00068 */  sw        $s0, 0x68($sp)
/* 78940 800DF490 F7BE00B0 */  sdc1      $f30, 0xB0($sp)
/* 78944 800DF494 F7BC00A8 */  sdc1      $f28, 0xA8($sp)
/* 78948 800DF498 F7BA00A0 */  sdc1      $f26, 0xA0($sp)
/* 7894C 800DF49C F7B80098 */  sdc1      $f24, 0x98($sp)
/* 78950 800DF4A0 F7B60090 */  sdc1      $f22, 0x90($sp)
/* 78954 800DF4A4 F7B40088 */  sdc1      $f20, 0x88($sp)
/* 78958 800DF4A8 8E820000 */  lw        $v0, 0x0($s4)
/* 7895C 800DF4AC 4480A000 */  mtc1      $zero, $f20
/* 78960 800DF4B0 C7BC00C8 */  lwc1      $f28, 0xC8($sp)
/* 78964 800DF4B4 30420006 */  andi      $v0, $v0, 0x6
/* 78968 800DF4B8 14400004 */  bnez      $v0, .L800DF4CC
/* 7896C 800DF4BC 2413FFFF */   addiu    $s3, $zero, -0x1
/* 78970 800DF4C0 3C014120 */  lui       $at, (0x412028F6 >> 16)
/* 78974 800DF4C4 342128F6 */  ori       $at, $at, (0x412028F6 & 0xFFFF)
/* 78978 800DF4C8 4481A000 */  mtc1      $at, $f20
.L800DF4CC:
/* 7897C 800DF4CC 27A50038 */  addiu     $a1, $sp, 0x38
/* 78980 800DF4D0 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 78984 800DF4D4 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 78988 800DF4D8 44810000 */  mtc1      $at, $f0
/* 7898C 800DF4DC C7A400CC */  lwc1      $f4, 0xCC($sp)
/* 78990 800DF4E0 27A6003C */  addiu     $a2, $sp, 0x3C
/* 78994 800DF4E4 46002102 */  mul.s     $f4, $f4, $f0
/* 78998 800DF4E8 00000000 */  nop
/* 7899C 800DF4EC 868200B2 */  lh        $v0, 0xB2($s4)
/* 789A0 800DF4F0 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 789A4 800DF4F4 44811000 */  mtc1      $at, $f2
/* 789A8 800DF4F8 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 789AC 800DF4FC 44816000 */  mtc1      $at, $f12
/* 789B0 800DF500 44820000 */  mtc1      $v0, $f0
/* 789B4 800DF504 00000000 */  nop
/* 789B8 800DF508 46800020 */  cvt.s.w   $f0, $f0
/* 789BC 800DF50C 46020782 */  mul.s     $f30, $f0, $f2
/* 789C0 800DF510 00000000 */  nop
/* 789C4 800DF514 0C00A82D */  jal       sin_cos_rad
/* 789C8 800DF518 460C2303 */   div.s    $f12, $f4, $f12
/* 789CC 800DF51C 27A20040 */  addiu     $v0, $sp, 0x40
/* 789D0 800DF520 461EE580 */  add.s     $f22, $f28, $f30
/* 789D4 800DF524 C7A0003C */  lwc1      $f0, 0x3C($sp)
/* 789D8 800DF528 C7A20038 */  lwc1      $f2, 0x38($sp)
/* 789DC 800DF52C 46000007 */  neg.s     $f0, $f0
/* 789E0 800DF530 E7A0003C */  swc1      $f0, 0x3C($sp)
/* 789E4 800DF534 E7B6004C */  swc1      $f22, 0x4C($sp)
/* 789E8 800DF538 C6A40000 */  lwc1      $f4, 0x0($s5)
/* 789EC 800DF53C 4602E682 */  mul.s     $f26, $f28, $f2
/* 789F0 800DF540 00000000 */  nop
/* 789F4 800DF544 AFA2001C */  sw        $v0, 0x1C($sp)
/* 789F8 800DF548 27A20044 */  addiu     $v0, $sp, 0x44
/* 789FC 800DF54C AFA20020 */  sw        $v0, 0x20($sp)
/* 78A00 800DF550 27A20048 */  addiu     $v0, $sp, 0x48
/* 78A04 800DF554 AFA20024 */  sw        $v0, 0x24($sp)
/* 78A08 800DF558 27A2004C */  addiu     $v0, $sp, 0x4C
/* 78A0C 800DF55C AFA20028 */  sw        $v0, 0x28($sp)
/* 78A10 800DF560 27A20050 */  addiu     $v0, $sp, 0x50
/* 78A14 800DF564 AFA2002C */  sw        $v0, 0x2C($sp)
/* 78A18 800DF568 27A20054 */  addiu     $v0, $sp, 0x54
/* 78A1C 800DF56C AFA20030 */  sw        $v0, 0x30($sp)
/* 78A20 800DF570 27A20058 */  addiu     $v0, $sp, 0x58
/* 78A24 800DF574 E7A20010 */  swc1      $f2, 0x10($sp)
/* 78A28 800DF578 AFA00014 */  sw        $zero, 0x14($sp)
/* 78A2C 800DF57C E7A00018 */  swc1      $f0, 0x18($sp)
/* 78A30 800DF580 AFA20034 */  sw        $v0, 0x34($sp)
/* 78A34 800DF584 46142100 */  add.s     $f4, $f4, $f20
/* 78A38 800DF588 8E250000 */  lw        $a1, 0x0($s1)
/* 78A3C 800DF58C 8E470000 */  lw        $a3, 0x0($s2)
/* 78A40 800DF590 44062000 */  mfc1      $a2, $f4
/* 78A44 800DF594 4600E602 */  mul.s     $f24, $f28, $f0
/* 78A48 800DF598 00000000 */  nop
/* 78A4C 800DF59C 0C037B97 */  jal       player_raycast_general
/* 78A50 800DF5A0 0000202D */   daddu    $a0, $zero, $zero
/* 78A54 800DF5A4 0040802D */  daddu     $s0, $v0, $zero
/* 78A58 800DF5A8 06000008 */  bltz      $s0, .L800DF5CC
/* 78A5C 800DF5AC 00000000 */   nop
/* 78A60 800DF5B0 C7A4004C */  lwc1      $f4, 0x4C($sp)
/* 78A64 800DF5B4 4616203E */  c.le.s    $f4, $f22
/* 78A68 800DF5B8 00000000 */  nop
/* 78A6C 800DF5BC 45000003 */  bc1f      .L800DF5CC
/* 78A70 800DF5C0 27A4005C */   addiu    $a0, $sp, 0x5C
/* 78A74 800DF5C4 08037DA1 */  j         .L800DF684
/* 78A78 800DF5C8 46162101 */   sub.s    $f4, $f4, $f22
.L800DF5CC:
/* 78A7C 800DF5CC 868300B0 */  lh        $v1, 0xB0($s4)
/* 78A80 800DF5D0 C6A60000 */  lwc1      $f6, 0x0($s5)
/* 78A84 800DF5D4 C7A00038 */  lwc1      $f0, 0x38($sp)
/* 78A88 800DF5D8 AFA00014 */  sw        $zero, 0x14($sp)
/* 78A8C 800DF5DC E7A00010 */  swc1      $f0, 0x10($sp)
/* 78A90 800DF5E0 C7A4003C */  lwc1      $f4, 0x3C($sp)
/* 78A94 800DF5E4 27A20040 */  addiu     $v0, $sp, 0x40
/* 78A98 800DF5E8 AFA2001C */  sw        $v0, 0x1C($sp)
/* 78A9C 800DF5EC 27A20044 */  addiu     $v0, $sp, 0x44
/* 78AA0 800DF5F0 AFA20020 */  sw        $v0, 0x20($sp)
/* 78AA4 800DF5F4 27A20048 */  addiu     $v0, $sp, 0x48
/* 78AA8 800DF5F8 AFA20024 */  sw        $v0, 0x24($sp)
/* 78AAC 800DF5FC 27A2004C */  addiu     $v0, $sp, 0x4C
/* 78AB0 800DF600 3C013FE8 */  lui       $at, (0x3FE80000 >> 16)
/* 78AB4 800DF604 44810800 */  mtc1      $at, $f1
/* 78AB8 800DF608 44800000 */  mtc1      $zero, $f0
/* 78ABC 800DF60C 44831000 */  mtc1      $v1, $f2
/* 78AC0 800DF610 00000000 */  nop
/* 78AC4 800DF614 468010A1 */  cvt.d.w   $f2, $f2
/* 78AC8 800DF618 AFA20028 */  sw        $v0, 0x28($sp)
/* 78ACC 800DF61C 46201082 */  mul.d     $f2, $f2, $f0
/* 78AD0 800DF620 00000000 */  nop
/* 78AD4 800DF624 27A20050 */  addiu     $v0, $sp, 0x50
/* 78AD8 800DF628 AFA2002C */  sw        $v0, 0x2C($sp)
/* 78ADC 800DF62C 27A20054 */  addiu     $v0, $sp, 0x54
/* 78AE0 800DF630 AFA20030 */  sw        $v0, 0x30($sp)
/* 78AE4 800DF634 27A20058 */  addiu     $v0, $sp, 0x58
/* 78AE8 800DF638 AFA20034 */  sw        $v0, 0x34($sp)
/* 78AEC 800DF63C E7A40018 */  swc1      $f4, 0x18($sp)
/* 78AF0 800DF640 46201520 */  cvt.s.d   $f20, $f2
/* 78AF4 800DF644 46143180 */  add.s     $f6, $f6, $f20
/* 78AF8 800DF648 8E250000 */  lw        $a1, 0x0($s1)
/* 78AFC 800DF64C 8E470000 */  lw        $a3, 0x0($s2)
/* 78B00 800DF650 44063000 */  mfc1      $a2, $f6
/* 78B04 800DF654 0C037B97 */  jal       player_raycast_general
/* 78B08 800DF658 0000202D */   daddu    $a0, $zero, $zero
/* 78B0C 800DF65C 0040802D */  daddu     $s0, $v0, $zero
/* 78B10 800DF660 06000021 */  bltz      $s0, .L800DF6E8
/* 78B14 800DF664 00000000 */   nop
/* 78B18 800DF668 461EE000 */  add.s     $f0, $f28, $f30
/* 78B1C 800DF66C C7A4004C */  lwc1      $f4, 0x4C($sp)
/* 78B20 800DF670 4600203E */  c.le.s    $f4, $f0
/* 78B24 800DF674 00000000 */  nop
/* 78B28 800DF678 4500001B */  bc1f      .L800DF6E8
/* 78B2C 800DF67C 27A4005C */   addiu    $a0, $sp, 0x5C
/* 78B30 800DF680 46002101 */  sub.s     $f4, $f4, $f0
.L800DF684:
/* 78B34 800DF684 4406D000 */  mfc1      $a2, $f26
/* 78B38 800DF688 C7A00038 */  lwc1      $f0, 0x38($sp)
/* 78B3C 800DF68C 4407C000 */  mfc1      $a3, $f24
/* 78B40 800DF690 C7A2003C */  lwc1      $f2, 0x3C($sp)
/* 78B44 800DF694 46002582 */  mul.s     $f22, $f4, $f0
/* 78B48 800DF698 00000000 */  nop
/* 78B4C 800DF69C C7A00050 */  lwc1      $f0, 0x50($sp)
/* 78B50 800DF6A0 27A50060 */  addiu     $a1, $sp, 0x60
/* 78B54 800DF6A4 E7A00010 */  swc1      $f0, 0x10($sp)
/* 78B58 800DF6A8 C7A00058 */  lwc1      $f0, 0x58($sp)
/* 78B5C 800DF6AC 46022502 */  mul.s     $f20, $f4, $f2
/* 78B60 800DF6B0 00000000 */  nop
/* 78B64 800DF6B4 0C037CFF */  jal       player_get_slip_vector
/* 78B68 800DF6B8 E7A00014 */   swc1     $f0, 0x14($sp)
/* 78B6C 800DF6BC C7A2005C */  lwc1      $f2, 0x5C($sp)
/* 78B70 800DF6C0 4602B080 */  add.s     $f2, $f22, $f2
/* 78B74 800DF6C4 C6200000 */  lwc1      $f0, 0x0($s1)
/* 78B78 800DF6C8 46020000 */  add.s     $f0, $f0, $f2
/* 78B7C 800DF6CC E6200000 */  swc1      $f0, 0x0($s1)
/* 78B80 800DF6D0 C7A00060 */  lwc1      $f0, 0x60($sp)
/* 78B84 800DF6D4 4600A000 */  add.s     $f0, $f20, $f0
/* 78B88 800DF6D8 C6420000 */  lwc1      $f2, 0x0($s2)
/* 78B8C 800DF6DC 46001080 */  add.s     $f2, $f2, $f0
/* 78B90 800DF6E0 0200982D */  daddu     $s3, $s0, $zero
/* 78B94 800DF6E4 E6420000 */  swc1      $f2, 0x0($s2)
.L800DF6E8:
/* 78B98 800DF6E8 C6200000 */  lwc1      $f0, 0x0($s1)
/* 78B9C 800DF6EC 461A0000 */  add.s     $f0, $f0, $f26
/* 78BA0 800DF6F0 E6200000 */  swc1      $f0, 0x0($s1)
/* 78BA4 800DF6F4 C6400000 */  lwc1      $f0, 0x0($s2)
/* 78BA8 800DF6F8 46180000 */  add.s     $f0, $f0, $f24
/* 78BAC 800DF6FC 0260102D */  daddu     $v0, $s3, $zero
/* 78BB0 800DF700 E6400000 */  swc1      $f0, 0x0($s2)
/* 78BB4 800DF704 8FBF0080 */  lw        $ra, 0x80($sp)
/* 78BB8 800DF708 8FB5007C */  lw        $s5, 0x7C($sp)
/* 78BBC 800DF70C 8FB40078 */  lw        $s4, 0x78($sp)
/* 78BC0 800DF710 8FB30074 */  lw        $s3, 0x74($sp)
/* 78BC4 800DF714 8FB20070 */  lw        $s2, 0x70($sp)
/* 78BC8 800DF718 8FB1006C */  lw        $s1, 0x6C($sp)
/* 78BCC 800DF71C 8FB00068 */  lw        $s0, 0x68($sp)
/* 78BD0 800DF720 D7BE00B0 */  ldc1      $f30, 0xB0($sp)
/* 78BD4 800DF724 D7BC00A8 */  ldc1      $f28, 0xA8($sp)
/* 78BD8 800DF728 D7BA00A0 */  ldc1      $f26, 0xA0($sp)
/* 78BDC 800DF72C D7B80098 */  ldc1      $f24, 0x98($sp)
/* 78BE0 800DF730 D7B60090 */  ldc1      $f22, 0x90($sp)
/* 78BE4 800DF734 D7B40088 */  ldc1      $f20, 0x88($sp)
/* 78BE8 800DF738 03E00008 */  jr        $ra
/* 78BEC 800DF73C 27BD00B8 */   addiu    $sp, $sp, 0xB8

### DECOMPILED C INSTRUCTIONS:

s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw) {
    f32 sinTheta;
    f32 cosTheta;
    f32 hitX;
    f32 hitY;
    f32 hitZ;
    f32 hitDepth;
    f32 hitNx;
    f32 hitNy;
    f32 hitNz;
    f32 slipDx;
    f32 slipDz;
    f32 radius;
    f32 height;
    s32 hitID;
    f32 targetDx, targetDz;
    f32 dx, dz;
    f32 depthDiff;
    s32 ret = NO_COLLIDER;

    height = 0.0f;
    if (!(playerStatus->flags & (PS_FLAG_JUMPING | PS_FLAG_FALLING))) {
        height = 10.01f;
    }
    radius = playerStatus->colliderDiameter * 0.5f;

    sin_cos_rad(DEG_TO_RAD(yaw), &sinTheta, &cosTheta);
    cosTheta = -cosTheta;
    hitDepth = length + radius;

    targetDx = length * sinTheta;
    targetDz = length * cosTheta;

    hitID = player_raycast_general(0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
    if (hitID >= 0 && (depthDiff = hitDepth, depthDiff <= length + radius)) {
        depthDiff -= (length + radius);
        dx = depthDiff * sinTheta;
        dz = depthDiff * cosTheta;
        player_get_slip_vector(&slipDx, &slipDz, targetDx, targetDz, hitNx, hitNz);
        *x += dx + slipDx;
        *z += dz + slipDz;
        ret = hitID;
    } else {
        height = playerStatus->colliderHeight * 0.75;
        hitID = player_raycast_general(0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
        if (hitID >= 0 && (depthDiff = hitDepth, depthDiff <= length + radius)) {
            depthDiff -= (length + radius);
            dx = depthDiff * sinTheta;
            dz = depthDiff * cosTheta;
            player_get_slip_vector(&slipDx, &slipDz, targetDx, targetDz, hitNx, hitNz);
            *x += dx + slipDx;
            *z += dz + slipDz;
            ret = hitID;
        }
    }

    *x += targetDx;
    *z += targetDz;
    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel check_block_input
/* 1977AC 80268ECC 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 1977B0 80268ED0 AFB40020 */  sw        $s4, 0x20($sp)
/* 1977B4 80268ED4 0080A02D */  daddu     $s4, $a0, $zero
/* 1977B8 80268ED8 AFB7002C */  sw        $s7, 0x2C($sp)
/* 1977BC 80268EDC 0000B82D */  daddu     $s7, $zero, $zero
/* 1977C0 80268EE0 AFB10014 */  sw        $s1, 0x14($sp)
/* 1977C4 80268EE4 3C11800E */  lui       $s1, %hi(gBattleStatus)
/* 1977C8 80268EE8 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
/* 1977CC 80268EEC AFB50024 */  sw        $s5, 0x24($sp)
/* 1977D0 80268EF0 3C158011 */  lui       $s5, %hi(gPlayerData)
/* 1977D4 80268EF4 26B5F290 */  addiu     $s5, $s5, %lo(gPlayerData)
/* 1977D8 80268EF8 AFB60028 */  sw        $s6, 0x28($sp)
/* 1977DC 80268EFC 3C16802A */  lui       $s6, %hi(gActionCommandStatus)
/* 1977E0 80268F00 26D6FBE0 */  addiu     $s6, $s6, %lo(gActionCommandStatus)
/* 1977E4 80268F04 AFBF0030 */  sw        $ra, 0x30($sp)
/* 1977E8 80268F08 AFB3001C */  sw        $s3, 0x1C($sp)
/* 1977EC 80268F0C AFB20018 */  sw        $s2, 0x18($sp)
/* 1977F0 80268F10 AFB00010 */  sw        $s0, 0x10($sp)
/* 1977F4 80268F14 82230083 */  lb        $v1, 0x83($s1)
/* 1977F8 80268F18 2402FFFF */  addiu     $v0, $zero, -0x1
/* 1977FC 80268F1C 14620009 */  bne       $v1, $v0, .L80268F44
/* 197800 80268F20 A2200087 */   sb       $zero, 0x87($s1)
/* 197804 80268F24 8E220000 */  lw        $v0, 0x0($s1)
/* 197808 80268F28 3C030200 */  lui       $v1, (0x2000000 >> 16)
/* 19780C 80268F2C 00431024 */  and       $v0, $v0, $v1
/* 197810 80268F30 10400004 */  beqz      $v0, .L80268F44
/* 197814 80268F34 24020001 */   addiu    $v0, $zero, 0x1
/* 197818 80268F38 A2220087 */  sb        $v0, 0x87($s1)
/* 19781C 80268F3C 0809A43B */  j         .L802690EC
/* 197820 80268F40 24020001 */   addiu    $v0, $zero, 0x1
.L80268F44:
/* 197824 80268F44 82220083 */  lb        $v0, 0x83($s1)
/* 197828 80268F48 10400068 */  beqz      $v0, .L802690EC
/* 19782C 80268F4C 0000102D */   daddu    $v0, $zero, $zero
/* 197830 80268F50 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 197834 80268F54 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 197838 80268F58 904200AA */  lbu       $v0, 0xAA($v0)
/* 19783C 80268F5C 30420001 */  andi      $v0, $v0, 0x1
/* 197840 80268F60 14400062 */  bnez      $v0, .L802690EC
/* 197844 80268F64 0000102D */   daddu    $v0, $zero, $zero
/* 197848 80268F68 96A30298 */  lhu       $v1, 0x298($s5)
/* 19784C 80268F6C 2C62270F */  sltiu     $v0, $v1, 0x270F
/* 197850 80268F70 1040000A */  beqz      $v0, .L80268F9C
/* 197854 80268F74 24620001 */   addiu    $v0, $v1, 0x1
/* 197858 80268F78 A6A20298 */  sh        $v0, 0x298($s5)
/* 19785C 80268F7C 0809A3E9 */  j         .L80268FA4
/* 197860 80268F80 A6C0006E */   sh       $zero, 0x6E($s6)
.L80268F84:
/* 197864 80268F84 0809A408 */  j         .L80269020
/* 197868 80268F88 24170001 */   addiu    $s7, $zero, 0x1
.L80268F8C:
/* 19786C 80268F8C 24020001 */  addiu     $v0, $zero, 0x1
/* 197870 80268F90 A2220087 */  sb        $v0, 0x87($s1)
/* 197874 80268F94 0809A41A */  j         .L80269068
/* 197878 80268F98 24120001 */   addiu    $s2, $zero, 0x1
.L80268F9C:
/* 19787C 80268F9C 24020001 */  addiu     $v0, $zero, 0x1
/* 197880 80268FA0 A6C2006E */  sh        $v0, 0x6E($s6)
.L80268FA4:
/* 197884 80268FA4 0000902D */  daddu     $s2, $zero, $zero
/* 197888 80268FA8 24100003 */  addiu     $s0, $zero, 0x3
/* 19788C 80268FAC 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 197890 80268FB0 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
/* 197894 80268FB4 3C030008 */  lui       $v1, (0x80000 >> 16)
/* 197898 80268FB8 00431024 */  and       $v0, $v0, $v1
/* 19789C 80268FBC 14400005 */  bnez      $v0, .L80268FD4
/* 1978A0 80268FC0 2413000A */   addiu    $s3, $zero, 0xA
/* 1978A4 80268FC4 0C03A752 */  jal       is_ability_active
/* 1978A8 80268FC8 0240202D */   daddu    $a0, $s2, $zero
/* 1978AC 80268FCC 54400001 */  bnel      $v0, $zero, .L80268FD4
/* 1978B0 80268FD0 24100005 */   addiu    $s0, $zero, 0x5
.L80268FD4:
/* 1978B4 80268FD4 82230431 */  lb        $v1, 0x431($s1)
/* 1978B8 80268FD8 02701021 */  addu      $v0, $s3, $s0
/* 1978BC 80268FDC 00621823 */  subu      $v1, $v1, $v0
/* 1978C0 80268FE0 04620001 */  bltzl     $v1, .L80268FE8
/* 1978C4 80268FE4 24630040 */   addiu    $v1, $v1, 0x40
.L80268FE8:
/* 1978C8 80268FE8 1260000D */  beqz      $s3, .L80269020
/* 1978CC 80268FEC 0000202D */   daddu    $a0, $zero, $zero
.L80268FF0:
/* 1978D0 80268FF0 28620040 */  slti      $v0, $v1, 0x40
/* 1978D4 80268FF4 50400001 */  beql      $v0, $zero, .L80268FFC
/* 1978D8 80268FF8 2463FFC0 */   addiu    $v1, $v1, -0x40
.L80268FFC:
/* 1978DC 80268FFC 00031080 */  sll       $v0, $v1, 2
/* 1978E0 80269000 02221021 */  addu      $v0, $s1, $v0
/* 1978E4 80269004 8C420330 */  lw        $v0, 0x330($v0)
/* 1978E8 80269008 00541024 */  and       $v0, $v0, $s4
/* 1978EC 8026900C 1440FFDD */  bnez      $v0, .L80268F84
/* 1978F0 80269010 24840001 */   addiu    $a0, $a0, 0x1
/* 1978F4 80269014 0093102A */  slt       $v0, $a0, $s3
/* 1978F8 80269018 1440FFF5 */  bnez      $v0, .L80268FF0
/* 1978FC 8026901C 24630001 */   addiu    $v1, $v1, 0x1
.L80269020:
/* 197900 80269020 82230431 */  lb        $v1, 0x431($s1)
/* 197904 80269024 00701823 */  subu      $v1, $v1, $s0
/* 197908 80269028 04620001 */  bltzl     $v1, .L80269030
/* 19790C 8026902C 24630040 */   addiu    $v1, $v1, 0x40
.L80269030:
/* 197910 80269030 1200000D */  beqz      $s0, .L80269068
/* 197914 80269034 0000202D */   daddu    $a0, $zero, $zero
.L80269038:
/* 197918 80269038 28620040 */  slti      $v0, $v1, 0x40
/* 19791C 8026903C 50400001 */  beql      $v0, $zero, .L80269044
/* 197920 80269040 2463FFC0 */   addiu    $v1, $v1, -0x40
.L80269044:
/* 197924 80269044 00031080 */  sll       $v0, $v1, 2
/* 197928 80269048 02221021 */  addu      $v0, $s1, $v0
/* 19792C 8026904C 8C420330 */  lw        $v0, 0x330($v0)
/* 197930 80269050 00541024 */  and       $v0, $v0, $s4
/* 197934 80269054 1440FFCD */  bnez      $v0, .L80268F8C
/* 197938 80269058 24840001 */   addiu    $a0, $a0, 0x1
/* 19793C 8026905C 0090102A */  slt       $v0, $a0, $s0
/* 197940 80269060 1440FFF5 */  bnez      $v0, .L80269038
/* 197944 80269064 24630001 */   addiu    $v1, $v1, 0x1
.L80269068:
/* 197948 80269068 12E00003 */  beqz      $s7, .L80269078
/* 19794C 8026906C 2402FFFF */   addiu    $v0, $zero, -0x1
/* 197950 80269070 A2220087 */  sb        $v0, 0x87($s1)
/* 197954 80269074 0000902D */  daddu     $s2, $zero, $zero
.L80269078:
/* 197958 80269078 24020001 */  addiu     $v0, $zero, 0x1
/* 19795C 8026907C 16420012 */  bne       $s2, $v0, .L802690C8
/* 197960 80269080 02701021 */   addu     $v0, $s3, $s0
/* 197964 80269084 82230431 */  lb        $v1, 0x431($s1)
/* 197968 80269088 00621823 */  subu      $v1, $v1, $v0
/* 19796C 8026908C 04620001 */  bltzl     $v1, .L80269094
/* 197970 80269090 24630040 */   addiu    $v1, $v1, 0x40
.L80269094:
/* 197974 80269094 1040000C */  beqz      $v0, .L802690C8
/* 197978 80269098 0000202D */   daddu    $a0, $zero, $zero
/* 19797C 8026909C 0040282D */  daddu     $a1, $v0, $zero
.L802690A0:
/* 197980 802690A0 28620040 */  slti      $v0, $v1, 0x40
/* 197984 802690A4 50400001 */  beql      $v0, $zero, .L802690AC
/* 197988 802690A8 2463FFC0 */   addiu    $v1, $v1, -0x40
.L802690AC:
/* 19798C 802690AC 00031080 */  sll       $v0, $v1, 2
/* 197990 802690B0 02221021 */  addu      $v0, $s1, $v0
/* 197994 802690B4 AC400330 */  sw        $zero, 0x330($v0)
/* 197998 802690B8 24840001 */  addiu     $a0, $a0, 0x1
/* 19799C 802690BC 0085102A */  slt       $v0, $a0, $a1
/* 1979A0 802690C0 1440FFF7 */  bnez      $v0, .L802690A0
/* 1979A4 802690C4 24630001 */   addiu    $v1, $v1, 0x1
.L802690C8:
/* 1979A8 802690C8 12400008 */  beqz      $s2, .L802690EC
/* 1979AC 802690CC 0240102D */   daddu    $v0, $s2, $zero
/* 1979B0 802690D0 86C2006E */  lh        $v0, 0x6E($s6)
/* 1979B4 802690D4 14400005 */  bnez      $v0, .L802690EC
/* 1979B8 802690D8 0240102D */   daddu    $v0, $s2, $zero
/* 1979BC 802690DC 96A2029A */  lhu       $v0, 0x29A($s5)
/* 1979C0 802690E0 24420001 */  addiu     $v0, $v0, 0x1
/* 1979C4 802690E4 A6A2029A */  sh        $v0, 0x29A($s5)
/* 1979C8 802690E8 0240102D */  daddu     $v0, $s2, $zero
.L802690EC:
/* 1979CC 802690EC 8FBF0030 */  lw        $ra, 0x30($sp)
/* 1979D0 802690F0 8FB7002C */  lw        $s7, 0x2C($sp)
/* 1979D4 802690F4 8FB60028 */  lw        $s6, 0x28($sp)
/* 1979D8 802690F8 8FB50024 */  lw        $s5, 0x24($sp)
/* 1979DC 802690FC 8FB40020 */  lw        $s4, 0x20($sp)
/* 1979E0 80269100 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1979E4 80269104 8FB20018 */  lw        $s2, 0x18($sp)
/* 1979E8 80269108 8FB10014 */  lw        $s1, 0x14($sp)
/* 1979EC 8026910C 8FB00010 */  lw        $s0, 0x10($sp)
/* 1979F0 80269110 03E00008 */  jr        $ra
/* 1979F4 80269114 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

s32 check_block_input(s32 buttonMask) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
    s32 mashWindow;
    s32 blockWindow;
    s32 block;
    s32 mash = FALSE;
    s32 bufferPos;
    s32 i;
    s32 ignoreWindow;

    battleStatus->blockResult = 0; // Fail

    if (battleStatus->actionCommandMode == ACTION_COMMAND_MODE_TUTORIAL_BLOCK && (battleStatus->flags1 & BS_FLAGS1_TUTORIAL_BATTLE)) {
        battleStatus->blockResult = 1;
        return TRUE;
    }

    if (battleStatus->actionCommandMode == ACTION_COMMAND_MODE_NOT_LEARNED || (gGameStatusPtr->demoFlags & 1)) {
        return FALSE;
    }

    if (playerData->hitsTaken < 9999) {
        playerData->hitsTaken++;
        actionCommandStatus->hitsTakenIsMax = FALSE;
    } else {
        actionCommandStatus->hitsTakenIsMax = TRUE;
    }

    block = FALSE;
    blockWindow = 3;
    mashWindow = 10;

    if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING) && is_ability_active(ABILITY_DODGE_MASTER)) {
        blockWindow = 5;
    }

    // Pre-window mashing check
    bufferPos = battleStatus->inputBufferPos;
    bufferPos -= mashWindow + blockWindow;

    if (bufferPos < 0) {
        bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer);
    }
    for (i = 0; i < mashWindow; i++) {
        if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
            bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer);
        }

        if (battleStatus->pushInputBuffer[bufferPos] & buttonMask) {
            mash = TRUE;
            break;
        }
        bufferPos++;
    }

    // Block check
    bufferPos = battleStatus->inputBufferPos;
    bufferPos -= blockWindow;
    if (bufferPos < 0) {
        bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer);
    }
    for (i = 0; i < blockWindow; i++) {
        if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
            bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer);
        }

        if (battleStatus->pushInputBuffer[bufferPos] & buttonMask) {
            battleStatus->blockResult = 1; // Block
            block = TRUE;
            break;
        }
        bufferPos++;
    }

    if (mash) {
        battleStatus->blockResult = -1; // Mash
        block = FALSE;
    }

    // Ignore inputs until another mash window has passed, so check_block_input() can be called in quick succession
    if (block == TRUE) {
        bufferPos = battleStatus->inputBufferPos;
        bufferPos -= mashWindow + blockWindow;
        if (bufferPos < 0) {
            bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer);
        }

        for (i = 0; i < mashWindow + blockWindow; i++) {
            if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
                bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer);
            }
            battleStatus->pushInputBuffer[bufferPos] = 0;
            bufferPos++;
        }
    }
    if (block && !actionCommandStatus->hitsTakenIsMax) {
        playerData->hitsBlocked++;
    }

    return block;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel nuAuMgr
/* 26208 8004AE08 27BDFF50 */  addiu     $sp, $sp, -0xB0
/* 2620C 8004AE0C AFB00088 */  sw        $s0, 0x88($sp)
/* 26210 8004AE10 27B00020 */  addiu     $s0, $sp, 0x20
/* 26214 8004AE14 0200202D */  daddu     $a0, $s0, $zero
/* 26218 8004AE18 27A50038 */  addiu     $a1, $sp, 0x38
/* 2621C 8004AE1C 24060008 */  addiu     $a2, $zero, 0x8
/* 26220 8004AE20 AFBF00AC */  sw        $ra, 0xAC($sp)
/* 26224 8004AE24 AFBE00A8 */  sw        $fp, 0xA8($sp)
/* 26228 8004AE28 AFB700A4 */  sw        $s7, 0xA4($sp)
/* 2622C 8004AE2C AFB600A0 */  sw        $s6, 0xA0($sp)
/* 26230 8004AE30 AFB5009C */  sw        $s5, 0x9C($sp)
/* 26234 8004AE34 AFB40098 */  sw        $s4, 0x98($sp)
/* 26238 8004AE38 AFB30094 */  sw        $s3, 0x94($sp)
/* 2623C 8004AE3C AFB20090 */  sw        $s2, 0x90($sp)
/* 26240 8004AE40 0C019560 */  jal       osCreateMesgQueue
/* 26244 8004AE44 AFB1008C */   sw       $s1, 0x8C($sp)
/* 26248 8004AE48 27B10058 */  addiu     $s1, $sp, 0x58
/* 2624C 8004AE4C 0220202D */  daddu     $a0, $s1, $zero
/* 26250 8004AE50 27A50070 */  addiu     $a1, $sp, 0x70
/* 26254 8004AE54 0C019560 */  jal       osCreateMesgQueue
/* 26258 8004AE58 24060001 */   addiu    $a2, $zero, 0x1
/* 2625C 8004AE5C 27A40010 */  addiu     $a0, $sp, 0x10
/* 26260 8004AE60 0200282D */  daddu     $a1, $s0, $zero
/* 26264 8004AE64 0C017B8C */  jal       nuScAddClient
/* 26268 8004AE68 24060003 */   addiu    $a2, $zero, 0x3
/* 2626C 8004AE6C 0000902D */  daddu     $s2, $zero, $zero
/* 26270 8004AE70 0240982D */  daddu     $s3, $s2, $zero
/* 26274 8004AE74 0240A82D */  daddu     $s5, $s2, $zero
/* 26278 8004AE78 3C14800A */  lui       $s4, %hi(AlCmdListBuffers)
/* 2627C 8004AE7C 8E943510 */  lw        $s4, %lo(AlCmdListBuffers)($s4)
/* 26280 8004AE80 3C1E800A */  lui       $fp, %hi(D_800A3628)
/* 26284 8004AE84 8FDE3628 */  lw        $fp, %lo(D_800A3628)($fp)
/* 26288 8004AE88 3C178008 */  lui       $s7, %hi(nuAuPreNMI)
/* 2628C 8004AE8C 26F78170 */  addiu     $s7, $s7, %lo(nuAuPreNMI)
/* 26290 8004AE90 AFB10080 */  sw        $s1, 0x80($sp)
/* 26294 8004AE94 3C11800A */  lui       $s1, %hi(nuAuTasks)
/* 26298 8004AE98 26313520 */  addiu     $s1, $s1, %lo(nuAuTasks)
/* 2629C 8004AE9C AFA00078 */  sw        $zero, 0x78($sp)
.L8004AEA0:
/* 262A0 8004AEA0 27A40020 */  addiu     $a0, $sp, 0x20
.L8004AEA4:
/* 262A4 8004AEA4 27A50074 */  addiu     $a1, $sp, 0x74
.L8004AEA8:
/* 262A8 8004AEA8 0C0195BC */  jal       osRecvMesg
/* 262AC 8004AEAC 24060001 */   addiu    $a2, $zero, 0x1
/* 262B0 8004AEB0 8FA20074 */  lw        $v0, 0x74($sp)
/* 262B4 8004AEB4 84430000 */  lh        $v1, 0x0($v0)
/* 262B8 8004AEB8 24080001 */  addiu     $t0, $zero, 0x1
/* 262BC 8004AEBC 10680005 */  beq       $v1, $t0, .L8004AED4
/* 262C0 8004AEC0 24020002 */   addiu    $v0, $zero, 0x2
/* 262C4 8004AEC4 1062005F */  beq       $v1, $v0, .L8004B044
/* 262C8 8004AEC8 27A40020 */   addiu    $a0, $sp, 0x20
/* 262CC 8004AECC 08012BAA */  j         .L8004AEA8
/* 262D0 8004AED0 27A50074 */   addiu    $a1, $sp, 0x74
.L8004AED4:
/* 262D4 8004AED4 8FA20078 */  lw        $v0, 0x78($sp)
/* 262D8 8004AED8 10400021 */  beqz      $v0, .L8004AF60
/* 262DC 8004AEDC 24080001 */   addiu    $t0, $zero, 0x1
/* 262E0 8004AEE0 3C028008 */  lui       $v0, %hi(nuAuTaskStop)
/* 262E4 8004AEE4 90428180 */  lbu       $v0, %lo(nuAuTaskStop)($v0)
/* 262E8 8004AEE8 1448001D */  bne       $v0, $t0, .L8004AF60
/* 262EC 8004AEEC 0100302D */   daddu    $a2, $t0, $zero
/* 262F0 8004AEF0 8FA80080 */  lw        $t0, 0x80($sp)
/* 262F4 8004AEF4 3C04800E */  lui       $a0, %hi(D_800DA444)
/* 262F8 8004AEF8 2484A444 */  addiu     $a0, $a0, %lo(D_800DA444)
/* 262FC 8004AEFC AE340040 */  sw        $s4, 0x40($s1)
/* 26300 8004AF00 AE280050 */  sw        $t0, 0x50($s1)
/* 26304 8004AF04 8FA8007C */  lw        $t0, 0x7C($sp)
/* 26308 8004AF08 0220282D */  daddu     $a1, $s1, $zero
/* 2630C 8004AF0C 01141023 */  subu      $v0, $t0, $s4
/* 26310 8004AF10 000210C3 */  sra       $v0, $v0, 3
/* 26314 8004AF14 000210C0 */  sll       $v0, $v0, 3
/* 26318 8004AF18 0C019608 */  jal       osSendMesg
/* 2631C 8004AF1C AE220044 */   sw       $v0, 0x44($s1)
/* 26320 8004AF20 0C012C9A */  jal       nuAuCleanDMABuffers
/* 26324 8004AF24 26730001 */   addiu    $s3, $s3, 0x1
/* 26328 8004AF28 0000282D */  daddu     $a1, $zero, $zero
/* 2632C 8004AF2C 8FA40080 */  lw        $a0, 0x80($sp)
/* 26330 8004AF30 0C0195BC */  jal       osRecvMesg
/* 26334 8004AF34 24060001 */   addiu    $a2, $zero, 0x1
/* 26338 8004AF38 24080003 */  addiu     $t0, $zero, 0x3
/* 2633C 8004AF3C 52680001 */  beql      $s3, $t0, .L8004AF44
/* 26340 8004AF40 0000982D */   daddu    $s3, $zero, $zero
.L8004AF44:
/* 26344 8004AF44 26520001 */  addiu     $s2, $s2, 0x1
/* 26348 8004AF48 24080003 */  addiu     $t0, $zero, 0x3
/* 2634C 8004AF4C 16480004 */  bne       $s2, $t0, .L8004AF60
/* 26350 8004AF50 26310058 */   addiu    $s1, $s1, 0x58
/* 26354 8004AF54 3C11800A */  lui       $s1, %hi(nuAuTasks)
/* 26358 8004AF58 26313520 */  addiu     $s1, $s1, %lo(nuAuTasks)
/* 2635C 8004AF5C 0000902D */  daddu     $s2, $zero, $zero
.L8004AF60:
/* 26360 8004AF60 0C018554 */  jal       osAiGetStatus
/* 26364 8004AF64 00000000 */   nop
/* 26368 8004AF68 04410003 */  bgez      $v0, .L8004AF78
/* 2636C 8004AF6C 00000000 */   nop
/* 26370 8004AF70 08012BA8 */  j         .L8004AEA0
/* 26374 8004AF74 0000B02D */   daddu    $s6, $zero, $zero
.L8004AF78:
/* 26378 8004AF78 0C018550 */  jal       osAiGetLength
/* 2637C 8004AF7C 00000000 */   nop
/* 26380 8004AF80 8FA30078 */  lw        $v1, 0x78($sp)
/* 26384 8004AF84 10600011 */  beqz      $v1, .L8004AFCC
/* 26388 8004AF88 00028082 */   srl      $s0, $v0, 2
/* 2638C 8004AF8C 3C028008 */  lui       $v0, %hi(nuAuTaskStop)
/* 26390 8004AF90 90428180 */  lbu       $v0, %lo(nuAuTaskStop)($v0)
/* 26394 8004AF94 24080001 */  addiu     $t0, $zero, 0x1
/* 26398 8004AF98 1448000D */  bne       $v0, $t0, .L8004AFD0
/* 2639C 8004AF9C 2A0200B8 */   slti     $v0, $s0, 0xB8
/* 263A0 8004AFA0 03C0202D */  daddu     $a0, $fp, $zero
/* 263A4 8004AFA4 0C0185A0 */  jal       osAiSetNextBuffer
/* 263A8 8004AFA8 00152880 */   sll      $a1, $s5, 2
/* 263AC 8004AFAC 00121080 */  sll       $v0, $s2, 2
/* 263B0 8004AFB0 3C14800A */  lui       $s4, %hi(AlCmdListBuffers)
/* 263B4 8004AFB4 0282A021 */  addu      $s4, $s4, $v0
/* 263B8 8004AFB8 8E943510 */  lw        $s4, %lo(AlCmdListBuffers)($s4)
/* 263BC 8004AFBC 00131080 */  sll       $v0, $s3, 2
/* 263C0 8004AFC0 3C1E800A */  lui       $fp, %hi(D_800A3628)
/* 263C4 8004AFC4 03C2F021 */  addu      $fp, $fp, $v0
/* 263C8 8004AFC8 8FDE3628 */  lw        $fp, %lo(D_800A3628)($fp)
.L8004AFCC:
/* 263CC 8004AFCC 2A0200B8 */  slti      $v0, $s0, 0xB8
.L8004AFD0:
/* 263D0 8004AFD0 14400003 */  bnez      $v0, .L8004AFE0
/* 263D4 8004AFD4 00000000 */   nop
/* 263D8 8004AFD8 12C00005 */  beqz      $s6, .L8004AFF0
/* 263DC 8004AFDC 24160001 */   addiu    $s6, $zero, 0x1
.L8004AFE0:
/* 263E0 8004AFE0 3C15800A */  lui       $s5, %hi(AlFrameSize)
/* 263E4 8004AFE4 8EB53634 */  lw        $s5, %lo(AlFrameSize)($s5)
/* 263E8 8004AFE8 08012BFE */  j         .L8004AFF8
/* 263EC 8004AFEC 0000B02D */   daddu    $s6, $zero, $zero
.L8004AFF0:
/* 263F0 8004AFF0 3C15800A */  lui       $s5, %hi(AlMinFrameSize)
/* 263F4 8004AFF4 8EB53638 */  lw        $s5, %lo(AlMinFrameSize)($s5)
.L8004AFF8:
/* 263F8 8004AFF8 0C0187A4 */  jal       osVirtualToPhysical
/* 263FC 8004AFFC 03C0202D */   daddu    $a0, $fp, $zero
/* 26400 8004B000 0280202D */  daddu     $a0, $s4, $zero
/* 26404 8004B004 27A50078 */  addiu     $a1, $sp, 0x78
/* 26408 8004B008 0040302D */  daddu     $a2, $v0, $zero
/* 2640C 8004B00C 0C015970 */  jal       alAudioFrame
/* 26410 8004B010 02A0382D */   daddu    $a3, $s5, $zero
/* 26414 8004B014 3C038008 */  lui       $v1, %hi(nuAuPreNMIFunc)
/* 26418 8004B018 8C638174 */  lw        $v1, %lo(nuAuPreNMIFunc)($v1)
/* 2641C 8004B01C 1060FFA0 */  beqz      $v1, .L8004AEA0
/* 26420 8004B020 AFA2007C */   sw       $v0, 0x7C($sp)
/* 26424 8004B024 92E20000 */  lbu       $v0, 0x0($s7)
/* 26428 8004B028 1040FF9E */  beqz      $v0, .L8004AEA4
/* 2642C 8004B02C 27A40020 */   addiu    $a0, $sp, 0x20
/* 26430 8004B030 0040282D */  daddu     $a1, $v0, $zero
/* 26434 8004B034 0060F809 */  jalr      $v1
/* 26438 8004B038 24040001 */   addiu    $a0, $zero, 0x1
/* 2643C 8004B03C 08012C19 */  j         .L8004B064
/* 26440 8004B040 00000000 */   nop
.L8004B044:
/* 26444 8004B044 3C028008 */  lui       $v0, %hi(nuAuPreNMIFunc)
/* 26448 8004B048 8C428174 */  lw        $v0, %lo(nuAuPreNMIFunc)($v0)
/* 2644C 8004B04C 10400005 */  beqz      $v0, .L8004B064
/* 26450 8004B050 00000000 */   nop
/* 26454 8004B054 3C058008 */  lui       $a1, %hi(nuAuPreNMI)
/* 26458 8004B058 90A58170 */  lbu       $a1, %lo(nuAuPreNMI)($a1)
/* 2645C 8004B05C 0040F809 */  jalr      $v0
/* 26460 8004B060 24040002 */   addiu    $a0, $zero, 0x2
.L8004B064:
/* 26464 8004B064 92E20000 */  lbu       $v0, 0x0($s7)
/* 26468 8004B068 24420001 */  addiu     $v0, $v0, 0x1
/* 2646C 8004B06C 08012BA8 */  j         .L8004AEA0
/* 26470 8004B070 A2E20000 */   sb       $v0, 0x0($s7)

### DECOMPILED C INSTRUCTIONS:

void nuAuMgr(void* arg) {
    NUScClient auClient;
    OSMesgQueue auMesgQ;
    OSMesg auMsgBuf[NU_AU_MESG_MAX];
    OSMesgQueue auRtnMesgQ;
    OSMesg auRtnMesgBuf;
    NUScMsg* mesg_type;
    s32 cmdList_len;
    Acmd* cmdListAfter_ptr;
    s32 cmdListIndex;
    s32 bufferIndex;
    s32 sampleSize;
    Acmd* cmdListBuf;
    u8* bufferPtr;
    s32 samples;
    s32 cond;

    osCreateMesgQueue(&auMesgQ, auMsgBuf, NU_AU_MESG_MAX);
    osCreateMesgQueue(&auRtnMesgQ, &auRtnMesgBuf, 1);
    nuScAddClient(&auClient, &auMesgQ, NU_SC_RETRACE_MSG | NU_SC_PRENMI_MSG);

    cmdList_len = 0;
    cmdListIndex = 0;
    bufferIndex = 0;
    samples = 0;
    cmdListBuf = AlCmdListBuffers[0];
    bufferPtr = D_800A3628[0];
    while (TRUE) {
        osRecvMesg(&auMesgQ, (OSMesg*)&mesg_type, OS_MESG_BLOCK);
        switch (*mesg_type) {
            case NU_SC_RETRACE_MSG:
                if (cmdList_len != 0 && nuAuTaskStop == NU_AU_TASK_RUN) {
                    nuAuTasks[cmdListIndex].msgQ = &auRtnMesgQ;
                    nuAuTasks[cmdListIndex].list.t.data_ptr = (u64*)cmdListBuf;
                    nuAuTasks[cmdListIndex].list.t.data_size = (cmdListAfter_ptr - cmdListBuf) * sizeof(Acmd);
                    osSendMesg(&nusched.audioRequestMQ, &nuAuTasks[cmdListIndex], OS_MESG_BLOCK);
                    nuAuCleanDMABuffers();
                    osRecvMesg(&auRtnMesgQ, NULL, 1);
                    if (++bufferIndex == 3) {
                        bufferIndex = 0;
                    }
                    if (++cmdListIndex == 3) {
                        cmdListIndex = 0;
                    }
                }
                if (osAiGetStatus() & AI_STATUS_FIFO_FULL) {
                    cond = FALSE;
                    continue;
                }
                sampleSize = osAiGetLength() >> 2;
                if (cmdList_len != 0 && nuAuTaskStop == NU_AU_TASK_RUN) {
                    osAiSetNextBuffer(bufferPtr, samples * 4);
                    cmdListBuf = AlCmdListBuffers[cmdListIndex];
                    bufferPtr = D_800A3628[bufferIndex];
                }
                if (sampleSize < AUDIO_SAMPLES || cond) {
                    samples = AlFrameSize;
                    cond = FALSE;
                } else {
                    samples = AlMinFrameSize;
                    cond = TRUE;
                }
                cmdListAfter_ptr = alAudioFrame(cmdListBuf, &cmdList_len, (s16*)osVirtualToPhysical(bufferPtr), samples);
                if (nuAuPreNMIFunc != 0 && nuAuPreNMI != 0) {
                    nuAuPreNMIFunc(NU_SC_RETRACE_MSG, nuAuPreNMI);
                    nuAuPreNMI++;
                }

                break;
            case NU_SC_PRENMI_MSG:
                if (nuAuPreNMIFunc) {
                    nuAuPreNMIFunc(NU_SC_PRENMI_MSG, nuAuPreNMI);
                }
                nuAuPreNMI++;
                break;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel windy_leaves_appendGfx
/* 35E5D0 E0056BD0 27BDFEF0 */  addiu     $sp, $sp, -0x110
/* 35E5D4 E0056BD4 AFBE00F8 */  sw        $fp, 0xF8($sp)
/* 35E5D8 E0056BD8 0080F02D */  daddu     $fp, $a0, $zero
/* 35E5DC E0056BDC AFBF00FC */  sw        $ra, 0xFC($sp)
/* 35E5E0 E0056BE0 AFB700F4 */  sw        $s7, 0xF4($sp)
/* 35E5E4 E0056BE4 AFB600F0 */  sw        $s6, 0xF0($sp)
/* 35E5E8 E0056BE8 AFB500EC */  sw        $s5, 0xEC($sp)
/* 35E5EC E0056BEC AFB400E8 */  sw        $s4, 0xE8($sp)
/* 35E5F0 E0056BF0 AFB300E4 */  sw        $s3, 0xE4($sp)
/* 35E5F4 E0056BF4 AFB200E0 */  sw        $s2, 0xE0($sp)
/* 35E5F8 E0056BF8 AFB100DC */  sw        $s1, 0xDC($sp)
/* 35E5FC E0056BFC AFB000D8 */  sw        $s0, 0xD8($sp)
/* 35E600 E0056C00 F7B60108 */  sdc1      $f22, 0x108($sp)
/* 35E604 E0056C04 F7B40100 */  sdc1      $f20, 0x100($sp)
/* 35E608 E0056C08 8FD0000C */  lw        $s0, 0xC($fp)
/* 35E60C E0056C0C 8E020000 */  lw        $v0, 0x0($s0)
/* 35E610 E0056C10 3C170900 */  lui       $s7, %hi(D_09001280_40E510)
/* 35E614 E0056C14 26F71280 */  addiu     $s7, $s7, %lo(D_09001280_40E510)
/* 35E618 E0056C18 14400003 */  bnez      $v0, .LE0056C28
/* 35E61C E0056C1C 3C02DB06 */   lui      $v0, (0xDB060024 >> 16)
/* 35E620 E0056C20 3C170900 */  lui       $s7, %hi(D_09001258_40E4E8)
/* 35E624 E0056C24 26F71258 */  addiu     $s7, $s7, %lo(D_09001258_40E4E8)
.LE0056C28:
/* 35E628 E0056C28 34420024 */  ori       $v0, $v0, (0xDB060024 & 0xFFFF)
/* 35E62C E0056C2C 3C061464 */  lui       $a2, (0x14641400 >> 16)
/* 35E630 E0056C30 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 35E634 E0056C34 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 35E638 E0056C38 8E650000 */  lw        $a1, 0x0($s3)
/* 35E63C E0056C3C 34C61400 */  ori       $a2, $a2, (0x14641400 & 0xFFFF)
/* 35E640 E0056C40 00A0202D */  daddu     $a0, $a1, $zero
/* 35E644 E0056C44 24A50008 */  addiu     $a1, $a1, 0x8
/* 35E648 E0056C48 AE650000 */  sw        $a1, 0x0($s3)
/* 35E64C E0056C4C AC820000 */  sw        $v0, 0x0($a0)
/* 35E650 E0056C50 24A20008 */  addiu     $v0, $a1, 0x8
/* 35E654 E0056C54 AE620000 */  sw        $v0, 0x0($s3)
/* 35E658 E0056C58 8FC30010 */  lw        $v1, 0x10($fp)
/* 35E65C E0056C5C 24A20010 */  addiu     $v0, $a1, 0x10
/* 35E660 E0056C60 AE620000 */  sw        $v0, 0x0($s3)
/* 35E664 E0056C64 8C62001C */  lw        $v0, 0x1C($v1)
/* 35E668 E0056C68 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 35E66C E0056C6C 00431021 */  addu      $v0, $v0, $v1
/* 35E670 E0056C70 AC820004 */  sw        $v0, 0x4($a0)
/* 35E674 E0056C74 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 35E678 E0056C78 ACA20000 */  sw        $v0, 0x0($a1)
/* 35E67C E0056C7C 3C020900 */  lui       $v0, %hi(D_09001180_40E410)
/* 35E680 E0056C80 24421180 */  addiu     $v0, $v0, %lo(D_09001180_40E410)
/* 35E684 E0056C84 ACA20004 */  sw        $v0, 0x4($a1)
/* 35E688 E0056C88 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 35E68C E0056C8C ACA20008 */  sw        $v0, 0x8($a1)
/* 35E690 E0056C90 92020027 */  lbu       $v0, 0x27($s0)
/* 35E694 E0056C94 24120001 */  addiu     $s2, $zero, 0x1
/* 35E698 E0056C98 00461025 */  or        $v0, $v0, $a2
/* 35E69C E0056C9C ACA2000C */  sw        $v0, 0xC($a1)
/* 35E6A0 E0056CA0 8E050004 */  lw        $a1, 0x4($s0)
/* 35E6A4 E0056CA4 8E060008 */  lw        $a2, 0x8($s0)
/* 35E6A8 E0056CA8 8E07000C */  lw        $a3, 0xC($s0)
/* 35E6AC E0056CAC 0C080108 */  jal       shim_guTranslateF
/* 35E6B0 E0056CB0 27A40018 */   addiu    $a0, $sp, 0x18
/* 35E6B4 E0056CB4 27B10058 */  addiu     $s1, $sp, 0x58
/* 35E6B8 E0056CB8 4480A000 */  mtc1      $zero, $f20
/* 35E6BC E0056CBC 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 35E6C0 E0056CC0 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 35E6C4 E0056CC4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 35E6C8 E0056CC8 4481B000 */  mtc1      $at, $f22
/* 35E6CC E0056CCC 00031080 */  sll       $v0, $v1, 2
/* 35E6D0 E0056CD0 00431021 */  addu      $v0, $v0, $v1
/* 35E6D4 E0056CD4 00021080 */  sll       $v0, $v0, 2
/* 35E6D8 E0056CD8 00431023 */  subu      $v0, $v0, $v1
/* 35E6DC E0056CDC 000218C0 */  sll       $v1, $v0, 3
/* 35E6E0 E0056CE0 00431021 */  addu      $v0, $v0, $v1
/* 35E6E4 E0056CE4 000210C0 */  sll       $v0, $v0, 3
/* 35E6E8 E0056CE8 4406A000 */  mfc1      $a2, $f20
/* 35E6EC E0056CEC 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 35E6F0 E0056CF0 00220821 */  addu      $at, $at, $v0
/* 35E6F4 E0056CF4 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 35E6F8 E0056CF8 4407B000 */  mfc1      $a3, $f22
/* 35E6FC E0056CFC 46000007 */  neg.s     $f0, $f0
/* 35E700 E0056D00 44050000 */  mfc1      $a1, $f0
/* 35E704 E0056D04 0220202D */  daddu     $a0, $s1, $zero
/* 35E708 E0056D08 0C080104 */  jal       shim_guRotateF
/* 35E70C E0056D0C E7B40010 */   swc1     $f20, 0x10($sp)
/* 35E710 E0056D10 0220202D */  daddu     $a0, $s1, $zero
/* 35E714 E0056D14 27A50018 */  addiu     $a1, $sp, 0x18
/* 35E718 E0056D18 0C080114 */  jal       shim_guMtxCatF
/* 35E71C E0056D1C 27A60098 */   addiu    $a2, $sp, 0x98
/* 35E720 E0056D20 8FC20008 */  lw        $v0, 0x8($fp)
/* 35E724 E0056D24 0242102A */  slt       $v0, $s2, $v0
/* 35E728 E0056D28 1040004C */  beqz      $v0, .LE0056E5C
/* 35E72C E0056D2C 2610003C */   addiu    $s0, $s0, 0x3C
/* 35E730 E0056D30 3C16800A */  lui       $s6, %hi(gDisplayContext)
/* 35E734 E0056D34 26D6A674 */  addiu     $s6, $s6, %lo(gDisplayContext)
/* 35E738 E0056D38 3C158007 */  lui       $s5, %hi(gMatrixListPos)
/* 35E73C E0056D3C 26B541F0 */  addiu     $s5, $s5, %lo(gMatrixListPos)
/* 35E740 E0056D40 3C140001 */  lui       $s4, (0x11630 >> 16)
/* 35E744 E0056D44 36941630 */  ori       $s4, $s4, (0x11630 & 0xFFFF)
/* 35E748 E0056D48 26100020 */  addiu     $s0, $s0, 0x20
.LE0056D4C:
/* 35E74C E0056D4C 0220202D */  daddu     $a0, $s1, $zero
/* 35E750 E0056D50 8E05FFE4 */  lw        $a1, -0x1C($s0)
/* 35E754 E0056D54 8E06FFE8 */  lw        $a2, -0x18($s0)
/* 35E758 E0056D58 8E07FFEC */  lw        $a3, -0x14($s0)
/* 35E75C E0056D5C 0C080108 */  jal       shim_guTranslateF
/* 35E760 E0056D60 26520001 */   addiu    $s2, $s2, 0x1
/* 35E764 E0056D64 0220202D */  daddu     $a0, $s1, $zero
/* 35E768 E0056D68 27A50098 */  addiu     $a1, $sp, 0x98
/* 35E76C E0056D6C 0C080114 */  jal       shim_guMtxCatF
/* 35E770 E0056D70 27A60018 */   addiu    $a2, $sp, 0x18
/* 35E774 E0056D74 E7B60010 */  swc1      $f22, 0x10($sp)
/* 35E778 E0056D78 8E05FFF8 */  lw        $a1, -0x8($s0)
/* 35E77C E0056D7C 4406A000 */  mfc1      $a2, $f20
/* 35E780 E0056D80 4407A000 */  mfc1      $a3, $f20
/* 35E784 E0056D84 0C080104 */  jal       shim_guRotateF
/* 35E788 E0056D88 0220202D */   daddu    $a0, $s1, $zero
/* 35E78C E0056D8C 0220202D */  daddu     $a0, $s1, $zero
/* 35E790 E0056D90 27A50018 */  addiu     $a1, $sp, 0x18
/* 35E794 E0056D94 0C080114 */  jal       shim_guMtxCatF
/* 35E798 E0056D98 00A0302D */   daddu    $a2, $a1, $zero
/* 35E79C E0056D9C 0220202D */  daddu     $a0, $s1, $zero
/* 35E7A0 E0056DA0 E7B40010 */  swc1      $f20, 0x10($sp)
/* 35E7A4 E0056DA4 8E050000 */  lw        $a1, 0x0($s0)
/* 35E7A8 E0056DA8 4406A000 */  mfc1      $a2, $f20
/* 35E7AC E0056DAC 4407B000 */  mfc1      $a3, $f22
/* 35E7B0 E0056DB0 0C080104 */  jal       shim_guRotateF
/* 35E7B4 E0056DB4 2610003C */   addiu    $s0, $s0, 0x3C
/* 35E7B8 E0056DB8 0220202D */  daddu     $a0, $s1, $zero
/* 35E7BC E0056DBC 27A50018 */  addiu     $a1, $sp, 0x18
/* 35E7C0 E0056DC0 0C080114 */  jal       shim_guMtxCatF
/* 35E7C4 E0056DC4 00A0302D */   daddu    $a2, $a1, $zero
/* 35E7C8 E0056DC8 27A40018 */  addiu     $a0, $sp, 0x18
/* 35E7CC E0056DCC 96A50000 */  lhu       $a1, 0x0($s5)
/* 35E7D0 E0056DD0 8EC20000 */  lw        $v0, 0x0($s6)
/* 35E7D4 E0056DD4 00052980 */  sll       $a1, $a1, 6
/* 35E7D8 E0056DD8 00B42821 */  addu      $a1, $a1, $s4
/* 35E7DC E0056DDC 0C080118 */  jal       shim_guMtxF2L
/* 35E7E0 E0056DE0 00452821 */   addu     $a1, $v0, $a1
/* 35E7E4 E0056DE4 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 35E7E8 E0056DE8 8E640000 */  lw        $a0, 0x0($s3)
/* 35E7EC E0056DEC 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 35E7F0 E0056DF0 0080282D */  daddu     $a1, $a0, $zero
/* 35E7F4 E0056DF4 24840008 */  addiu     $a0, $a0, 0x8
/* 35E7F8 E0056DF8 AE640000 */  sw        $a0, 0x0($s3)
/* 35E7FC E0056DFC 96A20000 */  lhu       $v0, 0x0($s5)
/* 35E800 E0056E00 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 35E804 E0056E04 ACA30000 */  sw        $v1, 0x0($a1)
/* 35E808 E0056E08 24430001 */  addiu     $v1, $v0, 0x1
/* 35E80C E0056E0C 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 35E810 E0056E10 00021180 */  sll       $v0, $v0, 6
/* 35E814 E0056E14 A6A30000 */  sh        $v1, 0x0($s5)
/* 35E818 E0056E18 8EC30000 */  lw        $v1, 0x0($s6)
/* 35E81C E0056E1C 00541021 */  addu      $v0, $v0, $s4
/* 35E820 E0056E20 00621821 */  addu      $v1, $v1, $v0
/* 35E824 E0056E24 24820008 */  addiu     $v0, $a0, 0x8
/* 35E828 E0056E28 ACA30004 */  sw        $v1, 0x4($a1)
/* 35E82C E0056E2C AE620000 */  sw        $v0, 0x0($s3)
/* 35E830 E0056E30 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 35E834 E0056E34 AC820000 */  sw        $v0, 0x0($a0)
/* 35E838 E0056E38 24020040 */  addiu     $v0, $zero, 0x40
/* 35E83C E0056E3C AC970004 */  sw        $s7, 0x4($a0)
/* 35E840 E0056E40 AC860008 */  sw        $a2, 0x8($a0)
/* 35E844 E0056E44 AC82000C */  sw        $v0, 0xC($a0)
/* 35E848 E0056E48 8FC20008 */  lw        $v0, 0x8($fp)
/* 35E84C E0056E4C 24840010 */  addiu     $a0, $a0, 0x10
/* 35E850 E0056E50 0242102A */  slt       $v0, $s2, $v0
/* 35E854 E0056E54 1440FFBD */  bnez      $v0, .LE0056D4C
/* 35E858 E0056E58 AE640000 */   sw       $a0, 0x0($s3)
.LE0056E5C:
/* 35E85C E0056E5C 8FBF00FC */  lw        $ra, 0xFC($sp)
/* 35E860 E0056E60 8FBE00F8 */  lw        $fp, 0xF8($sp)
/* 35E864 E0056E64 8FB700F4 */  lw        $s7, 0xF4($sp)
/* 35E868 E0056E68 8FB600F0 */  lw        $s6, 0xF0($sp)
/* 35E86C E0056E6C 8FB500EC */  lw        $s5, 0xEC($sp)
/* 35E870 E0056E70 8FB400E8 */  lw        $s4, 0xE8($sp)
/* 35E874 E0056E74 8FB300E4 */  lw        $s3, 0xE4($sp)
/* 35E878 E0056E78 8FB200E0 */  lw        $s2, 0xE0($sp)
/* 35E87C E0056E7C 8FB100DC */  lw        $s1, 0xDC($sp)
/* 35E880 E0056E80 8FB000D8 */  lw        $s0, 0xD8($sp)
/* 35E884 E0056E84 D7B60108 */  ldc1      $f22, 0x108($sp)
/* 35E888 E0056E88 D7B40100 */  ldc1      $f20, 0x100($sp)
/* 35E88C E0056E8C 03E00008 */  jr        $ra
/* 35E890 E0056E90 27BD0110 */   addiu    $sp, $sp, 0x110
/* 35E894 E0056E94 00000000 */  nop
/* 35E898 E0056E98 00000000 */  nop
/* 35E89C E0056E9C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void windy_leaves_appendGfx(void* effect) {
    WindyLeavesFXData* part = ((EffectInstance*)effect)->data.windyLeaves;
    Matrix4f sp18, sp58, sp98;
    Gfx* dlist;
    s32 i;

    dlist = D_09001280_33E890;
    if (part->type == 0) {
        dlist = D_09001258_33E868;
    }

    gSPSegment(gMainGfxPos++, 0x09, OS_K0_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
    gSPDisplayList(gMainGfxPos++, D_09001180_33E790);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->alpha);
    shim_guTranslateF(sp18, part->unk_04.x, part->unk_04.y, part->unk_04.z);
    shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(sp58, sp18, sp98);

    part++;
    for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
        shim_guTranslateF(sp58, part->unk_04.x, part->unk_04.y, part->unk_04.z);
        shim_guMtxCatF(sp58, sp98, sp18);
        shim_guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f);
        shim_guMtxCatF(sp58, sp18, sp18);
        shim_guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f);
        shim_guMtxCatF(sp58, sp18, sp18);
        shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, dlist);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel BasicAI_Main
/* 2587C 8004A47C 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 25880 8004A480 AFB20038 */  sw        $s2, 0x38($sp)
/* 25884 8004A484 0080902D */  daddu     $s2, $a0, $zero
/* 25888 8004A488 AFBF0048 */  sw        $ra, 0x48($sp)
/* 2588C 8004A48C AFB50044 */  sw        $s5, 0x44($sp)
/* 25890 8004A490 AFB40040 */  sw        $s4, 0x40($sp)
/* 25894 8004A494 AFB3003C */  sw        $s3, 0x3C($sp)
/* 25898 8004A498 AFB10034 */  sw        $s1, 0x34($sp)
/* 2589C 8004A49C AFB00030 */  sw        $s0, 0x30($sp)
/* 258A0 8004A4A0 8E510148 */  lw        $s1, 0x148($s2)
/* 258A4 8004A4A4 86240008 */  lh        $a0, 0x8($s1)
/* 258A8 8004A4A8 0C00EABB */  jal       get_npc_unsafe
/* 258AC 8004A4AC 00A0802D */   daddu    $s0, $a1, $zero
/* 258B0 8004A4B0 8E43000C */  lw        $v1, 0xC($s2)
/* 258B4 8004A4B4 0240202D */  daddu     $a0, $s2, $zero
/* 258B8 8004A4B8 8C650000 */  lw        $a1, 0x0($v1)
/* 258BC 8004A4BC 0C0B1EAF */  jal       evt_get_variable
/* 258C0 8004A4C0 0040A82D */   daddu    $s5, $v0, $zero
/* 258C4 8004A4C4 AFA00010 */  sw        $zero, 0x10($sp)
/* 258C8 8004A4C8 8E2300D0 */  lw        $v1, 0xD0($s1)
/* 258CC 8004A4CC 8C630030 */  lw        $v1, 0x30($v1)
/* 258D0 8004A4D0 AFA30014 */  sw        $v1, 0x14($sp)
/* 258D4 8004A4D4 8E2300D0 */  lw        $v1, 0xD0($s1)
/* 258D8 8004A4D8 8C63001C */  lw        $v1, 0x1C($v1)
/* 258DC 8004A4DC AFA30018 */  sw        $v1, 0x18($sp)
/* 258E0 8004A4E0 8E2300D0 */  lw        $v1, 0xD0($s1)
/* 258E4 8004A4E4 8C630024 */  lw        $v1, 0x24($v1)
/* 258E8 8004A4E8 AFA3001C */  sw        $v1, 0x1C($sp)
/* 258EC 8004A4EC 8E2300D0 */  lw        $v1, 0xD0($s1)
/* 258F0 8004A4F0 8C630028 */  lw        $v1, 0x28($v1)
/* 258F4 8004A4F4 27B40010 */  addiu     $s4, $sp, 0x10
/* 258F8 8004A4F8 AFA30020 */  sw        $v1, 0x20($sp)
/* 258FC 8004A4FC 8E2300D0 */  lw        $v1, 0xD0($s1)
/* 25900 8004A500 3C014282 */  lui       $at, (0x42820000 >> 16)
/* 25904 8004A504 44810000 */  mtc1      $at, $f0
/* 25908 8004A508 8C63002C */  lw        $v1, 0x2C($v1)
/* 2590C 8004A50C 0040982D */  daddu     $s3, $v0, $zero
/* 25910 8004A510 E7A00028 */  swc1      $f0, 0x28($sp)
/* 25914 8004A514 A7A0002C */  sh        $zero, 0x2C($sp)
/* 25918 8004A518 16000005 */  bnez      $s0, .L8004A530
/* 2591C 8004A51C AFA30024 */   sw       $v1, 0x24($sp)
/* 25920 8004A520 8E2200B0 */  lw        $v0, 0xB0($s1)
/* 25924 8004A524 30420004 */  andi      $v0, $v0, 0x4
/* 25928 8004A528 1040002B */  beqz      $v0, .L8004A5D8
/* 2592C 8004A52C 00000000 */   nop
.L8004A530:
/* 25930 8004A530 2404F7FF */  addiu     $a0, $zero, -0x801
/* 25934 8004A534 AE400070 */  sw        $zero, 0x70($s2)
/* 25938 8004A538 A6A0008E */  sh        $zero, 0x8E($s5)
/* 2593C 8004A53C 8E2200CC */  lw        $v0, 0xCC($s1)
/* 25940 8004A540 8EA30000 */  lw        $v1, 0x0($s5)
/* 25944 8004A544 8C420000 */  lw        $v0, 0x0($v0)
/* 25948 8004A548 00641824 */  and       $v1, $v1, $a0
/* 2594C 8004A54C AEA30000 */  sw        $v1, 0x0($s5)
/* 25950 8004A550 AEA20028 */  sw        $v0, 0x28($s5)
/* 25954 8004A554 8E2200D0 */  lw        $v0, 0xD0($s1)
/* 25958 8004A558 8C420034 */  lw        $v0, 0x34($v0)
/* 2595C 8004A55C 54400005 */  bnel      $v0, $zero, .L8004A574
/* 25960 8004A560 2402FDFF */   addiu    $v0, $zero, -0x201
/* 25964 8004A564 34620200 */  ori       $v0, $v1, 0x200
/* 25968 8004A568 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 2596C 8004A56C 0801295F */  j         .L8004A57C
/* 25970 8004A570 00431024 */   and      $v0, $v0, $v1
.L8004A574:
/* 25974 8004A574 00621024 */  and       $v0, $v1, $v0
/* 25978 8004A578 34420008 */  ori       $v0, $v0, 0x8
.L8004A57C:
/* 2597C 8004A57C AEA20000 */  sw        $v0, 0x0($s5)
/* 25980 8004A580 8E2200B0 */  lw        $v0, 0xB0($s1)
/* 25984 8004A584 30420004 */  andi      $v0, $v0, 0x4
/* 25988 8004A588 10400004 */  beqz      $v0, .L8004A59C
/* 2598C 8004A58C 24020063 */   addiu    $v0, $zero, 0x63
/* 25990 8004A590 AE420070 */  sw        $v0, 0x70($s2)
/* 25994 8004A594 0801296D */  j         .L8004A5B4
/* 25998 8004A598 AE400074 */   sw       $zero, 0x74($s2)
.L8004A59C:
/* 2599C 8004A59C 8E220000 */  lw        $v0, 0x0($s1)
/* 259A0 8004A5A0 3C034000 */  lui       $v1, (0x40000000 >> 16)
/* 259A4 8004A5A4 00431024 */  and       $v0, $v0, $v1
/* 259A8 8004A5A8 10400002 */  beqz      $v0, .L8004A5B4
/* 259AC 8004A5AC 2402000C */   addiu    $v0, $zero, 0xC
/* 259B0 8004A5B0 AE420070 */  sw        $v0, 0x70($s2)
.L8004A5B4:
/* 259B4 8004A5B4 3C05BFFF */  lui       $a1, (0xBFFFFFFF >> 16)
/* 259B8 8004A5B8 34A5FFFF */  ori       $a1, $a1, (0xBFFFFFFF & 0xFFFF)
/* 259BC 8004A5BC 2404FFFB */  addiu     $a0, $zero, -0x5
/* 259C0 8004A5C0 8E2200B0 */  lw        $v0, 0xB0($s1)
/* 259C4 8004A5C4 8E230000 */  lw        $v1, 0x0($s1)
/* 259C8 8004A5C8 00441024 */  and       $v0, $v0, $a0
/* 259CC 8004A5CC 00651824 */  and       $v1, $v1, $a1
/* 259D0 8004A5D0 AE2200B0 */  sw        $v0, 0xB0($s1)
/* 259D4 8004A5D4 AE230000 */  sw        $v1, 0x0($s1)
.L8004A5D8:
/* 259D8 8004A5D8 8E430070 */  lw        $v1, 0x70($s2)
/* 259DC 8004A5DC 2C620064 */  sltiu     $v0, $v1, 0x64
/* 259E0 8004A5E0 10400038 */  beqz      $v0, .L8004A6C4
/* 259E4 8004A5E4 00031080 */   sll      $v0, $v1, 2
/* 259E8 8004A5E8 3C01800A */  lui       $at, %hi(jtbl_80098728)
/* 259EC 8004A5EC 00220821 */  addu      $at, $at, $v0
/* 259F0 8004A5F0 8C228728 */  lw        $v0, %lo(jtbl_80098728)($at)
/* 259F4 8004A5F4 00400008 */  jr        $v0
/* 259F8 8004A5F8 00000000 */   nop
glabel .L8004A5FC
/* 259FC 8004A5FC 0240202D */  daddu     $a0, $s2, $zero
/* 25A00 8004A600 0260282D */  daddu     $a1, $s3, $zero
/* 25A04 8004A604 0C012568 */  jal       basic_ai_wander_init
/* 25A08 8004A608 0280302D */   daddu    $a2, $s4, $zero
glabel .L8004A60C
/* 25A0C 8004A60C 0240202D */  daddu     $a0, $s2, $zero
/* 25A10 8004A610 0260282D */  daddu     $a1, $s3, $zero
/* 25A14 8004A614 0C0125AE */  jal       basic_ai_wander
/* 25A18 8004A618 0280302D */   daddu    $a2, $s4, $zero
/* 25A1C 8004A61C 080129B1 */  j         .L8004A6C4
/* 25A20 8004A620 00000000 */   nop
glabel .L8004A624
/* 25A24 8004A624 0240202D */  daddu     $a0, $s2, $zero
/* 25A28 8004A628 0260282D */  daddu     $a1, $s3, $zero
/* 25A2C 8004A62C 0C0126D1 */  jal       basic_ai_loiter_init
/* 25A30 8004A630 0280302D */   daddu    $a2, $s4, $zero
glabel .L8004A634
/* 25A34 8004A634 0240202D */  daddu     $a0, $s2, $zero
/* 25A38 8004A638 0260282D */  daddu     $a1, $s3, $zero
/* 25A3C 8004A63C 0C012701 */  jal       basic_ai_loiter
/* 25A40 8004A640 0280302D */   daddu    $a2, $s4, $zero
/* 25A44 8004A644 080129B1 */  j         .L8004A6C4
/* 25A48 8004A648 00000000 */   nop
glabel .L8004A64C
/* 25A4C 8004A64C 0240202D */  daddu     $a0, $s2, $zero
/* 25A50 8004A650 0260282D */  daddu     $a1, $s3, $zero
/* 25A54 8004A654 0C01278F */  jal       basic_ai_found_player_jump_init
/* 25A58 8004A658 0280302D */   daddu    $a2, $s4, $zero
glabel .L8004A65C
/* 25A5C 8004A65C 0240202D */  daddu     $a0, $s2, $zero
/* 25A60 8004A660 0260282D */  daddu     $a1, $s3, $zero
/* 25A64 8004A664 0C0127B3 */  jal       basic_ai_found_player_jump
/* 25A68 8004A668 0280302D */   daddu    $a2, $s4, $zero
/* 25A6C 8004A66C 080129B1 */  j         .L8004A6C4
/* 25A70 8004A670 00000000 */   nop
glabel .L8004A674
/* 25A74 8004A674 0240202D */  daddu     $a0, $s2, $zero
/* 25A78 8004A678 0260282D */  daddu     $a1, $s3, $zero
/* 25A7C 8004A67C 0C0127DF */  jal       basic_ai_chase_init
/* 25A80 8004A680 0280302D */   daddu    $a2, $s4, $zero
glabel .L8004A684
/* 25A84 8004A684 0240202D */  daddu     $a0, $s2, $zero
/* 25A88 8004A688 0260282D */  daddu     $a1, $s3, $zero
/* 25A8C 8004A68C 0C012849 */  jal       basic_ai_chase
/* 25A90 8004A690 0280302D */   daddu    $a2, $s4, $zero
/* 25A94 8004A694 8E430070 */  lw        $v1, 0x70($s2)
/* 25A98 8004A698 2402000E */  addiu     $v0, $zero, 0xE
/* 25A9C 8004A69C 14620009 */  bne       $v1, $v0, .L8004A6C4
/* 25AA0 8004A6A0 00000000 */   nop
glabel .L8004A6A4
/* 25AA4 8004A6A4 0240202D */  daddu     $a0, $s2, $zero
/* 25AA8 8004A6A8 0260282D */  daddu     $a1, $s3, $zero
/* 25AAC 8004A6AC 0C0128FA */  jal       basic_ai_lose_player
/* 25AB0 8004A6B0 0280302D */   daddu    $a2, $s4, $zero
/* 25AB4 8004A6B4 080129B1 */  j         .L8004A6C4
/* 25AB8 8004A6B8 00000000 */   nop
glabel .L8004A6BC
/* 25ABC 8004A6BC 0C0129CF */  jal       basic_ai_suspend
/* 25AC0 8004A6C0 0240202D */   daddu    $a0, $s2, $zero
glabel .L8004A6C4
/* 25AC4 8004A6C4 8FBF0048 */  lw        $ra, 0x48($sp)
/* 25AC8 8004A6C8 8FB50044 */  lw        $s5, 0x44($sp)
/* 25ACC 8004A6CC 8FB40040 */  lw        $s4, 0x40($sp)
/* 25AD0 8004A6D0 8FB3003C */  lw        $s3, 0x3C($sp)
/* 25AD4 8004A6D4 8FB20038 */  lw        $s2, 0x38($sp)
/* 25AD8 8004A6D8 8FB10034 */  lw        $s1, 0x34($sp)
/* 25ADC 8004A6DC 8FB00030 */  lw        $s0, 0x30($sp)
/* 25AE0 8004A6E0 0000102D */  daddu     $v0, $zero, $zero
/* 25AE4 8004A6E4 03E00008 */  jr        $ra
/* 25AE8 8004A6E8 27BD0050 */   addiu    $sp, $sp, 0x50
/* 25AEC 8004A6EC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

ApiStatus BasicAI_Main(Evt* script, s32 isInitialCall) {
    Enemy* enemy = script->owner1.enemy;
    Npc* npc = get_npc_unsafe(enemy->npcID);
    Bytecode* args = script->ptrReadPos;
    EnemyDetectVolume territory;
    EnemyDetectVolume* pTerritory = &territory;
    MobileAISettings* aiSettings = (MobileAISettings*) evt_get_variable(script, *args++);

    territory.skipPlayerDetectChance = 0;
    territory.shape = enemy->territory->wander.detectShape;
    territory.pointX = enemy->territory->wander.detectPos.x;
    territory.pointZ = enemy->territory->wander.detectPos.z;
    territory.sizeX = enemy->territory->wander.detectSize.x;
    territory.sizeZ = enemy->territory->wander.detectSize.z;
    territory.halfHeight = 65.0f;
    territory.detectFlags = 0;

    if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
        script->AI_TEMP_STATE = AI_STATE_WANDER_INIT;
        npc->duration = 0;

        npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];

        npc->flags &= ~NPC_FLAG_JUMPING;
        if (!enemy->territory->wander.isFlying) {
            npc->flags |= NPC_FLAG_GRAVITY;
            npc->flags &= ~NPC_FLAG_8;
        } else {
            npc->flags &= ~NPC_FLAG_GRAVITY;
            npc->flags |= NPC_FLAG_8;
        }

        if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) {
            script->AI_TEMP_STATE = AI_STATE_SUSPEND;
            script->functionTemp[1] = AI_STATE_WANDER_INIT;
        } else if (enemy->flags & ENEMY_FLAG_BEGIN_WITH_CHASING) {
            script->AI_TEMP_STATE = AI_STATE_CHASE_INIT;
        }

        enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND;
        enemy->flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
    }

    switch (script->AI_TEMP_STATE) {
        case AI_STATE_WANDER_INIT:
            basic_ai_wander_init(script, aiSettings, pTerritory);
        case AI_STATE_WANDER:
            basic_ai_wander(script, aiSettings, pTerritory);
            break;

        case AI_STATE_LOITER_INIT:
            basic_ai_loiter_init(script, aiSettings, pTerritory);
        case AI_STATE_LOITER:
            basic_ai_loiter(script, aiSettings, pTerritory);
            break;

        case AI_STATE_ALERT_INIT:
            basic_ai_found_player_jump_init(script, aiSettings, pTerritory);
        case AI_STATE_ALERT:
            basic_ai_found_player_jump(script, aiSettings, pTerritory);
            break;

        case AI_STATE_CHASE_INIT:
            basic_ai_chase_init(script, aiSettings, pTerritory);
        case AI_STATE_CHASE:
            basic_ai_chase(script, aiSettings, pTerritory);
            if (script->AI_TEMP_STATE != AI_STATE_LOSE_PLAYER) {
                break;
            }

        case AI_STATE_LOSE_PLAYER:
            basic_ai_lose_player(script, aiSettings, pTerritory);
            break;
        case AI_STATE_SUSPEND:
            basic_ai_suspend(script);
            break;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802B7728
/* E20838 802B7728 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* E2083C 802B772C AFB00010 */  sw        $s0, 0x10($sp)
/* E20840 802B7730 241000FF */  addiu     $s0, $zero, 0xFF
/* E20844 802B7734 AFBF0018 */  sw        $ra, 0x18($sp)
/* E20848 802B7738 0C0ADD7A */  jal       func_802B75E8
/* E2084C 802B773C AFB10014 */   sw       $s1, 0x14($sp)
/* E20850 802B7740 3C03802B */  lui       $v1, %hi(D_802B7CB8)
/* E20854 802B7744 24637CB8 */  addiu     $v1, $v1, %lo(D_802B7CB8)
/* E20858 802B7748 8C640000 */  lw        $a0, 0x0($v1)
/* E2085C 802B774C 3C118011 */  lui       $s1, %hi(gPlayerStatus)
/* E20860 802B7750 2631EFC8 */  addiu     $s1, $s1, %lo(gPlayerStatus)
/* E20864 802B7754 90850023 */  lbu       $a1, 0x23($a0)
/* E20868 802B7758 24020001 */  addiu     $v0, $zero, 0x1
/* E2086C 802B775C 10A20026 */  beq       $a1, $v0, .L802B77F8
/* E20870 802B7760 28A20002 */   slti     $v0, $a1, 0x2
/* E20874 802B7764 10400005 */  beqz      $v0, .L802B777C
/* E20878 802B7768 24020002 */   addiu    $v0, $zero, 0x2
/* E2087C 802B776C 10A00009 */  beqz      $a1, .L802B7794
/* E20880 802B7770 00000000 */   nop
/* E20884 802B7774 080ADE4A */  j         .L802B7928
/* E20888 802B7778 00000000 */   nop
.L802B777C:
/* E2088C 802B777C 10A20027 */  beq       $a1, $v0, .L802B781C
/* E20890 802B7780 24020003 */   addiu    $v0, $zero, 0x3
/* E20894 802B7784 10A20033 */  beq       $a1, $v0, .L802B7854
/* E20898 802B7788 00000000 */   nop
/* E2089C 802B778C 080ADE4A */  j         .L802B7928
/* E208A0 802B7790 00000000 */   nop
.L802B7794:
/* E208A4 802B7794 C4800010 */  lwc1      $f0, 0x10($a0)
/* E208A8 802B7798 3C01802B */  lui       $at, %hi(D_802B7D88)
/* E208AC 802B779C D4227D88 */  ldc1      $f2, %lo(D_802B7D88)($at)
/* E208B0 802B77A0 3C01802B */  lui       $at, %hi(D_802B7D90)
/* E208B4 802B77A4 D4247D90 */  ldc1      $f4, %lo(D_802B7D90)($at)
/* E208B8 802B77A8 46000021 */  cvt.d.s   $f0, $f0
/* E208BC 802B77AC 46220000 */  add.d     $f0, $f0, $f2
/* E208C0 802B77B0 AC80000C */  sw        $zero, 0xC($a0)
/* E208C4 802B77B4 46200020 */  cvt.s.d   $f0, $f0
/* E208C8 802B77B8 460000A1 */  cvt.d.s   $f2, $f0
/* E208CC 802B77BC 4622203E */  c.le.d    $f4, $f2
/* E208D0 802B77C0 00000000 */  nop
/* E208D4 802B77C4 45000058 */  bc1f      .L802B7928
/* E208D8 802B77C8 E4800010 */   swc1     $f0, 0x10($a0)
/* E208DC 802B77CC 90820023 */  lbu       $v0, 0x23($a0)
/* E208E0 802B77D0 3C013F0C */  lui       $at, (0x3F0CCCCD >> 16)
/* E208E4 802B77D4 3421CCCD */  ori       $at, $at, (0x3F0CCCCD & 0xFFFF)
/* E208E8 802B77D8 44810000 */  mtc1      $at, $f0
/* E208EC 802B77DC 24420001 */  addiu     $v0, $v0, 0x1
/* E208F0 802B77E0 E4800010 */  swc1      $f0, 0x10($a0)
/* E208F4 802B77E4 A0820023 */  sb        $v0, 0x23($a0)
/* E208F8 802B77E8 8C630000 */  lw        $v1, 0x0($v1)
/* E208FC 802B77EC 2402000C */  addiu     $v0, $zero, 0xC
/* E20900 802B77F0 080ADE4A */  j         .L802B7928
/* E20904 802B77F4 AC620014 */   sw       $v0, 0x14($v1)
.L802B77F8:
/* E20908 802B77F8 8C820014 */  lw        $v0, 0x14($a0)
/* E2090C 802B77FC AC80000C */  sw        $zero, 0xC($a0)
/* E20910 802B7800 2442FFFF */  addiu     $v0, $v0, -0x1
/* E20914 802B7804 1C400048 */  bgtz      $v0, .L802B7928
/* E20918 802B7808 AC820014 */   sw       $v0, 0x14($a0)
/* E2091C 802B780C 90820023 */  lbu       $v0, 0x23($a0)
/* E20920 802B7810 24420001 */  addiu     $v0, $v0, 0x1
/* E20924 802B7814 080ADE4A */  j         .L802B7928
/* E20928 802B7818 A0820023 */   sb       $v0, 0x23($a0)
.L802B781C:
/* E2092C 802B781C C48C000C */  lwc1      $f12, 0xC($a0)
/* E20930 802B7820 3C014120 */  lui       $at, (0x41200000 >> 16)
/* E20934 802B7824 44810000 */  mtc1      $at, $f0
/* E20938 802B7828 00000000 */  nop
/* E2093C 802B782C 46006300 */  add.s     $f12, $f12, $f0
/* E20940 802B7830 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* E20944 802B7834 44810000 */  mtc1      $at, $f0
/* E20948 802B7838 00000000 */  nop
/* E2094C 802B783C 460C003E */  c.le.s    $f0, $f12
/* E20950 802B7840 00000000 */  nop
/* E20954 802B7844 45030001 */  bc1tl     .L802B784C
/* E20958 802B7848 46006301 */   sub.s    $f12, $f12, $f0
.L802B784C:
/* E2095C 802B784C 080ADE47 */  j         .L802B791C
/* E20960 802B7850 E48C000C */   swc1     $f12, 0xC($a0)
.L802B7854:
/* E20964 802B7854 C48C000C */  lwc1      $f12, 0xC($a0)
/* E20968 802B7858 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* E2096C 802B785C 44810000 */  mtc1      $at, $f0
/* E20970 802B7860 00000000 */  nop
/* E20974 802B7864 46006300 */  add.s     $f12, $f12, $f0
/* E20978 802B7868 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* E2097C 802B786C 44810000 */  mtc1      $at, $f0
/* E20980 802B7870 00000000 */  nop
/* E20984 802B7874 460C003E */  c.le.s    $f0, $f12
/* E20988 802B7878 00000000 */  nop
/* E2098C 802B787C 45030001 */  bc1tl     .L802B7884
/* E20990 802B7880 46006301 */   sub.s    $f12, $f12, $f0
.L802B7884:
/* E20994 802B7884 8C82001C */  lw        $v0, 0x1C($a0)
/* E20998 802B7888 E48C000C */  swc1      $f12, 0xC($a0)
/* E2099C 802B788C 2442FFE7 */  addiu     $v0, $v0, -0x19
/* E209A0 802B7890 04410002 */  bgez      $v0, .L802B789C
/* E209A4 802B7894 AC82001C */   sw       $v0, 0x1C($a0)
/* E209A8 802B7898 AC80001C */  sw        $zero, 0x1C($a0)
.L802B789C:
/* E209AC 802B789C 3C01428C */  lui       $at, (0x428C0000 >> 16)
/* E209B0 802B78A0 44810000 */  mtc1      $at, $f0
/* E209B4 802B78A4 00000000 */  nop
/* E209B8 802B78A8 460C003E */  c.le.s    $f0, $f12
/* E209BC 802B78AC 00000000 */  nop
/* E209C0 802B78B0 45000008 */  bc1f      .L802B78D4
/* E209C4 802B78B4 00000000 */   nop
/* E209C8 802B78B8 3C0142DC */  lui       $at, (0x42DC0000 >> 16)
/* E209CC 802B78BC 44810000 */  mtc1      $at, $f0
/* E209D0 802B78C0 00000000 */  nop
/* E209D4 802B78C4 4600603E */  c.le.s    $f12, $f0
/* E209D8 802B78C8 00000000 */  nop
/* E209DC 802B78CC 4501000F */  bc1t      .L802B790C
/* E209E0 802B78D0 00000000 */   nop
.L802B78D4:
/* E209E4 802B78D4 3C01437A */  lui       $at, (0x437A0000 >> 16)
/* E209E8 802B78D8 44810000 */  mtc1      $at, $f0
/* E209EC 802B78DC 00000000 */  nop
/* E209F0 802B78E0 460C003E */  c.le.s    $f0, $f12
/* E209F4 802B78E4 00000000 */  nop
/* E209F8 802B78E8 4500000C */  bc1f      .L802B791C
/* E209FC 802B78EC 00000000 */   nop
/* E20A00 802B78F0 3C014391 */  lui       $at, (0x43910000 >> 16)
/* E20A04 802B78F4 44810000 */  mtc1      $at, $f0
/* E20A08 802B78F8 00000000 */  nop
/* E20A0C 802B78FC 4600603E */  c.le.s    $f12, $f0
/* E20A10 802B7900 00000000 */  nop
/* E20A14 802B7904 45000005 */  bc1f      .L802B791C
/* E20A18 802B7908 00000000 */   nop
.L802B790C:
/* E20A1C 802B790C 3C02802B */  lui       $v0, %hi(func_802B79C8)
D_802B7910:
/* E20A20 802B7910 244279C8 */  addiu     $v0, $v0, %lo(func_802B79C8)
/* E20A24 802B7914 3C018011 */  lui       $at, %hi(InteractNotificationCallback)
/* E20A28 802B7918 AC22C958 */  sw        $v0, %lo(InteractNotificationCallback)($at)
.L802B791C:
/* E20A2C 802B791C 0C0ADC00 */  jal       appendGfx_ispy_icon
/* E20A30 802B7920 00000000 */   nop
/* E20A34 802B7924 0040802D */  daddu     $s0, $v0, $zero
.L802B7928:
/* E20A38 802B7928 3C02802B */  lui       $v0, %hi(D_802B7CB8)
/* E20A3C 802B792C 8C427CB8 */  lw        $v0, %lo(D_802B7CB8)($v0)
D_802B7930:
/* E20A40 802B7930 A0500024 */  sb        $s0, 0x24($v0)
/* E20A44 802B7934 0C0ADD14 */  jal       should_continue_inspect
/* E20A48 802B7938 823000B4 */   lb       $s0, 0xB4($s1)
/* E20A4C 802B793C 1040000A */  beqz      $v0, .L802B7968
/* E20A50 802B7940 00000000 */   nop
/* E20A54 802B7944 82220015 */  lb        $v0, 0x15($s1)
/* E20A58 802B7948 14400007 */  bnez      $v0, .L802B7968
/* E20A5C 802B794C 00000000 */   nop
/* E20A60 802B7950 8E220000 */  lw        $v0, 0x0($s1)
/* E20A64 802B7954 30420020 */  andi      $v0, $v0, 0x20
/* E20A68 802B7958 14400003 */  bnez      $v0, .L802B7968
/* E20A6C 802B795C 2E020003 */   sltiu    $v0, $s0, 0x3
/* E20A70 802B7960 14400005 */  bnez      $v0, .L802B7978
/* E20A74 802B7964 00000000 */   nop
.L802B7968:
/* E20A78 802B7968 3C03802B */  lui       $v1, %hi(D_802B7CB8)
/* E20A7C 802B796C 8C637CB8 */  lw        $v1, %lo(D_802B7CB8)($v1)
/* E20A80 802B7970 24020003 */  addiu     $v0, $zero, 0x3
/* E20A84 802B7974 A0620023 */  sb        $v0, 0x23($v1)
.L802B7978:
/* E20A88 802B7978 862400C6 */  lh        $a0, 0xC6($s1)
/* E20A8C 802B797C 962200C6 */  lhu       $v0, 0xC6($s1)
/* E20A90 802B7980 0480000C */  bltz      $a0, .L802B79B4
/* E20A94 802B7984 30424000 */   andi     $v0, $v0, 0x4000
/* E20A98 802B7988 1040000A */  beqz      $v0, .L802B79B4
/* E20A9C 802B798C 00000000 */   nop
/* E20AA0 802B7990 0C04417A */  jal       get_entity_by_index
/* E20AA4 802B7994 00000000 */   nop
/* E20AA8 802B7998 8C420000 */  lw        $v0, 0x0($v0)
/* E20AAC 802B799C 30421000 */  andi      $v0, $v0, 0x1000
/* E20AB0 802B79A0 14400004 */  bnez      $v0, .L802B79B4
/* E20AB4 802B79A4 24020003 */   addiu    $v0, $zero, 0x3
D_802B79A8:
/* E20AB8 802B79A8 3C03802B */  lui       $v1, %hi(D_802B7CB8)
/* E20ABC 802B79AC 8C637CB8 */  lw        $v1, %lo(D_802B7CB8)($v1)
D_802B79B0:
/* E20AC0 802B79B0 A0620023 */  sb        $v0, 0x23($v1)
.L802B79B4:
/* E20AC4 802B79B4 8FBF0018 */  lw        $ra, 0x18($sp)
D_802B79B8:
/* E20AC8 802B79B8 8FB10014 */  lw        $s1, 0x14($sp)
/* E20ACC 802B79BC 8FB00010 */  lw        $s0, 0x10($sp)
D_802B79C0:
/* E20AD0 802B79C0 03E00008 */  jr        $ra
/* E20AD4 802B79C4 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void interact_inspect_update(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    s32 brightness = 255;
    f32 angle;
    s32 actionState;

    update_inspect_icon_pos();

    switch (InspectIconPtr->state) {
        case INSPECT_ICON_APPEAR:
            InspectIconPtr->yaw = 0.0f;
            InspectIconPtr->scale += 0.05;
            if (InspectIconPtr->scale >= 0.55) {
                InspectIconPtr->scale = 0.55f;
                InspectIconPtr->state++;
                InspectIconPtr->holdTime = 12;
            }
            break;
        case INSPECT_ICON_HOLD:
            InspectIconPtr->yaw = 0.0f;
            InspectIconPtr->holdTime--;
            if (InspectIconPtr->holdTime <= 0) {
                InspectIconPtr->state++;
            }
            break;
        case INSPECT_ICON_IDLE:
            angle = InspectIconPtr->yaw;
            angle += 10.0f;
            if (angle >= 360.0f) {
                angle -= 360.0f;
            }
            InspectIconPtr->yaw = angle;
            brightness = N(GetIconBrightnessForAngle)(angle);
            break;
        case INSPECT_ICON_VANISH:
            angle = InspectIconPtr->yaw;
            angle += 25.0f;
            if (angle >= 360.0f) {
                angle -= 360.0f;
            }
            InspectIconPtr->yaw = angle;
            InspectIconPtr->alpha -= 25;
            if (InspectIconPtr->alpha < 0) {
                InspectIconPtr->alpha = 0;
            }
            if ((angle >= 70.0f && angle <= 110.0f) || (angle >= 250.0f && angle <= 290.0f)) {
                // only dimiss when the icon is rotated away from view
                InteractNotificationCallback = interact_inspect_dismiss;
            }
            brightness = N(GetIconBrightnessForAngle)(angle);
            break;
    }
    InspectIconPtr->brightness = brightness;

    actionState = playerStatus->actionState;
    if (!should_continue_inspect()
        || (playerStatus->inputDisabledCount != 0)
        || (playerStatus->flags & PS_FLAG_PAUSED)
        || !(actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN)
    ) {
        InspectIconPtr->state = INSPECT_ICON_VANISH;
    }

    if ((playerStatus->interactingWithID >= 0)
        && (playerStatus->interactingWithID & COLLISION_WITH_ENTITY_BIT)
        && !(get_entity_by_index(playerStatus->interactingWithID)->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT)
    ) {
        InspectIconPtr->state = INSPECT_ICON_VANISH;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel get_current_partner_id
/* 7E538 800E5088 3C028011 */  lui       $v0, %hi(gPlayerData + 0x12)
/* 7E53C 800E508C 8042F2A2 */  lb        $v0, %lo(gPlayerData + 0x12)($v0)
/* 7E540 800E5090 03E00008 */  jr        $ra
/* 7E544 800E5094 00000000 */   nop

### DECOMPILED C INSTRUCTIONS:

            if (get_current_partner_id() == PARTNER_BOW) {
                playerStatus->position.x += playerStatus->pushVelocity.x;
                playerStatus->position.y += playerStatus->pushVelocity.y;
                playerStatus->position.z += playerStatus->pushVelocity.z;

                if (playerStatus->pushVelocity.x != 0.0f ||
                    playerStatus->pushVelocity.y != 0.0f ||
                    playerStatus->pushVelocity.z != 0.0f)
                {
                    gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
                    gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
                    gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
                    if (playerStatus->alpha1 != 128) {
                        collision_check_player_intersecting_world(0, 0,
                            atan2(0.0f, 0.0f, playerStatus->pushVelocity.x, playerStatus->pushVelocity.z));
                    }
                }
            }
            break;
        case ACTION_STATE_SPIN_POUND:
        case ACTION_STATE_TORNADO_POUND:
            playerStatus->position.x += playerStatus->pushVelocity.x;
            playerStatus->position.y += playerStatus->pushVelocity.y;
            playerStatus->position.z += playerStatus->pushVelocity.z;
            if (playerStatus->pushVelocity.x != 0.0f ||
                playerStatus->pushVelocity.y != 0.0f ||
                playerStatus->pushVelocity.z != 0.0f)
            {
                gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
                gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
                gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
            }
            if (playerStatus->pushVelocity.x != 0.0f ||
                playerStatus->pushVelocity.y != 0.0f ||
                playerStatus->pushVelocity.z != 0.0f)
            {
                collision_check_player_intersecting_world(0, 0,
                    playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw);
            }
            break;
        case ACTION_STATE_HAMMER:
            playerStatus->position.x += playerStatus->pushVelocity.x;
            playerStatus->position.y += playerStatus->pushVelocity.y;
            playerStatus->position.z += playerStatus->pushVelocity.z;
            if (playerStatus->pushVelocity.x != 0.0f ||
                playerStatus->pushVelocity.y != 0.0f ||
                playerStatus->pushVelocity.z != 0.0f)
            {
                gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
                gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
                gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
            }

            playerX = playerStatus->position.x;
            playerY = playerStatus->position.y;
            playerZ = playerStatus->position.z;
            if (playerStatus->currentSpeed != 0.0f) {
                yaw = playerStatus->targetYaw;
            } else {
                yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw;
            }
            collisionStatus->currentWall =
                player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ,
                                               playerStatus->colliderDiameter * 0.5f, yaw);

            if (playerStatus->pushVelocity.x != 0.0f ||
                playerStatus->pushVelocity.y != 0.0f ||
                playerStatus->pushVelocity.z != 0.0f)
            {
                collision_check_player_intersecting_world(0, 0,
                    playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw);
            }
            break;
        default:
            if (!(playerStatus->flags & PS_FLAG_FLYING)) {
                f32 new_var;

                speed = 0.0f;
                if (!(playerStatus->flags & (PS_FLAG_SCRIPTED_FALL | PS_FLAG_INPUT_DISABLED))) {
                    player_input_to_move_vector(&yaw, &speed);
                    if (!(playerStatus->animFlags & PA_FLAG_SPINNING)) {
                        speed *= 0.03125f;
                        if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
                            speed *= 0.25;
                        }
                        if (playerStatus->actionState == ACTION_STATE_LAUNCH) {
                            speed *= 1.5;
                        }
                        if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
                            speed *= 0.5f;
                        }
                    }
                    sin_cos_rad(DEG_TO_RAD(yaw), &sinTheta, &cosTheta);

                    if (playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK) {
                        if (fabsf(sinTheta) > fabsf(cosTheta)) {
                            xBump = speed * sinTheta;
                            zBump = 0.0f;
                        } else {
                            xBump = 0.0f;
                            zBump = -speed * cosTheta;
                        }
                    } else if (!(playerStatus->animFlags & PA_FLAG_SPINNING)) {
                        xBump = speed * sinTheta;
                        zBump = -speed * cosTheta;
                    } else {
                        xBump = 0.0f;
                        zBump = 0.0f;
                    }

                    sin_cos_rad(DEG_TO_RAD(playerStatus->targetYaw), &sinTheta, &cosTheta);
                    speed = playerStatus->currentSpeed;
                    if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
                        speed *= 0.5f;
                    }
                    playerX = xBump + (speed * sinTheta);
                    playerZ = zBump - (speed * cosTheta);
                    yaw = atan2(0.0f, 0.0f, playerX, playerZ);
                    speed = sqrtf(SQ(playerX) + SQ(playerZ));
                    if (playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING)) {
                        if (speed > playerStatus->runSpeed) {
                            speed = playerStatus->runSpeed;
                        }
                    }
                }

                playerStatus->position.x += playerStatus->pushVelocity.x;
                playerStatus->position.z += playerStatus->pushVelocity.z;
                if (playerStatus->timeInAir == 0) {
                    playerStatus->position.y += playerStatus->pushVelocity.y;
                }

                if (
                    playerStatus->pushVelocity.x != 0.0f ||
                    playerStatus->pushVelocity.y != 0.0f ||
                    playerStatus->pushVelocity.z != 0.0f)
                {
                    gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
                    gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
                    gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
                }

                playerX = playerStatus->position.x;
                playerY = playerStatus->position.y;
                playerZ = playerStatus->position.z;
                result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ,
                                                        playerStatus->colliderDiameter * 0.5f, playerStatus->targetYaw);
                if (speed == 0.0f && result < 0) {
                    yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw;
                    sin_cos_rad(DEG_TO_RAD(yaw2 + 180.0f), &sinTheta, &cosTheta);
                    playerX = playerStatus->position.x + (sinTheta * playerStatus->colliderDiameter * 0.5f);
                    playerY = playerStatus->position.y;
                    playerZ = playerStatus->position.z - (cosTheta * playerStatus->colliderDiameter * 0.5f);
                    result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ,
                                                            playerStatus->colliderDiameter, yaw2);
                }
                collisionStatus->currentWall = result;
                if (!(playerStatus->flags & PS_FLAG_MOVEMENT_LOCKED) && playerStatus->actionState != ACTION_STATE_HAMMER) {
                    if (speed == 0.0f) {
                        collision_check_player_intersecting_world(0, 0,
                            playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw);
                        break;
                    }

                    playerX = playerStatus->position.x;
                    playerZ = playerStatus->position.z;
                    playerY = playerStatus->position.y;
                    yaw2 = yaw;

                    if (speed > 4.0f) {
                        result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, 4.0f, yaw2);
                        if (result < 0) {
                            result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, speed - 4.0f, yaw2);
                        }
                        collisionStatus->pushingAgainstWall = result;
                    } else {
                        collisionStatus->pushingAgainstWall =
                            player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, speed, yaw2);
                    }

                    test1X = playerX;
                    test1Y = playerY;
                    test1Z = playerZ;
                    yaw = clamp_angle(yaw2 - 35.0);
                    test1 = player_test_lateral_overlap(0, playerStatus, &test1X, &test1Y, &test1Z, 0.0f, yaw);
                    test2X = playerX;
                    test2Z = playerY;
                    test2Y = playerZ;
                    yaw = clamp_angle(yaw2 + 35.0);
                    test2 = player_test_lateral_overlap(0, playerStatus, &test2X, &test2Z, &test2Y, 0.0f, yaw);

                    if (test1 < 0) {
                        if (test2 < 0) {
                            playerStatus->position.x = playerX;
                            playerStatus->position.z = playerZ;
                        } else {
                            playerStatus->position.x = test1X;
                            playerStatus->position.z = test1Z;
                        }
                    } else if (test2 < 0) {
                        playerStatus->position.x = test2X;
                        playerStatus->position.z = test2Y;
                    }

                    if (playerStatus->enableCollisionOverlapsCheck == 0) {
                        if (playerStatus->animFlags & PA_FLAG_SPINNING) {
                            yaw2 = playerStatus->targetYaw;
                        } else {
                            yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw;
                        }
                        if (collision_check_player_intersecting_world(0, 0, yaw2) < 0) {
                            collision_check_player_intersecting_world(1, playerStatus->colliderHeight * 0.75f, yaw2);
                        }
                    }
                }
            }
            break;
        case ACTION_STATE_LANDING_ON_SWITCH:
        case ACTION_STATE_LAND:
        case ACTION_STATE_STEP_DOWN_LAND:
        case ACTION_STATE_TORNADO_JUMP:
        case ACTION_STATE_SLIDING:
        case ACTION_STATE_HIT_FIRE:
        case ACTION_STATE_HIT_LAVA:
        case ACTION_STATE_USE_SNEAKY_PARASOL:
        case ACTION_STATE_USE_SPRING:
            break;
    }
}