### RAW ASSEMBLY INSTRUCTIONS:

glabel JumpToGoalSimple2
/* 1A7D00 80279420 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 1A7D04 80279424 AFB20020 */  sw        $s2, 0x20($sp)
/* 1A7D08 80279428 0080902D */  daddu     $s2, $a0, $zero
/* 1A7D0C 8027942C AFBF0024 */  sw        $ra, 0x24($sp)
/* 1A7D10 80279430 AFB1001C */  sw        $s1, 0x1C($sp)
/* 1A7D14 80279434 AFB00018 */  sw        $s0, 0x18($sp)
/* 1A7D18 80279438 F7BE0050 */  sdc1      $f30, 0x50($sp)
/* 1A7D1C 8027943C F7BC0048 */  sdc1      $f28, 0x48($sp)
/* 1A7D20 80279440 F7BA0040 */  sdc1      $f26, 0x40($sp)
/* 1A7D24 80279444 F7B80038 */  sdc1      $f24, 0x38($sp)
/* 1A7D28 80279448 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 1A7D2C 8027944C F7B40028 */  sdc1      $f20, 0x28($sp)
/* 1A7D30 80279450 8E51000C */  lw        $s1, 0xC($s2)
/* 1A7D34 80279454 54A00001 */  bnel      $a1, $zero, .L8027945C
/* 1A7D38 80279458 AE400070 */   sw       $zero, 0x70($s2)
.L8027945C:
/* 1A7D3C 8027945C 8E420070 */  lw        $v0, 0x70($s2)
/* 1A7D40 80279460 14400073 */  bnez      $v0, .L80279630
/* 1A7D44 80279464 00000000 */   nop
/* 1A7D48 80279468 8E250000 */  lw        $a1, 0x0($s1)
/* 1A7D4C 8027946C 26310004 */  addiu     $s1, $s1, 0x4
/* 1A7D50 80279470 0C0B1EAF */  jal       evt_get_variable
/* 1A7D54 80279474 0240202D */   daddu    $a0, $s2, $zero
/* 1A7D58 80279478 0040202D */  daddu     $a0, $v0, $zero
/* 1A7D5C 8027947C 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 1A7D60 80279480 14820002 */  bne       $a0, $v0, .L8027948C
/* 1A7D64 80279484 00000000 */   nop
/* 1A7D68 80279488 8E440148 */  lw        $a0, 0x148($s2)
.L8027948C:
/* 1A7D6C 8027948C 0C09A75B */  jal       get_actor
/* 1A7D70 80279490 00000000 */   nop
/* 1A7D74 80279494 0040802D */  daddu     $s0, $v0, $zero
/* 1A7D78 80279498 AE500074 */  sw        $s0, 0x74($s2)
/* 1A7D7C 8027949C 8E250000 */  lw        $a1, 0x0($s1)
/* 1A7D80 802794A0 0C0B1EAF */  jal       evt_get_variable
/* 1A7D84 802794A4 0240202D */   daddu    $a0, $s2, $zero
/* 1A7D88 802794A8 C6000148 */  lwc1      $f0, 0x148($s0)
/* 1A7D8C 802794AC C61A0018 */  lwc1      $f26, 0x18($s0)
/* 1A7D90 802794B0 C61C0020 */  lwc1      $f28, 0x20($s0)
/* 1A7D94 802794B4 C614014C */  lwc1      $f20, 0x14C($s0)
/* 1A7D98 802794B8 C618001C */  lwc1      $f24, 0x1C($s0)
/* 1A7D9C 802794BC 2611000C */  addiu     $s1, $s0, 0xC
/* 1A7DA0 802794C0 A6020070 */  sh        $v0, 0x70($s0)
/* 1A7DA4 802794C4 E6000010 */  swc1      $f0, 0x10($s0)
/* 1A7DA8 802794C8 46000786 */  mov.s     $f30, $f0
/* 1A7DAC 802794CC 4406D000 */  mfc1      $a2, $f26
/* 1A7DB0 802794D0 4407E000 */  mfc1      $a3, $f28
/* 1A7DB4 802794D4 C6000144 */  lwc1      $f0, 0x144($s0)
/* 1A7DB8 802794D8 4600A386 */  mov.s     $f14, $f20
/* 1A7DBC 802794DC E6140014 */  swc1      $f20, 0x14($s0)
/* 1A7DC0 802794E0 E600000C */  swc1      $f0, 0xC($s0)
/* 1A7DC4 802794E4 46000586 */  mov.s     $f22, $f0
/* 1A7DC8 802794E8 0C00A720 */  jal       atan2
/* 1A7DCC 802794EC 4600B306 */   mov.s    $f12, $f22
/* 1A7DD0 802794F0 4600B306 */  mov.s     $f12, $f22
/* 1A7DD4 802794F4 4600A386 */  mov.s     $f14, $f20
/* 1A7DD8 802794F8 4406D000 */  mfc1      $a2, $f26
/* 1A7DDC 802794FC 4407E000 */  mfc1      $a3, $f28
/* 1A7DE0 80279500 4618F781 */  sub.s     $f30, $f30, $f24
/* 1A7DE4 80279504 0C00A7B5 */  jal       dist2D
/* 1A7DE8 80279508 E6000054 */   swc1     $f0, 0x54($s0)
/* 1A7DEC 8027950C 86020070 */  lh        $v0, 0x70($s0)
/* 1A7DF0 80279510 46000106 */  mov.s     $f4, $f0
/* 1A7DF4 80279514 14400012 */  bnez      $v0, .L80279560
/* 1A7DF8 80279518 E6040058 */   swc1     $f4, 0x58($s0)
/* 1A7DFC 8027951C C600004C */  lwc1      $f0, 0x4C($s0)
/* 1A7E00 80279520 C602004C */  lwc1      $f2, 0x4C($s0)
/* 1A7E04 80279524 46002003 */  div.s     $f0, $f4, $f0
/* 1A7E08 80279528 4600028D */  trunc.w.s $f10, $f0
/* 1A7E0C 8027952C 44035000 */  mfc1      $v1, $f10
/* 1A7E10 80279530 00000000 */  nop
/* 1A7E14 80279534 00031400 */  sll       $v0, $v1, 16
/* 1A7E18 80279538 00021403 */  sra       $v0, $v0, 16
/* 1A7E1C 8027953C 44820000 */  mtc1      $v0, $f0
/* 1A7E20 80279540 00000000 */  nop
/* 1A7E24 80279544 46800020 */  cvt.s.w   $f0, $f0
/* 1A7E28 80279548 46020002 */  mul.s     $f0, $f0, $f2
/* 1A7E2C 8027954C 00000000 */  nop
/* 1A7E30 80279550 46002086 */  mov.s     $f2, $f4
/* 1A7E34 80279554 A6030070 */  sh        $v1, 0x70($s0)
/* 1A7E38 80279558 0809E565 */  j         .L80279594
/* 1A7E3C 8027955C 46001201 */   sub.s    $f8, $f2, $f0
.L80279560:
/* 1A7E40 80279560 44821000 */  mtc1      $v0, $f2
/* 1A7E44 80279564 00000000 */  nop
/* 1A7E48 80279568 468010A0 */  cvt.s.w   $f2, $f2
/* 1A7E4C 8027956C 86020070 */  lh        $v0, 0x70($s0)
/* 1A7E50 80279570 46022083 */  div.s     $f2, $f4, $f2
/* 1A7E54 80279574 44820000 */  mtc1      $v0, $f0
/* 1A7E58 80279578 00000000 */  nop
/* 1A7E5C 8027957C 46800020 */  cvt.s.w   $f0, $f0
/* 1A7E60 80279580 46020002 */  mul.s     $f0, $f0, $f2
/* 1A7E64 80279584 00000000 */  nop
/* 1A7E68 80279588 C6040058 */  lwc1      $f4, 0x58($s0)
/* 1A7E6C 8027958C E602004C */  swc1      $f2, 0x4C($s0)
/* 1A7E70 80279590 46002201 */  sub.s     $f8, $f4, $f0
.L80279594:
/* 1A7E74 80279594 86220064 */  lh        $v0, 0x64($s1)
/* 1A7E78 80279598 14400003 */  bnez      $v0, .L802795A8
/* 1A7E7C 8027959C 00000000 */   nop
/* 1A7E80 802795A0 0809E5BE */  j         .L802796F8
/* 1A7E84 802795A4 24020002 */   addiu    $v0, $zero, 0x2
.L802795A8:
/* 1A7E88 802795A8 C622003C */  lwc1      $f2, 0x3C($s1)
/* 1A7E8C 802795AC 44823000 */  mtc1      $v0, $f6
/* 1A7E90 802795B0 00000000 */  nop
/* 1A7E94 802795B4 468031A0 */  cvt.s.w   $f6, $f6
/* 1A7E98 802795B8 46061082 */  mul.s     $f2, $f2, $f6
/* 1A7E9C 802795BC 00000000 */  nop
/* 1A7EA0 802795C0 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 1A7EA4 802795C4 44810000 */  mtc1      $at, $f0
/* 1A7EA8 802795C8 00000000 */  nop
/* 1A7EAC 802795CC 46001082 */  mul.s     $f2, $f2, $f0
/* 1A7EB0 802795D0 00000000 */  nop
/* 1A7EB4 802795D4 86220064 */  lh        $v0, 0x64($s1)
/* 1A7EB8 802795D8 C6240040 */  lwc1      $f4, 0x40($s1)
/* 1A7EBC 802795DC 44820000 */  mtc1      $v0, $f0
/* 1A7EC0 802795E0 00000000 */  nop
/* 1A7EC4 802795E4 46800020 */  cvt.s.w   $f0, $f0
/* 1A7EC8 802795E8 46004003 */  div.s     $f0, $f8, $f0
/* 1A7ECC 802795EC 46002100 */  add.s     $f4, $f4, $f0
/* 1A7ED0 802795F0 4606F183 */  div.s     $f6, $f30, $f6
/* 1A7ED4 802795F4 46061080 */  add.s     $f2, $f2, $f6
/* 1A7ED8 802795F8 E6240040 */  swc1      $f4, 0x40($s1)
/* 1A7EDC 802795FC E6220044 */  swc1      $f2, 0x44($s1)
/* 1A7EE0 80279600 8E0201AC */  lw        $v0, 0x1AC($s0)
/* 1A7EE4 80279604 10400009 */  beqz      $v0, .L8027962C
/* 1A7EE8 80279608 24020001 */   addiu    $v0, $zero, 0x1
/* 1A7EEC 8027960C C600014C */  lwc1      $f0, 0x14C($s0)
/* 1A7EF0 80279610 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A7EF4 80279614 8E0401AC */  lw        $a0, 0x1AC($s0)
/* 1A7EF8 80279618 8E060144 */  lw        $a2, 0x144($s0)
/* 1A7EFC 8027961C 8E070148 */  lw        $a3, 0x148($s0)
/* 1A7F00 80279620 0C052757 */  jal       sfx_play_sound_at_position
/* 1A7F04 80279624 0000282D */   daddu    $a1, $zero, $zero
/* 1A7F08 80279628 24020001 */  addiu     $v0, $zero, 0x1
.L8027962C:
/* 1A7F0C 8027962C AE420070 */  sw        $v0, 0x70($s2)
.L80279630:
/* 1A7F10 80279630 8E500074 */  lw        $s0, 0x74($s2)
/* 1A7F14 80279634 C6000050 */  lwc1      $f0, 0x50($s0)
/* 1A7F18 80279638 C6040010 */  lwc1      $f4, 0x10($s0)
/* 1A7F1C 8027963C 46000086 */  mov.s     $f2, $f0
/* 1A7F20 80279640 46002101 */  sub.s     $f4, $f4, $f0
/* 1A7F24 80279644 C6000048 */  lwc1      $f0, 0x48($s0)
/* 1A7F28 80279648 46001081 */  sub.s     $f2, $f2, $f0
/* 1A7F2C 8027964C 44800000 */  mtc1      $zero, $f0
/* 1A7F30 80279650 2611000C */  addiu     $s1, $s0, 0xC
/* 1A7F34 80279654 E6040010 */  swc1      $f4, 0x10($s0)
/* 1A7F38 80279658 4602003C */  c.lt.s    $f0, $f2
/* 1A7F3C 8027965C 00000000 */  nop
/* 1A7F40 80279660 45000007 */  bc1f      .L80279680
/* 1A7F44 80279664 E6020050 */   swc1     $f2, 0x50($s0)
/* 1A7F48 80279668 C602001C */  lwc1      $f2, 0x1C($s0)
/* 1A7F4C 8027966C 46002006 */  mov.s     $f0, $f4
/* 1A7F50 80279670 4600103C */  c.lt.s    $f2, $f0
/* 1A7F54 80279674 00000000 */  nop
/* 1A7F58 80279678 45030001 */  bc1tl     .L80279680
/* 1A7F5C 8027967C E6020010 */   swc1     $f2, 0x10($s0)
.L80279680:
/* 1A7F60 80279680 8E250040 */  lw        $a1, 0x40($s1)
/* 1A7F64 80279684 8E260048 */  lw        $a2, 0x48($s1)
/* 1A7F68 80279688 0C09904A */  jal       add_xz_vec3f
/* 1A7F6C 8027968C 0220202D */   daddu    $a0, $s1, $zero
/* 1A7F70 80279690 C6200000 */  lwc1      $f0, 0x0($s1)
/* 1A7F74 80279694 E6000144 */  swc1      $f0, 0x144($s0)
/* 1A7F78 80279698 C6200004 */  lwc1      $f0, 0x4($s1)
/* 1A7F7C 8027969C E6000148 */  swc1      $f0, 0x148($s0)
/* 1A7F80 802796A0 C6200008 */  lwc1      $f0, 0x8($s1)
/* 1A7F84 802796A4 E600014C */  swc1      $f0, 0x14C($s0)
/* 1A7F88 802796A8 96220064 */  lhu       $v0, 0x64($s1)
/* 1A7F8C 802796AC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 1A7F90 802796B0 A6220064 */  sh        $v0, 0x64($s1)
/* 1A7F94 802796B4 00021400 */  sll       $v0, $v0, 16
/* 1A7F98 802796B8 1C40000F */  bgtz      $v0, .L802796F8
/* 1A7F9C 802796BC 0000102D */   daddu    $v0, $zero, $zero
/* 1A7FA0 802796C0 C6200048 */  lwc1      $f0, 0x48($s1)
/* 1A7FA4 802796C4 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A7FA8 802796C8 8E25000C */  lw        $a1, 0xC($s1)
/* 1A7FAC 802796CC 8E260010 */  lw        $a2, 0x10($s1)
/* 1A7FB0 802796D0 8E270014 */  lw        $a3, 0x14($s1)
/* 1A7FB4 802796D4 0C0990BC */  jal       play_movement_dust_effects
/* 1A7FB8 802796D8 24040002 */   addiu    $a0, $zero, 0x2
/* 1A7FBC 802796DC C620000C */  lwc1      $f0, 0xC($s1)
/* 1A7FC0 802796E0 E6000144 */  swc1      $f0, 0x144($s0)
/* 1A7FC4 802796E4 C6200010 */  lwc1      $f0, 0x10($s1)
/* 1A7FC8 802796E8 E6000148 */  swc1      $f0, 0x148($s0)
/* 1A7FCC 802796EC C6200014 */  lwc1      $f0, 0x14($s1)
/* 1A7FD0 802796F0 24020001 */  addiu     $v0, $zero, 0x1
/* 1A7FD4 802796F4 E600014C */  swc1      $f0, 0x14C($s0)
.L802796F8:
/* 1A7FD8 802796F8 8FBF0024 */  lw        $ra, 0x24($sp)
/* 1A7FDC 802796FC 8FB20020 */  lw        $s2, 0x20($sp)
/* 1A7FE0 80279700 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1A7FE4 80279704 8FB00018 */  lw        $s0, 0x18($sp)
/* 1A7FE8 80279708 D7BE0050 */  ldc1      $f30, 0x50($sp)
/* 1A7FEC 8027970C D7BC0048 */  ldc1      $f28, 0x48($sp)
/* 1A7FF0 80279710 D7BA0040 */  ldc1      $f26, 0x40($sp)
/* 1A7FF4 80279714 D7B80038 */  ldc1      $f24, 0x38($sp)
/* 1A7FF8 80279718 D7B60030 */  ldc1      $f22, 0x30($sp)
/* 1A7FFC 8027971C D7B40028 */  ldc1      $f20, 0x28($sp)
/* 1A8000 80279720 03E00008 */  jr        $ra
/* 1A8004 80279724 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

ApiStatus JumpToGoalSimple2(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    ActorState* state;
    f32 posX, posY, posZ;
    f32 goalX, goalY, goalZ;
    f32 moveDist;
    Actor* actor;

    if (isInitialCall) {
        script->functionTemp[0] = FALSE;
    }

    if (!script->functionTemp[0]) {
        s32 actorID = evt_get_variable(script, *args++);

        if (actorID == ACTOR_SELF) {
            actorID = script->owner1.actorID;
        }

        script->functionTempPtr[1] = actor = get_actor(actorID);
        state = &actor->state;

        state->moveTime = evt_get_variable(script, *args++);
        state->currentPos.x = actor->currentPos.x;
        state->currentPos.y = actor->currentPos.y;
        state->currentPos.z = actor->currentPos.z;

        posX = state->currentPos.x;
        posY = state->currentPos.y;
        posZ = state->currentPos.z;
        goalX = state->goalPos.x;
        goalY = state->goalPos.y;
        goalZ = state->goalPos.z;
        state->angle = atan2(posX, posZ, goalX, goalZ);
        state->distance = dist2D(posX, posZ, goalX, goalZ);

        // make relative (note: negated)
        posX = (posX - goalX);
        posY = (posY - goalY);
        posZ = (posZ - goalZ);

        if (state->moveTime == 0) {
            state->moveTime = state->distance / state->speed;
            moveDist = state->distance - (state->moveTime * state->speed);
        } else {
            state->speed = state->distance / state->moveTime;
            moveDist = state->distance - (state->moveTime * state->speed);
        }

        if (state->moveTime == 0) {
            return ApiStatus_DONE2;
        }

        state->velocity = ((state->acceleration * state->moveTime) * 0.5f) + (posY / state->moveTime);
        state->speed += moveDist / state->moveTime;
        if (actor->actorTypeData1[4] != 0) {
            sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
        }
        script->functionTemp[0] = TRUE;
    }

    actor = script->functionTempPtr[1];
    state = &actor->state;

    state->currentPos.y -= state->velocity;
    state->velocity -= state->acceleration;
    if (state->velocity > 0.0f && state->goalPos.y < state->currentPos.y) {
        state->currentPos.y = state->goalPos.y;
    }
    add_xz_vec3f(&state->currentPos, state->speed, state->angle);
    actor->currentPos.x = state->currentPos.x;
    actor->currentPos.y = state->currentPos.y;
    actor->currentPos.z = state->currentPos.z;

    state->moveTime--;
    if (state->moveTime <= 0) {
        play_movement_dust_effects(2, state->goalPos.x, state->goalPos.y, state->goalPos.z, state->angle);
        actor->currentPos.x = state->goalPos.x;
        actor->currentPos.y = state->goalPos.y;
        actor->currentPos.z = state->goalPos.z;
        return ApiStatus_DONE1;
    }

    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel draw_encounters_pre_battle
/* 1CD64 80041964 27BDFF88 */  addiu     $sp, $sp, -0x78
/* 1CD68 80041968 AFB00038 */  sw        $s0, 0x38($sp)
/* 1CD6C 8004196C 3C10800B */  lui       $s0, %hi(gCurrentEncounter)
/* 1CD70 80041970 26100F10 */  addiu     $s0, $s0, %lo(gCurrentEncounter)
/* 1CD74 80041974 AFBF0040 */  sw        $ra, 0x40($sp)
/* 1CD78 80041978 AFB1003C */  sw        $s1, 0x3C($sp)
/* 1CD7C 8004197C F7BE0070 */  sdc1      $f30, 0x70($sp)
/* 1CD80 80041980 F7BC0068 */  sdc1      $f28, 0x68($sp)
/* 1CD84 80041984 F7BA0060 */  sdc1      $f26, 0x60($sp)
/* 1CD88 80041988 F7B80058 */  sdc1      $f24, 0x58($sp)
/* 1CD8C 8004198C F7B60050 */  sdc1      $f22, 0x50($sp)
/* 1CD90 80041990 F7B40048 */  sdc1      $f20, 0x48($sp)
/* 1CD94 80041994 8E02008C */  lw        $v0, 0x8C($s0)
/* 1CD98 80041998 84440008 */  lh        $a0, 0x8($v0)
/* 1CD9C 8004199C 0C00EABB */  jal       get_npc_unsafe
/* 1CDA0 800419A0 0200882D */   daddu    $s1, $s0, $zero
/* 1CDA4 800419A4 0040382D */  daddu     $a3, $v0, $zero
/* 1CDA8 800419A8 8E020094 */  lw        $v0, 0x94($s0)
/* 1CDAC 800419AC 3C048011 */  lui       $a0, %hi(gPlayerStatus)
/* 1CDB0 800419B0 2484EFC8 */  addiu     $a0, $a0, %lo(gPlayerStatus)
/* 1CDB4 800419B4 1040009E */  beqz      $v0, .L80041C30
/* 1CDB8 800419B8 240500FF */   addiu    $a1, $zero, 0xFF
/* 1CDBC 800419BC 8E030090 */  lw        $v1, 0x90($s0)
/* 1CDC0 800419C0 1065009B */  beq       $v1, $a1, .L80041C30
/* 1CDC4 800419C4 00000000 */   nop
/* 1CDC8 800419C8 8E020098 */  lw        $v0, 0x98($s0)
/* 1CDCC 800419CC 24420001 */  addiu     $v0, $v0, 0x1
/* 1CDD0 800419D0 AE020098 */  sw        $v0, 0x98($s0)
/* 1CDD4 800419D4 2842000B */  slti      $v0, $v0, 0xB
/* 1CDD8 800419D8 14400002 */  bnez      $v0, .L800419E4
/* 1CDDC 800419DC 2402000A */   addiu    $v0, $zero, 0xA
/* 1CDE0 800419E0 AE020098 */  sw        $v0, 0x98($s0)
.L800419E4:
/* 1CDE4 800419E4 8E020098 */  lw        $v0, 0x98($s0)
/* 1CDE8 800419E8 00621021 */  addu      $v0, $v1, $v0
/* 1CDEC 800419EC AE020090 */  sw        $v0, 0x90($s0)
/* 1CDF0 800419F0 28420100 */  slti      $v0, $v0, 0x100
/* 1CDF4 800419F4 50400001 */  beql      $v0, $zero, .L800419FC
/* 1CDF8 800419F8 AE050090 */   sw       $a1, 0x90($s0)
.L800419FC:
/* 1CDFC 800419FC C4FE0038 */  lwc1      $f30, 0x38($a3)
/* 1CE00 80041A00 C4FA003C */  lwc1      $f26, 0x3C($a3)
/* 1CE04 80041A04 3C01C477 */  lui       $at, (0xC4778000 >> 16)
/* 1CE08 80041A08 34218000 */  ori       $at, $at, (0xC4778000 & 0xFFFF)
/* 1CE0C 80041A0C 44810000 */  mtc1      $at, $f0
/* 1CE10 80041A10 C4FC0040 */  lwc1      $f28, 0x40($a3)
/* 1CE14 80041A14 C4940028 */  lwc1      $f20, 0x28($a0)
/* 1CE18 80041A18 C498002C */  lwc1      $f24, 0x2C($a0)
/* 1CE1C 80041A1C C4960030 */  lwc1      $f22, 0x30($a0)
/* 1CE20 80041A20 4600D03C */  c.lt.s    $f26, $f0
/* 1CE24 80041A24 00000000 */  nop
/* 1CE28 80041A28 45000004 */  bc1f      .L80041A3C
/* 1CE2C 80041A2C 00000000 */   nop
/* 1CE30 80041A30 4600A786 */  mov.s     $f30, $f20
/* 1CE34 80041A34 4600C686 */  mov.s     $f26, $f24
/* 1CE38 80041A38 4600B706 */  mov.s     $f28, $f22
.L80041A3C:
/* 1CE3C 80041A3C 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 1CE40 80041A40 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 1CE44 80041A44 80430071 */  lb        $v1, 0x71($v0)
/* 1CE48 80041A48 24020002 */  addiu     $v0, $zero, 0x2
/* 1CE4C 80041A4C 1462003C */  bne       $v1, $v0, .L80041B40
/* 1CE50 80041A50 00000000 */   nop
/* 1CE54 80041A54 C6020090 */  lwc1      $f2, 0x90($s0)
/* 1CE58 80041A58 468010A0 */  cvt.s.w   $f2, $f2
/* 1CE5C 80041A5C 44051000 */  mfc1      $a1, $f2
/* 1CE60 80041A60 0C04DF69 */  jal       set_screen_overlay_params_back
/* 1CE64 80041A64 2404000A */   addiu    $a0, $zero, 0xA
/* 1CE68 80041A68 3C05437F */  lui       $a1, (0x437F0000 >> 16)
/* 1CE6C 80041A6C 0C04E035 */  jal       set_screen_overlay_alpha
/* 1CE70 80041A70 24040001 */   addiu    $a0, $zero, 0x1
/* 1CE74 80041A74 24040001 */  addiu     $a0, $zero, 0x1
/* 1CE78 80041A78 0000282D */  daddu     $a1, $zero, $zero
/* 1CE7C 80041A7C 00A0302D */  daddu     $a2, $a1, $zero
/* 1CE80 80041A80 0C04DF84 */  jal       set_screen_overlay_color
/* 1CE84 80041A84 00A0382D */   daddu    $a3, $a1, $zero
/* 1CE88 80041A88 3C108007 */  lui       $s0, %hi(gCurrentCameraID)
/* 1CE8C 80041A8C 26107410 */  addiu     $s0, $s0, %lo(gCurrentCameraID)
/* 1CE90 80041A90 8E040000 */  lw        $a0, 0x0($s0)
/* 1CE94 80041A94 4405A000 */  mfc1      $a1, $f20
/* 1CE98 80041A98 4407B000 */  mfc1      $a3, $f22
/* 1CE9C 80041A9C 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
/* 1CEA0 80041AA0 44810000 */  mtc1      $at, $f0
/* 1CEA4 80041AA4 27A20020 */  addiu     $v0, $sp, 0x20
/* 1CEA8 80041AA8 AFA20010 */  sw        $v0, 0x10($sp)
/* 1CEAC 80041AAC 4600C600 */  add.s     $f24, $f24, $f0
/* 1CEB0 80041AB0 27A20024 */  addiu     $v0, $sp, 0x24
/* 1CEB4 80041AB4 AFA20014 */  sw        $v0, 0x14($sp)
/* 1CEB8 80041AB8 4406C000 */  mfc1      $a2, $f24
/* 1CEBC 80041ABC 27A20028 */  addiu     $v0, $sp, 0x28
/* 1CEC0 80041AC0 0C00B94E */  jal       get_screen_coords
/* 1CEC4 80041AC4 AFA20018 */   sw       $v0, 0x18($sp)
/* 1CEC8 80041AC8 8E040000 */  lw        $a0, 0x0($s0)
/* 1CECC 80041ACC 4405F000 */  mfc1      $a1, $f30
/* 1CED0 80041AD0 4407E000 */  mfc1      $a3, $f28
/* 1CED4 80041AD4 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 1CED8 80041AD8 44810000 */  mtc1      $at, $f0
/* 1CEDC 80041ADC 27A2002C */  addiu     $v0, $sp, 0x2C
/* 1CEE0 80041AE0 AFA20010 */  sw        $v0, 0x10($sp)
/* 1CEE4 80041AE4 4600D680 */  add.s     $f26, $f26, $f0
/* 1CEE8 80041AE8 27A20030 */  addiu     $v0, $sp, 0x30
/* 1CEEC 80041AEC AFA20014 */  sw        $v0, 0x14($sp)
/* 1CEF0 80041AF0 4406D000 */  mfc1      $a2, $f26
/* 1CEF4 80041AF4 27A20034 */  addiu     $v0, $sp, 0x34
/* 1CEF8 80041AF8 0C00B94E */  jal       get_screen_coords
/* 1CEFC 80041AFC AFA20018 */   sw       $v0, 0x18($sp)
/* 1CF00 80041B00 24040001 */  addiu     $a0, $zero, 0x1
/* 1CF04 80041B04 0000282D */  daddu     $a1, $zero, $zero
/* 1CF08 80041B08 8FA60020 */  lw        $a2, 0x20($sp)
/* 1CF0C 80041B0C 8FA8002C */  lw        $t0, 0x2C($sp)
/* 1CF10 80041B10 8FA70024 */  lw        $a3, 0x24($sp)
/* 1CF14 80041B14 8FA30030 */  lw        $v1, 0x30($sp)
/* 1CF18 80041B18 00C83023 */  subu      $a2, $a2, $t0
/* 1CF1C 80041B1C 000617C2 */  srl       $v0, $a2, 31
/* 1CF20 80041B20 00C23021 */  addu      $a2, $a2, $v0
/* 1CF24 80041B24 00863007 */  srav      $a2, $a2, $a0
/* 1CF28 80041B28 00C83021 */  addu      $a2, $a2, $t0
/* 1CF2C 80041B2C 00E33823 */  subu      $a3, $a3, $v1
/* 1CF30 80041B30 000717C2 */  srl       $v0, $a3, 31
/* 1CF34 80041B34 00E23821 */  addu      $a3, $a3, $v0
/* 1CF38 80041B38 0801070A */  j         .L80041C28
/* 1CF3C 80041B3C 00873807 */   srav     $a3, $a3, $a0
.L80041B40:
/* 1CF40 80041B40 C6220090 */  lwc1      $f2, 0x90($s1)
/* 1CF44 80041B44 468010A0 */  cvt.s.w   $f2, $f2
/* 1CF48 80041B48 44051000 */  mfc1      $a1, $f2
/* 1CF4C 80041B4C 0C04DF62 */  jal       set_screen_overlay_params_front
/* 1CF50 80041B50 2404000A */   addiu    $a0, $zero, 0xA
/* 1CF54 80041B54 3C05437F */  lui       $a1, (0x437F0000 >> 16)
/* 1CF58 80041B58 0C04E035 */  jal       set_screen_overlay_alpha
/* 1CF5C 80041B5C 0000202D */   daddu    $a0, $zero, $zero
/* 1CF60 80041B60 0000202D */  daddu     $a0, $zero, $zero
/* 1CF64 80041B64 0080282D */  daddu     $a1, $a0, $zero
/* 1CF68 80041B68 0080302D */  daddu     $a2, $a0, $zero
/* 1CF6C 80041B6C 0C04DF84 */  jal       set_screen_overlay_color
/* 1CF70 80041B70 0080382D */   daddu    $a3, $a0, $zero
/* 1CF74 80041B74 3C108007 */  lui       $s0, %hi(gCurrentCameraID)
/* 1CF78 80041B78 26107410 */  addiu     $s0, $s0, %lo(gCurrentCameraID)
/* 1CF7C 80041B7C 8E040000 */  lw        $a0, 0x0($s0)
/* 1CF80 80041B80 4405A000 */  mfc1      $a1, $f20
/* 1CF84 80041B84 4407B000 */  mfc1      $a3, $f22
/* 1CF88 80041B88 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
/* 1CF8C 80041B8C 44810000 */  mtc1      $at, $f0
/* 1CF90 80041B90 27A20020 */  addiu     $v0, $sp, 0x20
/* 1CF94 80041B94 AFA20010 */  sw        $v0, 0x10($sp)
/* 1CF98 80041B98 4600C600 */  add.s     $f24, $f24, $f0
/* 1CF9C 80041B9C 27A20024 */  addiu     $v0, $sp, 0x24
/* 1CFA0 80041BA0 AFA20014 */  sw        $v0, 0x14($sp)
/* 1CFA4 80041BA4 4406C000 */  mfc1      $a2, $f24
/* 1CFA8 80041BA8 27A20028 */  addiu     $v0, $sp, 0x28
/* 1CFAC 80041BAC 0C00B94E */  jal       get_screen_coords
/* 1CFB0 80041BB0 AFA20018 */   sw       $v0, 0x18($sp)
/* 1CFB4 80041BB4 8E040000 */  lw        $a0, 0x0($s0)
/* 1CFB8 80041BB8 4405F000 */  mfc1      $a1, $f30
/* 1CFBC 80041BBC 4407E000 */  mfc1      $a3, $f28
/* 1CFC0 80041BC0 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 1CFC4 80041BC4 44810000 */  mtc1      $at, $f0
/* 1CFC8 80041BC8 27A2002C */  addiu     $v0, $sp, 0x2C
/* 1CFCC 80041BCC AFA20010 */  sw        $v0, 0x10($sp)
/* 1CFD0 80041BD0 4600D680 */  add.s     $f26, $f26, $f0
/* 1CFD4 80041BD4 27A20030 */  addiu     $v0, $sp, 0x30
/* 1CFD8 80041BD8 AFA20014 */  sw        $v0, 0x14($sp)
/* 1CFDC 80041BDC 4406D000 */  mfc1      $a2, $f26
/* 1CFE0 80041BE0 27A20034 */  addiu     $v0, $sp, 0x34
/* 1CFE4 80041BE4 0C00B94E */  jal       get_screen_coords
/* 1CFE8 80041BE8 AFA20018 */   sw       $v0, 0x18($sp)
/* 1CFEC 80041BEC 0000202D */  daddu     $a0, $zero, $zero
/* 1CFF0 80041BF0 0080282D */  daddu     $a1, $a0, $zero
/* 1CFF4 80041BF4 8FA60020 */  lw        $a2, 0x20($sp)
/* 1CFF8 80041BF8 8FA8002C */  lw        $t0, 0x2C($sp)
/* 1CFFC 80041BFC 8FA70024 */  lw        $a3, 0x24($sp)
/* 1D000 80041C00 8FA30030 */  lw        $v1, 0x30($sp)
/* 1D004 80041C04 00C83023 */  subu      $a2, $a2, $t0
/* 1D008 80041C08 000617C2 */  srl       $v0, $a2, 31
/* 1D00C 80041C0C 00C23021 */  addu      $a2, $a2, $v0
/* 1D010 80041C10 00063043 */  sra       $a2, $a2, 1
/* 1D014 80041C14 00C83021 */  addu      $a2, $a2, $t0
/* 1D018 80041C18 00E33823 */  subu      $a3, $a3, $v1
/* 1D01C 80041C1C 000717C2 */  srl       $v0, $a3, 31
/* 1D020 80041C20 00E23821 */  addu      $a3, $a3, $v0
/* 1D024 80041C24 00073843 */  sra       $a3, $a3, 1
.L80041C28:
/* 1D028 80041C28 0C04DF93 */  jal       set_screen_overlay_center
/* 1D02C 80041C2C 00E33821 */   addu     $a3, $a3, $v1
.L80041C30:
/* 1D030 80041C30 8FBF0040 */  lw        $ra, 0x40($sp)
/* 1D034 80041C34 8FB1003C */  lw        $s1, 0x3C($sp)
/* 1D038 80041C38 8FB00038 */  lw        $s0, 0x38($sp)
/* 1D03C 80041C3C D7BE0070 */  ldc1      $f30, 0x70($sp)
/* 1D040 80041C40 D7BC0068 */  ldc1      $f28, 0x68($sp)
/* 1D044 80041C44 D7BA0060 */  ldc1      $f26, 0x60($sp)
/* 1D048 80041C48 D7B80058 */  ldc1      $f24, 0x58($sp)
/* 1D04C 80041C4C D7B60050 */  ldc1      $f22, 0x50($sp)
/* 1D050 80041C50 D7B40048 */  ldc1      $f20, 0x48($sp)
/* 1D054 80041C54 03E00008 */  jr        $ra
/* 1D058 80041C58 27BD0078 */   addiu    $sp, $sp, 0x78

### DECOMPILED C INSTRUCTIONS:

void draw_encounters_pre_battle(void) {
    EncounterStatus* encounter = &gCurrentEncounter;
    Npc* npc = get_npc_unsafe(encounter->currentEnemy->npcID);
    PlayerStatus* playerStatus = &gPlayerStatus;

    if (encounter->unk_94 != 0) {
        f32 playerX, playerY, playerZ;
        f32 otherX, otherY, otherZ;
        s32 pScreenX, pScreenY, pScreenZ;
        s32 oScreenX, oScreenY, oScreenZ;

        if (encounter->fadeOutAmount != 255) {
            encounter->fadeOutAccel++;
            if (encounter->fadeOutAccel > 10) {
                encounter->fadeOutAccel = 10;
            }

            encounter->fadeOutAmount += encounter->fadeOutAccel;
            if (encounter->fadeOutAmount > 255) {
                encounter->fadeOutAmount = 255;
            }

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

            otherX = npc->pos.x;
            otherY = npc->pos.y;
            otherZ = npc->pos.z;
            if (otherY < -990.0f) {
                otherX = playerX;
                otherY = playerY;
                otherZ = playerZ;
            }

            if (gGameStatusPtr->demoState == DEMO_STATE_CHANGE_MAP) {
                set_screen_overlay_params_back(OVERLAY_START_BATTLE, encounter->fadeOutAmount);
                set_screen_overlay_alpha(SCREEN_LAYER_BACK, 255.0f);
                set_screen_overlay_color(SCREEN_LAYER_BACK, 0, 0, 0);
                get_screen_coords(gCurrentCameraID, playerX, playerY + 20.0f, playerZ, &pScreenX, &pScreenY, &pScreenZ);
                get_screen_coords(gCurrentCameraID, otherX, otherY + 15.0f, otherZ, &oScreenX, &oScreenY, &oScreenZ);
                set_screen_overlay_center(SCREEN_LAYER_BACK, 0, (pScreenX - oScreenX) / 2 + oScreenX,
                                              (pScreenY - oScreenY) / 2 + oScreenY);
            } else {
                set_screen_overlay_params_front(OVERLAY_START_BATTLE, encounter->fadeOutAmount);
                set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 255.0f);
                set_screen_overlay_color(SCREEN_LAYER_FRONT, 0, 0, 0);
                get_screen_coords(gCurrentCameraID, playerX, playerY + 20.0f, playerZ, &pScreenX, &pScreenY, &pScreenZ);
                get_screen_coords(gCurrentCameraID, otherX, otherY + 15.0f, otherZ, &oScreenX, &oScreenY, &oScreenZ);
                set_screen_overlay_center(SCREEN_LAYER_FRONT, 0, (pScreenX - oScreenX) / 2 + oScreenX,
                                              (pScreenY - oScreenY) / 2 + oScreenY);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel parasol_get_npc
/* E27C90 802B6000 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* E27C94 802B6004 AFB00020 */  sw        $s0, 0x20($sp)
/* E27C98 802B6008 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* E27C9C 802B600C 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* E27CA0 802B6010 AFBF0028 */  sw        $ra, 0x28($sp)
/* E27CA4 802B6014 AFB10024 */  sw        $s1, 0x24($sp)
.L802B6018:
/* E27CA8 802B6018 8E020000 */  lw        $v0, 0x0($s0)
/* E27CAC 802B601C 04410048 */  bgez      $v0, .L802B6140
/* E27CB0 802B6020 0200882D */   daddu    $s1, $s0, $zero
/* E27CB4 802B6024 3C037FFF */  lui       $v1, (0x7FFFFFFF >> 16)
/* E27CB8 802B6028 3463FFFF */  ori       $v1, $v1, (0x7FFFFFFF & 0xFFFF)
/* E27CBC 802B602C 3C040001 */  lui       $a0, (0x10019 >> 16)
/* E27CC0 802B6030 00431824 */  and       $v1, $v0, $v1
/* E27CC4 802B6034 8E020004 */  lw        $v0, 0x4($s0)
/* E27CC8 802B6038 34840019 */  ori       $a0, $a0, (0x10019 & 0xFFFF)
/* E27CCC 802B603C AE030000 */  sw        $v1, 0x0($s0)
.L802B6040:
/* E27CD0 802B6040 34630808 */  ori       $v1, $v1, 0x808
.L802B6044:
/* E27CD4 802B6044 AE030000 */  sw        $v1, 0x0($s0)
glabel action_hammer_play_hit_fx
/* E27CD8 802B6048 34420004 */  ori       $v0, $v0, 0x4
.L802B604C:
/* E27CDC 802B604C 0C037FDE */  jal       suggest_player_anim_always_forward
.L802B6050:
/* E27CE0 802B6050 AE020004 */   sw       $v0, 0x4($s0)
/* E27CE4 802B6054 C60C0028 */  lwc1      $f12, 0x28($s0)
.L802B6058:
/* E27CE8 802B6058 C60E0030 */  lwc1      $f14, 0x30($s0)
/* E27CEC 802B605C 3C014192 */  lui       $at, (0x4192C745 >> 16)
glabel action_update_sliding
/* E27CF0 802B6060 3421C745 */  ori       $at, $at, (0x4192C745 & 0xFFFF)
/* E27CF4 802B6064 44811000 */  mtc1      $at, $f2
.L802B6068:
/* E27CF8 802B6068 3C01C06F */  lui       $at, (0xC06F3B64 >> 16)
/* E27CFC 802B606C 34213B64 */  ori       $at, $at, (0xC06F3B64 & 0xFFFF)
/* E27D00 802B6070 44812000 */  mtc1      $at, $f4
.L802B6074:
/* E27D04 802B6074 3C013F4E */  lui       $at, (0x3F4E4F76 >> 16)
/* E27D08 802B6078 34214F76 */  ori       $at, $at, (0x3F4E4F76 & 0xFFFF)
glabel .L802B607C
/* E27D0C 802B607C 44813000 */  mtc1      $at, $f6
.L802B6080:
/* E27D10 802B6080 86020016 */  lh        $v0, 0x16($s0)
/* E27D14 802B6084 3C01BDCA */  lui       $at, (0xBDCA233A >> 16)
/* E27D18 802B6088 3421233A */  ori       $at, $at, (0xBDCA233A & 0xFFFF)
.L802B608C:
/* E27D1C 802B608C 44810000 */  mtc1      $at, $f0
.L802B6090:
/* E27D20 802B6090 8604001A */  lh        $a0, 0x1A($s0)
.L802B6094:
/* E27D24 802B6094 3C03800B */  lui       $v1, %hi(gCameras)
/* E27D28 802B6098 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
glabel action_update_state_23
/* E27D2C 802B609C A20000B6 */  sb        $zero, 0xB6($s0)
/* E27D30 802B60A0 44824000 */  mtc1      $v0, $f8
glabel action_update_use_spinning_flower
/* E27D34 802B60A4 00000000 */  nop
.L802B60A8:
/* E27D38 802B60A8 46804220 */  cvt.s.w   $f8, $f8
.L802B60AC:
/* E27D3C 802B60AC 44064000 */  mfc1      $a2, $f8
/* E27D40 802B60B0 44844000 */  mtc1      $a0, $f8
glabel action_update_jump
/* E27D44 802B60B4 00000000 */  nop
/* E27D48 802B60B8 46804220 */  cvt.s.w   $f8, $f8
/* E27D4C 802B60BC E6020070 */  swc1      $f2, 0x70($s0)
/* E27D50 802B60C0 E6040074 */  swc1      $f4, 0x74($s0)
/* E27D54 802B60C4 E6060078 */  swc1      $f6, 0x78($s0)
.L802B60C8:
/* E27D58 802B60C8 E600007C */  swc1      $f0, 0x7C($s0)
/* E27D5C 802B60CC 94620002 */  lhu       $v0, 0x2($v1)
glabel .L802B60D0
/* E27D60 802B60D0 44074000 */  mfc1      $a3, $f8
.L802B60D4:
/* E27D64 802B60D4 34420001 */  ori       $v0, $v0, 0x1
/* E27D68 802B60D8 0C00A720 */  jal       atan2
/* E27D6C 802B60DC A4620002 */   sh       $v0, 0x2($v1)
/* E27D70 802B60E0 86020016 */  lh        $v0, 0x16($s0)
/* E27D74 802B60E4 8603001A */  lh        $v1, 0x1A($s0)
.L802B60E8:
/* E27D78 802B60E8 3C01802B */  lui       $at, %hi(jtbl_802B62B0)
.L802B60EC:
/* E27D7C 802B60EC E42062B0 */  swc1      $f0, %lo(jtbl_802B62B0)($at)
.L802B60F0:
/* E27D80 802B60F0 44826000 */  mtc1      $v0, $f12
glabel .L802B60F4
/* E27D84 802B60F4 00000000 */  nop
/* E27D88 802B60F8 46806320 */  cvt.s.w   $f12, $f12
/* E27D8C 802B60FC 44837000 */  mtc1      $v1, $f14
.L802B6100:
/* E27D90 802B6100 00000000 */  nop
.L802B6104:
/* E27D94 802B6104 0C038022 */  jal       get_xz_dist_to_player
.L802B6108:
/* E27D98 802B6108 468073A0 */   cvt.s.w  $f14, $f14
glabel .L802B610C
/* E27D9C 802B610C 3C014190 */  lui       $at, (0x41900000 >> 16)
.L802B6110:
/* E27DA0 802B6110 44811000 */  mtc1      $at, $f2
/* E27DA4 802B6114 24040001 */  addiu     $a0, $zero, 0x1
.L802B6118:
/* E27DA8 802B6118 46020003 */  div.s     $f0, $f0, $f2
/* E27DAC 802B611C 0C03A8CD */  jal       subtract_hp
glabel action_update_parasol
/* E27DB0 802B6120 E6000054 */   swc1     $f0, 0x54($s0)
.L802B6124:
/* E27DB4 802B6124 0C03A5D8 */  jal       open_status_bar_long
.L802B6128:
/* E27DB8 802B6128 00000000 */   nop
/* E27DBC 802B612C 3C03800A */  lui       $v1, %hi(gOverrideFlags)
/* E27DC0 802B6130 2463A650 */  addiu     $v1, $v1, %lo(gOverrideFlags)
glabel .L802B6134
/* E27DC4 802B6134 8C620000 */  lw        $v0, 0x0($v1)
/* E27DC8 802B6138 34420040 */  ori       $v0, $v0, 0x40
.L802B613C:
/* E27DCC 802B613C AC620000 */  sw        $v0, 0x0($v1)
.L802B6140:
/* E27DD0 802B6140 3C01802B */  lui       $at, %hi(jtbl_802B62B0)
.L802B6144:
/* E27DD4 802B6144 C42C62B0 */  lwc1      $f12, %lo(jtbl_802B62B0)($at)
/* E27DD8 802B6148 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
.L802B614C:
/* E27DDC 802B614C 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
.L802B6150:
/* E27DE0 802B6150 44810000 */  mtc1      $at, $f0
.L802B6154:
/* E27DE4 802B6154 00000000 */  nop
.L802B6158:
/* E27DE8 802B6158 46006302 */  mul.s     $f12, $f12, $f0
.L802B615C:
/* E27DEC 802B615C 00000000 */  nop
/* E27DF0 802B6160 27A50010 */  addiu     $a1, $sp, 0x10
.L802B6164:
/* E27DF4 802B6164 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
.L802B6168:
/* E27DF8 802B6168 44810000 */  mtc1      $at, $f0
/* E27DFC 802B616C 27A60014 */  addiu     $a2, $sp, 0x14
glabel .L802B6170
/* E27E00 802B6170 0C00A82D */  jal       sin_cos_rad
glabel .L802B6174
/* E27E04 802B6174 46006303 */   div.s    $f12, $f12, $f0
/* E27E08 802B6178 3C030004 */  lui       $v1, (0x40000 >> 16)
.L802B617C:
/* E27E0C 802B617C 8E020000 */  lw        $v0, 0x0($s0)
.L802B6180:
/* E27E10 802B6180 C6060054 */  lwc1      $f6, 0x54($s0)
glabel .L802B6184
/* E27E14 802B6184 00431024 */  and       $v0, $v0, $v1
.L802B6188:
/* E27E18 802B6188 10400008 */  beqz      $v0, .L802B61AC
.L802B618C:
/* E27E1C 802B618C 00000000 */   nop
.L802B6190:
/* E27E20 802B6190 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
.L802B6194:
/* E27E24 802B6194 44811800 */  mtc1      $at, $f3
glabel func_802B6198
/* E27E28 802B6198 44801000 */  mtc1      $zero, $f2
/* E27E2C 802B619C 46003021 */  cvt.d.s   $f0, $f6
.L802B61A0:
/* E27E30 802B61A0 46220002 */  mul.d     $f0, $f0, $f2
.L802B61A4:
/* E27E34 802B61A4 00000000 */  nop
.L802B61A8:
/* E27E38 802B61A8 462001A0 */  cvt.s.d   $f6, $f0
.L802B61AC:
/* E27E3C 802B61AC C7A00010 */  lwc1      $f0, 0x10($sp)
.L802B61B0:
/* E27E40 802B61B0 46003002 */  mul.s     $f0, $f6, $f0
.L802B61B4:
/* E27E44 802B61B4 00000000 */  nop
/* E27E48 802B61B8 C7A40014 */  lwc1      $f4, 0x14($sp)
/* E27E4C 802B61BC 46043102 */  mul.s     $f4, $f6, $f4
glabel func_802B61C0
/* E27E50 802B61C0 00000000 */  nop
/* E27E54 802B61C4 C6020028 */  lwc1      $f2, 0x28($s0)
.L802B61C8:
/* E27E58 802B61C8 46001080 */  add.s     $f2, $f2, $f0
.L802B61CC:
/* E27E5C 802B61CC C6000030 */  lwc1      $f0, 0x30($s0)
/* E27E60 802B61D0 820200B6 */  lb        $v0, 0xB6($s0)
.L802B61D4:
/* E27E64 802B61D4 46040001 */  sub.s     $f0, $f0, $f4
.L802B61D8:
/* E27E68 802B61D8 E6020028 */  swc1      $f2, 0x28($s0)
.L802B61DC:
/* E27E6C 802B61DC 14400012 */  bnez      $v0, .L802B6228
/* E27E70 802B61E0 E6000030 */   swc1     $f0, 0x30($s0)
glabel func_802B61E4
/* E27E74 802B61E4 0C038D12 */  jal       integrate_gravity
.L802B61E8:
/* E27E78 802B61E8 00000000 */   nop
.L802B61EC:
/* E27E7C 802B61EC C600002C */  lwc1      $f0, 0x2C($s0)
.L802B61F0:
/* E27E80 802B61F0 C6040070 */  lwc1      $f4, 0x70($s0)
.L802B61F4:
/* E27E84 802B61F4 46040000 */  add.s     $f0, $f0, $f4
.L802B61F8:
/* E27E88 802B61F8 44801000 */  mtc1      $zero, $f2
.L802B61FC:
/* E27E8C 802B61FC 00000000 */  nop
.L802B6200:
/* E27E90 802B6200 4602203C */  c.lt.s    $f4, $f2
.L802B6204:
/* E27E94 802B6204 00000000 */  nop
glabel .L802B6208
/* E27E98 802B6208 45000021 */  bc1f      .L802B6290
/* E27E9C 802B620C E600002C */   swc1     $f0, 0x2C($s0)
.L802B6210:
/* E27EA0 802B6210 8E020000 */  lw        $v0, 0x0($s0)
.L802B6214:
/* E27EA4 802B6214 24030001 */  addiu     $v1, $zero, 0x1
glabel .L802B6218
/* E27EA8 802B6218 A20300B6 */  sb        $v1, 0xB6($s0)
/* E27EAC 802B621C 34420004 */  ori       $v0, $v0, 0x4
.L802B6220:
/* E27EB0 802B6220 080AD8A4 */  j         .L802B6290
.L802B6224:
/* E27EB4 802B6224 AE020000 */   sw       $v0, 0x0($s0)
glabel .L802B6228
/* E27EB8 802B6228 0C038D36 */  jal       func_800E34D8
.L802B622C:
/* E27EBC 802B622C 00000000 */   nop
glabel action_update_step_up_peach
/* E27EC0 802B6230 46000306 */  mov.s     $f12, $f0
/* E27EC4 802B6234 0C038D45 */  jal       player_check_collision_below
glabel .L802B6238
/* E27EC8 802B6238 27A50018 */   addiu    $a1, $sp, 0x18
glabel .L802B623C
/* E27ECC 802B623C 8FA40018 */  lw        $a0, 0x18($sp)
glabel .L802B6240
/* E27ED0 802B6240 04800013 */  bltz      $a0, .L802B6290
glabel .L802B6244
/* E27ED4 802B6244 E620002C */   swc1     $f0, 0x2C($s1)
glabel .L802B6248
/* E27ED8 802B6248 0C016F6A */  jal       get_collider_flags
/* E27EDC 802B624C 00000000 */   nop
glabel .L802B6250
/* E27EE0 802B6250 2404000A */  addiu     $a0, $zero, 0xA
.L802B6254:
/* E27EE4 802B6254 0C039769 */  jal       set_action_state
glabel .L802B6258
/* E27EE8 802B6258 AFA20018 */   sw       $v0, 0x18($sp)
.L802B625C:
/* E27EEC 802B625C 2402003C */  addiu     $v0, $zero, 0x3C
/* E27EF0 802B6260 2403F7FF */  addiu     $v1, $zero, -0x801
/* E27EF4 802B6264 A6220010 */  sh        $v0, 0x10($s1)
.L802B6268:
/* E27EF8 802B6268 8E220000 */  lw        $v0, 0x0($s1)
.L802B626C:
/* E27EFC 802B626C 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* E27F00 802B6270 2484A650 */  addiu     $a0, $a0, %lo(gOverrideFlags)
.L802B6274:
/* E27F04 802B6274 A22000BF */  sb        $zero, 0xBF($s1)
glabel .L802B6278
/* E27F08 802B6278 00431024 */  and       $v0, $v0, $v1
/* E27F0C 802B627C AE220000 */  sw        $v0, 0x0($s1)
.L802B6280:
/* E27F10 802B6280 8C820000 */  lw        $v0, 0x0($a0)
.L802B6284:
/* E27F14 802B6284 2403FFBF */  addiu     $v1, $zero, -0x41
glabel action_update_run
/* E27F18 802B6288 00431024 */  and       $v0, $v0, $v1
/* E27F1C 802B628C AC820000 */  sw        $v0, 0x0($a0)
.L802B6290:
/* E27F20 802B6290 8FBF0028 */  lw        $ra, 0x28($sp)
glabel func_802B6294
/* E27F24 802B6294 8FB10024 */  lw        $s1, 0x24($sp)
glabel .L802B6298
/* E27F28 802B6298 8FB00020 */  lw        $s0, 0x20($sp)
/* E27F2C 802B629C 03E00008 */  jr        $ra
/* E27F30 802B62A0 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void action_update_hit_fire(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 dx, dy;
    f32 speed;

    static f32 ReturnAngle;

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;

        playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER;
        playerStatus->flags |= (PS_FLAG_HIT_FIRE | PS_FLAG_FLYING);

        suggest_player_anim_always_forward(ANIM_Mario1_TouchedFire);

        playerStatus->actionSubstate = SUBSTATE_FLYING;
        playerStatus->gravityIntegrator[0] = 18.3473f;
        playerStatus->gravityIntegrator[1] = -3.738f;
        playerStatus->gravityIntegrator[2] = 0.8059f;
        playerStatus->gravityIntegrator[3] = -0.0987f;
        gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y;
        ReturnAngle = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z);
        playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f;
        subtract_hp(1);
        open_status_bar_long();
        gOverrideFlags |= GLOBAL_OVERRIDES_40;
    }

    sin_cos_rad(DEG_TO_RAD(ReturnAngle), &dx, &dy);
    speed = playerStatus->currentSpeed;

    if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
        speed *= 0.5;
    }

    playerStatus->position.x += speed * dx;
    playerStatus->position.z -= speed * dy;

    if (playerStatus->actionSubstate == SUBSTATE_FLYING) {
        integrate_gravity();
        playerStatus->position.y += playerStatus->gravityIntegrator[0];
        if (playerStatus->gravityIntegrator[0] < 0.0f) {
            playerStatus->actionSubstate = SUBSTATE_FALLING;
            playerStatus->flags |= PS_FLAG_FALLING;
        }
    } else {
        s32 colliderID;

        playerStatus->position.y = player_check_collision_below(player_fall_distance(), &colliderID);
        if (colliderID >= 0) {
            colliderID = get_collider_flags(colliderID); //TODO surfaceType
            set_action_state(ACTION_STATE_LAND);
            playerStatus->blinkTimer = 60;
            playerStatus->hazardType = HAZARD_TYPE_NONE;
            playerStatus->flags &= ~PS_FLAG_HIT_FIRE;
            gOverrideFlags &= ~GLOBAL_OVERRIDES_40;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel interact_speech_update
/* E212DC 802B742C 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* E212E0 802B7430 3C020204 */  lui       $v0, (0x2040020 >> 16)
/* E212E4 802B7434 AFB00010 */  sw        $s0, 0x10($sp)
.L802B7438:
/* E212E8 802B7438 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* E212EC 802B743C 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
.L802B7440:
/* E212F0 802B7440 AFBF0014 */  sw        $ra, 0x14($sp)
.L802B7444:
/* E212F4 802B7444 8E030000 */  lw        $v1, 0x0($s0)
/* E212F8 802B7448 34420020 */  ori       $v0, $v0, (0x2040020 & 0xFFFF)
/* E212FC 802B744C 00621824 */  and       $v1, $v1, $v0
glabel should_continue_inspect
/* E21300 802B7450 3C020200 */  lui       $v0, (0x2000000 >> 16)
/* E21304 802B7454 14620010 */  bne       $v1, $v0, .L802B7498
/* E21308 802B7458 240600FF */   addiu    $a2, $zero, 0xFF
/* E2130C 802B745C 3C03800A */  lui       $v1, %hi(gEncounterState)
.L802B7460:
/* E21310 802B7460 8C63A600 */  lw        $v1, %lo(gEncounterState)($v1)
.L802B7464:
/* E21314 802B7464 24020004 */  addiu     $v0, $zero, 0x4
/* E21318 802B7468 1062000B */  beq       $v1, $v0, .L802B7498
/* E2131C 802B746C 00000000 */   nop
/* E21320 802B7470 8E030004 */  lw        $v1, 0x4($s0)
/* E21324 802B7474 30620001 */  andi      $v0, $v1, 0x1
.L802B7478:
/* E21328 802B7478 14400007 */  bnez      $v0, .L802B7498
/* E2132C 802B747C 00000000 */   nop
/* E21330 802B7480 82020015 */  lb        $v0, 0x15($s0)
/* E21334 802B7484 14400004 */  bnez      $v0, .L802B7498
/* E21338 802B7488 3C020001 */   lui      $v0, (0x10000 >> 16)
/* E2133C 802B748C 00621024 */  and       $v0, $v1, $v0
/* E21340 802B7490 10400005 */  beqz      $v0, .L802B74A8
/* E21344 802B7494 00000000 */   nop
.L802B7498:
/* E21348 802B7498 3C03802B */  lui       $v1, %hi(D_802B79A8)
/* E2134C 802B749C 8C6379A8 */  lw        $v1, %lo(D_802B79A8)($v1)
/* E21350 802B74A0 24020003 */  addiu     $v0, $zero, 0x3
/* E21354 802B74A4 A062002A */  sb        $v0, 0x2A($v1)
.L802B74A8:
/* E21358 802B74A8 3C03802B */  lui       $v1, %hi(D_802B79A8)
/* E2135C 802B74AC 246379A8 */  addiu     $v1, $v1, %lo(D_802B79A8)
.L802B74B0:
/* E21360 802B74B0 8C640000 */  lw        $a0, 0x0($v1)
/* E21364 802B74B4 9085002A */  lbu       $a1, 0x2A($a0)
/* E21368 802B74B8 24020001 */  addiu     $v0, $zero, 0x1
/* E2136C 802B74BC 10A20026 */  beq       $a1, $v0, .L802B7558
/* E21370 802B74C0 28A20002 */   slti     $v0, $a1, 0x2
/* E21374 802B74C4 10400005 */  beqz      $v0, .L802B74DC
glabel .L802B74C8
/* E21378 802B74C8 24020002 */   addiu    $v0, $zero, 0x2
/* E2137C 802B74CC 10A00009 */  beqz      $a1, .L802B74F4
.L802B74D0:
/* E21380 802B74D0 00000000 */   nop
.L802B74D4:
/* E21384 802B74D4 080ADDA0 */  j         .L802B7680
/* E21388 802B74D8 00000000 */   nop
.L802B74DC:
/* E2138C 802B74DC 10A20027 */  beq       $a1, $v0, func_802B757C
.L802B74E0:
/* E21390 802B74E0 24020003 */   addiu    $v0, $zero, 0x3
/* E21394 802B74E4 10A20033 */  beq       $a1, $v0, .L802B75B4
/* E21398 802B74E8 00000000 */   nop
/* E2139C 802B74EC 080ADDA0 */  j         .L802B7680
glabel pulse_stone_notification_update
/* E213A0 802B74F0 00000000 */   nop
.L802B74F4:
/* E213A4 802B74F4 C4800014 */  lwc1      $f0, 0x14($a0)
/* E213A8 802B74F8 3C01802B */  lui       $at, %hi(D_802B79B0)
/* E213AC 802B74FC D42279B0 */  ldc1      $f2, %lo(D_802B79B0)($at)
/* E213B0 802B7500 3C01802B */  lui       $at, %hi(D_802B79B8)
/* E213B4 802B7504 D42479B8 */  ldc1      $f4, %lo(D_802B79B8)($at)
/* E213B8 802B7508 46000021 */  cvt.d.s   $f0, $f0
.L802B750C:
/* E213BC 802B750C 46220000 */  add.d     $f0, $f0, $f2
/* E213C0 802B7510 AC800010 */  sw        $zero, 0x10($a0)
/* E213C4 802B7514 46200020 */  cvt.s.d   $f0, $f0
/* E213C8 802B7518 460000A1 */  cvt.d.s   $f2, $f0
/* E213CC 802B751C 4622203E */  c.le.d    $f4, $f2
.L802B7520:
/* E213D0 802B7520 00000000 */  nop
.L802B7524:
/* E213D4 802B7524 45000056 */  bc1f      .L802B7680
.L802B7528:
/* E213D8 802B7528 E4800014 */   swc1     $f0, 0x14($a0)
/* E213DC 802B752C 9082002A */  lbu       $v0, 0x2A($a0)
/* E213E0 802B7530 3C013F0C */  lui       $at, (0x3F0CCCCD >> 16)
/* E213E4 802B7534 3421CCCD */  ori       $at, $at, (0x3F0CCCCD & 0xFFFF)
/* E213E8 802B7538 44810000 */  mtc1      $at, $f0
/* E213EC 802B753C 24420001 */  addiu     $v0, $v0, 0x1
/* E213F0 802B7540 E4800014 */  swc1      $f0, 0x14($a0)
.L802B7544:
/* E213F4 802B7544 A082002A */  sb        $v0, 0x2A($a0)
/* E213F8 802B7548 8C630000 */  lw        $v1, 0x0($v1)
/* E213FC 802B754C 2402000C */  addiu     $v0, $zero, 0xC
/* E21400 802B7550 080ADDA0 */  j         .L802B7680
/* E21404 802B7554 AC620020 */   sw       $v0, 0x20($v1)
.L802B7558:
/* E21408 802B7558 8C820020 */  lw        $v0, 0x20($a0)
/* E2140C 802B755C AC800010 */  sw        $zero, 0x10($a0)
/* E21410 802B7560 2442FFFF */  addiu     $v0, $v0, -0x1
.L802B7564:
/* E21414 802B7564 1C400046 */  bgtz      $v0, .L802B7680
.L802B7568:
/* E21418 802B7568 AC820020 */   sw       $v0, 0x20($a0)
.L802B756C:
/* E2141C 802B756C 9082002A */  lbu       $v0, 0x2A($a0)
/* E21420 802B7570 24420001 */  addiu     $v0, $v0, 0x1
/* E21424 802B7574 080ADDA0 */  j         .L802B7680
/* E21428 802B7578 A082002A */   sb       $v0, 0x2A($a0)
glabel func_802B757C
/* E2142C 802B757C C48C0010 */  lwc1      $f12, 0x10($a0)
ispy_icon_img:
/* E21430 802B7580 3C014120 */  lui       $at, (0x41200000 >> 16)
/* E21434 802B7584 44810000 */  mtc1      $at, $f0
/* E21438 802B7588 00000000 */  nop
/* E2143C 802B758C 46006300 */  add.s     $f12, $f12, $f0
glabel .L802B7590
/* E21440 802B7590 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* E21444 802B7594 44810000 */  mtc1      $at, $f0
/* E21448 802B7598 00000000 */  nop
/* E2144C 802B759C 460C003E */  c.le.s    $f0, $f12
/* E21450 802B75A0 00000000 */  nop
/* E21454 802B75A4 45030001 */  bc1tl     .L802B75AC
/* E21458 802B75A8 46006301 */   sub.s    $f12, $f12, $f0
.L802B75AC:
/* E2145C 802B75AC 080ADD9D */  j         .L802B7674
/* E21460 802B75B0 E48C0010 */   swc1     $f12, 0x10($a0)
.L802B75B4:
/* E21464 802B75B4 C48C0010 */  lwc1      $f12, 0x10($a0)
.L802B75B8:
/* E21468 802B75B8 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* E2146C 802B75BC 44810000 */  mtc1      $at, $f0
/* E21470 802B75C0 00000000 */  nop
/* E21474 802B75C4 46006300 */  add.s     $f12, $f12, $f0
.L802B75C8:
/* E21478 802B75C8 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* E2147C 802B75CC 44810000 */  mtc1      $at, $f0
.L802B75D0:
/* E21480 802B75D0 00000000 */  nop
/* E21484 802B75D4 460C003E */  c.le.s    $f0, $f12
/* E21488 802B75D8 00000000 */  nop
/* E2148C 802B75DC 45030001 */  bc1tl     .L802B75E4
/* E21490 802B75E0 46006301 */   sub.s    $f12, $f12, $f0
.L802B75E4:
/* E21494 802B75E4 3C01428C */  lui       $at, (0x428C0000 >> 16)
glabel func_802B75E8
/* E21498 802B75E8 44810000 */  mtc1      $at, $f0
/* E2149C 802B75EC 00000000 */  nop
/* E214A0 802B75F0 460C003E */  c.le.s    $f0, $f12
/* E214A4 802B75F4 00000000 */  nop
.L802B75F8:
/* E214A8 802B75F8 45000008 */  bc1f      .L802B761C
/* E214AC 802B75FC E48C0010 */   swc1     $f12, 0x10($a0)
/* E214B0 802B7600 3C0142DC */  lui       $at, (0x42DC0000 >> 16)
/* E214B4 802B7604 44810000 */  mtc1      $at, $f0
/* E214B8 802B7608 00000000 */  nop
/* E214BC 802B760C 4600603E */  c.le.s    $f12, $f0
.L802B7610:
/* E214C0 802B7610 00000000 */  nop
/* E214C4 802B7614 4501000F */  bc1t      .L802B7654
/* E214C8 802B7618 00000000 */   nop
.L802B761C:
/* E214CC 802B761C 3C01437A */  lui       $at, (0x437A0000 >> 16)
/* E214D0 802B7620 44810000 */  mtc1      $at, $f0
.L802B7624:
/* E214D4 802B7624 00000000 */  nop
/* E214D8 802B7628 460C003E */  c.le.s    $f0, $f12
.L802B762C:
/* E214DC 802B762C 00000000 */  nop
/* E214E0 802B7630 45000010 */  bc1f      .L802B7674
.L802B7634:
/* E214E4 802B7634 00000000 */   nop
/* E214E8 802B7638 3C014391 */  lui       $at, (0x43910000 >> 16)
/* E214EC 802B763C 44810000 */  mtc1      $at, $f0
D_802B7640:
/* E214F0 802B7640 00000000 */  nop
/* E214F4 802B7644 4600603E */  c.le.s    $f12, $f0
/* E214F8 802B7648 00000000 */  nop
/* E214FC 802B764C 45000009 */  bc1f      .L802B7674
/* E21500 802B7650 00000000 */   nop
.L802B7654:
/* E21504 802B7654 8E020004 */  lw        $v0, 0x4($s0)
/* E21508 802B7658 2403FFDF */  addiu     $v1, $zero, -0x21
/* E2150C 802B765C 3C018011 */  lui       $at, %hi(TalkNotificationCallback)
/* E21510 802B7660 AC20C940 */  sw        $zero, %lo(TalkNotificationCallback)($at)
/* E21514 802B7664 AE0000C8 */  sw        $zero, 0xC8($s0)
/* E21518 802B7668 00431024 */  and       $v0, $v0, $v1
/* E2151C 802B766C 080ADDBE */  j         .L802B76F8
/* E21520 802B7670 AE020004 */   sw       $v0, 0x4($s0)
.L802B7674:
/* E21524 802B7674 0C0ADC00 */  jal       appendGfx_ispy_icon
/* E21528 802B7678 00000000 */   nop
/* E2152C 802B767C 0040302D */  daddu     $a2, $v0, $zero
.L802B7680:
/* E21530 802B7680 3C04802B */  lui       $a0, %hi(D_802B79A8)
/* E21534 802B7684 248479A8 */  addiu     $a0, $a0, %lo(D_802B79A8)
/* E21538 802B7688 8C820000 */  lw        $v0, 0x0($a0)
/* E2153C 802B768C A046002B */  sb        $a2, 0x2B($v0)
/* E21540 802B7690 8E0300C8 */  lw        $v1, 0xC8($s0)
/* E21544 802B7694 10600005 */  beqz      $v1, .L802B76AC
/* E21548 802B7698 00000000 */   nop
/* E2154C 802B769C 8C840000 */  lw        $a0, 0x0($a0)
/* E21550 802B76A0 8C820000 */  lw        $v0, 0x0($a0)
/* E21554 802B76A4 54620001 */  bnel      $v1, $v0, .L802B76AC
/* E21558 802B76A8 AC830000 */   sw       $v1, 0x0($a0)
.L802B76AC:
/* E2155C 802B76AC 3C03802B */  lui       $v1, %hi(D_802B79A8)
/* E21560 802B76B0 8C6379A8 */  lw        $v1, %lo(D_802B79A8)($v1)
/* E21564 802B76B4 8C640000 */  lw        $a0, 0x0($v1)
/* E21568 802B76B8 848200A8 */  lh        $v0, 0xA8($a0)
/* E2156C 802B76BC C480003C */  lwc1      $f0, 0x3C($a0)
/* E21570 802B76C0 44821000 */  mtc1      $v0, $f2
/* E21574 802B76C4 00000000 */  nop
/* E21578 802B76C8 468010A0 */  cvt.s.w   $f2, $f2
/* E2157C 802B76CC 46020000 */  add.s     $f0, $f0, $f2
/* E21580 802B76D0 3C014100 */  lui       $at, (0x41000000 >> 16)
/* E21584 802B76D4 44811000 */  mtc1      $at, $f2
/* E21588 802B76D8 00000000 */  nop
/* E2158C 802B76DC 46020000 */  add.s     $f0, $f0, $f2
/* E21590 802B76E0 E460001C */  swc1      $f0, 0x1C($v1)
/* E21594 802B76E4 E4600008 */  swc1      $f0, 0x8($v1)
/* E21598 802B76E8 C4800038 */  lwc1      $f0, 0x38($a0)
/* E2159C 802B76EC E4600004 */  swc1      $f0, 0x4($v1)
/* E215A0 802B76F0 C4800040 */  lwc1      $f0, 0x40($a0)
.L802B76F4:
/* E215A4 802B76F4 E460000C */  swc1      $f0, 0xC($v1)
.L802B76F8:
/* E215A8 802B76F8 8FBF0014 */  lw        $ra, 0x14($sp)
/* E215AC 802B76FC 8FB00010 */  lw        $s0, 0x10($sp)
/* E215B0 802B7700 03E00008 */  jr        $ra
/* E215B4 802B7704 27BD0018 */   addiu    $sp, $sp, 0x18
/* E215B8 802B7708 00000000 */  nop
/* E215BC 802B770C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void interact_speech_update(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    s32 brightness = 255;
    f32 yaw;
    Npc* npc;

    if (((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_ENTERING_BATTLE | PS_FLAG_PAUSED))
            != PS_FLAG_HAS_CONVERSATION_NPC)
        || gEncounterState == ENCOUNTER_STATE_CONVERSATION
        || playerStatus->animFlags & PA_FLAG_USING_WATT
        || playerStatus->inputDisabledCount != 0
        || playerStatus->animFlags & PA_FLAG_SPINNING
    ) {
        SpeechBubblePtr->state = 3;
    }

    switch (SpeechBubblePtr->state) {
        case SPEECH_BUBBLE_APPEAR:
            SpeechBubblePtr->yaw = 0.0f;
            SpeechBubblePtr->scale += 0.05;
            if (SpeechBubblePtr->scale >= 0.55) {
                SpeechBubblePtr->scale = 0.55f;
                SpeechBubblePtr->state++;
                SpeechBubblePtr->holdTime = 12;
            }
            break;
        case SPEECH_BUBBLE_HOLD:
            SpeechBubblePtr->yaw = 0.0f;
            SpeechBubblePtr->holdTime--;
            if (SpeechBubblePtr->holdTime <= 0) {
                SpeechBubblePtr->state++;
            }
            break;
        case SPEECH_BUBBLE_IDLE:
            yaw = SpeechBubblePtr->yaw;
            yaw += 10.0f;
            if (yaw >= 360.0f) {
                yaw -= 360.0f;
            }
            SpeechBubblePtr->yaw = yaw;
            brightness = N(GetIconBrightnessForAngle)(yaw);
            break;
        case SPEECH_BUBBLE_VANISH:
            yaw = SpeechBubblePtr->yaw;
            yaw += 25.0f;
            if (yaw >= 360.0f) {
                yaw -= 360.0f;
            }
            SpeechBubblePtr->yaw = yaw;
            if ((yaw >= 70.0f && yaw <= 110.0f) || (yaw >= 250.0f && yaw <= 290.0f)) {
                // only dimiss when the icon is rotated away from view
                TalkNotificationCallback = NULL;
                playerStatus->encounteredNPC = NULL;
                playerStatus->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE;
                return;
            }
            brightness = N(GetIconBrightnessForAngle)(yaw);
            break;
    }

    SpeechBubblePtr->brightness = brightness;
    if (playerStatus->encounteredNPC != NULL) {
        if (playerStatus->encounteredNPC != SpeechBubblePtr->encounteredNPC) {
            SpeechBubblePtr->encounteredNPC = playerStatus->encounteredNPC;
        }
    }

    npc = SpeechBubblePtr->encounteredNPC;
    SpeechBubblePtr->pos.y = SpeechBubblePtr->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
    SpeechBubblePtr->pos.x = npc->pos.x;
    SpeechBubblePtr->pos.z = npc->pos.z;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8026E558
/* 19CE38 8026E558 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 19CE3C 8026E55C AFB3001C */  sw        $s3, 0x1C($sp)
/* 19CE40 8026E560 0080982D */  daddu     $s3, $a0, $zero
/* 19CE44 8026E564 AFBF0020 */  sw        $ra, 0x20($sp)
/* 19CE48 8026E568 AFB20018 */  sw        $s2, 0x18($sp)
/* 19CE4C 8026E56C AFB10014 */  sw        $s1, 0x14($sp)
/* 19CE50 8026E570 AFB00010 */  sw        $s0, 0x10($sp)
/* 19CE54 8026E574 8E70000C */  lw        $s0, 0xC($s3)
/* 19CE58 8026E578 8E050000 */  lw        $a1, 0x0($s0)
/* 19CE5C 8026E57C 0C0B1EAF */  jal       evt_get_variable
/* 19CE60 8026E580 26100004 */   addiu    $s0, $s0, 0x4
/* 19CE64 8026E584 0040882D */  daddu     $s1, $v0, $zero
/* 19CE68 8026E588 8E050000 */  lw        $a1, 0x0($s0)
/* 19CE6C 8026E58C 26100004 */  addiu     $s0, $s0, 0x4
/* 19CE70 8026E590 0C0B1EAF */  jal       evt_get_variable
/* 19CE74 8026E594 0260202D */   daddu    $a0, $s3, $zero
/* 19CE78 8026E598 0040902D */  daddu     $s2, $v0, $zero
/* 19CE7C 8026E59C 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 19CE80 8026E5A0 16220002 */  bne       $s1, $v0, .L8026E5AC
/* 19CE84 8026E5A4 8E100000 */   lw       $s0, 0x0($s0)
/* 19CE88 8026E5A8 8E710148 */  lw        $s1, 0x148($s3)
.L8026E5AC:
/* 19CE8C 8026E5AC 0C09A75B */  jal       get_actor
/* 19CE90 8026E5B0 0220202D */   daddu    $a0, $s1, $zero
/* 19CE94 8026E5B4 0040202D */  daddu     $a0, $v0, $zero
/* 19CE98 8026E5B8 C4820148 */  lwc1      $f2, 0x148($a0)
/* 19CE9C 8026E5BC 3C014220 */  lui       $at, (0x42200000 >> 16)
/* 19CEA0 8026E5C0 44810000 */  mtc1      $at, $f0
/* 19CEA4 8026E5C4 C4840144 */  lwc1      $f4, 0x144($a0)
/* 19CEA8 8026E5C8 C486014C */  lwc1      $f6, 0x14C($a0)
/* 19CEAC 8026E5CC 4600103C */  c.lt.s    $f2, $f0
/* 19CEB0 8026E5D0 00000000 */  nop
/* 19CEB4 8026E5D4 45000003 */  bc1f      .L8026E5E4
/* 19CEB8 8026E5D8 2406FFFF */   addiu    $a2, $zero, -0x1
/* 19CEBC 8026E5DC 0809B988 */  j         .L8026E620
/* 19CEC0 8026E5E0 0000402D */   daddu    $t0, $zero, $zero
.L8026E5E4:
/* 19CEC4 8026E5E4 3C0142AA */  lui       $at, (0x42AA0000 >> 16)
/* 19CEC8 8026E5E8 44810000 */  mtc1      $at, $f0
/* 19CECC 8026E5EC 00000000 */  nop
/* 19CED0 8026E5F0 4600103C */  c.lt.s    $f2, $f0
/* 19CED4 8026E5F4 00000000 */  nop
/* 19CED8 8026E5F8 45010009 */  bc1t      .L8026E620
/* 19CEDC 8026E5FC 24080001 */   addiu    $t0, $zero, 0x1
/* 19CEE0 8026E600 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 19CEE4 8026E604 44810000 */  mtc1      $at, $f0
/* 19CEE8 8026E608 00000000 */  nop
/* 19CEEC 8026E60C 4600103C */  c.lt.s    $f2, $f0
/* 19CEF0 8026E610 00000000 */  nop
/* 19CEF4 8026E614 45000002 */  bc1f      .L8026E620
/* 19CEF8 8026E618 24080003 */   addiu    $t0, $zero, 0x3
/* 19CEFC 8026E61C 24080002 */  addiu     $t0, $zero, 0x2
.L8026E620:
/* 19CF00 8026E620 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 19CF04 8026E624 44810000 */  mtc1      $at, $f0
/* 19CF08 8026E628 00000000 */  nop
/* 19CF0C 8026E62C 4600203C */  c.lt.s    $f4, $f0
/* 19CF10 8026E630 00000000 */  nop
/* 19CF14 8026E634 45010010 */  bc1t      .L8026E678
/* 19CF18 8026E638 0000282D */   daddu    $a1, $zero, $zero
/* 19CF1C 8026E63C 3C014282 */  lui       $at, (0x42820000 >> 16)
/* 19CF20 8026E640 44810000 */  mtc1      $at, $f0
/* 19CF24 8026E644 00000000 */  nop
/* 19CF28 8026E648 4600203C */  c.lt.s    $f4, $f0
/* 19CF2C 8026E64C 00000000 */  nop
/* 19CF30 8026E650 45010009 */  bc1t      .L8026E678
/* 19CF34 8026E654 24050001 */   addiu    $a1, $zero, 0x1
/* 19CF38 8026E658 3C0142D2 */  lui       $at, (0x42D20000 >> 16)
/* 19CF3C 8026E65C 44810000 */  mtc1      $at, $f0
/* 19CF40 8026E660 00000000 */  nop
/* 19CF44 8026E664 4600203C */  c.lt.s    $f4, $f0
/* 19CF48 8026E668 00000000 */  nop
/* 19CF4C 8026E66C 45000002 */  bc1f      .L8026E678
/* 19CF50 8026E670 24050003 */   addiu    $a1, $zero, 0x3
/* 19CF54 8026E674 24050002 */  addiu     $a1, $zero, 0x2
.L8026E678:
/* 19CF58 8026E678 3C01C1F0 */  lui       $at, (0xC1F00000 >> 16)
/* 19CF5C 8026E67C 44810000 */  mtc1      $at, $f0
/* 19CF60 8026E680 00000000 */  nop
/* 19CF64 8026E684 4600303C */  c.lt.s    $f6, $f0
/* 19CF68 8026E688 00000000 */  nop
/* 19CF6C 8026E68C 45000002 */  bc1f      .L8026E698
/* 19CF70 8026E690 24070001 */   addiu    $a3, $zero, 0x1
/* 19CF74 8026E694 0000382D */  daddu     $a3, $zero, $zero
.L8026E698:
/* 19CF78 8026E698 1240000C */  beqz      $s2, .L8026E6CC
/* 19CF7C 8026E69C 00000000 */   nop
/* 19CF80 8026E6A0 1E400006 */  bgtz      $s2, .L8026E6BC
/* 19CF84 8026E6A4 24020001 */   addiu    $v0, $zero, 0x1
/* 19CF88 8026E6A8 2402FFFF */  addiu     $v0, $zero, -0x1
/* 19CF8C 8026E6AC 12420045 */  beq       $s2, $v0, .L8026E7C4
pause_stats_bar_png:
/* 19CF90 8026E6B0 00000000 */   nop
/* 19CF94 8026E6B4 0809BA0F */  j         .L8026E83C
/* 19CF98 8026E6B8 0260202D */   daddu    $a0, $s3, $zero
.L8026E6BC:
/* 19CF9C 8026E6BC 12420022 */  beq       $s2, $v0, .L8026E748
/* 19CFA0 8026E6C0 00000000 */   nop
/* 19CFA4 8026E6C4 0809BA0F */  j         .L8026E83C
/* 19CFA8 8026E6C8 0260202D */   daddu    $a0, $s3, $zero
.L8026E6CC:
/* 19CFAC 8026E6CC 8082040C */  lb        $v0, 0x40C($a0)
/* 19CFB0 8026E6D0 18400059 */  blez      $v0, .L8026E838
/* 19CFB4 8026E6D4 0000882D */   daddu    $s1, $zero, $zero
/* 19CFB8 8026E6D8 0040482D */  daddu     $t1, $v0, $zero
/* 19CFBC 8026E6DC 00911021 */  addu      $v0, $a0, $s1
.L8026E6E0:
/* 19CFC0 8026E6E0 8043040D */  lb        $v1, 0x40D($v0)
/* 19CFC4 8026E6E4 00031080 */  sll       $v0, $v1, 2
/* 19CFC8 8026E6E8 00431021 */  addu      $v0, $v0, $v1
/* 19CFCC 8026E6EC 00021080 */  sll       $v0, $v0, 2
/* 19CFD0 8026E6F0 2442022C */  addiu     $v0, $v0, 0x22C
/* 19CFD4 8026E6F4 00821821 */  addu      $v1, $a0, $v0
/* 19CFD8 8026E6F8 80620011 */  lb        $v0, 0x11($v1)
/* 19CFDC 8026E6FC 5445000D */  bnel      $v0, $a1, .L8026E734
/* 19CFE0 8026E700 26310001 */   addiu    $s1, $s1, 0x1
/* 19CFE4 8026E704 80620013 */  lb        $v0, 0x13($v1)
/* 19CFE8 8026E708 1447000A */  bne       $v0, $a3, .L8026E734
/* 19CFEC 8026E70C 26310001 */   addiu    $s1, $s1, 0x1
/* 19CFF0 8026E710 80620012 */  lb        $v0, 0x12($v1)
/* 19CFF4 8026E714 0048102A */  slt       $v0, $v0, $t0
/* 19CFF8 8026E718 10400006 */  beqz      $v0, .L8026E734
/* 19CFFC 8026E71C 00000000 */   nop
/* 19D000 8026E720 94620000 */  lhu       $v0, 0x0($v1)
/* 19D004 8026E724 A4820428 */  sh        $v0, 0x428($a0)
/* 19D008 8026E728 90620003 */  lbu       $v0, 0x3($v1)
/* 19D00C 8026E72C 0000302D */  daddu     $a2, $zero, $zero
/* 19D010 8026E730 A0820426 */  sb        $v0, 0x426($a0)
.L8026E734:
/* 19D014 8026E734 0229102A */  slt       $v0, $s1, $t1
/* 19D018 8026E738 1440FFE9 */  bnez      $v0, .L8026E6E0
/* 19D01C 8026E73C 00911021 */   addu     $v0, $a0, $s1
/* 19D020 8026E740 0809BA0F */  j         .L8026E83C
/* 19D024 8026E744 0260202D */   daddu    $a0, $s3, $zero
.L8026E748:
/* 19D028 8026E748 8082040C */  lb        $v0, 0x40C($a0)
/* 19D02C 8026E74C 1840003A */  blez      $v0, .L8026E838
/* 19D030 8026E750 0000882D */   daddu    $s1, $zero, $zero
/* 19D034 8026E754 0040482D */  daddu     $t1, $v0, $zero
/* 19D038 8026E758 00911021 */  addu      $v0, $a0, $s1
.L8026E75C:
/* 19D03C 8026E75C 8043040D */  lb        $v1, 0x40D($v0)
/* 19D040 8026E760 00031080 */  sll       $v0, $v1, 2
/* 19D044 8026E764 00431021 */  addu      $v0, $v0, $v1
/* 19D048 8026E768 00021080 */  sll       $v0, $v0, 2
/* 19D04C 8026E76C 2442022C */  addiu     $v0, $v0, 0x22C
/* 19D050 8026E770 00821821 */  addu      $v1, $a0, $v0
/* 19D054 8026E774 80620011 */  lb        $v0, 0x11($v1)
/* 19D058 8026E778 5445000D */  bnel      $v0, $a1, .L8026E7B0
/* 19D05C 8026E77C 26310001 */   addiu    $s1, $s1, 0x1
/* 19D060 8026E780 80620013 */  lb        $v0, 0x13($v1)
/* 19D064 8026E784 1447000A */  bne       $v0, $a3, .L8026E7B0
/* 19D068 8026E788 26310001 */   addiu    $s1, $s1, 0x1
/* 19D06C 8026E78C 80620012 */  lb        $v0, 0x12($v1)
/* 19D070 8026E790 0048102A */  slt       $v0, $v0, $t0
/* 19D074 8026E794 10400006 */  beqz      $v0, .L8026E7B0
/* 19D078 8026E798 00000000 */   nop
/* 19D07C 8026E79C 94620000 */  lhu       $v0, 0x0($v1)
/* 19D080 8026E7A0 A4820428 */  sh        $v0, 0x428($a0)
/* 19D084 8026E7A4 90620003 */  lbu       $v0, 0x3($v1)
/* 19D088 8026E7A8 0000302D */  daddu     $a2, $zero, $zero
/* 19D08C 8026E7AC A0820426 */  sb        $v0, 0x426($a0)
.L8026E7B0:
/* 19D090 8026E7B0 0229102A */  slt       $v0, $s1, $t1
/* 19D094 8026E7B4 1440FFE9 */  bnez      $v0, .L8026E75C
/* 19D098 8026E7B8 00911021 */   addu     $v0, $a0, $s1
/* 19D09C 8026E7BC 0809BA0F */  j         .L8026E83C
/* 19D0A0 8026E7C0 0260202D */   daddu    $a0, $s3, $zero
.L8026E7C4:
/* 19D0A4 8026E7C4 8082040C */  lb        $v0, 0x40C($a0)
/* 19D0A8 8026E7C8 1840001B */  blez      $v0, .L8026E838
/* 19D0AC 8026E7CC 0000882D */   daddu    $s1, $zero, $zero
/* 19D0B0 8026E7D0 0040482D */  daddu     $t1, $v0, $zero
/* 19D0B4 8026E7D4 00911021 */  addu      $v0, $a0, $s1
.L8026E7D8:
/* 19D0B8 8026E7D8 8043040D */  lb        $v1, 0x40D($v0)
/* 19D0BC 8026E7DC 00031080 */  sll       $v0, $v1, 2
/* 19D0C0 8026E7E0 00431021 */  addu      $v0, $v0, $v1
/* 19D0C4 8026E7E4 00021080 */  sll       $v0, $v0, 2
/* 19D0C8 8026E7E8 2442022C */  addiu     $v0, $v0, 0x22C
/* 19D0CC 8026E7EC 00821821 */  addu      $v1, $a0, $v0
/* 19D0D0 8026E7F0 80620011 */  lb        $v0, 0x11($v1)
/* 19D0D4 8026E7F4 5445000D */  bnel      $v0, $a1, .L8026E82C
/* 19D0D8 8026E7F8 26310001 */   addiu    $s1, $s1, 0x1
/* 19D0DC 8026E7FC 80620013 */  lb        $v0, 0x13($v1)
/* 19D0E0 8026E800 1447000A */  bne       $v0, $a3, .L8026E82C
/* 19D0E4 8026E804 26310001 */   addiu    $s1, $s1, 0x1
/* 19D0E8 8026E808 80620012 */  lb        $v0, 0x12($v1)
/* 19D0EC 8026E80C 0048102A */  slt       $v0, $v0, $t0
/* 19D0F0 8026E810 10400006 */  beqz      $v0, .L8026E82C
/* 19D0F4 8026E814 00000000 */   nop
/* 19D0F8 8026E818 94620000 */  lhu       $v0, 0x0($v1)
/* 19D0FC 8026E81C A4820428 */  sh        $v0, 0x428($a0)
/* 19D100 8026E820 90620003 */  lbu       $v0, 0x3($v1)
/* 19D104 8026E824 0000302D */  daddu     $a2, $zero, $zero
/* 19D108 8026E828 A0820426 */  sb        $v0, 0x426($a0)
.L8026E82C:
/* 19D10C 8026E82C 0229102A */  slt       $v0, $s1, $t1
/* 19D110 8026E830 1440FFE9 */  bnez      $v0, .L8026E7D8
/* 19D114 8026E834 00911021 */   addu     $v0, $a0, $s1
.L8026E838:
/* 19D118 8026E838 0260202D */  daddu     $a0, $s3, $zero
.L8026E83C:
/* 19D11C 8026E83C 0C0B2026 */  jal       evt_set_variable
/* 19D120 8026E840 0200282D */   daddu    $a1, $s0, $zero
/* 19D124 8026E844 8FBF0020 */  lw        $ra, 0x20($sp)
/* 19D128 8026E848 8FB3001C */  lw        $s3, 0x1C($sp)
/* 19D12C 8026E84C 8FB20018 */  lw        $s2, 0x18($sp)
/* 19D130 8026E850 8FB10014 */  lw        $s1, 0x14($sp)
/* 19D134 8026E854 8FB00010 */  lw        $s0, 0x10($sp)
/* 19D138 8026E858 24020002 */  addiu     $v0, $zero, 0x2
/* 19D13C 8026E85C 03E00008 */  jr        $ra
/* 19D140 8026E860 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

s32 func_8026E558(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    SelectableTarget* target;
    s32 mode;
    s32 outVar;
    Actor* actor;
    f32 x, y, z;
    s32 outVal;
    s32 row;
    s32 column;
    s32 layer;
    s32 i;

    i = evt_get_variable(script, *args++);
    mode = evt_get_variable(script, *args++);
    outVar = *args++;

    if (i == ACTOR_SELF) {
        i = script->owner1.actorID;
    }

    actor = get_actor(i);
    x = actor->currentPos.x;
    y = actor->currentPos.y;
    z = actor->currentPos.z;

    outVal = -1;

    if (y < 40.0f) {
        row = 0;
    } else if (y < 85.0f) {
        row = 1;
    } else if (y < 100.0f) {
        row = 2;
    } else {
        row = 3;
    }

    if (x < 25.0f) {
        column = 0;
    } else if (x < 65.0f) {
        column = 1;
    } else if (x < 105.0f) {
        column = 2;
    } else {
        column = 3;
    }

    if (z < -30.0f) {
        layer = 0;
    } else {
        layer = 1;
    }

    switch (mode) {
        case 0:
            for (i = 0; i < actor->targetListLength; i++) {
                target = &actor->targetData[actor->targetIndexList[i]];

                if (target->homeCol == column && target->layer == layer && target->homeRow < row) {
                    actor->targetActorID = target->actorID;
                    actor->targetPartIndex = target->partID;
                    outVal = 0;
                }
            }
            break;
        case 1:
            for (i = 0; i < actor->targetListLength; i++) {
                target = &actor->targetData[actor->targetIndexList[i]];

                if (target->homeCol == column && target->layer == layer && target->homeRow < row) {
                    actor->targetActorID = target->actorID;
                    actor->targetPartIndex = target->partID;
                    outVal = 0;
                }
            }
            break;
        case -1:
            for (i = 0; i < actor->targetListLength; i++) {
                target = &actor->targetData[actor->targetIndexList[i]];

                if (target->homeCol == column && target->layer == layer && target->homeRow < row) {
                    actor->targetActorID = target->actorID;
                    actor->targetPartIndex = target->partID;
                    outVal = 0;
                }
            }
            break;
    }
    evt_set_variable(script, outVar, outVal);
    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel parasol_get_npc
/* E236E0 802B6000 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* E236E4 802B6004 AFB30024 */  sw        $s3, 0x24($sp)
/* E236E8 802B6008 AFB00018 */  sw        $s0, 0x18($sp)
/* E236EC 802B600C 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* E236F0 802B6010 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* E236F4 802B6014 AFBF002C */  sw        $ra, 0x2C($sp)
.L802B6018:
/* E236F8 802B6018 AFB40028 */  sw        $s4, 0x28($sp)
/* E236FC 802B601C AFB20020 */  sw        $s2, 0x20($sp)
/* E23700 802B6020 AFB1001C */  sw        $s1, 0x1C($sp)
/* E23704 802B6024 8E050004 */  lw        $a1, 0x4($s0)
/* E23708 802B6028 3C148011 */  lui       $s4, %hi(gPlayerData)
/* E2370C 802B602C 2694F290 */  addiu     $s4, $s4, %lo(gPlayerData)
/* E23710 802B6030 30A21000 */  andi      $v0, $a1, 0x1000
/* E23714 802B6034 10400005 */  beqz      $v0, .L802B604C
/* E23718 802B6038 0000982D */   daddu    $s3, $zero, $zero
/* E2371C 802B603C 0C0AD97A */  jal       action_update_walk_peach
.L802B6040:
/* E23720 802B6040 00000000 */   nop
.L802B6044:
/* E23724 802B6044 080AD89A */  j         .L802B6268
glabel action_hammer_play_hit_fx
/* E23728 802B6048 00000000 */   nop
.L802B604C:
/* E2372C 802B604C 8E030000 */  lw        $v1, 0x0($s0)
.L802B6050:
/* E23730 802B6050 04610016 */  bgez      $v1, .L802B60AC
/* E23734 802B6054 3C027F77 */   lui      $v0, (0x7F77FFFF >> 16)
.L802B6058:
/* E23738 802B6058 3442FFFF */  ori       $v0, $v0, (0x7F77FFFF & 0xFFFF)
/* E2373C 802B605C 24130001 */  addiu     $s3, $zero, 0x1
glabel action_update_sliding
/* E23740 802B6060 00621024 */  and       $v0, $v1, $v0
/* E23744 802B6064 AE020000 */  sw        $v0, 0x0($s0)
.L802B6068:
/* E23748 802B6068 30624000 */  andi      $v0, $v1, 0x4000
/* E2374C 802B606C 14400003 */  bnez      $v0, .L802B607C
/* E23750 802B6070 AE000060 */   sw       $zero, 0x60($s0)
.L802B6074:
/* E23754 802B6074 C6000058 */  lwc1      $f0, 0x58($s0)
/* E23758 802B6078 E6000054 */  swc1      $f0, 0x54($s0)
glabel .L802B607C
/* E2375C 802B607C 30A24000 */  andi      $v0, $a1, 0x4000
.L802B6080:
/* E23760 802B6080 10400003 */  beqz      $v0, .L802B6090
/* E23764 802B6084 3C040009 */   lui      $a0, (0x90003 >> 16)
/* E23768 802B6088 080AD829 */  j         action_update_use_spinning_flower
.L802B608C:
/* E2376C 802B608C 34840003 */   ori      $a0, $a0, (0x90003 & 0xFFFF)
.L802B6090:
/* E23770 802B6090 30A20001 */  andi      $v0, $a1, 0x1
.L802B6094:
/* E23774 802B6094 14400003 */  bnez      $v0, action_update_use_spinning_flower
/* E23778 802B6098 3C040006 */   lui      $a0, (0x60000 >> 16)
glabel action_update_state_23
/* E2377C 802B609C 3C040001 */  lui       $a0, (0x10004 >> 16)
/* E23780 802B60A0 34840004 */  ori       $a0, $a0, (0x10004 & 0xFFFF)
glabel action_update_use_spinning_flower
/* E23784 802B60A4 0C037FBF */  jal       suggest_player_anim_allow_backward
.L802B60A8:
/* E23788 802B60A8 00000000 */   nop
.L802B60AC:
/* E2378C 802B60AC 8E020000 */  lw        $v0, 0x0($s0)
/* E23790 802B60B0 30424000 */  andi      $v0, $v0, 0x4000
glabel action_update_jump
/* E23794 802B60B4 10400006 */  beqz      $v0, .L802B60D0
/* E23798 802B60B8 24040008 */   addiu    $a0, $zero, 0x8
/* E2379C 802B60BC C60000A0 */  lwc1      $f0, 0xA0($s0)
/* E237A0 802B60C0 0C039426 */  jal       try_player_footstep_sounds
/* E237A4 802B60C4 E6000080 */   swc1     $f0, 0x80($s0)
.L802B60C8:
/* E237A8 802B60C8 080AD89A */  j         .L802B6268
/* E237AC 802B60CC 00000000 */   nop
glabel .L802B60D0
/* E237B0 802B60D0 27B20010 */  addiu     $s2, $sp, 0x10
.L802B60D4:
/* E237B4 802B60D4 0240202D */  daddu     $a0, $s2, $zero
/* E237B8 802B60D8 27B10014 */  addiu     $s1, $sp, 0x14
/* E237BC 802B60DC 0C0388C1 */  jal       player_input_to_move_vector
/* E237C0 802B60E0 0220282D */   daddu    $a1, $s1, $zero
/* E237C4 802B60E4 0C039454 */  jal       phys_update_interact_collider
.L802B60E8:
/* E237C8 802B60E8 00000000 */   nop
.L802B60EC:
/* E237CC 802B60EC 0C039858 */  jal       check_input_jump
.L802B60F0:
/* E237D0 802B60F0 00000000 */   nop
glabel .L802B60F4
/* E237D4 802B60F4 1440005C */  bnez      $v0, .L802B6268
/* E237D8 802B60F8 00000000 */   nop
/* E237DC 802B60FC 16600006 */  bnez      $s3, .L802B6118
.L802B6100:
/* E237E0 802B6100 0240202D */   daddu    $a0, $s2, $zero
.L802B6104:
/* E237E4 802B6104 0C039838 */  jal       check_input_hammer
.L802B6108:
/* E237E8 802B6108 00000000 */   nop
glabel .L802B610C
/* E237EC 802B610C 14400056 */  bnez      $v0, .L802B6268
.L802B6110:
/* E237F0 802B6110 00000000 */   nop
/* E237F4 802B6114 0240202D */  daddu     $a0, $s2, $zero
.L802B6118:
/* E237F8 802B6118 0C0388C1 */  jal       player_input_to_move_vector
/* E237FC 802B611C 0220282D */   daddu    $a1, $s1, $zero
glabel action_update_parasol
/* E23800 802B6120 C7A40014 */  lwc1      $f4, 0x14($sp)
.L802B6124:
/* E23804 802B6124 44800000 */  mtc1      $zero, $f0
.L802B6128:
/* E23808 802B6128 00000000 */  nop
/* E2380C 802B612C 46002032 */  c.eq.s    $f4, $f0
/* E23810 802B6130 00000000 */  nop
glabel .L802B6134
/* E23814 802B6134 45000005 */  bc1f      .L802B614C
/* E23818 802B6138 00000000 */   nop
.L802B613C:
/* E2381C 802B613C 0C039769 */  jal       set_action_state
.L802B6140:
/* E23820 802B6140 0000202D */   daddu    $a0, $zero, $zero
.L802B6144:
/* E23824 802B6144 080AD89A */  j         .L802B6268
/* E23828 802B6148 00000000 */   nop
.L802B614C:
/* E2382C 802B614C C7A60010 */  lwc1      $f6, 0x10($sp)
.L802B6150:
/* E23830 802B6150 3C01800F */  lui       $at, %hi(PrevPlayerCamRelativeYaw)
.L802B6154:
/* E23834 802B6154 C4207B40 */  lwc1      $f0, %lo(PrevPlayerCamRelativeYaw)($at)
.L802B6158:
/* E23838 802B6158 46800020 */  cvt.s.w   $f0, $f0
.L802B615C:
/* E2383C 802B615C 46060001 */  sub.s     $f0, $f0, $f6
/* E23840 802B6160 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
.L802B6164:
/* E23844 802B6164 44811000 */  mtc1      $at, $f2
.L802B6168:
/* E23848 802B6168 46000005 */  abs.s     $f0, $f0
/* E2384C 802B616C 4602003E */  c.le.s    $f0, $f2
glabel .L802B6170
/* E23850 802B6170 00000000 */  nop
glabel .L802B6174
/* E23854 802B6174 4500001C */  bc1f      .L802B61E8
/* E23858 802B6178 00000000 */   nop
.L802B617C:
/* E2385C 802B617C 3C01800F */  lui       $at, %hi(D_800F7B44)
.L802B6180:
/* E23860 802B6180 C4207B44 */  lwc1      $f0, %lo(D_800F7B44)($at)
glabel .L802B6184
/* E23864 802B6184 46800020 */  cvt.s.w   $f0, $f0
.L802B6188:
/* E23868 802B6188 46002001 */  sub.s     $f0, $f4, $f0
.L802B618C:
/* E2386C 802B618C 4600020D */  trunc.w.s $f8, $f0
.L802B6190:
/* E23870 802B6190 44024000 */  mfc1      $v0, $f8
.L802B6194:
/* E23874 802B6194 00000000 */  nop
glabel func_802B6198
/* E23878 802B6198 04420001 */  bltzl     $v0, .L802B61A0
/* E2387C 802B619C 00021023 */   negu     $v0, $v0
.L802B61A0:
/* E23880 802B61A0 28420014 */  slti      $v0, $v0, 0x14
.L802B61A4:
/* E23884 802B61A4 10400010 */  beqz      $v0, .L802B61E8
.L802B61A8:
/* E23888 802B61A8 00000000 */   nop
.L802B61AC:
/* E2388C 802B61AC 8E020004 */  lw        $v0, 0x4($s0)
.L802B61B0:
/* E23890 802B61B0 0440000A */  bltz      $v0, .L802B61DC
.L802B61B4:
/* E23894 802B61B4 3C037FFF */   lui      $v1, (0x7FFFFFFF >> 16)
/* E23898 802B61B8 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
/* E2389C 802B61BC 44810000 */  mtc1      $at, $f0
glabel func_802B61C0
/* E238A0 802B61C0 00000000 */  nop
/* E238A4 802B61C4 4604003E */  c.le.s    $f0, $f4
.L802B61C8:
/* E238A8 802B61C8 00000000 */  nop
.L802B61CC:
/* E238AC 802B61CC 45030002 */  bc1tl     .L802B61D8
/* E238B0 802B61D0 E6060080 */   swc1     $f6, 0x80($s0)
.L802B61D4:
/* E238B4 802B61D4 3C037FFF */  lui       $v1, (0x7FFFFFFF >> 16)
.L802B61D8:
/* E238B8 802B61D8 8E020004 */  lw        $v0, 0x4($s0)
.L802B61DC:
/* E238BC 802B61DC 3463FFFF */  ori       $v1, $v1, (0x7FFFFFFF & 0xFFFF)
/* E238C0 802B61E0 080AD881 */  j         .L802B6204
glabel func_802B61E4
/* E238C4 802B61E4 00431024 */   and      $v0, $v0, $v1
.L802B61E8:
/* E238C8 802B61E8 8E020004 */  lw        $v0, 0x4($s0)
.L802B61EC:
/* E238CC 802B61EC 04410004 */  bgez      $v0, .L802B6200
.L802B61F0:
/* E238D0 802B61F0 3C038000 */   lui      $v1, (0x80000000 >> 16)
.L802B61F4:
/* E238D4 802B61F4 C7A00010 */  lwc1      $f0, 0x10($sp)
.L802B61F8:
/* E238D8 802B61F8 080AD882 */  j         .L802B6208
.L802B61FC:
/* E238DC 802B61FC E6000080 */   swc1     $f0, 0x80($s0)
.L802B6200:
/* E238E0 802B6200 00431025 */  or        $v0, $v0, $v1
.L802B6204:
/* E238E4 802B6204 AE020004 */  sw        $v0, 0x4($s0)
glabel .L802B6208
/* E238E8 802B6208 0C03A752 */  jal       is_ability_active
/* E238EC 802B620C 2404000B */   addiu    $a0, $zero, 0xB
.L802B6210:
/* E238F0 802B6210 14400010 */  bnez      $v0, .L802B6254
.L802B6214:
/* E238F4 802B6214 00000000 */   nop
glabel .L802B6218
/* E238F8 802B6218 8E0200E8 */  lw        $v0, 0xE8($s0)
/* E238FC 802B621C 00420018 */  mult      $v0, $v0
.L802B6220:
/* E23900 802B6220 00001812 */  mflo      $v1
.L802B6224:
/* E23904 802B6224 8E0200EC */  lw        $v0, 0xEC($s0)
glabel .L802B6228
/* E23908 802B6228 00000000 */  nop
.L802B622C:
/* E2390C 802B622C 00420018 */  mult      $v0, $v0
glabel action_update_step_up_peach
/* E23910 802B6230 00003812 */  mflo      $a3
/* E23914 802B6234 00671021 */  addu      $v0, $v1, $a3
glabel .L802B6238
/* E23918 802B6238 28420BD2 */  slti      $v0, $v0, 0xBD2
glabel .L802B623C
/* E2391C 802B623C 14400005 */  bnez      $v0, .L802B6254
glabel .L802B6240
/* E23920 802B6240 00000000 */   nop
glabel .L802B6244
/* E23924 802B6244 0C039769 */  jal       set_action_state
glabel .L802B6248
/* E23928 802B6248 24040002 */   addiu    $a0, $zero, 0x2
/* E2392C 802B624C 080AD89A */  j         .L802B6268
glabel .L802B6250
/* E23930 802B6250 00000000 */   nop
.L802B6254:
/* E23934 802B6254 0C039426 */  jal       try_player_footstep_sounds
glabel .L802B6258
/* E23938 802B6258 24040008 */   addiu    $a0, $zero, 0x8
.L802B625C:
/* E2393C 802B625C 8E8202AC */  lw        $v0, 0x2AC($s4)
/* E23940 802B6260 24420001 */  addiu     $v0, $v0, 0x1
/* E23944 802B6264 AE8202AC */  sw        $v0, 0x2AC($s4)
.L802B6268:
/* E23948 802B6268 8FBF002C */  lw        $ra, 0x2C($sp)
.L802B626C:
/* E2394C 802B626C 8FB40028 */  lw        $s4, 0x28($sp)
/* E23950 802B6270 8FB30024 */  lw        $s3, 0x24($sp)
.L802B6274:
/* E23954 802B6274 8FB20020 */  lw        $s2, 0x20($sp)
glabel .L802B6278
/* E23958 802B6278 8FB1001C */  lw        $s1, 0x1C($sp)
/* E2395C 802B627C 8FB00018 */  lw        $s0, 0x18($sp)
.L802B6280:
/* E23960 802B6280 03E00008 */  jr        $ra
.L802B6284:
/* E23964 802B6284 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void action_update_walk(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    PlayerData* playerData = &gPlayerData;
    f32 moveVectorMagnitude;
    f32 moveVectorAngle;
    s32 stickAxisX;
    s32 stickAxisY;
    AnimID anim;
    s32 changedAnim = FALSE;
    if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
        action_update_walk_peach();
        return;
    }

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~(
            PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_SCRIPTED_FALL | PS_FLAG_ARMS_RAISED);
        playerStatus->unk_60 = 0;
        changedAnim = TRUE;

        if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) {
            playerStatus->currentSpeed = playerStatus->walkSpeed;
        }

        if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
            anim = ANIM_MarioW3_8bit_Run;
        }
        else if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
            anim = ANIM_Mario1_Walk;
        }
        else {
            anim = ANIM_MarioW1_CarryWalk;
        }
        suggest_player_anim_allow_backward(anim);
    }

    if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
        playerStatus->targetYaw = playerStatus->heading;
        try_player_footstep_sounds(8);
        return;
    }

    player_input_to_move_vector(&moveVectorAngle, &moveVectorMagnitude);
    phys_update_interact_collider();

    if (!check_input_jump()) {
        if (changedAnim != 0 || !check_input_hammer()) {
            player_input_to_move_vector(&moveVectorAngle, &moveVectorMagnitude);
            if (moveVectorMagnitude == 0.0f) {
                set_action_state(ACTION_STATE_IDLE);
                return;
            }

            if (fabsf(PrevPlayerCamRelativeYaw - moveVectorAngle) <= 90.0f && abs(moveVectorMagnitude - D_800F7B44) < 20) {
                if (!(playerStatus->animFlags & PA_FLAG_80000000)) {
                    if (moveVectorMagnitude >= 20.0f) {
                        playerStatus->targetYaw = moveVectorAngle;
                    }
                }
                playerStatus->animFlags &= ~PA_FLAG_80000000;
            } else {
                if (playerStatus->animFlags & PA_FLAG_80000000) {
                    playerStatus->targetYaw = moveVectorAngle;
                } else {
                    playerStatus->animFlags |= PA_FLAG_80000000;
                }
            }

            if (!is_ability_active(ABILITY_SLOW_GO)) {
                stickAxisX = playerStatus->stickAxis[0];
                stickAxisY = playerStatus->stickAxis[1];
                if (SQ(stickAxisX) + SQ(stickAxisY) > SQ(55)) {
                    set_action_state(ACTION_STATE_RUN);
                    return;
                }
            }

            try_player_footstep_sounds(8);
            playerData->walkingStepsTaken++;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80248B08
/* 1773E8 80248B08 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 1773EC 80248B0C 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_80248B10:
/* 1773F0 80248B10 3C06800E */  lui       $a2, %hi(gCurrentBattlePtr)
/* 1773F4 80248B14 8CC6C4FC */  lw        $a2, %lo(gCurrentBattlePtr)($a2)
D_80248B18:
/* 1773F8 80248B18 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 1773FC 80248B1C AFB20018 */  sw        $s2, 0x18($sp)
/* 177400 80248B20 3C12800E */  lui       $s2, %hi(gBattleStatus)
D_80248B24:
/* 177404 80248B24 2652C070 */  addiu     $s2, $s2, %lo(gBattleStatus)
/* 177408 80248B28 AFBF001C */  sw        $ra, 0x1C($sp)
/* 17740C 80248B2C AFB10014 */  sw        $s1, 0x14($sp)
/* 177410 80248B30 2C620005 */  sltiu     $v0, $v1, 0x5
/* 177414 80248B34 1040008A */  beqz      $v0, D_80248D60
/* 177418 80248B38 AFB00010 */   sw       $s0, 0x10($sp)
/* 17741C 80248B3C 00031080 */  sll       $v0, $v1, 2
/* 177420 80248B40 3C01802A */  lui       $at, %hi(jtbl_8029CBE0)
D_80248B44:
/* 177424 80248B44 00220821 */  addu      $at, $at, $v0
/* 177428 80248B48 8C22CBE0 */  lw        $v0, %lo(jtbl_8029CBE0)($at)
/* 17742C 80248B4C 00400008 */  jr        $v0
D_80248B50:
/* 177430 80248B50 00000000 */   nop
glabel .L80248B54
/* 177434 80248B54 3C038028 */  lui       $v1, %hi(D_802809F6)
/* 177438 80248B58 846309F6 */  lh        $v1, %lo(D_802809F6)($v1)
/* 17743C 80248B5C 2402FFFF */  addiu     $v0, $zero, -0x1
.L80248B60:
/* 177440 80248B60 3C018028 */  lui       $at, %hi(BattleScreenFadeAmt)
/* 177444 80248B64 AC200A30 */  sw        $zero, %lo(BattleScreenFadeAmt)($at)
/* 177448 80248B68 1462000A */  bne       $v1, $v0, .L80248B94
/* 17744C 80248B6C 24020001 */   addiu    $v0, $zero, 0x1
.L80248B70:
/* 177450 80248B70 3C048028 */  lui       $a0, %hi(DemoBattleBeginDelay)
/* 177454 80248B74 248409F8 */  addiu     $a0, $a0, %lo(DemoBattleBeginDelay)
/* 177458 80248B78 84820000 */  lh        $v0, 0x0($a0)
D_80248B7C:
/* 17745C 80248B7C 94830000 */  lhu       $v1, 0x0($a0)
/* 177460 80248B80 10400003 */  beqz      $v0, .L80248B90
/* 177464 80248B84 2462FFFF */   addiu    $v0, $v1, -0x1
/* 177468 80248B88 08092358 */  j         D_80248D60
/* 17746C 80248B8C A4820000 */   sh       $v0, 0x0($a0)
.L80248B90:
/* 177470 80248B90 24020001 */  addiu     $v0, $zero, 0x1
.L80248B94:
/* 177474 80248B94 3C01800E */  lui       $at, %hi(gBattleSubState)
.L80248B98:
/* 177478 80248B98 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
D_80248B9C:
/* 17747C 80248B9C 08092358 */  j         D_80248D60
D_80248BA0:
/* 177480 80248BA0 00000000 */   nop
glabel .L80248BA4
/* 177484 80248BA4 3C038028 */  lui       $v1, %hi(D_802809F6)
D_80248BA8:
/* 177488 80248BA8 846309F6 */  lh        $v1, %lo(D_802809F6)($v1)
/* 17748C 80248BAC 2402FFFF */  addiu     $v0, $zero, -0x1
/* 177490 80248BB0 10620005 */  beq       $v1, $v0, .L80248BC8
/* 177494 80248BB4 240200FF */   addiu    $v0, $zero, 0xFF
/* 177498 80248BB8 14620069 */  bne       $v1, $v0, D_80248D60
/* 17749C 80248BBC 24020002 */   addiu    $v0, $zero, 0x2
/* 1774A0 80248BC0 080922F9 */  j         .L80248BE4
.L80248BC4:
/* 1774A4 80248BC4 00000000 */   nop
.L80248BC8:
/* 1774A8 80248BC8 3C038028 */  lui       $v1, %hi(BattleScreenFadeAmt)
.L80248BCC:
/* 1774AC 80248BCC 24630A30 */  addiu     $v1, $v1, %lo(BattleScreenFadeAmt)
/* 1774B0 80248BD0 8C620000 */  lw        $v0, 0x0($v1)
D_80248BD4:
/* 1774B4 80248BD4 240400FF */  addiu     $a0, $zero, 0xFF
D_80248BD8:
/* 1774B8 80248BD8 14440006 */  bne       $v0, $a0, func_80248BF4
.L80248BDC:
/* 1774BC 80248BDC 24420032 */   addiu    $v0, $v0, 0x32
/* 1774C0 80248BE0 24020002 */  addiu     $v0, $zero, 0x2
.L80248BE4:
/* 1774C4 80248BE4 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 1774C8 80248BE8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 1774CC 80248BEC 08092358 */  j         D_80248D60
/* 1774D0 80248BF0 00000000 */   nop
glabel func_80248BF4
/* 1774D4 80248BF4 AC620000 */  sw        $v0, 0x0($v1)
/* 1774D8 80248BF8 28420100 */  slti      $v0, $v0, 0x100
.L80248BFC:
/* 1774DC 80248BFC 50400058 */  beql      $v0, $zero, D_80248D60
D_80248C00:
/* 1774E0 80248C00 AC640000 */   sw       $a0, 0x0($v1)
D_80248C04:
/* 1774E4 80248C04 08092358 */  j         D_80248D60
/* 1774E8 80248C08 00000000 */   nop
glabel .L80248C0C
/* 1774EC 80248C0C 240200FF */  addiu     $v0, $zero, 0xFF
/* 1774F0 80248C10 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 1774F4 80248C14 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
/* 1774F8 80248C18 2403FFFE */  addiu     $v1, $zero, -0x2
/* 1774FC 80248C1C 3C018028 */  lui       $at, %hi(BattleScreenFadeAmt)
/* 177500 80248C20 AC220A30 */  sw        $v0, %lo(BattleScreenFadeAmt)($at)
/* 177504 80248C24 8C820000 */  lw        $v0, 0x0($a0)
D_80248C28:
/* 177508 80248C28 3C05800E */  lui       $a1, %hi(gCurrentStagePtr)
D_80248C2C:
/* 17750C 80248C2C 8CA5C064 */  lw        $a1, %lo(gCurrentStagePtr)($a1)
D_80248C30:
/* 177510 80248C30 00431024 */  and       $v0, $v0, $v1
D_80248C34:
/* 177514 80248C34 14A00004 */  bnez      $a1, .L80248C48
/* 177518 80248C38 AC820000 */   sw       $v0, 0x0($a0)
/* 17751C 80248C3C 8CC4000C */  lw        $a0, 0xC($a2)
/* 177520 80248C40 08092313 */  j         .L80248C4C
/* 177524 80248C44 00000000 */   nop
.L80248C48:
/* 177528 80248C48 8CA40004 */  lw        $a0, 0x4($a1)
.L80248C4C:
/* 17752C 80248C4C 8C840010 */  lw        $a0, 0x10($a0)
/* 177530 80248C50 14800006 */  bnez      $a0, D_80248C6C
/* 177534 80248C54 2405000A */   addiu    $a1, $zero, 0xA
D_80248C58:
/* 177538 80248C58 24020004 */  addiu     $v0, $zero, 0x4
/* 17753C 80248C5C 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 177540 80248C60 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 177544 80248C64 08092358 */  j         D_80248D60
/* 177548 80248C68 00000000 */   nop
D_80248C6C:
/* 17754C 80248C6C 0C0B0CF8 */  jal       start_script
D_80248C70:
/* 177550 80248C70 0000302D */   daddu    $a2, $zero, $zero
/* 177554 80248C74 AE4200BC */  sw        $v0, 0xBC($s2)
.L80248C78:
/* 177558 80248C78 8C430144 */  lw        $v1, 0x144($v0)
/* 17755C 80248C7C 24020003 */  addiu     $v0, $zero, 0x3
/* 177560 80248C80 3C01800E */  lui       $at, %hi(gBattleSubState)
D_80248C84:
/* 177564 80248C84 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 177568 80248C88 08092358 */  j         D_80248D60
/* 17756C 80248C8C AE4300C0 */   sw       $v1, 0xC0($s2)
glabel .L80248C90
/* 177570 80248C90 8E4400C0 */  lw        $a0, 0xC0($s2)
D_80248C94:
/* 177574 80248C94 0C0B1059 */  jal       does_script_exist
/* 177578 80248C98 00000000 */   nop
/* 17757C 80248C9C 14400030 */  bnez      $v0, D_80248D60
/* 177580 80248CA0 24020004 */   addiu    $v0, $zero, 0x4
/* 177584 80248CA4 3C01800E */  lui       $at, %hi(gBattleSubState)
.L80248CA8:
/* 177588 80248CA8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel .L80248CAC
/* 17758C 80248CAC 0C0B1045 */  jal       kill_all_scripts
D_80248CB0:
/* 177590 80248CB0 0000882D */   daddu    $s1, $zero, $zero
/* 177594 80248CB4 0240802D */  daddu     $s0, $s2, $zero
.L80248CB8:
/* 177598 80248CB8 8E0400E0 */  lw        $a0, 0xE0($s0)
/* 17759C 80248CBC 10800003 */  beqz      $a0, .L80248CCC
.L80248CC0:
/* 1775A0 80248CC0 26310001 */   addiu    $s1, $s1, 0x1
/* 1775A4 80248CC4 0C0902EF */  jal       func_80240BBC
D_80248CC8:
/* 1775A8 80248CC8 00000000 */   nop
.L80248CCC:
/* 1775AC 80248CCC 2A220018 */  slti      $v0, $s1, 0x18
D_80248CD0:
/* 1775B0 80248CD0 1440FFF9 */  bnez      $v0, .L80248CB8
D_80248CD4:
/* 1775B4 80248CD4 26100004 */   addiu    $s0, $s0, 0x4
/* 1775B8 80248CD8 8E4400DC */  lw        $a0, 0xDC($s2)
D_80248CDC:
/* 1775BC 80248CDC 10800003 */  beqz      $a0, .L80248CEC
/* 1775C0 80248CE0 00000000 */   nop
/* 1775C4 80248CE4 0C0902EF */  jal       func_80240BBC
/* 1775C8 80248CE8 00000000 */   nop
.L80248CEC:
/* 1775CC 80248CEC 0C09035A */  jal       func_80240D68
D_80248CF0:
/* 1775D0 80248CF0 8E4400D8 */   lw       $a0, 0xD8($s2)
/* 1775D4 80248CF4 0C016938 */  jal       remove_all_effects
/* 1775D8 80248CF8 00000000 */   nop
/* 1775DC 80248CFC 0C051FB1 */  jal       set_windows_visible
/* 1775E0 80248D00 0000202D */   daddu    $a0, $zero, $zero
/* 1775E4 80248D04 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x4)
D_80248D08:
/* 1775E8 80248D08 8C42C074 */  lw        $v0, %lo(gBattleStatus + 0x4)($v0)
/* 1775EC 80248D0C 30420040 */  andi      $v0, $v0, 0x40
.L80248D10:
/* 1775F0 80248D10 10400003 */  beqz      $v0, .L80248D20
/* 1775F4 80248D14 00000000 */   nop
D_80248D18:
/* 1775F8 80248D18 0C03A6CC */  jal       decrement_status_bar_disabled
/* 1775FC 80248D1C 00000000 */   nop
.L80248D20:
/* 177600 80248D20 3C038028 */  lui       $v1, %hi(D_802809F6)
D_80248D24:
/* 177604 80248D24 846309F6 */  lh        $v1, %lo(D_802809F6)($v1)
D_80248D28:
/* 177608 80248D28 2402FFFF */  addiu     $v0, $zero, -0x1
/* 17760C 80248D2C 10620004 */  beq       $v1, $v0, .L80248D40
/* 177610 80248D30 24020012 */   addiu    $v0, $zero, 0x12
D_80248D34:
/* 177614 80248D34 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 177618 80248D38 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
D_80248D3C:
/* 17761C 80248D3C A0620072 */  sb        $v0, 0x72($v1)
.L80248D40:
/* 177620 80248D40 0C090464 */  jal       func_80241190
/* 177624 80248D44 0000202D */   daddu    $a0, $zero, $zero
/* 177628 80248D48 3C02800E */  lui       $v0, %hi(gBattleState)
D_80248D4C:
/* 17762C 80248D4C 8C42C068 */  lw        $v0, %lo(gBattleState)($v0)
/* 177630 80248D50 3C01800E */  lui       $at, %hi(gLastDrawBattleState)
D_80248D54:
/* 177634 80248D54 AC22C4D0 */  sw        $v0, %lo(gLastDrawBattleState)($at)
/* 177638 80248D58 0C00CD3C */  jal       set_game_mode
.L80248D5C:
/* 17763C 80248D5C 24040009 */   addiu    $a0, $zero, 0x9
D_80248D60:
/* 177640 80248D60 8FBF001C */  lw        $ra, 0x1C($sp)
/* 177644 80248D64 8FB20018 */  lw        $s2, 0x18($sp)
/* 177648 80248D68 8FB10014 */  lw        $s1, 0x14($sp)
/* 17764C 80248D6C 8FB00010 */  lw        $s0, 0x10($sp)
.L80248D70:
/* 177650 80248D70 03E00008 */  jr        $ra
/* 177654 80248D74 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_end_demo_battle(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    Battle* battle = gCurrentBattlePtr;
    Stage* stage;
    s32 i;

    switch (gBattleSubState) {
        case BTL_SUBSTATE_END_DEMO_BATTLE_INIT:
            BattleScreenFadeAmt = 0;
            if (D_802809F6 == -1) {
                if (DemoBattleBeginDelay != 0) {
                    DemoBattleBeginDelay--;
                    break;
                }
            }
            gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT;
            break;
        case BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT:
            switch (D_802809F6) {
                case 255:
                    gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT;
                    return;
                case -1:
                    if (BattleScreenFadeAmt == 255) {
                        gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT;
                        return;
                    }
                    BattleScreenFadeAmt += 50;
                    if (BattleScreenFadeAmt > 255) {
                        BattleScreenFadeAmt = 255;
                    }
                    return;
            }
            break;
        case BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT:
            BattleScreenFadeAmt = 255;
            gBattleStatus.flags1 &= ~BS_FLAGS1_ACTORS_VISIBLE;
            if (gCurrentStagePtr == NULL) {
                stage = battle->stage;
            } else {
                stage = gCurrentStagePtr->stage;
            }

            if (stage->postBattle == NULL) {
                gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP;
            } else {
                battleStatus->controlScript = start_script(stage->postBattle, EVT_PRIORITY_A, 0);
                battleStatus->controlScriptID = battleStatus->controlScript->id;
                gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT;
            }
            break;
        case BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT:
            if (does_script_exist(battleStatus->controlScriptID)) {
                break;
            }
            gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP;
            //fallthrough
        case BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP:
            kill_all_scripts();

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                Actor* enemy = battleStatus->enemyActors[i];

                if (enemy != NULL) {
                    btl_delete_actor(enemy);
                }
            }

            if (battleStatus->partnerActor != NULL) {
                btl_delete_actor(battleStatus->partnerActor);
            }

            btl_delete_player_actor(battleStatus->playerActor);
            remove_all_effects();
            set_windows_visible(WINDOW_GROUP_ALL);

            if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
                decrement_status_bar_disabled();
            }

            if (D_802809F6 != -1) {
                gGameStatusPtr->nextDemoScene = LAST_DEMO_SCENE_IDX;
            }

            btl_set_state(BATTLE_STATE_0);
            gLastDrawBattleState = gBattleState;
            set_game_mode(GAME_MODE_END_BATTLE);
            break;
    }
}