### RAW ASSEMBLY INSTRUCTIONS:

glabel dispatch_damage_event_player
/* 1A1A9C 802731BC 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 1A1AA0 802731C0 00A0402D */  daddu     $t0, $a1, $zero
/* 1A1AA4 802731C4 AFB30024 */  sw        $s3, 0x24($sp)
/* 1A1AA8 802731C8 3C13800E */  lui       $s3, %hi(gBattleStatus)
/* 1A1AAC 802731CC 2673C070 */  addiu     $s3, $s3, %lo(gBattleStatus)
/* 1A1AB0 802731D0 AFBF0028 */  sw        $ra, 0x28($sp)
/* 1A1AB4 802731D4 AFB20020 */  sw        $s2, 0x20($sp)
/* 1A1AB8 802731D8 AFB1001C */  sw        $s1, 0x1C($sp)
/* 1A1ABC 802731DC AFB00018 */  sw        $s0, 0x18($sp)
/* 1A1AC0 802731E0 A664017E */  sh        $a0, 0x17E($s3)
/* 1A1AC4 802731E4 00042400 */  sll       $a0, $a0, 16
/* 1A1AC8 802731E8 8E7000D8 */  lw        $s0, 0xD8($s3)
/* 1A1ACC 802731EC 00043C03 */  sra       $a3, $a0, 16
/* 1A1AD0 802731F0 960201FA */  lhu       $v0, 0x1FA($s0)
/* 1A1AD4 802731F4 3C058011 */  lui       $a1, %hi(gPlayerData)
/* 1A1AD8 802731F8 24A5F290 */  addiu     $a1, $a1, %lo(gPlayerData)
/* 1A1ADC 802731FC 00471021 */  addu      $v0, $v0, $a3
/* 1A1AE0 80273200 00021C00 */  sll       $v1, $v0, 16
/* 1A1AE4 80273204 00033C03 */  sra       $a3, $v1, 16
/* 1A1AE8 80273208 A60201FA */  sh        $v0, 0x1FA($s0)
/* 1A1AEC 8027320C 90A40002 */  lbu       $a0, 0x2($a1)
/* 1A1AF0 80273210 960201FC */  lhu       $v0, 0x1FC($s0)
/* 1A1AF4 80273214 960301FA */  lhu       $v1, 0x1FA($s0)
/* 1A1AF8 80273218 00471021 */  addu      $v0, $v0, $a3
/* 1A1AFC 8027321C 00671823 */  subu      $v1, $v1, $a3
/* 1A1B00 80273220 A60201FC */  sh        $v0, 0x1FC($s0)
/* 1A1B04 80273224 A20401B8 */  sb        $a0, 0x1B8($s0)
/* 1A1B08 80273228 A60301FA */  sh        $v1, 0x1FA($s0)
/* 1A1B0C 8027322C A6600180 */  sh        $zero, 0x180($s3)
/* 1A1B10 80273230 920201B8 */  lbu       $v0, 0x1B8($s0)
/* 1A1B14 80273234 00471023 */  subu      $v0, $v0, $a3
/* 1A1B18 80273238 A20201B8 */  sb        $v0, 0x1B8($s0)
/* 1A1B1C 8027323C 9262007B */  lbu       $v0, 0x7B($s3)
/* 1A1B20 80273240 0100902D */  daddu     $s2, $t0, $zero
/* 1A1B24 80273244 00471021 */  addu      $v0, $v0, $a3
/* 1A1B28 80273248 A262007B */  sb        $v0, 0x7B($s3)
/* 1A1B2C 8027324C 820301B8 */  lb        $v1, 0x1B8($s0)
/* 1A1B30 80273250 1C600006 */  bgtz      $v1, .L8027326C
/* 1A1B34 80273254 2611000C */   addiu    $s1, $s0, 0xC
/* 1A1B38 80273258 96620180 */  lhu       $v0, 0x180($s3)
/* 1A1B3C 8027325C 24120020 */  addiu     $s2, $zero, 0x20
/* 1A1B40 80273260 00431021 */  addu      $v0, $v0, $v1
/* 1A1B44 80273264 A6620180 */  sh        $v0, 0x180($s3)
/* 1A1B48 80273268 A20001B8 */  sb        $zero, 0x1B8($s0)
.L8027326C:
/* 1A1B4C 8027326C 96620180 */  lhu       $v0, 0x180($s3)
/* 1A1B50 80273270 00471021 */  addu      $v0, $v0, $a3
/* 1A1B54 80273274 A6620180 */  sh        $v0, 0x180($s3)
/* 1A1B58 80273278 920201B8 */  lbu       $v0, 0x1B8($s0)
/* 1A1B5C 8027327C A0A20002 */  sb        $v0, 0x2($a1)
/* 1A1B60 80273280 24020009 */  addiu     $v0, $zero, 0x9
/* 1A1B64 80273284 52420001 */  beql      $s2, $v0, .L8027328C
/* 1A1B68 80273288 2412000A */   addiu    $s2, $zero, 0xA
.L8027328C:
/* 1A1B6C 8027328C 24020017 */  addiu     $v0, $zero, 0x17
/* 1A1B70 80273290 52420001 */  beql      $s2, $v0, .L80273298
/* 1A1B74 80273294 24120019 */   addiu    $s2, $zero, 0x19
.L80273298:
/* 1A1B78 80273298 24020020 */  addiu     $v0, $zero, 0x20
/* 1A1B7C 8027329C 16420009 */  bne       $s2, $v0, .L802732C4
/* 1A1B80 802732A0 2402002A */   addiu    $v0, $zero, 0x2A
/* 1A1B84 802732A4 51020001 */  beql      $t0, $v0, .L802732AC
/* 1A1B88 802732A8 24120027 */   addiu    $s2, $zero, 0x27
.L802732AC:
/* 1A1B8C 802732AC 2402002C */  addiu     $v0, $zero, 0x2C
/* 1A1B90 802732B0 51020001 */  beql      $t0, $v0, .L802732B8
/* 1A1B94 802732B4 24120024 */   addiu    $s2, $zero, 0x24
.L802732B8:
/* 1A1B98 802732B8 2402002F */  addiu     $v0, $zero, 0x2F
/* 1A1B9C 802732BC 51020001 */  beql      $t0, $v0, .L802732C4
/* 1A1BA0 802732C0 24120026 */   addiu    $s2, $zero, 0x26
.L802732C4:
/* 1A1BA4 802732C4 14C0000D */  bnez      $a2, .L802732FC
/* 1A1BA8 802732C8 24020001 */   addiu    $v0, $zero, 0x1
/* 1A1BAC 802732CC 0220202D */  daddu     $a0, $s1, $zero
/* 1A1BB0 802732D0 0000282D */  daddu     $a1, $zero, $zero
/* 1A1BB4 802732D4 0C09A5D5 */  jal       set_goal_pos_to_part
/* 1A1BB8 802732D8 00A0302D */   daddu    $a2, $a1, $zero
/* 1A1BBC 802732DC C6200014 */  lwc1      $f0, 0x14($s1)
/* 1A1BC0 802732E0 240400E9 */  addiu     $a0, $zero, 0xE9
/* 1A1BC4 802732E4 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A1BC8 802732E8 8E26000C */  lw        $a2, 0xC($s1)
/* 1A1BCC 802732EC 8E270010 */  lw        $a3, 0x10($s1)
/* 1A1BD0 802732F0 0C052757 */  jal       sfx_play_sound_at_position
/* 1A1BD4 802732F4 0000282D */   daddu    $a1, $zero, $zero
/* 1A1BD8 802732F8 24020001 */  addiu     $v0, $zero, 0x1
.L802732FC:
/* 1A1BDC 802732FC AFA20010 */  sw        $v0, 0x10($sp)
/* 1A1BE0 80273300 8E260014 */  lw        $a2, 0x14($s1)
/* 1A1BE4 80273304 86670180 */  lh        $a3, 0x180($s3)
/* 1A1BE8 80273308 C62C000C */  lwc1      $f12, 0xC($s1)
/* 1A1BEC 8027330C 0C09996B */  jal       show_next_damage_popup
/* 1A1BF0 80273310 C62E0010 */   lwc1     $f14, 0x10($s1)
/* 1A1BF4 80273314 86620180 */  lh        $v0, 0x180($s3)
/* 1A1BF8 80273318 AFA20010 */  sw        $v0, 0x10($sp)
/* 1A1BFC 8027331C 8E25000C */  lw        $a1, 0xC($s1)
/* 1A1C00 80273320 8E260010 */  lw        $a2, 0x10($s1)
/* 1A1C04 80273324 8E270014 */  lw        $a3, 0x14($s1)
/* 1A1C08 80273328 0C0999B9 */  jal       show_damage_fx
/* 1A1C0C 8027332C 0200202D */   daddu    $a0, $s0, $zero
/* 1A1C10 80273330 86620180 */  lh        $v0, 0x180($s3)
/* 1A1C14 80273334 18400003 */  blez      $v0, .L80273344
/* 1A1C18 80273338 0200202D */   daddu    $a0, $s0, $zero
/* 1A1C1C 8027333C 0C099C06 */  jal       func_80267018
/* 1A1C20 80273340 24050001 */   addiu    $a1, $zero, 0x1
.L80273344:
/* 1A1C24 80273344 3C10800E */  lui       $s0, %hi(gBattleStatus)
/* 1A1C28 80273348 8E10C070 */  lw        $s0, %lo(gBattleStatus)($s0)
/* 1A1C2C 8027334C 0240202D */  daddu     $a0, $s2, $zero
/* 1A1C30 80273350 32100240 */  andi      $s0, $s0, 0x240
/* 1A1C34 80273354 0C09C596 */  jal       dispatch_event_player
/* 1A1C38 80273358 0010802B */   sltu     $s0, $zero, $s0
/* 1A1C3C 8027335C 0200102D */  daddu     $v0, $s0, $zero
/* 1A1C40 80273360 8FBF0028 */  lw        $ra, 0x28($sp)
/* 1A1C44 80273364 8FB30024 */  lw        $s3, 0x24($sp)
/* 1A1C48 80273368 8FB20020 */  lw        $s2, 0x20($sp)
/* 1A1C4C 8027336C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1A1C50 80273370 8FB00018 */  lw        $s0, 0x18($sp)
/* 1A1C54 80273374 03E00008 */  jr        $ra
/* 1A1C58 80273378 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

s32 dispatch_damage_event_player(s32 damageAmount, s32 event, s32 arg2) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    Actor* player = battleStatus->playerActor;
    ActorState* state = &player->state;
    s32 oldHPChangeCounter;
    s32 flags;
    s32 dispatchEvent;
    s32 oldPlayerHP;
    s32 temp;

    battleStatus->currentAttackDamage = damageAmount;

    temp = (s16)damageAmount; //TODO usage of temp here required to match
    player->hpChangeCounter += temp;

    temp = player->hpChangeCounter;
    player->currentHP = playerData->curHP;
    player->damageCounter += temp;
    player->hpChangeCounter -= temp;
    battleStatus->lastAttackDamage = 0;
    player->currentHP -= temp;
    battleStatus->damageTaken += temp;

    oldPlayerHP = player->currentHP;

    dispatchEvent = event;
    if (player->currentHP < 1) {
        battleStatus->lastAttackDamage += oldPlayerHP;
        player->currentHP = 0;
        dispatchEvent = EVENT_DEATH;
    }
    battleStatus->lastAttackDamage += temp;
    playerData->curHP = player->currentHP;

    if (dispatchEvent == EVENT_HIT_COMBO) {
        dispatchEvent = EVENT_HIT;
    }
    if (dispatchEvent == EVENT_ZERO_DAMAGE) {
        dispatchEvent = EVENT_IMMUNE;
    }

    if (dispatchEvent == EVENT_DEATH) {
        if (event == EVENT_SPIKE_CONTACT) {
            dispatchEvent = EVENT_SPIKE_DEATH;
        }
        if (event == EVENT_BURN_CONTACT) {
            dispatchEvent = EVENT_BURN_DEATH;
        }
        if (event == EVENT_SHOCK_HIT) {
            dispatchEvent = EVENT_SHOCK_DEATH;
        }
    }

    if (!arg2) {
        set_goal_pos_to_part(state, ACTOR_PLAYER, 0);
        sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
    }

    show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 1);
    show_damage_fx(player, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage);

    if (battleStatus->lastAttackDamage > 0) {
        func_80267018(player, 1);
    }

    flags = (gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40)) != 0;
    dispatch_event_player(dispatchEvent);
    return flags;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_HiddenPanel_init
/* 1084A4 802E6C24 27BDFF40 */  addiu     $sp, $sp, -0xC0
/* 1084A8 802E6C28 AFB300A4 */  sw        $s3, 0xA4($sp)
/* 1084AC 802E6C2C 0080982D */  daddu     $s3, $a0, $zero
/* 1084B0 802E6C30 AFB400A8 */  sw        $s4, 0xA8($sp)
/* 1084B4 802E6C34 3C148016 */  lui       $s4, %hi(gCurrentHiddenPanels)
/* 1084B8 802E6C38 2694A578 */  addiu     $s4, $s4, %lo(gCurrentHiddenPanels)
/* 1084BC 802E6C3C 0280202D */  daddu     $a0, $s4, $zero
/* 1084C0 802E6C40 AFBF00AC */  sw        $ra, 0xAC($sp)
/* 1084C4 802E6C44 AFB200A0 */  sw        $s2, 0xA0($sp)
/* 1084C8 802E6C48 AFB1009C */  sw        $s1, 0x9C($sp)
/* 1084CC 802E6C4C AFB00098 */  sw        $s0, 0x98($sp)
/* 1084D0 802E6C50 F7B600B8 */  sdc1      $f22, 0xB8($sp)
/* 1084D4 802E6C54 F7B400B0 */  sdc1      $f20, 0xB0($sp)
/* 1084D8 802E6C58 8E720040 */  lw        $s2, 0x40($s3)
/* 1084DC 802E6C5C 0C00A580 */  jal       mem_clear
/* 1084E0 802E6C60 24050010 */   addiu    $a1, $zero, 0x10
/* 1084E4 802E6C64 3C02802E */  lui       $v0, %hi(entity_HiddenPanel_setupGfx)
/* 1084E8 802E6C68 244261B0 */  addiu     $v0, $v0, %lo(entity_HiddenPanel_setupGfx)
/* 1084EC 802E6C6C AE62003C */  sw        $v0, 0x3C($s3)
/* 1084F0 802E6C70 3402FFFF */  ori       $v0, $zero, 0xFFFF
/* 1084F4 802E6C74 A6420006 */  sh        $v0, 0x6($s2)
/* 1084F8 802E6C78 C660004C */  lwc1      $f0, 0x4C($s3)
/* 1084FC 802E6C7C 3C038016 */  lui       $v1, %hi(CreateEntityVarArgBuffer)
/* 108500 802E6C80 2463C7D0 */  addiu     $v1, $v1, %lo(CreateEntityVarArgBuffer)
/* 108504 802E6C84 E6400024 */  swc1      $f0, 0x24($s2)
/* 108508 802E6C88 94620002 */  lhu       $v0, 0x2($v1)
/* 10850C 802E6C8C A6420074 */  sh        $v0, 0x74($s2)
/* 108510 802E6C90 8C630004 */  lw        $v1, 0x4($v1)
/* 108514 802E6C94 24020001 */  addiu     $v0, $zero, 0x1
/* 108518 802E6C98 A2420003 */  sb        $v0, 0x3($s2)
/* 10851C 802E6C9C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 108520 802E6CA0 AE420014 */  sw        $v0, 0x14($s2)
/* 108524 802E6CA4 14600003 */  bnez      $v1, .L802E6CB4
/* 108528 802E6CA8 AE430010 */   sw       $v1, 0x10($s2)
/* 10852C 802E6CAC 2402015C */  addiu     $v0, $zero, 0x15C
/* 108530 802E6CB0 AE420010 */  sw        $v0, 0x10($s2)
.L802E6CB4:
/* 108534 802E6CB4 26510034 */  addiu     $s1, $s2, 0x34
/* 108538 802E6CB8 0C019D28 */  jal       guMtxIdentF
/* 10853C 802E6CBC 0220202D */   daddu    $a0, $s1, $zero
/* 108540 802E6CC0 8E650048 */  lw        $a1, 0x48($s3)
/* 108544 802E6CC4 8E66004C */  lw        $a2, 0x4C($s3)
/* 108548 802E6CC8 8E670050 */  lw        $a3, 0x50($s3)
/* 10854C 802E6CCC 4480A000 */  mtc1      $zero, $f20
/* 108550 802E6CD0 0C019E40 */  jal       guTranslateF
/* 108554 802E6CD4 27A40018 */   addiu    $a0, $sp, 0x18
/* 108558 802E6CD8 27B00058 */  addiu     $s0, $sp, 0x58
/* 10855C 802E6CDC E7B40010 */  swc1      $f20, 0x10($sp)
/* 108560 802E6CE0 8E650064 */  lw        $a1, 0x64($s3)
/* 108564 802E6CE4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 108568 802E6CE8 4481B000 */  mtc1      $at, $f22
/* 10856C 802E6CEC 4406A000 */  mfc1      $a2, $f20
/* 108570 802E6CF0 4407B000 */  mfc1      $a3, $f22
/* 108574 802E6CF4 0C019EC8 */  jal       guRotateF
/* 108578 802E6CF8 0200202D */   daddu    $a0, $s0, $zero
/* 10857C 802E6CFC 0200202D */  daddu     $a0, $s0, $zero
/* 108580 802E6D00 27A50018 */  addiu     $a1, $sp, 0x18
/* 108584 802E6D04 0C019D80 */  jal       guMtxCatF
/* 108588 802E6D08 00A0302D */   daddu    $a2, $a1, $zero
/* 10858C 802E6D0C E7B40010 */  swc1      $f20, 0x10($sp)
/* 108590 802E6D10 8E650060 */  lw        $a1, 0x60($s3)
/* 108594 802E6D14 4406B000 */  mfc1      $a2, $f22
/* 108598 802E6D18 4407A000 */  mfc1      $a3, $f20
/* 10859C 802E6D1C 0C019EC8 */  jal       guRotateF
/* 1085A0 802E6D20 0200202D */   daddu    $a0, $s0, $zero
/* 1085A4 802E6D24 0200202D */  daddu     $a0, $s0, $zero
/* 1085A8 802E6D28 27A50018 */  addiu     $a1, $sp, 0x18
/* 1085AC 802E6D2C 0C019D80 */  jal       guMtxCatF
/* 1085B0 802E6D30 00A0302D */   daddu    $a2, $a1, $zero
/* 1085B4 802E6D34 4406A000 */  mfc1      $a2, $f20
/* 1085B8 802E6D38 0200202D */  daddu     $a0, $s0, $zero
/* 1085BC 802E6D3C E7B60010 */  swc1      $f22, 0x10($sp)
/* 1085C0 802E6D40 8E650068 */  lw        $a1, 0x68($s3)
/* 1085C4 802E6D44 0C019EC8 */  jal       guRotateF
/* 1085C8 802E6D48 00C0382D */   daddu    $a3, $a2, $zero
/* 1085CC 802E6D4C 0200202D */  daddu     $a0, $s0, $zero
/* 1085D0 802E6D50 27A50018 */  addiu     $a1, $sp, 0x18
/* 1085D4 802E6D54 0C019D80 */  jal       guMtxCatF
/* 1085D8 802E6D58 00A0302D */   daddu    $a2, $a1, $zero
/* 1085DC 802E6D5C 8E650054 */  lw        $a1, 0x54($s3)
/* 1085E0 802E6D60 8E660058 */  lw        $a2, 0x58($s3)
/* 1085E4 802E6D64 8E67005C */  lw        $a3, 0x5C($s3)
/* 1085E8 802E6D68 0C019DF0 */  jal       guScaleF
/* 1085EC 802E6D6C 0200202D */   daddu    $a0, $s0, $zero
/* 1085F0 802E6D70 0200202D */  daddu     $a0, $s0, $zero
/* 1085F4 802E6D74 27A50018 */  addiu     $a1, $sp, 0x18
/* 1085F8 802E6D78 0C019D80 */  jal       guMtxCatF
/* 1085FC 802E6D7C 0220302D */   daddu    $a2, $s1, $zero
/* 108600 802E6D80 92820001 */  lbu       $v0, 0x1($s4)
/* 108604 802E6D84 30420001 */  andi      $v0, $v0, 0x1
/* 108608 802E6D88 10400009 */  beqz      $v0, .L802E6DB0
/* 10860C 802E6D8C 00000000 */   nop
/* 108610 802E6D90 3C100A00 */  lui       $s0, %hi(D_0A0001B0_E9D800)
/* 108614 802E6D94 261001B0 */  addiu     $s0, $s0, %lo(D_0A0001B0_E9D800)
/* 108618 802E6D98 3C05802F */  lui       $a1, %hi(D_802EAAE0)
/* 10861C 802E6D9C 24A5AAE0 */  addiu     $a1, $a1, %lo(D_802EAAE0)
/* 108620 802E6DA0 0C0442F3 */  jal       entity_set_render_script
/* 108624 802E6DA4 0260202D */   daddu    $a0, $s3, $zero
/* 108628 802E6DA8 080B9B6F */  j         .L802E6DBC
/* 10862C 802E6DAC 3202FFFF */   andi     $v0, $s0, 0xFFFF
.L802E6DB0:
/* 108630 802E6DB0 3C100A00 */  lui       $s0, %hi(D_0A000180_E9D7D0)
/* 108634 802E6DB4 26100180 */  addiu     $s0, $s0, %lo(D_0A000180_E9D7D0)
/* 108638 802E6DB8 3202FFFF */  andi      $v0, $s0, 0xFFFF
.L802E6DBC:
/* 10863C 802E6DBC 8E650044 */  lw        $a1, 0x44($s3)
/* 108640 802E6DC0 96440074 */  lhu       $a0, 0x74($s2)
/* 108644 802E6DC4 00A22821 */  addu      $a1, $a1, $v0
/* 108648 802E6DC8 AE450078 */  sw        $a1, 0x78($s2)
/* 10864C 802E6DCC 8E670044 */  lw        $a3, 0x44($s3)
/* 108650 802E6DD0 0C0470CB */  jal       mdl_project_tex_coords
/* 108654 802E6DD4 26460034 */   addiu    $a2, $s2, 0x34
/* 108658 802E6DD8 3C038016 */  lui       $v1, %hi(gCurrentHiddenPanels)
/* 10865C 802E6DDC 2463A578 */  addiu     $v1, $v1, %lo(gCurrentHiddenPanels)
/* 108660 802E6DE0 90620001 */  lbu       $v0, 0x1($v1)
/* 108664 802E6DE4 24420001 */  addiu     $v0, $v0, 0x1
/* 108668 802E6DE8 A0620001 */  sb        $v0, 0x1($v1)
/* 10866C 802E6DEC 8FBF00AC */  lw        $ra, 0xAC($sp)
/* 108670 802E6DF0 8FB400A8 */  lw        $s4, 0xA8($sp)
/* 108674 802E6DF4 8FB300A4 */  lw        $s3, 0xA4($sp)
/* 108678 802E6DF8 8FB200A0 */  lw        $s2, 0xA0($sp)
/* 10867C 802E6DFC 8FB1009C */  lw        $s1, 0x9C($sp)
/* 108680 802E6E00 8FB00098 */  lw        $s0, 0x98($sp)
/* 108684 802E6E04 D7B600B8 */  ldc1      $f22, 0xB8($sp)
/* 108688 802E6E08 D7B400B0 */  ldc1      $f20, 0xB0($sp)
/* 10868C 802E6E0C 03E00008 */  jr        $ra
/* 108690 802E6E10 27BD00C0 */   addiu    $sp, $sp, 0xC0
/* 108694 802E6E14 00000000 */  nop
/* 108698 802E6E18 00000000 */  nop
/* 10869C 802E6E1C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void entity_HiddenPanel_init(Entity* entity) {
    HiddenPanelData* data = entity->dataBuf.hiddenPanel;
    Matrix4f sp18;
    Matrix4f sp58;
    Gfx* dlist;

    mem_clear(&gCurrentHiddenPanels, sizeof(gCurrentHiddenPanels));
    entity->renderSetupFunc = entity_HiddenPanel_setupGfx;
    data->pickupVar = 0xFFFF;
    data->initialY = entity->position.y;
    data->modelID = CreateEntityVarArgBuffer[0];
    data->itemID = CreateEntityVarArgBuffer[1];
    data->needSpawnItem = TRUE;
    data->spawnedItemIndex = -1;

    if (data->itemID == 0) {
        data->itemID = ITEM_STAR_PIECE;
    }

    guMtxIdentF(data->entityMatrix);
    guTranslateF(sp18, entity->position.x, entity->position.y, entity->position.z);
    guRotateF(sp58, entity->rotation.y, 0.0f, 1.0f, 0.0f);
    guMtxCatF(sp58, sp18, sp18);
    guRotateF(sp58, entity->rotation.x, 1.0f, 0.0f, 0.0f);
    guMtxCatF(sp58, sp18, sp18);
    guRotateF(sp58, entity->rotation.z, 0.0f, 0.0f, 1.0f);
    guMtxCatF(sp58, sp18, sp18);
    guScaleF(sp58, entity->scale.x, entity->scale.y, entity->scale.z);
    guMtxCatF(sp58, sp18, data->entityMatrix);

    if (gCurrentHiddenPanels.panelsCount & 1) {
        dlist = Gfx_AltHiddenPanel_RenderTop;
        entity_set_render_script(entity, &ERS_AltHiddenPanel);
    } else {
        dlist = Gfx_HiddenPanel_RenderTop;
    }
    data->renderDList = ENTITY_ADDR(entity, Gfx*, dlist);

    mdl_project_tex_coords(data->modelID, data->renderDList, data->entityMatrix, entity->gfxBaseAddr);
    gCurrentHiddenPanels.panelsCount++;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel osSpTaskLoad
/* 40E10 80065A10 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 40E14 80065A14 AFB00010 */  sw        $s0, 0x10($sp)
/* 40E18 80065A18 00808021 */  addu      $s0, $a0, $zero
/* 40E1C 80065A1C AFB10014 */  sw        $s1, 0x14($sp)
/* 40E20 80065A20 3C11800B */  lui       $s1, %hi(tmp_task)
/* 40E24 80065A24 2631F8C0 */  addiu     $s1, $s1, %lo(tmp_task)
/* 40E28 80065A28 02202821 */  addu      $a1, $s1, $zero
/* 40E2C 80065A2C AFBF0018 */  sw        $ra, 0x18($sp)
/* 40E30 80065A30 0C019194 */  jal       bcopy
/* 40E34 80065A34 24060040 */   addiu    $a2, $zero, 0x40
/* 40E38 80065A38 3C04800B */  lui       $a0, %hi(D_800AF8D0)
/* 40E3C 80065A3C 8C84F8D0 */  lw        $a0, %lo(D_800AF8D0)($a0)
/* 40E40 80065A40 10800005 */  beqz      $a0, .L80065A58
/* 40E44 80065A44 00000000 */   nop
/* 40E48 80065A48 0C0187A4 */  jal       osVirtualToPhysical
/* 40E4C 80065A4C 00000000 */   nop
/* 40E50 80065A50 3C01800B */  lui       $at, %hi(D_800AF8D0)
/* 40E54 80065A54 AC22F8D0 */  sw        $v0, %lo(D_800AF8D0)($at)
.L80065A58:
/* 40E58 80065A58 3C04800B */  lui       $a0, %hi(D_800AF8D8)
/* 40E5C 80065A5C 8C84F8D8 */  lw        $a0, %lo(D_800AF8D8)($a0)
/* 40E60 80065A60 10800005 */  beqz      $a0, .L80065A78
/* 40E64 80065A64 00000000 */   nop
/* 40E68 80065A68 0C0187A4 */  jal       osVirtualToPhysical
/* 40E6C 80065A6C 00000000 */   nop
/* 40E70 80065A70 3C01800B */  lui       $at, %hi(D_800AF8D8)
/* 40E74 80065A74 AC22F8D8 */  sw        $v0, %lo(D_800AF8D8)($at)
.L80065A78:
/* 40E78 80065A78 3C04800B */  lui       $a0, %hi(D_800AF8E0)
/* 40E7C 80065A7C 8C84F8E0 */  lw        $a0, %lo(D_800AF8E0)($a0)
/* 40E80 80065A80 10800005 */  beqz      $a0, .L80065A98
/* 40E84 80065A84 00000000 */   nop
/* 40E88 80065A88 0C0187A4 */  jal       osVirtualToPhysical
/* 40E8C 80065A8C 00000000 */   nop
/* 40E90 80065A90 3C01800B */  lui       $at, %hi(D_800AF8E0)
/* 40E94 80065A94 AC22F8E0 */  sw        $v0, %lo(D_800AF8E0)($at)
.L80065A98:
/* 40E98 80065A98 3C04800B */  lui       $a0, %hi(D_800AF8E8)
/* 40E9C 80065A9C 8C84F8E8 */  lw        $a0, %lo(D_800AF8E8)($a0)
/* 40EA0 80065AA0 10800005 */  beqz      $a0, .L80065AB8
/* 40EA4 80065AA4 00000000 */   nop
/* 40EA8 80065AA8 0C0187A4 */  jal       osVirtualToPhysical
/* 40EAC 80065AAC 00000000 */   nop
/* 40EB0 80065AB0 3C01800B */  lui       $at, %hi(D_800AF8E8)
/* 40EB4 80065AB4 AC22F8E8 */  sw        $v0, %lo(D_800AF8E8)($at)
.L80065AB8:
/* 40EB8 80065AB8 3C04800B */  lui       $a0, %hi(D_800AF8EC)
/* 40EBC 80065ABC 8C84F8EC */  lw        $a0, %lo(D_800AF8EC)($a0)
/* 40EC0 80065AC0 10800005 */  beqz      $a0, .L80065AD8
/* 40EC4 80065AC4 00000000 */   nop
/* 40EC8 80065AC8 0C0187A4 */  jal       osVirtualToPhysical
/* 40ECC 80065ACC 00000000 */   nop
/* 40ED0 80065AD0 3C01800B */  lui       $at, %hi(D_800AF8EC)
/* 40ED4 80065AD4 AC22F8EC */  sw        $v0, %lo(D_800AF8EC)($at)
.L80065AD8:
/* 40ED8 80065AD8 3C04800B */  lui       $a0, %hi(D_800AF8F0)
/* 40EDC 80065ADC 8C84F8F0 */  lw        $a0, %lo(D_800AF8F0)($a0)
/* 40EE0 80065AE0 10800005 */  beqz      $a0, .L80065AF8
/* 40EE4 80065AE4 00000000 */   nop
/* 40EE8 80065AE8 0C0187A4 */  jal       osVirtualToPhysical
/* 40EEC 80065AEC 00000000 */   nop
/* 40EF0 80065AF0 3C01800B */  lui       $at, %hi(D_800AF8F0)
/* 40EF4 80065AF4 AC22F8F0 */  sw        $v0, %lo(D_800AF8F0)($at)
.L80065AF8:
/* 40EF8 80065AF8 3C04800B */  lui       $a0, %hi(D_800AF8F8)
/* 40EFC 80065AFC 8C84F8F8 */  lw        $a0, %lo(D_800AF8F8)($a0)
/* 40F00 80065B00 10800005 */  beqz      $a0, .L80065B18
/* 40F04 80065B04 00000000 */   nop
/* 40F08 80065B08 0C0187A4 */  jal       osVirtualToPhysical
/* 40F0C 80065B0C 00000000 */   nop
/* 40F10 80065B10 3C01800B */  lui       $at, %hi(D_800AF8F8)
/* 40F14 80065B14 AC22F8F8 */  sw        $v0, %lo(D_800AF8F8)($at)
.L80065B18:
/* 40F18 80065B18 3C02800B */  lui       $v0, %hi(D_800AF8C4)
/* 40F1C 80065B1C 8C42F8C4 */  lw        $v0, %lo(D_800AF8C4)($v0)
/* 40F20 80065B20 30420001 */  andi      $v0, $v0, 0x1
/* 40F24 80065B24 10400019 */  beqz      $v0, .L80065B8C
/* 40F28 80065B28 02202021 */   addu     $a0, $s1, $zero
/* 40F2C 80065B2C 3C02800B */  lui       $v0, %hi(D_800AF8F8)
/* 40F30 80065B30 8C42F8F8 */  lw        $v0, %lo(D_800AF8F8)($v0)
/* 40F34 80065B34 3C03800B */  lui       $v1, %hi(D_800AF8FC)
/* 40F38 80065B38 8C63F8FC */  lw        $v1, %lo(D_800AF8FC)($v1)
/* 40F3C 80065B3C 3C01800B */  lui       $at, %hi(D_800AF8D8)
/* 40F40 80065B40 AC22F8D8 */  sw        $v0, %lo(D_800AF8D8)($at)
/* 40F44 80065B44 3C01800B */  lui       $at, %hi(D_800AF8DC)
/* 40F48 80065B48 AC23F8DC */  sw        $v1, %lo(D_800AF8DC)($at)
/* 40F4C 80065B4C 8E020004 */  lw        $v0, 0x4($s0)
/* 40F50 80065B50 2403FFFE */  addiu     $v1, $zero, -0x2
/* 40F54 80065B54 00431024 */  and       $v0, $v0, $v1
/* 40F58 80065B58 AE020004 */  sw        $v0, 0x4($s0)
/* 40F5C 80065B5C 3C02800B */  lui       $v0, %hi(D_800AF8C4)
/* 40F60 80065B60 8C42F8C4 */  lw        $v0, %lo(D_800AF8C4)($v0)
/* 40F64 80065B64 30420004 */  andi      $v0, $v0, 0x4
/* 40F68 80065B68 10400008 */  beqz      $v0, .L80065B8C
/* 40F6C 80065B6C 3C03A000 */   lui      $v1, %hi(D_A0000000)
/* 40F70 80065B70 8E020038 */  lw        $v0, 0x38($s0)
/* 40F74 80065B74 24420BFC */  addiu     $v0, $v0, 0xBFC
/* 40F78 80065B78 00431025 */  or        $v0, $v0, $v1
/* 40F7C 80065B7C 8C420000 */  lw        $v0, %lo(D_A0000000)($v0)
/* 40F80 80065B80 3C01800B */  lui       $at, %hi(D_800AF8D0)
/* 40F84 80065B84 AC22F8D0 */  sw        $v0, %lo(D_800AF8D0)($at)
/* 40F88 80065B88 02202021 */  addu      $a0, $s1, $zero
.L80065B8C:
/* 40F8C 80065B8C 0C018614 */  jal       osWritebackDCache
/* 40F90 80065B90 24050040 */   addiu    $a1, $zero, 0x40
/* 40F94 80065B94 0C01B1BC */  jal       __osSpSetStatus
/* 40F98 80065B98 24042B00 */   addiu    $a0, $zero, 0x2B00
/* 40F9C 80065B9C 2410FFFF */  addiu     $s0, $zero, -0x1
/* 40FA0 80065BA0 3C040400 */  lui       $a0, (0x4001000 >> 16)
.L80065BA4:
/* 40FA4 80065BA4 0C01B1C0 */  jal       __osSpSetPc
/* 40FA8 80065BA8 34841000 */   ori      $a0, $a0, (0x4001000 & 0xFFFF)
/* 40FAC 80065BAC 1050FFFD */  beq       $v0, $s0, .L80065BA4
/* 40FB0 80065BB0 3C040400 */   lui      $a0, (0x4001000 >> 16)
/* 40FB4 80065BB4 2410FFFF */  addiu     $s0, $zero, -0x1
/* 40FB8 80065BB8 24040001 */  addiu     $a0, $zero, 0x1
.L80065BBC:
/* 40FBC 80065BBC 3C050400 */  lui       $a1, (0x4000FC0 >> 16)
/* 40FC0 80065BC0 34A50FC0 */  ori       $a1, $a1, (0x4000FC0 & 0xFFFF)
/* 40FC4 80065BC4 02203021 */  addu      $a2, $s1, $zero
/* 40FC8 80065BC8 0C01B1CC */  jal       __osSpRawStartDma
/* 40FCC 80065BCC 24070040 */   addiu    $a3, $zero, 0x40
/* 40FD0 80065BD0 1050FFFA */  beq       $v0, $s0, .L80065BBC
/* 40FD4 80065BD4 24040001 */   addiu    $a0, $zero, 0x1
.L80065BD8:
/* 40FD8 80065BD8 0C01B1B0 */  jal       __osSpDeviceBusy
/* 40FDC 80065BDC 00000000 */   nop
/* 40FE0 80065BE0 1440FFFD */  bnez      $v0, .L80065BD8
/* 40FE4 80065BE4 24040001 */   addiu    $a0, $zero, 0x1
/* 40FE8 80065BE8 2410FFFF */  addiu     $s0, $zero, -0x1
.L80065BEC:
/* 40FEC 80065BEC 8E260008 */  lw        $a2, 0x8($s1)
/* 40FF0 80065BF0 8E27000C */  lw        $a3, 0xC($s1)
/* 40FF4 80065BF4 3C050400 */  lui       $a1, (0x4001000 >> 16)
/* 40FF8 80065BF8 0C01B1CC */  jal       __osSpRawStartDma
/* 40FFC 80065BFC 34A51000 */   ori      $a1, $a1, (0x4001000 & 0xFFFF)
/* 41000 80065C00 1050FFFA */  beq       $v0, $s0, .L80065BEC
/* 41004 80065C04 24040001 */   addiu    $a0, $zero, 0x1
/* 41008 80065C08 8FBF0018 */  lw        $ra, 0x18($sp)
/* 4100C 80065C0C 8FB10014 */  lw        $s1, 0x14($sp)
/* 41010 80065C10 8FB00010 */  lw        $s0, 0x10($sp)
/* 41014 80065C14 03E00008 */  jr        $ra
/* 41018 80065C18 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void osSpTaskLoad(OSTask *intp) {
    OSTask *tp;
    tp = &tmp_task;
    bcopy(intp, tp, sizeof(OSTask));
    _osVirtualToPhysical(tp->t.ucode);
    _osVirtualToPhysical(tp->t.ucode_data);
    _osVirtualToPhysical(tp->t.dram_stack);
    _osVirtualToPhysical(tp->t.output_buff);
    _osVirtualToPhysical(tp->t.output_buff_size);
    _osVirtualToPhysical(tp->t.data_ptr);
    _osVirtualToPhysical(tp->t.yield_data_ptr);

    if (tp->t.flags & OS_TASK_YIELDED) {
        tp->t.ucode_data = tp->t.yield_data_ptr;
        tp->t.ucode_data_size = tp->t.yield_data_size;
        intp->t.flags &= ~OS_TASK_YIELDED;
        if (tp->t.flags & OS_TASK_LOADABLE) {
            tp->t.ucode = (u64 *)IO_READ((u32)intp->t.yield_data_ptr + OS_YIELD_DATA_SIZE - 4);
        }
    }
    osWritebackDCache(tp, sizeof(OSTask));
    __osSpSetStatus(SP_CLR_YIELD | SP_CLR_YIELDED | SP_CLR_TASKDONE | SP_SET_INTR_BREAK);
    while (__osSpSetPc(SP_IMEM_START) == -1) {
    }
    while (__osSpRawStartDma(1, (SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {
    }
    while (__osSpDeviceBusy()) {
    }
    while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucode_boot, tp->t.ucode_boot_size) == -1) {
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel whirlwind_update
/* 3D2CE4 E00CE224 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 3D2CE8 E00CE228 AFBF0010 */  sw        $ra, 0x10($sp)
/* 3D2CEC E00CE22C 8C830000 */  lw        $v1, 0x0($a0)
/* 3D2CF0 E00CE230 8C85000C */  lw        $a1, 0xC($a0)
/* 3D2CF4 E00CE234 30620010 */  andi      $v0, $v1, 0x10
/* 3D2CF8 E00CE238 10400005 */  beqz      $v0, .LE00CE250
/* 3D2CFC E00CE23C 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3D2D00 E00CE240 00621024 */  and       $v0, $v1, $v0
/* 3D2D04 E00CE244 AC820000 */  sw        $v0, 0x0($a0)
/* 3D2D08 E00CE248 24020010 */  addiu     $v0, $zero, 0x10
/* 3D2D0C E00CE24C ACA20010 */  sw        $v0, 0x10($a1)
.LE00CE250:
/* 3D2D10 E00CE250 8CA30010 */  lw        $v1, 0x10($a1)
/* 3D2D14 E00CE254 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3D2D18 E00CE258 10400002 */  beqz      $v0, .LE00CE264
/* 3D2D1C E00CE25C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3D2D20 E00CE260 ACA20010 */  sw        $v0, 0x10($a1)
.LE00CE264:
/* 3D2D24 E00CE264 8CA20014 */  lw        $v0, 0x14($a1)
/* 3D2D28 E00CE268 8CA30010 */  lw        $v1, 0x10($a1)
/* 3D2D2C E00CE26C 24460001 */  addiu     $a2, $v0, 0x1
/* 3D2D30 E00CE270 04610005 */  bgez      $v1, .LE00CE288
/* 3D2D34 E00CE274 ACA60014 */   sw       $a2, 0x14($a1)
/* 3D2D38 E00CE278 0C080128 */  jal       shim_remove_effect
/* 3D2D3C E00CE27C 00000000 */   nop
/* 3D2D40 E00CE280 08033907 */  j         .LE00CE41C
/* 3D2D44 E00CE284 00000000 */   nop
.LE00CE288:
/* 3D2D48 E00CE288 C4AC0034 */  lwc1      $f12, 0x34($a1)
/* 3D2D4C E00CE28C 28620010 */  slti      $v0, $v1, 0x10
/* 3D2D50 E00CE290 10400002 */  beqz      $v0, .LE00CE29C
/* 3D2D54 E00CE294 00031100 */   sll      $v0, $v1, 4
/* 3D2D58 E00CE298 ACA20024 */  sw        $v0, 0x24($a1)
.LE00CE29C:
/* 3D2D5C E00CE29C 28C20010 */  slti      $v0, $a2, 0x10
/* 3D2D60 E00CE2A0 10400003 */  beqz      $v0, .LE00CE2B0
/* 3D2D64 E00CE2A4 00061100 */   sll      $v0, $a2, 4
/* 3D2D68 E00CE2A8 2442000F */  addiu     $v0, $v0, 0xF
/* 3D2D6C E00CE2AC ACA20024 */  sw        $v0, 0x24($a1)
.LE00CE2B0:
/* 3D2D70 E00CE2B0 24040007 */  addiu     $a0, $zero, 0x7
/* 3D2D74 E00CE2B4 24060018 */  addiu     $a2, $zero, 0x18
/* 3D2D78 E00CE2B8 24A3001C */  addiu     $v1, $a1, 0x1C
/* 3D2D7C E00CE2BC 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3D2D80 E00CE2C0 44817000 */  mtc1      $at, $f14
/* 3D2D84 E00CE2C4 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 3D2D88 E00CE2C8 44815000 */  mtc1      $at, $f10
/* 3D2D8C E00CE2CC 3C01C2B4 */  lui       $at, (0xC2B40000 >> 16)
/* 3D2D90 E00CE2D0 44814000 */  mtc1      $at, $f8
/* 3D2D94 E00CE2D4 C4A40004 */  lwc1      $f4, 0x4($a1)
/* 3D2D98 E00CE2D8 C4A60008 */  lwc1      $f6, 0x8($a1)
/* 3D2D9C E00CE2DC 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 3D2DA0 E00CE2E0 44810000 */  mtc1      $at, $f0
/* 3D2DA4 E00CE2E4 C4A2000C */  lwc1      $f2, 0xC($a1)
/* 3D2DA8 E00CE2E8 46006302 */  mul.s     $f12, $f12, $f0
/* 3D2DAC E00CE2EC 00000000 */  nop
/* 3D2DB0 E00CE2F0 E4A40038 */  swc1      $f4, 0x38($a1)
/* 3D2DB4 E00CE2F4 E4A60058 */  swc1      $f6, 0x58($a1)
/* 3D2DB8 E00CE2F8 E4A20078 */  swc1      $f2, 0x78($a1)
.LE00CE2FC:
/* 3D2DBC E00CE2FC 00A61021 */  addu      $v0, $a1, $a2
/* 3D2DC0 E00CE300 C4400038 */  lwc1      $f0, 0x38($v0)
/* 3D2DC4 E00CE304 C4620038 */  lwc1      $f2, 0x38($v1)
/* 3D2DC8 E00CE308 46020001 */  sub.s     $f0, $f0, $f2
/* 3D2DCC E00CE30C 460E0002 */  mul.s     $f0, $f0, $f14
/* 3D2DD0 E00CE310 00000000 */  nop
/* 3D2DD4 E00CE314 E4600118 */  swc1      $f0, 0x118($v1)
/* 3D2DD8 E00CE318 C4400038 */  lwc1      $f0, 0x38($v0)
/* 3D2DDC E00CE31C E4600038 */  swc1      $f0, 0x38($v1)
/* 3D2DE0 E00CE320 C4400058 */  lwc1      $f0, 0x58($v0)
/* 3D2DE4 E00CE324 460C0000 */  add.s     $f0, $f0, $f12
/* 3D2DE8 E00CE328 C4620118 */  lwc1      $f2, 0x118($v1)
/* 3D2DEC E00CE32C E4600058 */  swc1      $f0, 0x58($v1)
/* 3D2DF0 E00CE330 C4400078 */  lwc1      $f0, 0x78($v0)
/* 3D2DF4 E00CE334 4602503C */  c.lt.s    $f10, $f2
/* 3D2DF8 E00CE338 00000000 */  nop
/* 3D2DFC E00CE33C 45000003 */  bc1f      .LE00CE34C
/* 3D2E00 E00CE340 E4600078 */   swc1     $f0, 0x78($v1)
/* 3D2E04 E00CE344 080338D7 */  j         .LE00CE35C
/* 3D2E08 E00CE348 E46A0118 */   swc1     $f10, 0x118($v1)
.LE00CE34C:
/* 3D2E0C E00CE34C 4608103C */  c.lt.s    $f2, $f8
/* 3D2E10 E00CE350 00000000 */  nop
/* 3D2E14 E00CE354 45030001 */  bc1tl     .LE00CE35C
/* 3D2E18 E00CE358 E4680118 */   swc1     $f8, 0x118($v1)
.LE00CE35C:
/* 3D2E1C E00CE35C 24C6FFFC */  addiu     $a2, $a2, -0x4
/* 3D2E20 E00CE360 2484FFFF */  addiu     $a0, $a0, -0x1
/* 3D2E24 E00CE364 1C80FFE5 */  bgtz      $a0, .LE00CE2FC
/* 3D2E28 E00CE368 2463FFFC */   addiu    $v1, $v1, -0x4
/* 3D2E2C E00CE36C C4A40138 */  lwc1      $f4, 0x138($a1)
/* 3D2E30 E00CE370 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3D2E34 E00CE374 44810000 */  mtc1      $at, $f0
/* 3D2E38 E00CE378 00000000 */  nop
/* 3D2E3C E00CE37C 46002100 */  add.s     $f4, $f4, $f0
/* 3D2E40 E00CE380 C4A0013C */  lwc1      $f0, 0x13C($a1)
/* 3D2E44 E00CE384 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D2E48 E00CE388 D422EE60 */  ldc1      $f2, -0x11A0($at)
/* 3D2E4C E00CE38C 46000021 */  cvt.d.s   $f0, $f0
/* 3D2E50 E00CE390 46220000 */  add.d     $f0, $f0, $f2
/* 3D2E54 E00CE394 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D2E58 E00CE398 D422EE68 */  ldc1      $f2, -0x1198($at)
/* 3D2E5C E00CE39C E4A40138 */  swc1      $f4, 0x138($a1)
/* 3D2E60 E00CE3A0 46200020 */  cvt.s.d   $f0, $f0
/* 3D2E64 E00CE3A4 E4A0013C */  swc1      $f0, 0x13C($a1)
/* 3D2E68 E00CE3A8 C4A00140 */  lwc1      $f0, 0x140($a1)
/* 3D2E6C E00CE3AC C4A4013C */  lwc1      $f4, 0x13C($a1)
/* 3D2E70 E00CE3B0 46000021 */  cvt.d.s   $f0, $f0
/* 3D2E74 E00CE3B4 46220000 */  add.d     $f0, $f0, $f2
/* 3D2E78 E00CE3B8 3C014280 */  lui       $at, (0x42800000 >> 16)
/* 3D2E7C E00CE3BC 44811000 */  mtc1      $at, $f2
/* 3D2E80 E00CE3C0 00000000 */  nop
/* 3D2E84 E00CE3C4 4604103C */  c.lt.s    $f2, $f4
/* 3D2E88 E00CE3C8 46200020 */  cvt.s.d   $f0, $f0
/* 3D2E8C E00CE3CC 45000003 */  bc1f      .LE00CE3DC
/* 3D2E90 E00CE3D0 E4A00140 */   swc1     $f0, 0x140($a1)
/* 3D2E94 E00CE3D4 46022001 */  sub.s     $f0, $f4, $f2
/* 3D2E98 E00CE3D8 E4A0013C */  swc1      $f0, 0x13C($a1)
.LE00CE3DC:
/* 3D2E9C E00CE3DC C4A00140 */  lwc1      $f0, 0x140($a1)
/* 3D2EA0 E00CE3E0 4600103C */  c.lt.s    $f2, $f0
/* 3D2EA4 E00CE3E4 00000000 */  nop
/* 3D2EA8 E00CE3E8 45000003 */  bc1f      .LE00CE3F8
/* 3D2EAC E00CE3EC 0000202D */   daddu    $a0, $zero, $zero
/* 3D2EB0 E00CE3F0 46020001 */  sub.s     $f0, $f0, $f2
/* 3D2EB4 E00CE3F4 E4A00140 */  swc1      $f0, 0x140($a1)
.LE00CE3F8:
/* 3D2EB8 E00CE3F8 00A0182D */  daddu     $v1, $a1, $zero
.LE00CE3FC:
/* 3D2EBC E00CE3FC C46000B8 */  lwc1      $f0, 0xB8($v1)
/* 3D2EC0 E00CE400 C46200D8 */  lwc1      $f2, 0xD8($v1)
/* 3D2EC4 E00CE404 46020000 */  add.s     $f0, $f0, $f2
/* 3D2EC8 E00CE408 24840001 */  addiu     $a0, $a0, 0x1
/* 3D2ECC E00CE40C 28820008 */  slti      $v0, $a0, 0x8
/* 3D2ED0 E00CE410 E46000B8 */  swc1      $f0, 0xB8($v1)
/* 3D2ED4 E00CE414 1440FFF9 */  bnez      $v0, .LE00CE3FC
/* 3D2ED8 E00CE418 24630004 */   addiu    $v1, $v1, 0x4
.LE00CE41C:
/* 3D2EDC E00CE41C 8FBF0010 */  lw        $ra, 0x10($sp)
/* 3D2EE0 E00CE420 03E00008 */  jr        $ra
/* 3D2EE4 E00CE424 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void whirlwind_update(EffectInstance* effect) {
    s32 temp_a2;
    s32 temp_v1_3;
    WhirlwindFXData* part;
    s32 i;
    f32 temp;

    part = effect->data.whirlwind;
    if ((effect->flags & FX_INSTANCE_FLAG_DISMISS)) {
        effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        part->unk_10 = 16;
    }
    if (part->unk_10 < 1000) {
        part->unk_10--;
    }
    part->unk_14++;
    if (part->unk_10 < 0) {
        shim_remove_effect(effect);
        return;
    }
    temp = part->unk_34;
    temp_v1_3 = part->unk_10;
    temp_a2 = part->unk_14;
    if (temp_v1_3 < 0x10) {
        part->primAlpha = temp_v1_3 * 16;
    }

    if (temp_a2 < 0x10) {
        part->primAlpha = temp_a2 * 16 + 15;
    }
    part->unk_38[0] = part->pos.x;
    part->unk_58[0] = part->pos.y;
    part->unk_78[0] = part->pos.z;

    for (i = MAX_WHIRLWIND_SEGMENTS - 1; i > 0; i--) {
        part->unk_118[i] = (part->unk_38[i - 1] - part->unk_38[i]) * 4.0f;
        part->unk_38[i] = part->unk_38[i - 1];
        part->unk_58[i] = part->unk_58[i - 1] + temp * 5.0f;
        part->unk_78[i] = part->unk_78[i - 1];
        if (part->unk_118[i] > 90.0f) {
            part->unk_118[i] = 90.0f;
        } else if (part->unk_118[i] < -90.0f) {
            part->unk_118[i] = -90.0f;
        }
    }

    part->unk_138 += 10.0f;
    part->unk_13C += 12.96;
    part->unk_140 += 17.28;
    if (part->unk_13C > 64.0f) {
        part->unk_13C -= 64.0f;
    }
    if (part->unk_140 > 64.0f) {
        part->unk_140 -= 64.0f;
    }
    for(i = 0; i < MAX_WHIRLWIND_SEGMENTS; i++) {
        part->unk_B8[i] += part->unk_D8[i];
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel gather_magic_main
/* 38EE60 E008E000 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 38EE64 E008E004 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 38EE68 E008E008 4485A000 */  mtc1      $a1, $f20
/* 38EE6C E008E00C F7B60048 */  sdc1      $f22, 0x48($sp)
/* 38EE70 E008E010 4486B000 */  mtc1      $a2, $f22
/* 38EE74 E008E014 AFB30034 */  sw        $s3, 0x34($sp)
/* 38EE78 E008E018 0080982D */  daddu     $s3, $a0, $zero
/* 38EE7C E008E01C F7B80050 */  sdc1      $f24, 0x50($sp)
/* 38EE80 E008E020 4487C000 */  mtc1      $a3, $f24
/* 38EE84 E008E024 27A40010 */  addiu     $a0, $sp, 0x10
/* 38EE88 E008E028 AFB20030 */  sw        $s2, 0x30($sp)
/* 38EE8C E008E02C 8FB2006C */  lw        $s2, 0x6C($sp)
/* 38EE90 E008E030 3C02E009 */  lui       $v0, %hi(gather_magic_init)
/* 38EE94 E008E034 2442E1FC */  addiu     $v0, $v0, %lo(gather_magic_init)
/* 38EE98 E008E038 AFA20018 */  sw        $v0, 0x18($sp)
/* 38EE9C E008E03C 3C02E009 */  lui       $v0, %hi(gather_magic_update)
/* 38EEA0 E008E040 2442E204 */  addiu     $v0, $v0, %lo(gather_magic_update)
/* 38EEA4 E008E044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 38EEA8 E008E048 3C02E009 */  lui       $v0, %hi(gather_magic_render)
/* 38EEAC E008E04C 2442E498 */  addiu     $v0, $v0, %lo(gather_magic_render)
/* 38EEB0 E008E050 AFA20020 */  sw        $v0, 0x20($sp)
/* 38EEB4 E008E054 24020047 */  addiu     $v0, $zero, 0x47
/* 38EEB8 E008E058 AFBF0038 */  sw        $ra, 0x38($sp)
/* 38EEBC E008E05C AFB1002C */  sw        $s1, 0x2C($sp)
/* 38EEC0 E008E060 AFB00028 */  sw        $s0, 0x28($sp)
/* 38EEC4 E008E064 AFA00010 */  sw        $zero, 0x10($sp)
/* 38EEC8 E008E068 AFA00024 */  sw        $zero, 0x24($sp)
/* 38EECC E008E06C 0C080124 */  jal       shim_create_effect_instance
/* 38EED0 E008E070 AFA20014 */   sw       $v0, 0x14($sp)
/* 38EED4 E008E074 240408B8 */  addiu     $a0, $zero, 0x8B8
/* 38EED8 E008E078 2411001F */  addiu     $s1, $zero, 0x1F
/* 38EEDC E008E07C 0040802D */  daddu     $s0, $v0, $zero
/* 38EEE0 E008E080 0C08012C */  jal       shim_general_heap_malloc
/* 38EEE4 E008E084 AE110008 */   sw       $s1, 0x8($s0)
/* 38EEE8 E008E088 0040282D */  daddu     $a1, $v0, $zero
/* 38EEEC E008E08C 14A00003 */  bnez      $a1, .LE008E09C
/* 38EEF0 E008E090 AE05000C */   sw       $a1, 0xC($s0)
.LE008E094:
/* 38EEF4 E008E094 08023825 */  j         .LE008E094
/* 38EEF8 E008E098 00000000 */   nop
.LE008E09C:
/* 38EEFC E008E09C ACB30004 */  sw        $s3, 0x4($a1)
/* 38EF00 E008E0A0 1E400004 */  bgtz      $s2, .LE008E0B4
/* 38EF04 E008E0A4 ACA0001C */   sw       $zero, 0x1C($a1)
/* 38EF08 E008E0A8 24020064 */  addiu     $v0, $zero, 0x64
/* 38EF0C E008E0AC 0802382E */  j         .LE008E0B8
/* 38EF10 E008E0B0 ACA20018 */   sw       $v0, 0x18($a1)
.LE008E0B4:
/* 38EF14 E008E0B4 ACB20018 */  sw        $s2, 0x18($a1)
.LE008E0B8:
/* 38EF18 E008E0B8 ACA00014 */  sw        $zero, 0x14($a1)
/* 38EF1C E008E0BC E4B40008 */  swc1      $f20, 0x8($a1)
/* 38EF20 E008E0C0 E4B6000C */  swc1      $f22, 0xC($a1)
/* 38EF24 E008E0C4 16600008 */  bnez      $s3, .LE008E0E8
/* 38EF28 E008E0C8 E4B80010 */   swc1     $f24, 0x10($a1)
/* 38EF2C E008E0CC 240200FF */  addiu     $v0, $zero, 0xFF
/* 38EF30 E008E0D0 ACA20030 */  sw        $v0, 0x30($a1)
/* 38EF34 E008E0D4 ACA00034 */  sw        $zero, 0x34($a1)
/* 38EF38 E008E0D8 ACA20038 */  sw        $v0, 0x38($a1)
/* 38EF3C E008E0DC ACA2003C */  sw        $v0, 0x3C($a1)
/* 38EF40 E008E0E0 08023844 */  j         .LE008E110
/* 38EF44 E008E0E4 ACA20040 */   sw       $v0, 0x40($a1)
.LE008E0E8:
/* 38EF48 E008E0E8 240200FF */  addiu     $v0, $zero, 0xFF
/* 38EF4C E008E0EC 24030014 */  addiu     $v1, $zero, 0x14
/* 38EF50 E008E0F0 ACA20030 */  sw        $v0, 0x30($a1)
/* 38EF54 E008E0F4 24020021 */  addiu     $v0, $zero, 0x21
/* 38EF58 E008E0F8 ACA20038 */  sw        $v0, 0x38($a1)
/* 38EF5C E008E0FC 24020032 */  addiu     $v0, $zero, 0x32
/* 38EF60 E008E100 ACA2003C */  sw        $v0, 0x3C($a1)
/* 38EF64 E008E104 2402000A */  addiu     $v0, $zero, 0xA
/* 38EF68 E008E108 ACA30034 */  sw        $v1, 0x34($a1)
/* 38EF6C E008E10C ACA30040 */  sw        $v1, 0x40($a1)
.LE008E110:
/* 38EF70 E008E110 ACA20044 */  sw        $v0, 0x44($a1)
/* 38EF74 E008E114 240A0001 */  addiu     $t2, $zero, 0x1
/* 38EF78 E008E118 0151102A */  slt       $v0, $t2, $s1
/* 38EF7C E008E11C 1040002C */  beqz      $v0, .LE008E1D0
/* 38EF80 E008E120 24A50048 */   addiu    $a1, $a1, 0x48
/* 38EF84 E008E124 2629FFFF */  addiu     $t1, $s1, -0x1
/* 38EF88 E008E128 44801000 */  mtc1      $zero, $f2
/* 38EF8C E008E12C 24A6002C */  addiu     $a2, $a1, 0x2C
/* 38EF90 E008E130 0000402D */  daddu     $t0, $zero, $zero
/* 38EF94 E008E134 0100382D */  daddu     $a3, $t0, $zero
.LE008E138:
/* 38EF98 E008E138 15200002 */  bnez      $t1, .LE008E144
/* 38EF9C E008E13C 00E9001A */   div      $zero, $a3, $t1
/* 38EFA0 E008E140 0007000D */  break     7
.LE008E144:
/* 38EFA4 E008E144 2401FFFF */  addiu     $at, $zero, -0x1
/* 38EFA8 E008E148 15210004 */  bne       $t1, $at, .LE008E15C
/* 38EFAC E008E14C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38EFB0 E008E150 14E10002 */  bne       $a3, $at, .LE008E15C
/* 38EFB4 E008E154 00000000 */   nop
/* 38EFB8 E008E158 0006000D */  break     6
.LE008E15C:
/* 38EFBC E008E15C 00001812 */  mflo      $v1
/* 38EFC0 E008E160 00000000 */  nop
/* 38EFC4 E008E164 15200002 */  bnez      $t1, .LE008E170
/* 38EFC8 E008E168 0109001A */   div      $zero, $t0, $t1
/* 38EFCC E008E16C 0007000D */  break     7
.LE008E170:
/* 38EFD0 E008E170 2401FFFF */  addiu     $at, $zero, -0x1
/* 38EFD4 E008E174 15210004 */  bne       $t1, $at, .LE008E188
/* 38EFD8 E008E178 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38EFDC E008E17C 15010002 */  bne       $t0, $at, .LE008E188
/* 38EFE0 E008E180 00000000 */   nop
/* 38EFE4 E008E184 0006000D */  break     6
.LE008E188:
/* 38EFE8 E008E188 00002012 */  mflo      $a0
/* 38EFEC E008E18C 25080064 */  addiu     $t0, $t0, 0x64
/* 38EFF0 E008E190 24E70CA8 */  addiu     $a3, $a3, 0xCA8
/* 38EFF4 E008E194 254A0001 */  addiu     $t2, $t2, 0x1
/* 38EFF8 E008E198 0151102A */  slt       $v0, $t2, $s1
/* 38EFFC E008E19C E4C2FFF8 */  swc1      $f2, -0x8($a2)
/* 38F000 E008E1A0 44830000 */  mtc1      $v1, $f0
/* 38F004 E008E1A4 00000000 */  nop
/* 38F008 E008E1A8 46800020 */  cvt.s.w   $f0, $f0
/* 38F00C E008E1AC E4C0FFF4 */  swc1      $f0, -0xC($a2)
/* 38F010 E008E1B0 44840000 */  mtc1      $a0, $f0
/* 38F014 E008E1B4 00000000 */  nop
/* 38F018 E008E1B8 46800020 */  cvt.s.w   $f0, $f0
/* 38F01C E008E1BC E4C00000 */  swc1      $f0, 0x0($a2)
/* 38F020 E008E1C0 24C60048 */  addiu     $a2, $a2, 0x48
/* 38F024 E008E1C4 ACA00000 */  sw        $zero, 0x0($a1)
/* 38F028 E008E1C8 1440FFDB */  bnez      $v0, .LE008E138
/* 38F02C E008E1CC 24A50048 */   addiu    $a1, $a1, 0x48
.LE008E1D0:
/* 38F030 E008E1D0 0200102D */  daddu     $v0, $s0, $zero
/* 38F034 E008E1D4 8FBF0038 */  lw        $ra, 0x38($sp)
/* 38F038 E008E1D8 8FB30034 */  lw        $s3, 0x34($sp)
/* 38F03C E008E1DC 8FB20030 */  lw        $s2, 0x30($sp)
/* 38F040 E008E1E0 8FB1002C */  lw        $s1, 0x2C($sp)
/* 38F044 E008E1E4 8FB00028 */  lw        $s0, 0x28($sp)
/* 38F048 E008E1E8 D7B80050 */  ldc1      $f24, 0x50($sp)
/* 38F04C E008E1EC D7B60048 */  ldc1      $f22, 0x48($sp)
/* 38F050 E008E1F0 D7B40040 */  ldc1      $f20, 0x40($sp)
/* 38F054 E008E1F4 03E00008 */  jr        $ra
/* 38F058 E008E1F8 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

EffectInstance* gather_magic_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
    EffectBlueprint bp;
    EffectInstance* effect;
    GatherMagicFXData* data;
    s32 numParts = 31;
    s32 i;

    bp.unk_00 = 0;
    bp.init = gather_magic_init;
    bp.update = gather_magic_update;
    bp.renderWorld = gather_magic_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_GATHER_MAGIC;

    effect = shim_create_effect_instance(&bp);
    effect->numParts = numParts;
    data = shim_general_heap_malloc(numParts * sizeof(*data));
    effect->data.gatherMagic = data;
    ASSERT(effect->data.gatherMagic != NULL);

    data->unk_04 = arg0;
    data->unk_1C = 0;
    if (arg5 <= 0) {
        data->unk_18 = 100;
    } else {
        data->unk_18 = arg5;
    }
    data->unk_14 = 0;
    data->unk_08 = arg1;
    data->unk_0C = arg2;
    data->unk_10 = arg3;

    if (arg0 == 0) {
        data->unk_30 = 255;
        data->unk_34 = 0;
        data->unk_38 = 255;
        data->unk_3C = 255;
        data->unk_40 = 255;
        data->unk_44 = 255;
    } else {
        data->unk_30 = 255;
        data->unk_34 = 20;
        data->unk_38 = 33;
        data->unk_3C = 50;
        data->unk_40 = 20;
        data->unk_44 = 10;
    }

    data++;
    for (i = 1; i < numParts; i++, data++) {
        s32 d = numParts - 1;
        f32 zero = 0.0f;

        data->unk_20 = ((i - 1) * 3240) / d;
        data->unk_24 = zero;
        data->unk_2C = ((i - 1) * 100) / d;
        data->unk_00 = 0;
    }
    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel phys_player_land
/* 7C728 800E3278 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 7C72C 800E327C 3C02FF7F */  lui       $v0, (0xFF7FFFFF >> 16)
/* 7C730 800E3280 3442FFFF */  ori       $v0, $v0, (0xFF7FFFFF & 0xFFFF)
/* 7C734 800E3284 24040148 */  addiu     $a0, $zero, 0x148
/* 7C738 800E3288 AFB00018 */  sw        $s0, 0x18($sp)
/* 7C73C 800E328C 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* 7C740 800E3290 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* 7C744 800E3294 AFBF0020 */  sw        $ra, 0x20($sp)
/* 7C748 800E3298 AFB1001C */  sw        $s1, 0x1C($sp)
/* 7C74C 800E329C 8E030000 */  lw        $v1, 0x0($s0)
/* 7C750 800E32A0 C6000028 */  lwc1      $f0, 0x28($s0)
/* 7C754 800E32A4 C6020030 */  lwc1      $f2, 0x30($s0)
/* 7C758 800E32A8 0000282D */  daddu     $a1, $zero, $zero
/* 7C75C 800E32AC A60000C0 */  sh        $zero, 0xC0($s0)
/* 7C760 800E32B0 A60000C2 */  sh        $zero, 0xC2($s0)
/* 7C764 800E32B4 00621824 */  and       $v1, $v1, $v0
/* 7C768 800E32B8 2402FFF1 */  addiu     $v0, $zero, -0xF
/* 7C76C 800E32BC AE030000 */  sw        $v1, 0x0($s0)
/* 7C770 800E32C0 00621824 */  and       $v1, $v1, $v0
/* 7C774 800E32C4 E6000044 */  swc1      $f0, 0x44($s0)
/* 7C778 800E32C8 E6020048 */  swc1      $f2, 0x48($s0)
/* 7C77C 800E32CC 0C052736 */  jal       sfx_play_sound_at_player
/* 7C780 800E32D0 AE030000 */   sw       $v1, 0x0($s0)
/* 7C784 800E32D4 3C038016 */  lui       $v1, %hi(gCollisionStatus)
/* 7C788 800E32D8 2463A550 */  addiu     $v1, $v1, %lo(gCollisionStatus)
/* 7C78C 800E32DC 94620002 */  lhu       $v0, 0x2($v1)
/* 7C790 800E32E0 30424000 */  andi      $v0, $v0, 0x4000
/* 7C794 800E32E4 14400003 */  bnez      $v0, .L800E32F4
/* 7C798 800E32E8 0060882D */   daddu    $s1, $v1, $zero
/* 7C79C 800E32EC 0C03954C */  jal       phys_adjust_cam_on_landing
/* 7C7A0 800E32F0 00000000 */   nop
.L800E32F4:
/* 7C7A4 800E32F4 96240002 */  lhu       $a0, 0x2($s1)
/* 7C7A8 800E32F8 2402FFFF */  addiu     $v0, $zero, -0x1
/* 7C7AC 800E32FC A6220004 */  sh        $v0, 0x4($s1)
/* 7C7B0 800E3300 30824000 */  andi      $v0, $a0, 0x4000
/* 7C7B4 800E3304 10400022 */  beqz      $v0, .L800E3390
/* 7C7B8 800E3308 00042400 */   sll      $a0, $a0, 16
/* 7C7BC 800E330C 0C0441A9 */  jal       get_entity_type
/* 7C7C0 800E3310 00042403 */   sra      $a0, $a0, 16
/* 7C7C4 800E3314 0040182D */  daddu     $v1, $v0, $zero
/* 7C7C8 800E3318 28620009 */  slti      $v0, $v1, 0x9
/* 7C7CC 800E331C 1040001C */  beqz      $v0, .L800E3390
/* 7C7D0 800E3320 28620007 */   slti     $v0, $v1, 0x7
/* 7C7D4 800E3324 1440001A */  bnez      $v0, .L800E3390
/* 7C7D8 800E3328 00000000 */   nop
/* 7C7DC 800E332C 0C04417A */  jal       get_entity_by_index
/* 7C7E0 800E3330 86240002 */   lh       $a0, 0x2($s1)
/* 7C7E4 800E3334 90430006 */  lbu       $v1, 0x6($v0)
/* 7C7E8 800E3338 34630001 */  ori       $v1, $v1, 0x1
/* 7C7EC 800E333C A0430006 */  sb        $v1, 0x6($v0)
/* 7C7F0 800E3340 920300B4 */  lbu       $v1, 0xB4($s0)
/* 7C7F4 800E3344 2462FFF1 */  addiu     $v0, $v1, -0xF
/* 7C7F8 800E3348 2C420002 */  sltiu     $v0, $v0, 0x2
/* 7C7FC 800E334C 1440000B */  bnez      $v0, .L800E337C
/* 7C800 800E3350 00031600 */   sll      $v0, $v1, 24
/* 7C804 800E3354 00021E03 */  sra       $v1, $v0, 24
/* 7C808 800E3358 2402000D */  addiu     $v0, $zero, 0xD
/* 7C80C 800E335C 10620007 */  beq       $v1, $v0, .L800E337C
/* 7C810 800E3360 2402000E */   addiu    $v0, $zero, 0xE
/* 7C814 800E3364 10620005 */  beq       $v1, $v0, .L800E337C
/* 7C818 800E3368 00000000 */   nop
/* 7C81C 800E336C 0C039769 */  jal       set_action_state
/* 7C820 800E3370 24040007 */   addiu    $a0, $zero, 0x7
/* 7C824 800E3374 08038D0D */  j         .L800E3434
/* 7C828 800E3378 00000000 */   nop
.L800E337C:
/* 7C82C 800E337C 0C03805E */  jal       disable_player_input
/* 7C830 800E3380 00000000 */   nop
/* 7C834 800E3384 2402000B */  addiu     $v0, $zero, 0xB
/* 7C838 800E3388 08038D0D */  j         .L800E3434
/* 7C83C 800E338C A20200B6 */   sb       $v0, 0xB6($s0)
.L800E3390:
/* 7C840 800E3390 8E020000 */  lw        $v0, 0x0($s0)
/* 7C844 800E3394 30424000 */  andi      $v0, $v0, 0x4000
/* 7C848 800E3398 10400005 */  beqz      $v0, .L800E33B0
/* 7C84C 800E339C 24020007 */   addiu    $v0, $zero, 0x7
/* 7C850 800E33A0 0C039769 */  jal       set_action_state
/* 7C854 800E33A4 24040002 */   addiu    $a0, $zero, 0x2
/* 7C858 800E33A8 08038D0D */  j         .L800E3434
/* 7C85C 800E33AC 00000000 */   nop
.L800E33B0:
/* 7C860 800E33B0 820300B4 */  lb        $v1, 0xB4($s0)
/* 7C864 800E33B4 14620005 */  bne       $v1, $v0, .L800E33CC
/* 7C868 800E33B8 27A40010 */   addiu    $a0, $sp, 0x10
/* 7C86C 800E33BC 0C039769 */  jal       set_action_state
/* 7C870 800E33C0 24040020 */   addiu    $a0, $zero, 0x20
/* 7C874 800E33C4 08038D0D */  j         .L800E3434
/* 7C878 800E33C8 00000000 */   nop
.L800E33CC:
/* 7C87C 800E33CC 0C0388C1 */  jal       player_input_to_move_vector
/* 7C880 800E33D0 27A50014 */   addiu    $a1, $sp, 0x14
/* 7C884 800E33D4 C7A00014 */  lwc1      $f0, 0x14($sp)
/* 7C888 800E33D8 44801000 */  mtc1      $zero, $f2
/* 7C88C 800E33DC 00000000 */  nop
/* 7C890 800E33E0 46020032 */  c.eq.s    $f0, $f2
/* 7C894 800E33E4 00000000 */  nop
/* 7C898 800E33E8 4500000C */  bc1f      .L800E341C
/* 7C89C 800E33EC 24020009 */   addiu    $v0, $zero, 0x9
/* 7C8A0 800E33F0 820300B4 */  lb        $v1, 0xB4($s0)
/* 7C8A4 800E33F4 10620005 */  beq       $v1, $v0, .L800E340C
/* 7C8A8 800E33F8 00000000 */   nop
/* 7C8AC 800E33FC 0C039769 */  jal       set_action_state
/* 7C8B0 800E3400 2404000A */   addiu    $a0, $zero, 0xA
/* 7C8B4 800E3404 08038D0D */  j         .L800E3434
/* 7C8B8 800E3408 00000000 */   nop
.L800E340C:
/* 7C8BC 800E340C 0C039769 */  jal       set_action_state
/* 7C8C0 800E3410 2404000B */   addiu    $a0, $zero, 0xB
/* 7C8C4 800E3414 08038D0D */  j         .L800E3434
/* 7C8C8 800E3418 00000000 */   nop
.L800E341C:
/* 7C8CC 800E341C 45010003 */  bc1t      .L800E342C
/* 7C8D0 800E3420 00000000 */   nop
/* 7C8D4 800E3424 C7A00010 */  lwc1      $f0, 0x10($sp)
/* 7C8D8 800E3428 E6000080 */  swc1      $f0, 0x80($s0)
.L800E342C:
/* 7C8DC 800E342C 0C0397DA */  jal       update_locomotion_state
/* 7C8E0 800E3430 00000000 */   nop
.L800E3434:
/* 7C8E4 800E3434 8FBF0020 */  lw        $ra, 0x20($sp)
/* 7C8E8 800E3438 8FB1001C */  lw        $s1, 0x1C($sp)
/* 7C8EC 800E343C 8FB00018 */  lw        $s0, 0x18($sp)
/* 7C8F0 800E3440 03E00008 */  jr        $ra
/* 7C8F4 800E3444 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void phys_player_land(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    CollisionStatus* collisionStatus = &gCollisionStatus;
    f32 moveAngle;
    f32 moveMagnitude;

    playerStatus->timeInAir = 0;
    playerStatus->peakJumpTime = 0;
    playerStatus->flags &= ~PS_FLAG_SCRIPTED_FALL;
    playerStatus->landPos.x = playerStatus->position.x;
    playerStatus->landPos.z = playerStatus->position.z;
    playerStatus->flags &= ~PS_FLAG_AIRBORNE;
    sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);
    if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
        phys_adjust_cam_on_landing();
    }

    collisionStatus->lastTouchedFloor = -1;
    if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) {
        s32 entityType = get_entity_type(collisionStatus->currentFloor);

        if (entityType <= ACTION_STATE_FALLING) {
            if (entityType >= ACTION_STATE_LANDING_ON_SWITCH) {
                Entity* entity = get_entity_by_index(collisionStatus->currentFloor);

                entity->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR;
                if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP
                    && playerStatus->actionState != ACTION_STATE_TORNADO_POUND
                    && playerStatus->actionState != ACTION_STATE_SPIN_JUMP
                    && playerStatus->actionState != ACTION_STATE_SPIN_POUND
                ) {
                    set_action_state(ACTION_STATE_LANDING_ON_SWITCH);
                } else {
                    disable_player_input();
                    playerStatus->actionSubstate = 11;
                }
                return;
            }
        }
    }

    if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
        set_action_state(ACTION_STATE_RUN);
        return;
    }

    if (playerStatus->actionState == ACTION_STATE_LANDING_ON_SWITCH) {
        set_action_state(ACTION_STATE_BOUNCE_OFF_SWITCH);
        return;
    }

    player_input_to_move_vector(&moveAngle, &moveMagnitude);
    if (moveMagnitude == 0.0f) {
        if (playerStatus->actionState != ACTION_STATE_STEP_DOWN) {
            set_action_state(ACTION_STATE_LAND);
        } else {
            set_action_state(ACTION_STATE_STEP_DOWN_LAND);
        }
        return;
    }

    if (moveMagnitude != 0.0f) {
        playerStatus->targetYaw = moveAngle;
    }
    update_locomotion_state();
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel VirtualEntityMoveTo
/* F8410 802D3A60 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* F8414 802D3A64 AFB20018 */  sw        $s2, 0x18($sp)
/* F8418 802D3A68 0080902D */  daddu     $s2, $a0, $zero
/* F841C 802D3A6C AFBF001C */  sw        $ra, 0x1C($sp)
/* F8420 802D3A70 AFB10014 */  sw        $s1, 0x14($sp)
/* F8424 802D3A74 AFB00010 */  sw        $s0, 0x10($sp)
/* F8428 802D3A78 F7BA0038 */  sdc1      $f26, 0x38($sp)
/* F842C 802D3A7C F7B80030 */  sdc1      $f24, 0x30($sp)
/* F8430 802D3A80 F7B60028 */  sdc1      $f22, 0x28($sp)
/* F8434 802D3A84 F7B40020 */  sdc1      $f20, 0x20($sp)
/* F8438 802D3A88 8E51000C */  lw        $s1, 0xC($s2)
/* F843C 802D3A8C 54A00001 */  bnel      $a1, $zero, .L802D3A94
/* F8440 802D3A90 AE400070 */   sw       $zero, 0x70($s2)
.L802D3A94:
/* F8444 802D3A94 8E420070 */  lw        $v0, 0x70($s2)
/* F8448 802D3A98 14400049 */  bnez      $v0, .L802D3BC0
/* F844C 802D3A9C 00000000 */   nop
/* F8450 802D3AA0 8E250000 */  lw        $a1, 0x0($s1)
/* F8454 802D3AA4 26310004 */  addiu     $s1, $s1, 0x4
/* F8458 802D3AA8 0C0B1EAF */  jal       evt_get_variable
/* F845C 802D3AAC 0240202D */   daddu    $a0, $s2, $zero
/* F8460 802D3AB0 8E250000 */  lw        $a1, 0x0($s1)
/* F8464 802D3AB4 26310004 */  addiu     $s1, $s1, 0x4
/* F8468 802D3AB8 0240202D */  daddu     $a0, $s2, $zero
/* F846C 802D3ABC 0C0B1EAF */  jal       evt_get_variable
/* F8470 802D3AC0 0040802D */   daddu    $s0, $v0, $zero
/* F8474 802D3AC4 4482D000 */  mtc1      $v0, $f26
/* F8478 802D3AC8 00000000 */  nop
/* F847C 802D3ACC 4680D6A0 */  cvt.s.w   $f26, $f26
/* F8480 802D3AD0 8E250000 */  lw        $a1, 0x0($s1)
/* F8484 802D3AD4 26310004 */  addiu     $s1, $s1, 0x4
/* F8488 802D3AD8 0C0B1EAF */  jal       evt_get_variable
/* F848C 802D3ADC 0240202D */   daddu    $a0, $s2, $zero
/* F8490 802D3AE0 8E250000 */  lw        $a1, 0x0($s1)
/* F8494 802D3AE4 26310004 */  addiu     $s1, $s1, 0x4
/* F8498 802D3AE8 4482A000 */  mtc1      $v0, $f20
/* F849C 802D3AEC 00000000 */  nop
/* F84A0 802D3AF0 4680A520 */  cvt.s.w   $f20, $f20
/* F84A4 802D3AF4 0C0B1EAF */  jal       evt_get_variable
/* F84A8 802D3AF8 0240202D */   daddu    $a0, $s2, $zero
/* F84AC 802D3AFC 4482C000 */  mtc1      $v0, $f24
/* F84B0 802D3B00 00000000 */  nop
/* F84B4 802D3B04 4680C620 */  cvt.s.w   $f24, $f24
/* F84B8 802D3B08 8E250000 */  lw        $a1, 0x0($s1)
/* F84BC 802D3B0C 0C0B1EAF */  jal       evt_get_variable
/* F84C0 802D3B10 0240202D */   daddu    $a0, $s2, $zero
/* F84C4 802D3B14 3C04802E */  lui       $a0, %hi(gCurrentVirtualEntityListPtr)
/* F84C8 802D3B18 8C84B7C0 */  lw        $a0, %lo(gCurrentVirtualEntityListPtr)($a0)
/* F84CC 802D3B1C 00101880 */  sll       $v1, $s0, 2
/* F84D0 802D3B20 00641821 */  addu      $v1, $v1, $a0
/* F84D4 802D3B24 8C710000 */  lw        $s1, 0x0($v1)
/* F84D8 802D3B28 AE500074 */  sw        $s0, 0x74($s2)
/* F84DC 802D3B2C E63A0028 */  swc1      $f26, 0x28($s1)
/* F84E0 802D3B30 C63A0004 */  lwc1      $f26, 0x4($s1)
/* F84E4 802D3B34 E6380030 */  swc1      $f24, 0x30($s1)
/* F84E8 802D3B38 C638000C */  lwc1      $f24, 0xC($s1)
/* F84EC 802D3B3C E634002C */  swc1      $f20, 0x2C($s1)
/* F84F0 802D3B40 C6340028 */  lwc1      $f20, 0x28($s1)
/* F84F4 802D3B44 C6360030 */  lwc1      $f22, 0x30($s1)
/* F84F8 802D3B48 44820000 */  mtc1      $v0, $f0
/* F84FC 802D3B4C 00000000 */  nop
/* F8500 802D3B50 46800020 */  cvt.s.w   $f0, $f0
/* F8504 802D3B54 E6200048 */  swc1      $f0, 0x48($s1)
/* F8508 802D3B58 4600D306 */  mov.s     $f12, $f26
/* F850C 802D3B5C 4406A000 */  mfc1      $a2, $f20
/* F8510 802D3B60 4407B000 */  mfc1      $a3, $f22
/* F8514 802D3B64 0C00A720 */  jal       atan2
/* F8518 802D3B68 4600C386 */   mov.s    $f14, $f24
/* F851C 802D3B6C 4600D306 */  mov.s     $f12, $f26
/* F8520 802D3B70 4406A000 */  mfc1      $a2, $f20
/* F8524 802D3B74 4407B000 */  mfc1      $a3, $f22
/* F8528 802D3B78 4600C386 */  mov.s     $f14, $f24
/* F852C 802D3B7C 0C00A7B5 */  jal       dist2D
/* F8530 802D3B80 E6200038 */   swc1     $f0, 0x38($s1)
/* F8534 802D3B84 C6260048 */  lwc1      $f6, 0x48($s1)
/* F8538 802D3B88 44801000 */  mtc1      $zero, $f2
/* F853C 802D3B8C 46000106 */  mov.s     $f4, $f0
/* F8540 802D3B90 46023032 */  c.eq.s    $f6, $f2
/* F8544 802D3B94 00000000 */  nop
/* F8548 802D3B98 45000005 */  bc1f      .L802D3BB0
/* F854C 802D3B9C E6240034 */   swc1     $f4, 0x34($s1)
/* F8550 802D3BA0 C620003C */  lwc1      $f0, 0x3C($s1)
/* F8554 802D3BA4 46002003 */  div.s     $f0, $f4, $f0
/* F8558 802D3BA8 080B4EEE */  j         .L802D3BB8
/* F855C 802D3BAC E6200048 */   swc1     $f0, 0x48($s1)
.L802D3BB0:
/* F8560 802D3BB0 46062003 */  div.s     $f0, $f4, $f6
/* F8564 802D3BB4 E620003C */  swc1      $f0, 0x3C($s1)
.L802D3BB8:
/* F8568 802D3BB8 24020001 */  addiu     $v0, $zero, 0x1
/* F856C 802D3BBC AE420070 */  sw        $v0, 0x70($s2)
.L802D3BC0:
/* F8570 802D3BC0 8E420074 */  lw        $v0, 0x74($s2)
/* F8574 802D3BC4 3C03802E */  lui       $v1, %hi(gCurrentVirtualEntityListPtr)
/* F8578 802D3BC8 8C63B7C0 */  lw        $v1, %lo(gCurrentVirtualEntityListPtr)($v1)
/* F857C 802D3BCC 00021080 */  sll       $v0, $v0, 2
/* F8580 802D3BD0 00431021 */  addu      $v0, $v0, $v1
/* F8584 802D3BD4 8C510000 */  lw        $s1, 0x0($v0)
/* F8588 802D3BD8 8E25003C */  lw        $a1, 0x3C($s1)
/* F858C 802D3BDC 8E260038 */  lw        $a2, 0x38($s1)
/* F8590 802D3BE0 0C0B4BCD */  jal       virtual_entity_move_polar
/* F8594 802D3BE4 0220202D */   daddu    $a0, $s1, $zero
/* F8598 802D3BE8 C6200048 */  lwc1      $f0, 0x48($s1)
/* F859C 802D3BEC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F85A0 802D3BF0 44811000 */  mtc1      $at, $f2
/* F85A4 802D3BF4 00000000 */  nop
/* F85A8 802D3BF8 46020001 */  sub.s     $f0, $f0, $f2
/* F85AC 802D3BFC 44801000 */  mtc1      $zero, $f2
/* F85B0 802D3C00 00000000 */  nop
/* F85B4 802D3C04 4602003E */  c.le.s    $f0, $f2
/* F85B8 802D3C08 00000000 */  nop
/* F85BC 802D3C0C 45010003 */  bc1t      .L802D3C1C
/* F85C0 802D3C10 E6200048 */   swc1     $f0, 0x48($s1)
/* F85C4 802D3C14 080B4F0C */  j         .L802D3C30
/* F85C8 802D3C18 0000102D */   daddu    $v0, $zero, $zero
.L802D3C1C:
/* F85CC 802D3C1C C6200028 */  lwc1      $f0, 0x28($s1)
/* F85D0 802D3C20 C6220030 */  lwc1      $f2, 0x30($s1)
/* F85D4 802D3C24 24020001 */  addiu     $v0, $zero, 0x1
/* F85D8 802D3C28 E6200004 */  swc1      $f0, 0x4($s1)
/* F85DC 802D3C2C E622000C */  swc1      $f2, 0xC($s1)
.L802D3C30:
/* F85E0 802D3C30 8FBF001C */  lw        $ra, 0x1C($sp)
/* F85E4 802D3C34 8FB20018 */  lw        $s2, 0x18($sp)
/* F85E8 802D3C38 8FB10014 */  lw        $s1, 0x14($sp)
/* F85EC 802D3C3C 8FB00010 */  lw        $s0, 0x10($sp)
/* F85F0 802D3C40 D7BA0038 */  ldc1      $f26, 0x38($sp)
/* F85F4 802D3C44 D7B80030 */  ldc1      $f24, 0x30($sp)
/* F85F8 802D3C48 D7B60028 */  ldc1      $f22, 0x28($sp)
/* F85FC 802D3C4C D7B40020 */  ldc1      $f20, 0x20($sp)
/* F8600 802D3C50 03E00008 */  jr        $ra
/* F8604 802D3C54 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

ApiStatus VirtualEntityMoveTo(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    VirtualEntity* virtualEntity;

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

    if (script->functionTemp[0] == 0) {
        s32 index = evt_get_variable(script, *args++);
        f32 xTemp = evt_get_variable(script, *args++);
        f32 yTemp = evt_get_variable(script, *args++);
        f32 zTemp = evt_get_variable(script, *args++);
        s32 moveTime = evt_get_variable(script, *args++);
        f32 goalPosX;
        f32 goalPosZ;

        virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
        script->functionTemp[1] = index;

        virtualEntity->goalPos.x = xTemp;
        virtualEntity->goalPos.y = yTemp;
        virtualEntity->goalPos.z = zTemp;

        xTemp = virtualEntity->pos.x;
        zTemp = virtualEntity->pos.z;

        goalPosX = virtualEntity->goalPos.x;
        goalPosZ = virtualEntity->goalPos.z;

        virtualEntity->moveTime = moveTime;
        virtualEntity->moveAngle = atan2(xTemp, zTemp, goalPosX, goalPosZ);
        virtualEntity->moveDist = dist2D(xTemp, zTemp, goalPosX, goalPosZ);

        if (virtualEntity->moveTime == 0.0f) {
            virtualEntity->moveTime = virtualEntity->moveDist / virtualEntity->moveSpeed;
        } else {
            virtualEntity->moveSpeed = virtualEntity->moveDist / virtualEntity->moveTime;
        }

        script->functionTemp[0] = 1;
    }

    virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]];
    virtual_entity_move_polar(virtualEntity, virtualEntity->moveSpeed, virtualEntity->moveAngle);
    virtualEntity->moveTime--;

    if (virtualEntity->moveTime <= 0.0f) {
        virtualEntity->pos.x = virtualEntity->goalPos.x;
        virtualEntity->pos.z = virtualEntity->goalPos.z;
        return ApiStatus_DONE1;
    }

    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel should_continue_inspect
/* E20560 802B7450 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* E20564 802B7454 3C028016 */  lui       $v0, %hi(gCollisionStatus)
/* E20568 802B7458 2442A550 */  addiu     $v0, $v0, %lo(gCollisionStatus)
/* E2056C 802B745C AFB10014 */  sw        $s1, 0x14($sp)
.L802B7460:
/* E20570 802B7460 3C118011 */  lui       $s1, %hi(gPlayerStatus)
.L802B7464:
/* E20574 802B7464 2631EFC8 */  addiu     $s1, $s1, %lo(gPlayerStatus)
/* E20578 802B7468 AFB20018 */  sw        $s2, 0x18($sp)
/* E2057C 802B746C 2412FFFF */  addiu     $s2, $zero, -0x1
/* E20580 802B7470 AFBF001C */  sw        $ra, 0x1C($sp)
/* E20584 802B7474 AFB00010 */  sw        $s0, 0x10($sp)
.L802B7478:
/* E20588 802B7478 84500012 */  lh        $s0, 0x12($v0)
/* E2058C 802B747C 8E2500C8 */  lw        $a1, 0xC8($s1)
/* E20590 802B7480 56120030 */  bnel      $s0, $s2, .L802B7544
/* E20594 802B7484 32024000 */   andi     $v0, $s0, 0x4000
/* E20598 802B7488 84440002 */  lh        $a0, 0x2($v0)
/* E2059C 802B748C 04800010 */  bltz      $a0, .L802B74D0
/* E205A0 802B7490 30824000 */   andi     $v0, $a0, 0x4000
/* E205A4 802B7494 1040000F */  beqz      $v0, .L802B74D4
.L802B7498:
/* E205A8 802B7498 3C020200 */   lui      $v0, (0x2002000 >> 16)
/* E205AC 802B749C 0C0441A9 */  jal       get_entity_type
/* E205B0 802B74A0 0080802D */   daddu    $s0, $a0, $zero
/* E205B4 802B74A4 2443FFFD */  addiu     $v1, $v0, -0x3
.L802B74A8:
/* E205B8 802B74A8 2C620031 */  sltiu     $v0, $v1, 0x31
/* E205BC 802B74AC 10400038 */  beqz      $v0, .L802B7590
.L802B74B0:
/* E205C0 802B74B0 00031080 */   sll      $v0, $v1, 2
/* E205C4 802B74B4 3C01802B */  lui       $at, %hi(jtbl_802B7CC0)
/* E205C8 802B74B8 00220821 */  addu      $at, $at, $v0
/* E205CC 802B74BC 8C227CC0 */  lw        $v0, %lo(jtbl_802B7CC0)($at)
/* E205D0 802B74C0 00400008 */  jr        $v0
/* E205D4 802B74C4 00000000 */   nop
glabel .L802B74C8
/* E205D8 802B74C8 080ADD64 */  j         .L802B7590
/* E205DC 802B74CC 2410FFFF */   addiu    $s0, $zero, -0x1
.L802B74D0:
/* E205E0 802B74D0 3C020200 */  lui       $v0, (0x2002000 >> 16)
.L802B74D4:
/* E205E4 802B74D4 8E230000 */  lw        $v1, 0x0($s1)
/* E205E8 802B74D8 34422000 */  ori       $v0, $v0, (0x2002000 & 0xFFFF)
.L802B74DC:
/* E205EC 802B74DC 00621824 */  and       $v1, $v1, $v0
.L802B74E0:
/* E205F0 802B74E0 3C020200 */  lui       $v0, (0x2000000 >> 16)
/* E205F4 802B74E4 1462000F */  bne       $v1, $v0, .L802B7524
/* E205F8 802B74E8 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
/* E205FC 802B74EC 10A0000C */  beqz      $a1, .L802B7520
glabel pulse_stone_notification_update
/* E20600 802B74F0 3C031000 */   lui      $v1, (0x10000000 >> 16)
.L802B74F4:
/* E20604 802B74F4 8CA20000 */  lw        $v0, 0x0($a1)
/* E20608 802B74F8 00431024 */  and       $v0, $v0, $v1
/* E2060C 802B74FC 10400009 */  beqz      $v0, .L802B7524
/* E20610 802B7500 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
/* E20614 802B7504 80A200A4 */  lb        $v0, 0xA4($a1)
/* E20618 802B7508 862300C6 */  lh        $v1, 0xC6($s1)
.L802B750C:
/* E2061C 802B750C 34502000 */  ori       $s0, $v0, 0x2000
/* E20620 802B7510 14700029 */  bne       $v1, $s0, .L802B75B8
/* E20624 802B7514 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
/* E20628 802B7518 080ADD74 */  j         .L802B75D0
/* E2062C 802B751C 24020001 */   addiu    $v0, $zero, 0x1
.L802B7520:
/* E20630 802B7520 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
.L802B7524:
/* E20634 802B7524 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
.L802B7528:
/* E20638 802B7528 0000102D */  daddu     $v0, $zero, $zero
/* E2063C 802B752C 8E240000 */  lw        $a0, 0x0($s1)
/* E20640 802B7530 2405FFFF */  addiu     $a1, $zero, -0x1
/* E20644 802B7534 A62500C6 */  sh        $a1, 0xC6($s1)
/* E20648 802B7538 00832024 */  and       $a0, $a0, $v1
/* E2064C 802B753C 080ADD74 */  j         .L802B75D0
/* E20650 802B7540 AE240000 */   sw       $a0, 0x0($s1)
.L802B7544:
/* E20654 802B7544 14400007 */  bnez      $v0, .L802B7564
/* E20658 802B7548 32022000 */   andi     $v0, $s0, 0x2000
/* E2065C 802B754C 14400010 */  bnez      $v0, .L802B7590
/* E20660 802B7550 00000000 */   nop
/* E20664 802B7554 0C05173A */  jal       should_collider_allow_interact
.L802B7558:
/* E20668 802B7558 0200202D */   daddu    $a0, $s0, $zero
/* E2066C 802B755C 080ADD5B */  j         .L802B756C
/* E20670 802B7560 00000000 */   nop
.L802B7564:
/* E20674 802B7564 0C0394BE */  jal       phys_can_player_interact
.L802B7568:
/* E20678 802B7568 00000000 */   nop
.L802B756C:
/* E2067C 802B756C 14400008 */  bnez      $v0, .L802B7590
/* E20680 802B7570 3C04F7FF */   lui      $a0, (0xF7FFFFFF >> 16)
/* E20684 802B7574 3484FFFF */  ori       $a0, $a0, (0xF7FFFFFF & 0xFFFF)
/* E20688 802B7578 8E230000 */  lw        $v1, 0x0($s1)
glabel func_802B757C
/* E2068C 802B757C 0000102D */  daddu     $v0, $zero, $zero
ispy_icon_img:
/* E20690 802B7580 A63200C6 */  sh        $s2, 0xC6($s1)
/* E20694 802B7584 00641824 */  and       $v1, $v1, $a0
/* E20698 802B7588 080ADD74 */  j         .L802B75D0
/* E2069C 802B758C AE230000 */   sw       $v1, 0x0($s1)
glabel .L802B7590
/* E206A0 802B7590 862200C6 */  lh        $v0, 0xC6($s1)
/* E206A4 802B7594 14500008 */  bne       $v0, $s0, .L802B75B8
/* E206A8 802B7598 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
/* E206AC 802B759C 8E220000 */  lw        $v0, 0x0($s1)
/* E206B0 802B75A0 3C030800 */  lui       $v1, (0x800FFFF >> 16)
/* E206B4 802B75A4 00431024 */  and       $v0, $v0, $v1
/* E206B8 802B75A8 10400007 */  beqz      $v0, .L802B75C8
.L802B75AC:
/* E206BC 802B75AC 0000102D */   daddu    $v0, $zero, $zero
/* E206C0 802B75B0 080ADD74 */  j         .L802B75D0
.L802B75B4:
/* E206C4 802B75B4 00000000 */   nop
.L802B75B8:
/* E206C8 802B75B8 8E220000 */  lw        $v0, 0x0($s1)
/* E206CC 802B75BC 3463FFFF */  ori       $v1, $v1, (0x800FFFF & 0xFFFF)
/* E206D0 802B75C0 00431024 */  and       $v0, $v0, $v1
/* E206D4 802B75C4 AE220000 */  sw        $v0, 0x0($s1)
.L802B75C8:
/* E206D8 802B75C8 A63000C6 */  sh        $s0, 0xC6($s1)
/* E206DC 802B75CC 24020001 */  addiu     $v0, $zero, 0x1
.L802B75D0:
/* E206E0 802B75D0 8FBF001C */  lw        $ra, 0x1C($sp)
/* E206E4 802B75D4 8FB20018 */  lw        $s2, 0x18($sp)
/* E206E8 802B75D8 8FB10014 */  lw        $s1, 0x14($sp)
/* E206EC 802B75DC 8FB00010 */  lw        $s0, 0x10($sp)
/* E206F0 802B75E0 03E00008 */  jr        $ra
.L802B75E4:
/* E206F4 802B75E4 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

s32 should_continue_inspect(void) {
    CollisionStatus* collisionStatus = &gCollisionStatus;
    PlayerStatus* playerStatus = &gPlayerStatus;
    s32 curInteraction = collisionStatus->currentWall;
    Npc* npc = playerStatus->encounteredNPC;

    if (curInteraction == NO_COLLIDER) {
        s32 floor = gCollisionStatus.currentFloor;

        if (floor >= 0 && (floor & COLLISION_WITH_ENTITY_BIT)) {
            curInteraction = floor;
            switch (get_entity_type(floor)) {
                case ENTITY_TYPE_PADLOCK:
                case ENTITY_TYPE_PADLOCK_RED_FRAME:
                case ENTITY_TYPE_PADLOCK_RED_FACE:
                case ENTITY_TYPE_PADLOCK_BLUE_FACE:
                case ENTITY_TYPE_PUSH_BLOCK:
                case ENTITY_TYPE_CHEST:
                case ENTITY_TYPE_SIGNPOST:
                    curInteraction = NO_COLLIDER;
                    break;
            }
        } else if (
            ((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_INPUT_DISABLED)) == PS_FLAG_HAS_CONVERSATION_NPC)
            && (npc != NULL)
            && (npc->flags & NPC_FLAG_10000000)
        ) {
            curInteraction = npc->npcID | COLLISION_WITH_NPC_BIT;
            if (playerStatus->interactingWithID == curInteraction) {
                return TRUE;
            }
        } else {
            playerStatus->interactingWithID = NO_COLLIDER;
            playerStatus->flags &= ~PS_FLAG_INTERACTED;
            return FALSE;
        }
    } else {
        if (!(curInteraction & COLLISION_WITH_ENTITY_BIT)) {
            if (!(curInteraction & COLLISION_WITH_NPC_BIT)) {
                if (!should_collider_allow_interact(curInteraction)) {
                    playerStatus->interactingWithID = NO_COLLIDER;
                    playerStatus->flags &= ~PS_FLAG_INTERACTED;
                    return FALSE;
                }
            }
        } else {
            if (!phys_can_player_interact()) {
                playerStatus->interactingWithID = NO_COLLIDER;
                playerStatus->flags &= ~PS_FLAG_INTERACTED;
                return FALSE;
            }
        }
    }
    if (playerStatus->interactingWithID == curInteraction) {
        if ((playerStatus->flags & PS_FLAG_INTERACTED)) {
            return FALSE;
        }
    } else {
        playerStatus->flags &= ~PS_FLAG_INTERACTED;
    }

    playerStatus->interactingWithID = curInteraction;
    return TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel collision_main_above
/* 7BC90 800E27E0 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 7BC94 800E27E4 AFB10034 */  sw        $s1, 0x34($sp)
/* 7BC98 800E27E8 3C118011 */  lui       $s1, %hi(gPlayerStatus)
/* 7BC9C 800E27EC 2631EFC8 */  addiu     $s1, $s1, %lo(gPlayerStatus)
/* 7BCA0 800E27F0 AFBF003C */  sw        $ra, 0x3C($sp)
/* 7BCA4 800E27F4 AFB20038 */  sw        $s2, 0x38($sp)
/* 7BCA8 800E27F8 AFB00030 */  sw        $s0, 0x30($sp)
/* 7BCAC 800E27FC F7B40040 */  sdc1      $f20, 0x40($sp)
/* 7BCB0 800E2800 862200B0 */  lh        $v0, 0xB0($s1)
/* 7BCB4 800E2804 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 7BCB8 800E2808 44811000 */  mtc1      $at, $f2
/* 7BCBC 800E280C 44820000 */  mtc1      $v0, $f0
/* 7BCC0 800E2810 00000000 */  nop
/* 7BCC4 800E2814 46800020 */  cvt.s.w   $f0, $f0
/* 7BCC8 800E2818 46020002 */  mul.s     $f0, $f0, $f2
/* 7BCCC 800E281C 00000000 */  nop
/* 7BCD0 800E2820 27A40018 */  addiu     $a0, $sp, 0x18
/* 7BCD4 800E2824 C6220028 */  lwc1      $f2, 0x28($s1)
/* 7BCD8 800E2828 27A5001C */  addiu     $a1, $sp, 0x1C
/* 7BCDC 800E282C E7A20020 */  swc1      $f2, 0x20($sp)
/* 7BCE0 800E2830 46000506 */  mov.s     $f20, $f0
/* 7BCE4 800E2834 C620002C */  lwc1      $f0, 0x2C($s1)
/* 7BCE8 800E2838 C6220030 */  lwc1      $f2, 0x30($s1)
/* 7BCEC 800E283C 46140000 */  add.s     $f0, $f0, $f20
/* 7BCF0 800E2840 E7A20028 */  swc1      $f2, 0x28($sp)
/* 7BCF4 800E2844 E7B4002C */  swc1      $f20, 0x2C($sp)
/* 7BCF8 800E2848 0C0388C1 */  jal       player_input_to_move_vector
/* 7BCFC 800E284C E7A00024 */   swc1     $f0, 0x24($sp)
/* 7BD00 800E2850 C7A2001C */  lwc1      $f2, 0x1C($sp)
/* 7BD04 800E2854 44800000 */  mtc1      $zero, $f0
/* 7BD08 800E2858 3C128016 */  lui       $s2, %hi(gCollisionStatus)
/* 7BD0C 800E285C 2652A550 */  addiu     $s2, $s2, %lo(gCollisionStatus)
/* 7BD10 800E2860 46001032 */  c.eq.s    $f2, $f0
/* 7BD14 800E2864 00000000 */  nop
/* 7BD18 800E2868 45010004 */  bc1t      .L800E287C
/* 7BD1C 800E286C 0220202D */   daddu    $a0, $s1, $zero
/* 7BD20 800E2870 C6220080 */  lwc1      $f2, 0x80($s1)
/* 7BD24 800E2874 08038A31 */  j         .L800E28C4
/* 7BD28 800E2878 27A50020 */   addiu    $a1, $sp, 0x20
.L800E287C:
/* 7BD2C 800E287C 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 7BD30 800E2880 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 7BD34 800E2884 C62200A8 */  lwc1      $f2, 0xA8($s1)
/* 7BD38 800E2888 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 7BD3C 800E288C 44810000 */  mtc1      $at, $f0
/* 7BD40 800E2890 00031080 */  sll       $v0, $v1, 2
/* 7BD44 800E2894 00431021 */  addu      $v0, $v0, $v1
/* 7BD48 800E2898 00021080 */  sll       $v0, $v0, 2
/* 7BD4C 800E289C 00431023 */  subu      $v0, $v0, $v1
/* 7BD50 800E28A0 000218C0 */  sll       $v1, $v0, 3
/* 7BD54 800E28A4 00431021 */  addu      $v0, $v0, $v1
/* 7BD58 800E28A8 000210C0 */  sll       $v0, $v0, 3
/* 7BD5C 800E28AC 46001081 */  sub.s     $f2, $f2, $f0
/* 7BD60 800E28B0 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 7BD64 800E28B4 00220821 */  addu      $at, $at, $v0
/* 7BD68 800E28B8 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 7BD6C 800E28BC 46001080 */  add.s     $f2, $f2, $f0
/* 7BD70 800E28C0 27A50020 */  addiu     $a1, $sp, 0x20
.L800E28C4:
/* 7BD74 800E28C4 27A2002C */  addiu     $v0, $sp, 0x2C
/* 7BD78 800E28C8 27A60024 */  addiu     $a2, $sp, 0x24
/* 7BD7C 800E28CC 27A70028 */  addiu     $a3, $sp, 0x28
/* 7BD80 800E28D0 E7A20018 */  swc1      $f2, 0x18($sp)
/* 7BD84 800E28D4 AFA20010 */  sw        $v0, 0x10($sp)
/* 7BD88 800E28D8 0C0379F9 */  jal       player_raycast_up_corners
/* 7BD8C 800E28DC E7A20014 */   swc1     $f2, 0x14($sp)
/* 7BD90 800E28E0 0040802D */  daddu     $s0, $v0, $zero
/* 7BD94 800E28E4 06000030 */  bltz      $s0, .L800E29A8
/* 7BD98 800E28E8 A6500008 */   sh       $s0, 0x8($s2)
/* 7BD9C 800E28EC 922200B4 */  lbu       $v0, 0xB4($s1)
/* 7BDA0 800E28F0 2442FFF8 */  addiu     $v0, $v0, -0x8
/* 7BDA4 800E28F4 2C420002 */  sltiu     $v0, $v0, 0x2
/* 7BDA8 800E28F8 1440002C */  bnez      $v0, .L800E29AC
/* 7BDAC 800E28FC 0200102D */   daddu    $v0, $s0, $zero
/* 7BDB0 800E2900 86420002 */  lh        $v0, 0x2($s2)
/* 7BDB4 800E2904 04410029 */  bgez      $v0, .L800E29AC
/* 7BDB8 800E2908 0200102D */   daddu    $v0, $s0, $zero
/* 7BDBC 800E290C C6200070 */  lwc1      $f0, 0x70($s1)
/* 7BDC0 800E2910 4600A000 */  add.s     $f0, $f20, $f0
/* 7BDC4 800E2914 C7A2002C */  lwc1      $f2, 0x2C($sp)
/* 7BDC8 800E2918 46000005 */  abs.s     $f0, $f0
/* 7BDCC 800E291C 4600103E */  c.le.s    $f2, $f0
/* 7BDD0 800E2920 00000000 */  nop
/* 7BDD4 800E2924 45000020 */  bc1f      .L800E29A8
/* 7BDD8 800E2928 32024000 */   andi     $v0, $s0, 0x4000
/* 7BDDC 800E292C 10400006 */  beqz      $v0, .L800E2948
/* 7BDE0 800E2930 00000000 */   nop
/* 7BDE4 800E2934 0C0441A9 */  jal       get_entity_type
/* 7BDE8 800E2938 0200202D */   daddu    $a0, $s0, $zero
/* 7BDEC 800E293C 2403000D */  addiu     $v1, $zero, 0xD
/* 7BDF0 800E2940 1043001A */  beq       $v0, $v1, .L800E29AC
/* 7BDF4 800E2944 0200102D */   daddu    $v0, $s0, $zero
.L800E2948:
/* 7BDF8 800E2948 862200B0 */  lh        $v0, 0xB0($s1)
/* 7BDFC 800E294C 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 7BE00 800E2950 44810000 */  mtc1      $at, $f0
/* 7BE04 800E2954 3C014040 */  lui       $at, (0x40400000 >> 16)
/* 7BE08 800E2958 44812000 */  mtc1      $at, $f4
/* 7BE0C 800E295C 44821000 */  mtc1      $v0, $f2
/* 7BE10 800E2960 00000000 */  nop
/* 7BE14 800E2964 468010A0 */  cvt.s.w   $f2, $f2
/* 7BE18 800E2968 46001083 */  div.s     $f2, $f2, $f0
/* 7BE1C 800E296C 46041082 */  mul.s     $f2, $f2, $f4
/* 7BE20 800E2970 00000000 */  nop
/* 7BE24 800E2974 C7A00024 */  lwc1      $f0, 0x24($sp)
/* 7BE28 800E2978 46020001 */  sub.s     $f0, $f0, $f2
/* 7BE2C 800E297C 822300B4 */  lb        $v1, 0xB4($s1)
/* 7BE30 800E2980 2402000F */  addiu     $v0, $zero, 0xF
/* 7BE34 800E2984 10620008 */  beq       $v1, $v0, .L800E29A8
/* 7BE38 800E2988 E620002C */   swc1     $f0, 0x2C($s1)
/* 7BE3C 800E298C 2402000D */  addiu     $v0, $zero, 0xD
/* 7BE40 800E2990 10620006 */  beq       $v1, $v0, .L800E29AC
/* 7BE44 800E2994 0200102D */   daddu    $v0, $s0, $zero
/* 7BE48 800E2998 AE200070 */  sw        $zero, 0x70($s1)
/* 7BE4C 800E299C AE200074 */  sw        $zero, 0x74($s1)
/* 7BE50 800E29A0 AE200078 */  sw        $zero, 0x78($s1)
/* 7BE54 800E29A4 AE20007C */  sw        $zero, 0x7C($s1)
.L800E29A8:
/* 7BE58 800E29A8 0200102D */  daddu     $v0, $s0, $zero
.L800E29AC:
/* 7BE5C 800E29AC 8FBF003C */  lw        $ra, 0x3C($sp)
/* 7BE60 800E29B0 8FB20038 */  lw        $s2, 0x38($sp)
/* 7BE64 800E29B4 8FB10034 */  lw        $s1, 0x34($sp)
/* 7BE68 800E29B8 8FB00030 */  lw        $s0, 0x30($sp)
/* 7BE6C 800E29BC D7B40040 */  ldc1      $f20, 0x40($sp)
/* 7BE70 800E29C0 03E00008 */  jr        $ra
/* 7BE74 800E29C4 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

s32 collision_main_above(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    CollisionStatus* collisionStatus = &gCollisionStatus;
    f32 x, y, z;
    f32 new_var;
    f32 moveAngle;
    f32 moveMagnitude;
    f32 sp2C;
    s32 hitResult;
    f32 phi_f2;

    new_var = sp2C = playerStatus->colliderHeight * 0.5f;
    x = playerStatus->position.x;
    y = playerStatus->position.y + new_var;
    z = playerStatus->position.z;

    player_input_to_move_vector(&moveAngle, &moveMagnitude);

    if (moveMagnitude != 0.0f) {
        phi_f2 = playerStatus->targetYaw;
    } else {
        phi_f2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw;
    }

    moveAngle = phi_f2;
    hitResult = player_raycast_up_corners(playerStatus, &x, &y, &z, &sp2C, moveAngle);
    collisionStatus->currentCeiling = hitResult;

    if (hitResult >= 0) {
        if (playerStatus->actionState != ACTION_STATE_FALLING
            && playerStatus->actionState != ACTION_STATE_STEP_DOWN
            && collisionStatus->currentFloor <= NO_COLLIDER
        ) {
            if (sp2C <= fabsf(new_var + playerStatus->gravityIntegrator[0])) {
                do {
                    if ((hitResult & COLLISION_WITH_ENTITY_BIT) && get_entity_type(hitResult) == ENTITY_TYPE_BRICK_BLOCK) {
                        return hitResult;
                    }
                } while (0);

                playerStatus->position.y = y - ((playerStatus->colliderHeight / 5.0f) * 3.0f);
                if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP
                    && playerStatus->actionState != ACTION_STATE_SPIN_JUMP
                ) {
                    playerStatus->gravityIntegrator[0] = 0.0f;
                    playerStatus->gravityIntegrator[1] = 0.0f;
                    playerStatus->gravityIntegrator[2] = 0.0f;
                    playerStatus->gravityIntegrator[3] = 0.0f;
                }
            }
        }
    }

    return hitResult;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel energy_in_out_update
/* 3D5740 E00D6720 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 3D5744 E00D6724 AFB20018 */  sw        $s2, 0x18($sp)
/* 3D5748 E00D6728 0080902D */  daddu     $s2, $a0, $zero
/* 3D574C E00D672C AFBF001C */  sw        $ra, 0x1C($sp)
/* 3D5750 E00D6730 AFB10014 */  sw        $s1, 0x14($sp)
/* 3D5754 E00D6734 AFB00010 */  sw        $s0, 0x10($sp)
/* 3D5758 E00D6738 F7B40020 */  sdc1      $f20, 0x20($sp)
/* 3D575C E00D673C 8E430000 */  lw        $v1, 0x0($s2)
/* 3D5760 E00D6740 8E44000C */  lw        $a0, 0xC($s2)
/* 3D5764 E00D6744 30620010 */  andi      $v0, $v1, 0x10
/* 3D5768 E00D6748 10400005 */  beqz      $v0, .LE00D6760
/* 3D576C E00D674C 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3D5770 E00D6750 00621024 */  and       $v0, $v1, $v0
/* 3D5774 E00D6754 AE420000 */  sw        $v0, 0x0($s2)
/* 3D5778 E00D6758 24020010 */  addiu     $v0, $zero, 0x10
/* 3D577C E00D675C AC820010 */  sw        $v0, 0x10($a0)
.LE00D6760:
/* 3D5780 E00D6760 8C830010 */  lw        $v1, 0x10($a0)
/* 3D5784 E00D6764 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3D5788 E00D6768 10400002 */  beqz      $v0, .LE00D6774
/* 3D578C E00D676C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3D5790 E00D6770 AC820010 */  sw        $v0, 0x10($a0)
.LE00D6774:
/* 3D5794 E00D6774 8C820014 */  lw        $v0, 0x14($a0)
/* 3D5798 E00D6778 8C830010 */  lw        $v1, 0x10($a0)
/* 3D579C E00D677C 24450001 */  addiu     $a1, $v0, 0x1
/* 3D57A0 E00D6780 04610005 */  bgez      $v1, .LE00D6798
/* 3D57A4 E00D6784 AC850014 */   sw       $a1, 0x14($a0)
/* 3D57A8 E00D6788 0C080128 */  jal       shim_remove_effect
/* 3D57AC E00D678C 0240202D */   daddu    $a0, $s2, $zero
/* 3D57B0 E00D6790 08035A48 */  j         .LE00D6920
/* 3D57B4 E00D6794 00000000 */   nop
.LE00D6798:
/* 3D57B8 E00D6798 28620010 */  slti      $v0, $v1, 0x10
/* 3D57BC E00D679C 10400002 */  beqz      $v0, .LE00D67A8
/* 3D57C0 E00D67A0 00031100 */   sll      $v0, $v1, 4
/* 3D57C4 E00D67A4 AC820024 */  sw        $v0, 0x24($a0)
.LE00D67A8:
/* 3D57C8 E00D67A8 28A20010 */  slti      $v0, $a1, 0x10
/* 3D57CC E00D67AC 10400003 */  beqz      $v0, .LE00D67BC
/* 3D57D0 E00D67B0 00051100 */   sll      $v0, $a1, 4
/* 3D57D4 E00D67B4 2442000F */  addiu     $v0, $v0, 0xF
/* 3D57D8 E00D67B8 AC820024 */  sw        $v0, 0x24($a0)
.LE00D67BC:
/* 3D57DC E00D67BC 8E420008 */  lw        $v0, 0x8($s2)
/* 3D57E0 E00D67C0 24110001 */  addiu     $s1, $zero, 0x1
/* 3D57E4 E00D67C4 0222102A */  slt       $v0, $s1, $v0
/* 3D57E8 E00D67C8 10400055 */  beqz      $v0, .LE00D6920
/* 3D57EC E00D67CC 24840048 */   addiu    $a0, $a0, 0x48
/* 3D57F0 E00D67D0 4480A000 */  mtc1      $zero, $f20
/* 3D57F4 E00D67D4 24900024 */  addiu     $s0, $a0, 0x24
.LE00D67D8:
/* 3D57F8 E00D67D8 8E02FFF0 */  lw        $v0, -0x10($s0)
/* 3D57FC E00D67DC 8E03FFEC */  lw        $v1, -0x14($s0)
/* 3D5800 E00D67E0 24420001 */  addiu     $v0, $v0, 0x1
/* 3D5804 E00D67E4 AE02FFF0 */  sw        $v0, -0x10($s0)
/* 3D5808 E00D67E8 0043102A */  slt       $v0, $v0, $v1
/* 3D580C E00D67EC 14400016 */  bnez      $v0, .LE00D6848
/* 3D5810 E00D67F0 00000000 */   nop
/* 3D5814 E00D67F4 C6020014 */  lwc1      $f2, 0x14($s0)
/* 3D5818 E00D67F8 4614103C */  c.lt.s    $f2, $f20
/* 3D581C E00D67FC 00000000 */  nop
/* 3D5820 E00D6800 4500000A */  bc1f      .LE00D682C
/* 3D5824 E00D6804 AE00FFF0 */   sw       $zero, -0x10($s0)
/* 3D5828 E00D6808 0060102D */  daddu     $v0, $v1, $zero
/* 3D582C E00D680C 00021023 */  negu      $v0, $v0
/* 3D5830 E00D6810 44820000 */  mtc1      $v0, $f0
/* 3D5834 E00D6814 00000000 */  nop
/* 3D5838 E00D6818 46800020 */  cvt.s.w   $f0, $f0
/* 3D583C E00D681C 46020002 */  mul.s     $f0, $f0, $f2
/* 3D5840 E00D6820 00000000 */  nop
/* 3D5844 E00D6824 08035A0C */  j         .LE00D6830
/* 3D5848 E00D6828 E600FFE0 */   swc1     $f0, -0x20($s0)
.LE00D682C:
/* 3D584C E00D682C E614FFE0 */  swc1      $f20, -0x20($s0)
.LE00D6830:
/* 3D5850 E00D6830 0C080138 */  jal       shim_rand_int
/* 3D5854 E00D6834 24040167 */   addiu    $a0, $zero, 0x167
/* 3D5858 E00D6838 44820000 */  mtc1      $v0, $f0
/* 3D585C E00D683C 00000000 */  nop
/* 3D5860 E00D6840 46800020 */  cvt.s.w   $f0, $f0
/* 3D5864 E00D6844 E6000018 */  swc1      $f0, 0x18($s0)
.LE00D6848:
/* 3D5868 E00D6848 8E03FFF0 */  lw        $v1, -0x10($s0)
/* 3D586C E00D684C 00031040 */  sll       $v0, $v1, 1
/* 3D5870 E00D6850 00431021 */  addu      $v0, $v0, $v1
/* 3D5874 E00D6854 00021900 */  sll       $v1, $v0, 4
/* 3D5878 E00D6858 00621823 */  subu      $v1, $v1, $v0
/* 3D587C E00D685C 8E02FFEC */  lw        $v0, -0x14($s0)
/* 3D5880 E00D6860 00031880 */  sll       $v1, $v1, 2
/* 3D5884 E00D6864 14400002 */  bnez      $v0, .LE00D6870
/* 3D5888 E00D6868 0062001A */   div      $zero, $v1, $v0
/* 3D588C E00D686C 0007000D */  break     7
.LE00D6870:
/* 3D5890 E00D6870 2401FFFF */  addiu     $at, $zero, -0x1
/* 3D5894 E00D6874 14410004 */  bne       $v0, $at, .LE00D6888
/* 3D5898 E00D6878 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 3D589C E00D687C 14610002 */  bne       $v1, $at, .LE00D6888
/* 3D58A0 E00D6880 00000000 */   nop
/* 3D58A4 E00D6884 0006000D */  break     6
.LE00D6888:
/* 3D58A8 E00D6888 00001812 */  mflo      $v1
/* 3D58AC E00D688C C604FFE0 */  lwc1      $f4, -0x20($s0)
/* 3D58B0 E00D6890 C6000014 */  lwc1      $f0, 0x14($s0)
/* 3D58B4 E00D6894 C6020018 */  lwc1      $f2, 0x18($s0)
/* 3D58B8 E00D6898 46002100 */  add.s     $f4, $f4, $f0
/* 3D58BC E00D689C C600001C */  lwc1      $f0, 0x1C($s0)
/* 3D58C0 E00D68A0 46001080 */  add.s     $f2, $f2, $f0
/* 3D58C4 E00D68A4 E604FFE0 */  swc1      $f4, -0x20($s0)
/* 3D58C8 E00D68A8 44836000 */  mtc1      $v1, $f12
/* 3D58CC E00D68AC 00000000 */  nop
/* 3D58D0 E00D68B0 46806320 */  cvt.s.w   $f12, $f12
/* 3D58D4 E00D68B4 4614603C */  c.lt.s    $f12, $f20
/* 3D58D8 E00D68B8 00000000 */  nop
/* 3D58DC E00D68BC 45010008 */  bc1t      .LE00D68E0
/* 3D58E0 E00D68C0 E6020018 */   swc1     $f2, 0x18($s0)
/* 3D58E4 E00D68C4 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 3D58E8 E00D68C8 44810000 */  mtc1      $at, $f0
/* 3D58EC E00D68CC 00000000 */  nop
/* 3D58F0 E00D68D0 460C003C */  c.lt.s    $f0, $f12
/* 3D58F4 E00D68D4 00000000 */  nop
/* 3D58F8 E00D68D8 45000003 */  bc1f      .LE00D68E8
/* 3D58FC E00D68DC 00000000 */   nop
.LE00D68E0:
/* 3D5900 E00D68E0 08035A43 */  j         .LE00D690C
/* 3D5904 E00D68E4 AE000000 */   sw       $zero, 0x0($s0)
.LE00D68E8:
/* 3D5908 E00D68E8 0C080140 */  jal       shim_sin_deg
/* 3D590C E00D68EC 00000000 */   nop
/* 3D5910 E00D68F0 3C01437F */  lui       $at, (0x437F0000 >> 16)
/* 3D5914 E00D68F4 44811000 */  mtc1      $at, $f2
/* 3D5918 E00D68F8 00000000 */  nop
/* 3D591C E00D68FC 46020002 */  mul.s     $f0, $f0, $f2
/* 3D5920 E00D6900 00000000 */  nop
/* 3D5924 E00D6904 4600018D */  trunc.w.s $f6, $f0
/* 3D5928 E00D6908 E6060000 */  swc1      $f6, 0x0($s0)
.LE00D690C:
/* 3D592C E00D690C 26310001 */  addiu     $s1, $s1, 0x1
/* 3D5930 E00D6910 8E420008 */  lw        $v0, 0x8($s2)
/* 3D5934 E00D6914 0222102A */  slt       $v0, $s1, $v0
/* 3D5938 E00D6918 1440FFAF */  bnez      $v0, .LE00D67D8
/* 3D593C E00D691C 26100048 */   addiu    $s0, $s0, 0x48
.LE00D6920:
/* 3D5940 E00D6920 8FBF001C */  lw        $ra, 0x1C($sp)
/* 3D5944 E00D6924 8FB20018 */  lw        $s2, 0x18($sp)
/* 3D5948 E00D6928 8FB10014 */  lw        $s1, 0x14($sp)
/* 3D594C E00D692C 8FB00010 */  lw        $s0, 0x10($sp)
/* 3D5950 E00D6930 D7B40020 */  ldc1      $f20, 0x20($sp)
/* 3D5954 E00D6934 03E00008 */  jr        $ra
/* 3D5958 E00D6938 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void energy_in_out_update(EffectInstance* effect) {
    EnergyInOutFXData* part = effect->data.energyInOut;
    s32 unk_10;
    s32 unk_14;
    f32 angle;
    s32 i;

    if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
        effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        part->unk_10 = 16;
    }

    if (part->unk_10 < 1000) {
        part->unk_10--;
    }

    part->unk_14++;
    if (part->unk_10 < 0) {
        shim_remove_effect(effect);
        return;
    }

    unk_10 = part->unk_10;
    unk_14 = part->unk_14;

    if (unk_10 < 16) {
        part->unk_24 = unk_10 * 16;
    }

    if (unk_14 < 16) {
        part->unk_24 = unk_14 * 16 + 15;
    }

    part++;
    for (i = 1; i < effect->numParts; i++, part++) {
        part->unk_14++;
        if (part->unk_14 >= part->unk_10) {
            part->unk_14 = 0;
            if (part->unk_38 < 0.0f) {
                part->pos.x = -part->unk_10 * part->unk_38;
            } else {
                part->pos.x = 0.0f;
            }
            part->unk_3C = shim_rand_int(359);
        }

        part->pos.x += part->unk_38;
        part->unk_3C += part->unk_40;

        angle = (part->unk_14 * 180) / part->unk_10;
        if (angle < 0.0f || angle > 180.0f) {
            part->unk_24 = 0;
        } else {
            part->unk_24 = shim_sin_deg(angle) * 255.0f;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel render_window_root
/* DE1C4 80147AC4 27BDFED0 */  addiu     $sp, $sp, -0x130
/* DE1C8 80147AC8 27A20020 */  addiu     $v0, $sp, 0x20
/* DE1CC 80147ACC 2404FFFF */  addiu     $a0, $zero, -0x1
/* DE1D0 80147AD0 2403003F */  addiu     $v1, $zero, 0x3F
/* DE1D4 80147AD4 AFBF012C */  sw        $ra, 0x12C($sp)
/* DE1D8 80147AD8 AFB20128 */  sw        $s2, 0x128($sp)
/* DE1DC 80147ADC AFB10124 */  sw        $s1, 0x124($sp)
/* DE1E0 80147AE0 AFB00120 */  sw        $s0, 0x120($sp)
.L80147AE4:
/* DE1E4 80147AE4 AC440000 */  sw        $a0, 0x0($v0)
/* DE1E8 80147AE8 2463FFFF */  addiu     $v1, $v1, -0x1
/* DE1EC 80147AEC 0461FFFD */  bgez      $v1, .L80147AE4
/* DE1F0 80147AF0 24420004 */   addiu    $v0, $v0, 0x4
/* DE1F4 80147AF4 0000182D */  daddu     $v1, $zero, $zero
/* DE1F8 80147AF8 3C048016 */  lui       $a0, %hi(gWindows)
/* DE1FC 80147AFC 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
/* DE200 80147B00 27A50020 */  addiu     $a1, $sp, 0x20
.L80147B04:
/* DE204 80147B04 90820000 */  lbu       $v0, 0x0($a0)
/* DE208 80147B08 50400006 */  beql      $v0, $zero, .L80147B24
/* DE20C 80147B0C 24630001 */   addiu    $v1, $v1, 0x1
/* DE210 80147B10 90820001 */  lbu       $v0, 0x1($a0)
/* DE214 80147B14 00021080 */  sll       $v0, $v0, 2
/* DE218 80147B18 00A21021 */  addu      $v0, $a1, $v0
/* DE21C 80147B1C AC430000 */  sw        $v1, 0x0($v0)
/* DE220 80147B20 24630001 */  addiu     $v1, $v1, 0x1
.L80147B24:
/* DE224 80147B24 28620040 */  slti      $v0, $v1, 0x40
/* DE228 80147B28 1440FFF6 */  bnez      $v0, .L80147B04
/* DE22C 80147B2C 24840020 */   addiu    $a0, $a0, 0x20
/* DE230 80147B30 3C06D9FF */  lui       $a2, (0xD9FFFFFF >> 16)
/* DE234 80147B34 34C6FFFF */  ori       $a2, $a2, (0xD9FFFFFF & 0xFFFF)
/* DE238 80147B38 3C050020 */  lui       $a1, (0x200605 >> 16)
/* DE23C 80147B3C 34A50605 */  ori       $a1, $a1, (0x200605 & 0xFFFF)
/* DE240 80147B40 3C07E300 */  lui       $a3, (0xE3000800 >> 16)
/* DE244 80147B44 34E70800 */  ori       $a3, $a3, (0xE3000800 & 0xFFFF)
/* DE248 80147B48 3C09FCFF */  lui       $t1, (0xFCFFFFFF >> 16)
/* DE24C 80147B4C 3529FFFF */  ori       $t1, $t1, (0xFCFFFFFF & 0xFFFF)
/* DE250 80147B50 3C08FFFE */  lui       $t0, (0xFFFE793C >> 16)
/* DE254 80147B54 3508793C */  ori       $t0, $t0, (0xFFFE793C & 0xFFFF)
/* DE258 80147B58 3C0AE200 */  lui       $t2, (0xE2001E01 >> 16)
/* DE25C 80147B5C 354A1E01 */  ori       $t2, $t2, (0xE2001E01 & 0xFFFF)
/* DE260 80147B60 3C0BE300 */  lui       $t3, (0xE3000C0F >> 16)
/* DE264 80147B64 356B0C0F */  ori       $t3, $t3, (0xE3000C0F & 0xFFFF)
/* DE268 80147B68 3C0CDB04 */  lui       $t4, (0xDB040004 >> 16)
/* DE26C 80147B6C 358C0004 */  ori       $t4, $t4, (0xDB040004 & 0xFFFF)
/* DE270 80147B70 3C0DDB04 */  lui       $t5, (0xDB04000C >> 16)
/* DE274 80147B74 35AD000C */  ori       $t5, $t5, (0xDB04000C & 0xFFFF)
/* DE278 80147B78 3C0EDB04 */  lui       $t6, (0xDB040014 >> 16)
/* DE27C 80147B7C 35CE0014 */  ori       $t6, $t6, (0xDB040014 & 0xFFFF)
/* DE280 80147B80 3C0FDB04 */  lui       $t7, (0xDB04001C >> 16)
/* DE284 80147B84 35EF001C */  ori       $t7, $t7, (0xDB04001C & 0xFFFF)
/* DE288 80147B88 3C12FF10 */  lui       $s2, (0xFF10013F >> 16)
/* DE28C 80147B8C 3652013F */  ori       $s2, $s2, (0xFF10013F & 0xFFFF)
/* DE290 80147B90 3C11800A */  lui       $s1, %hi(gMainGfxPos)
/* DE294 80147B94 2631A66C */  addiu     $s1, $s1, %lo(gMainGfxPos)
/* DE298 80147B98 3C02D900 */  lui       $v0, (0xD9000000 >> 16)
/* DE29C 80147B9C 8E300000 */  lw        $s0, 0x0($s1)
/* DE2A0 80147BA0 3C04800A */  lui       $a0, %hi(nuGfxCfb_ptr)
/* DE2A4 80147BA4 8C84A64C */  lw        $a0, %lo(nuGfxCfb_ptr)($a0)
/* DE2A8 80147BA8 0200182D */  daddu     $v1, $s0, $zero
/* DE2AC 80147BAC 26100008 */  addiu     $s0, $s0, 0x8
/* DE2B0 80147BB0 AE300000 */  sw        $s0, 0x0($s1)
/* DE2B4 80147BB4 AC620000 */  sw        $v0, 0x0($v1)
/* DE2B8 80147BB8 26020008 */  addiu     $v0, $s0, 0x8
/* DE2BC 80147BBC AC600004 */  sw        $zero, 0x4($v1)
/* DE2C0 80147BC0 AE220000 */  sw        $v0, 0x0($s1)
/* DE2C4 80147BC4 26020010 */  addiu     $v0, $s0, 0x10
/* DE2C8 80147BC8 AE060000 */  sw        $a2, 0x0($s0)
/* DE2CC 80147BCC AE050004 */  sw        $a1, 0x4($s0)
/* DE2D0 80147BD0 AE220000 */  sw        $v0, 0x0($s1)
/* DE2D4 80147BD4 26020018 */  addiu     $v0, $s0, 0x18
/* DE2D8 80147BD8 AE070008 */  sw        $a3, 0x8($s0)
/* DE2DC 80147BDC AE00000C */  sw        $zero, 0xC($s0)
/* DE2E0 80147BE0 AE220000 */  sw        $v0, 0x0($s1)
/* DE2E4 80147BE4 26020020 */  addiu     $v0, $s0, 0x20
/* DE2E8 80147BE8 AE090010 */  sw        $t1, 0x10($s0)
/* DE2EC 80147BEC AE080014 */  sw        $t0, 0x14($s0)
/* DE2F0 80147BF0 AE220000 */  sw        $v0, 0x0($s1)
/* DE2F4 80147BF4 26020028 */  addiu     $v0, $s0, 0x28
/* DE2F8 80147BF8 AE0A0018 */  sw        $t2, 0x18($s0)
/* DE2FC 80147BFC AE00001C */  sw        $zero, 0x1C($s0)
/* DE300 80147C00 AE220000 */  sw        $v0, 0x0($s1)
/* DE304 80147C04 24022CF0 */  addiu     $v0, $zero, 0x2CF0
/* DE308 80147C08 AE020024 */  sw        $v0, 0x24($s0)
/* DE30C 80147C0C 26020030 */  addiu     $v0, $s0, 0x30
/* DE310 80147C10 24030002 */  addiu     $v1, $zero, 0x2
/* DE314 80147C14 AE0B0020 */  sw        $t3, 0x20($s0)
/* DE318 80147C18 AE220000 */  sw        $v0, 0x0($s1)
/* DE31C 80147C1C 26020038 */  addiu     $v0, $s0, 0x38
/* DE320 80147C20 AE0C0028 */  sw        $t4, 0x28($s0)
/* DE324 80147C24 AE03002C */  sw        $v1, 0x2C($s0)
/* DE328 80147C28 AE220000 */  sw        $v0, 0x0($s1)
/* DE32C 80147C2C 26020040 */  addiu     $v0, $s0, 0x40
/* DE330 80147C30 AE030034 */  sw        $v1, 0x34($s0)
/* DE334 80147C34 3403FFFE */  ori       $v1, $zero, 0xFFFE
/* DE338 80147C38 AE0D0030 */  sw        $t5, 0x30($s0)
/* DE33C 80147C3C AE220000 */  sw        $v0, 0x0($s1)
/* DE340 80147C40 26020048 */  addiu     $v0, $s0, 0x48
/* DE344 80147C44 AE0E0038 */  sw        $t6, 0x38($s0)
/* DE348 80147C48 AE03003C */  sw        $v1, 0x3C($s0)
/* DE34C 80147C4C AE220000 */  sw        $v0, 0x0($s1)
/* DE350 80147C50 26020050 */  addiu     $v0, $s0, 0x50
/* DE354 80147C54 AE0F0040 */  sw        $t7, 0x40($s0)
/* DE358 80147C58 AE030044 */  sw        $v1, 0x44($s0)
/* DE35C 80147C5C AE220000 */  sw        $v0, 0x0($s1)
/* DE360 80147C60 0C0187A4 */  jal       osVirtualToPhysical
/* DE364 80147C64 AE120048 */   sw       $s2, 0x48($s0)
/* DE368 80147C68 8E230000 */  lw        $v1, 0x0($s1)
/* DE36C 80147C6C 27A40020 */  addiu     $a0, $sp, 0x20
/* DE370 80147C70 AE02004C */  sw        $v0, 0x4C($s0)
/* DE374 80147C74 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* DE378 80147C78 0000302D */  daddu     $a2, $zero, $zero
/* DE37C 80147C7C 00C0382D */  daddu     $a3, $a2, $zero
/* DE380 80147C80 0060282D */  daddu     $a1, $v1, $zero
/* DE384 80147C84 24630008 */  addiu     $v1, $v1, 0x8
/* DE388 80147C88 AE230000 */  sw        $v1, 0x0($s1)
/* DE38C 80147C8C ACA20000 */  sw        $v0, 0x0($a1)
/* DE390 80147C90 240200FF */  addiu     $v0, $zero, 0xFF
/* DE394 80147C94 ACA00004 */  sw        $zero, 0x4($a1)
/* DE398 80147C98 2405FFFF */  addiu     $a1, $zero, -0x1
/* DE39C 80147C9C AFA00010 */  sw        $zero, 0x10($sp)
/* DE3A0 80147CA0 AFA20014 */  sw        $v0, 0x14($sp)
/* DE3A4 80147CA4 AFA00018 */  sw        $zero, 0x18($sp)
/* DE3A8 80147CA8 0C051DA6 */  jal       render_windows
/* DE3AC 80147CAC AFA0001C */   sw       $zero, 0x1C($sp)
/* DE3B0 80147CB0 8FBF012C */  lw        $ra, 0x12C($sp)
/* DE3B4 80147CB4 8FB20128 */  lw        $s2, 0x128($sp)
/* DE3B8 80147CB8 8FB10124 */  lw        $s1, 0x124($sp)
/* DE3BC 80147CBC 8FB00120 */  lw        $s0, 0x120($sp)
/* DE3C0 80147CC0 03E00008 */  jr        $ra
/* DE3C4 80147CC4 27BD0130 */   addiu    $sp, $sp, 0x130

### DECOMPILED C INSTRUCTIONS:

void render_window_root(void) {
    s32 priorityArray[ARRAY_COUNT(gWindows)];
    s32* ptr = priorityArray;
    s32 i;
    Window* window;

    for (i = 0; i < ARRAY_COUNT(gWindows); i++) {
        *ptr++ = -1;
    }
    for (i = 0, window = gWindows; i < ARRAY_COUNT(gWindows); window++, i++) {
        if (window->flags != 0) {
            priorityArray[window->priority] = i;
        }
    }

    gSPLoadGeometryMode(gMainGfxPos++, 0);
    gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_SHADING_SMOOTH);
    gDPPipelineMode(gMainGfxPos++, G_PM_NPRIMITIVE);
    gDPSetCombineMode(gMainGfxPos++, G_CC_SHADE, G_CC_SHADE);
    gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
    gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 16, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE);
    gSPClipRatio(gMainGfxPos++, FRUSTRATIO_2);
    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
    gDPPipeSync(gMainGfxPos++);
    render_windows(priorityArray, WINDOW_ID_NONE, 0, 0, 0, 255, 0, NULL);
}