### RAW ASSEMBLY INSTRUCTIONS:

glabel dispatch_damage_event_partner
/* 1AE2AC 8027F9CC 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 1AE2B0 8027F9D0 AFB30024 */  sw        $s3, 0x24($sp)
/* 1AE2B4 8027F9D4 00A0982D */  daddu     $s3, $a1, $zero
/* 1AE2B8 8027F9D8 AFB20020 */  sw        $s2, 0x20($sp)
/* 1AE2BC 8027F9DC 3C12800E */  lui       $s2, %hi(gBattleStatus)
/* 1AE2C0 8027F9E0 2652C070 */  addiu     $s2, $s2, %lo(gBattleStatus)
/* 1AE2C4 8027F9E4 00041400 */  sll       $v0, $a0, 16
/* 1AE2C8 8027F9E8 AFBF002C */  sw        $ra, 0x2C($sp)
/* 1AE2CC 8027F9EC AFB40028 */  sw        $s4, 0x28($sp)
/* 1AE2D0 8027F9F0 AFB1001C */  sw        $s1, 0x1C($sp)
/* 1AE2D4 8027F9F4 AFB00018 */  sw        $s0, 0x18($sp)
/* 1AE2D8 8027F9F8 8E5000DC */  lw        $s0, 0xDC($s2)
/* 1AE2DC 8027F9FC 00022C03 */  sra       $a1, $v0, 16
/* 1AE2E0 8027FA00 A644017E */  sh        $a0, 0x17E($s2)
/* 1AE2E4 8027FA04 960301FA */  lhu       $v1, 0x1FA($s0)
/* 1AE2E8 8027FA08 2402007F */  addiu     $v0, $zero, 0x7F
/* 1AE2EC 8027FA0C A20201B8 */  sb        $v0, 0x1B8($s0)
/* 1AE2F0 8027FA10 00651821 */  addu      $v1, $v1, $a1
/* 1AE2F4 8027FA14 00031400 */  sll       $v0, $v1, 16
/* 1AE2F8 8027FA18 00022C03 */  sra       $a1, $v0, 16
/* 1AE2FC 8027FA1C 960201FC */  lhu       $v0, 0x1FC($s0)
/* 1AE300 8027FA20 00C0A02D */  daddu     $s4, $a2, $zero
/* 1AE304 8027FA24 A60301FA */  sh        $v1, 0x1FA($s0)
/* 1AE308 8027FA28 00651823 */  subu      $v1, $v1, $a1
/* 1AE30C 8027FA2C A60301FA */  sh        $v1, 0x1FA($s0)
/* 1AE310 8027FA30 00451021 */  addu      $v0, $v0, $a1
/* 1AE314 8027FA34 A60201FC */  sh        $v0, 0x1FC($s0)
/* 1AE318 8027FA38 A6400180 */  sh        $zero, 0x180($s2)
/* 1AE31C 8027FA3C 920201B8 */  lbu       $v0, 0x1B8($s0)
/* 1AE320 8027FA40 00451023 */  subu      $v0, $v0, $a1
/* 1AE324 8027FA44 A20201B8 */  sb        $v0, 0x1B8($s0)
/* 1AE328 8027FA48 00021600 */  sll       $v0, $v0, 24
/* 1AE32C 8027FA4C 00021E03 */  sra       $v1, $v0, 24
/* 1AE330 8027FA50 1C600006 */  bgtz      $v1, .L8027FA6C
/* 1AE334 8027FA54 2611000C */   addiu    $s1, $s0, 0xC
/* 1AE338 8027FA58 96420180 */  lhu       $v0, 0x180($s2)
/* 1AE33C 8027FA5C 24130020 */  addiu     $s3, $zero, 0x20
/* 1AE340 8027FA60 00431021 */  addu      $v0, $v0, $v1
/* 1AE344 8027FA64 A6420180 */  sh        $v0, 0x180($s2)
/* 1AE348 8027FA68 A20001B8 */  sb        $zero, 0x1B8($s0)
.L8027FA6C:
/* 1AE34C 8027FA6C 96420180 */  lhu       $v0, 0x180($s2)
/* 1AE350 8027FA70 00451021 */  addu      $v0, $v0, $a1
/* 1AE354 8027FA74 A6420180 */  sh        $v0, 0x180($s2)
/* 1AE358 8027FA78 A60201F8 */  sh        $v0, 0x1F8($s0)
/* 1AE35C 8027FA7C 8E420000 */  lw        $v0, 0x0($s2)
/* 1AE360 8027FA80 30420020 */  andi      $v0, $v0, 0x20
/* 1AE364 8027FA84 10400007 */  beqz      $v0, .L8027FAA4
/* 1AE368 8027FA88 A240019A */   sb       $zero, 0x19A($s2)
/* 1AE36C 8027FA8C 24020009 */  addiu     $v0, $zero, 0x9
/* 1AE370 8027FA90 52620001 */  beql      $s3, $v0, .L8027FA98
/* 1AE374 8027FA94 2413000A */   addiu    $s3, $zero, 0xA
.L8027FA98:
/* 1AE378 8027FA98 24020017 */  addiu     $v0, $zero, 0x17
/* 1AE37C 8027FA9C 52620001 */  beql      $s3, $v0, .L8027FAA4
/* 1AE380 8027FAA0 24130019 */   addiu    $s3, $zero, 0x19
.L8027FAA4:
/* 1AE384 8027FAA4 86420180 */  lh        $v0, 0x180($s2)
/* 1AE388 8027FAA8 18400009 */  blez      $v0, .L8027FAD0
/* 1AE38C 8027FAAC 0200202D */   daddu    $a0, $s0, $zero
/* 1AE390 8027FAB0 2405000D */  addiu     $a1, $zero, 0xD
/* 1AE394 8027FAB4 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1AE398 8027FAB8 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1AE39C 8027FABC 8C620000 */  lw        $v0, 0x0($v1)
/* 1AE3A0 8027FAC0 86460180 */  lh        $a2, 0x180($s2)
/* 1AE3A4 8027FAC4 34420020 */  ori       $v0, $v0, 0x20
/* 1AE3A8 8027FAC8 0C0997D0 */  jal       inflict_status
/* 1AE3AC 8027FACC AC620000 */   sw       $v0, 0x0($v1)
.L8027FAD0:
/* 1AE3B0 8027FAD0 16800006 */  bnez      $s4, .L8027FAEC
/* 1AE3B4 8027FAD4 24020001 */   addiu    $v0, $zero, 0x1
/* 1AE3B8 8027FAD8 0220202D */  daddu     $a0, $s1, $zero
/* 1AE3BC 8027FADC 24050100 */  addiu     $a1, $zero, 0x100
/* 1AE3C0 8027FAE0 0C09A5D5 */  jal       set_goal_pos_to_part
/* 1AE3C4 8027FAE4 0000302D */   daddu    $a2, $zero, $zero
/* 1AE3C8 8027FAE8 24020001 */  addiu     $v0, $zero, 0x1
.L8027FAEC:
/* 1AE3CC 8027FAEC AFA20010 */  sw        $v0, 0x10($sp)
/* 1AE3D0 8027FAF0 8E260014 */  lw        $a2, 0x14($s1)
/* 1AE3D4 8027FAF4 86470180 */  lh        $a3, 0x180($s2)
/* 1AE3D8 8027FAF8 C62C000C */  lwc1      $f12, 0xC($s1)
/* 1AE3DC 8027FAFC 0C09996B */  jal       show_next_damage_popup
/* 1AE3E0 8027FB00 C62E0010 */   lwc1     $f14, 0x10($s1)
/* 1AE3E4 8027FB04 86420180 */  lh        $v0, 0x180($s2)
/* 1AE3E8 8027FB08 AFA20010 */  sw        $v0, 0x10($sp)
/* 1AE3EC 8027FB0C 8E25000C */  lw        $a1, 0xC($s1)
/* 1AE3F0 8027FB10 8E260010 */  lw        $a2, 0x10($s1)
/* 1AE3F4 8027FB14 8E270014 */  lw        $a3, 0x14($s1)
/* 1AE3F8 8027FB18 0C0999B9 */  jal       show_damage_fx
/* 1AE3FC 8027FB1C 0200202D */   daddu    $a0, $s0, $zero
/* 1AE400 8027FB20 86420180 */  lh        $v0, 0x180($s2)
/* 1AE404 8027FB24 18400003 */  blez      $v0, .L8027FB34
/* 1AE408 8027FB28 0200202D */   daddu    $a0, $s0, $zero
/* 1AE40C 8027FB2C 0C099C06 */  jal       func_80267018
/* 1AE410 8027FB30 24050001 */   addiu    $a1, $zero, 0x1
.L8027FB34:
/* 1AE414 8027FB34 8E020000 */  lw        $v0, 0x0($s0)
/* 1AE418 8027FB38 3C030008 */  lui       $v1, (0x80000 >> 16)
/* 1AE41C 8027FB3C 00431025 */  or        $v0, $v0, $v1
/* 1AE420 8027FB40 AE020000 */  sw        $v0, 0x0($s0)
/* 1AE424 8027FB44 3C10800E */  lui       $s0, %hi(gBattleStatus)
/* 1AE428 8027FB48 8E10C070 */  lw        $s0, %lo(gBattleStatus)($s0)
/* 1AE42C 8027FB4C 0260202D */  daddu     $a0, $s3, $zero
/* 1AE430 8027FB50 32100240 */  andi      $s0, $s0, 0x240
/* 1AE434 8027FB54 0C09F7A0 */  jal       dispatch_event_partner
/* 1AE438 8027FB58 0010802B */   sltu     $s0, $zero, $s0
/* 1AE43C 8027FB5C 0200102D */  daddu     $v0, $s0, $zero
/* 1AE440 8027FB60 8FBF002C */  lw        $ra, 0x2C($sp)
/* 1AE444 8027FB64 8FB40028 */  lw        $s4, 0x28($sp)
/* 1AE448 8027FB68 8FB30024 */  lw        $s3, 0x24($sp)
/* 1AE44C 8027FB6C 8FB20020 */  lw        $s2, 0x20($sp)
/* 1AE450 8027FB70 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1AE454 8027FB74 8FB00018 */  lw        $s0, 0x18($sp)
/* 1AE458 8027FB78 03E00008 */  jr        $ra
/* 1AE45C 8027FB7C 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

s32 dispatch_damage_event_partner(s32 damageAmount, s32 event, s32 stopMotion) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* partner = battleStatus->partnerActor;
    ActorState* state = &partner->state;
    s32 hpChange;
    s32 flagCheck;

    battleStatus->currentAttackDamage = damageAmount;

    hpChange = (s16)damageAmount;
    partner->hpChangeCounter += hpChange;

    hpChange = partner->hpChangeCounter;
    partner->currentHP = 127;
    partner->damageCounter += hpChange;
    partner->hpChangeCounter -= hpChange;
    battleStatus->lastAttackDamage = 0;
    partner->currentHP -= hpChange;

    if (partner->currentHP <= 0) {
        event = EVENT_DEATH;
        battleStatus->lastAttackDamage += partner->currentHP;
        partner->currentHP = 0;
    }

    battleStatus->lastAttackDamage += hpChange;
    partner->lastDamageTaken = battleStatus->lastAttackDamage;
    battleStatus->currentDamageSource = DMG_SRC_DEFAULT;
    if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) {
        if (event == EVENT_HIT_COMBO) {
            event = EVENT_HIT;
        }
        if (event == EVENT_ZERO_DAMAGE) {
            event = EVENT_IMMUNE;
        }
    }

    if (battleStatus->lastAttackDamage > 0) {
        gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;

        inflict_status(partner, STATUS_KEY_DAZE, battleStatus->lastAttackDamage);
    }

    if (!stopMotion) {
        set_goal_pos_to_part(state, ACTOR_PARTNER, 0);
    }

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

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

    partner->flags |= ACTOR_FLAG_HEALTH_BAR_HIDDEN;

    flagCheck = (gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40)) != 0;
    dispatch_event_partner(event);
    return flagCheck;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel corrupted_init
/* 48480 8006D080 27BDFED0 */  addiu     $sp, $sp, -0x130
/* 48484 8006D084 AFB20118 */  sw        $s2, 0x118($sp)
/* 48488 8006D088 00809021 */  addu      $s2, $a0, $zero
/* 4848C 8006D08C AFB40120 */  sw        $s4, 0x120($sp)
/* 48490 8006D090 00A0A021 */  addu      $s4, $a1, $zero
/* 48494 8006D094 240500FF */  addiu     $a1, $zero, 0xFF
/* 48498 8006D098 268200FF */  addiu     $v0, $s4, 0xFF
/* 4849C 8006D09C AFBF012C */  sw        $ra, 0x12C($sp)
/* 484A0 8006D0A0 AFB60128 */  sw        $s6, 0x128($sp)
/* 484A4 8006D0A4 AFB50124 */  sw        $s5, 0x124($sp)
/* 484A8 8006D0A8 AFB3011C */  sw        $s3, 0x11C($sp)
/* 484AC 8006D0AC AFB10114 */  sw        $s1, 0x114($sp)
/* 484B0 8006D0B0 AFB00110 */  sw        $s0, 0x110($sp)
.L8006D0B4:
/* 484B4 8006D0B4 A0400101 */  sb        $zero, 0x101($v0)
/* 484B8 8006D0B8 24A5FFFF */  addiu     $a1, $a1, -0x1
/* 484BC 8006D0BC 04A1FFFD */  bgez      $a1, .L8006D0B4
/* 484C0 8006D0C0 2442FFFF */   addiu    $v0, $v0, -0x1
/* 484C4 8006D0C4 240200FF */  addiu     $v0, $zero, 0xFF
/* 484C8 8006D0C8 A2820100 */  sb        $v0, 0x100($s4)
/* 484CC 8006D0CC 92420064 */  lbu       $v0, 0x64($s2)
/* 484D0 8006D0D0 10400036 */  beqz      $v0, .L8006D1AC
/* 484D4 8006D0D4 00009821 */   addu     $s3, $zero, $zero
/* 484D8 8006D0D8 27B50010 */  addiu     $s5, $sp, 0x10
/* 484DC 8006D0DC 24160001 */  addiu     $s6, $zero, 0x1
/* 484E0 8006D0E0 327000FF */  andi      $s0, $s3, 0xFF
.L8006D0E4:
/* 484E4 8006D0E4 16000002 */  bnez      $s0, .L8006D0F0
/* 484E8 8006D0E8 24110001 */   addiu    $s1, $zero, 0x1
/* 484EC 8006D0EC 8E510060 */  lw        $s1, 0x60($s2)
.L8006D0F0:
/* 484F0 8006D0F0 02402021 */  addu      $a0, $s2, $zero
/* 484F4 8006D0F4 27A50010 */  addiu     $a1, $sp, 0x10
/* 484F8 8006D0F8 00003021 */  addu      $a2, $zero, $zero
/* 484FC 8006D0FC 0C01A7A3 */  jal       __osPfsRWInode
/* 48500 8006D100 02003821 */   addu     $a3, $s0, $zero
/* 48504 8006D104 00402021 */  addu      $a0, $v0, $zero
/* 48508 8006D108 0004182B */  sltu      $v1, $zero, $a0
/* 4850C 8006D10C 38820003 */  xori      $v0, $a0, 0x3
/* 48510 8006D110 0002102B */  sltu      $v0, $zero, $v0
/* 48514 8006D114 00621824 */  and       $v1, $v1, $v0
/* 48518 8006D118 14600025 */  bnez      $v1, .L8006D1B0
/* 4851C 8006D11C 00801021 */   addu     $v0, $a0, $zero
/* 48520 8006D120 02202821 */  addu      $a1, $s1, $zero
/* 48524 8006D124 28A20080 */  slti      $v0, $a1, 0x80
/* 48528 8006D128 1040001A */  beqz      $v0, .L8006D194
/* 4852C 8006D12C 32020007 */   andi     $v0, $s0, 0x7
/* 48530 8006D130 02003821 */  addu      $a3, $s0, $zero
/* 48534 8006D134 00564004 */  sllv      $t0, $s6, $v0
/* 48538 8006D138 00051040 */  sll       $v0, $a1, 1
/* 4853C 8006D13C 00553021 */  addu      $a2, $v0, $s5
.L8006D140:
/* 48540 8006D140 94C40000 */  lhu       $a0, 0x0($a2)
/* 48544 8006D144 8E420060 */  lw        $v0, 0x60($s2)
/* 48548 8006D148 3083FFFF */  andi      $v1, $a0, 0xFFFF
/* 4854C 8006D14C 0062102A */  slt       $v0, $v1, $v0
/* 48550 8006D150 1440000D */  bnez      $v0, .L8006D188
/* 48554 8006D154 24A50001 */   addiu    $a1, $a1, 0x1
/* 48558 8006D158 00031A02 */  srl       $v1, $v1, 8
/* 4855C 8006D15C 1067000A */  beq       $v1, $a3, .L8006D188
/* 48560 8006D160 00000000 */   nop
/* 48564 8006D164 3082007F */  andi      $v0, $a0, 0x7F
/* 48568 8006D168 00021082 */  srl       $v0, $v0, 2
/* 4856C 8006D16C 30630007 */  andi      $v1, $v1, 0x7
/* 48570 8006D170 00031940 */  sll       $v1, $v1, 5
/* 48574 8006D174 00431021 */  addu      $v0, $v0, $v1
/* 48578 8006D178 02821021 */  addu      $v0, $s4, $v0
/* 4857C 8006D17C 90430101 */  lbu       $v1, 0x101($v0)
/* 48580 8006D180 00681825 */  or        $v1, $v1, $t0
/* 48584 8006D184 A0430101 */  sb        $v1, 0x101($v0)
.L8006D188:
/* 48588 8006D188 28A20080 */  slti      $v0, $a1, 0x80
/* 4858C 8006D18C 1440FFEC */  bnez      $v0, .L8006D140
/* 48590 8006D190 24C60002 */   addiu    $a2, $a2, 0x2
.L8006D194:
/* 48594 8006D194 92430064 */  lbu       $v1, 0x64($s2)
/* 48598 8006D198 26730001 */  addiu     $s3, $s3, 0x1
/* 4859C 8006D19C 326200FF */  andi      $v0, $s3, 0xFF
/* 485A0 8006D1A0 0043102B */  sltu      $v0, $v0, $v1
/* 485A4 8006D1A4 1440FFCF */  bnez      $v0, .L8006D0E4
/* 485A8 8006D1A8 327000FF */   andi     $s0, $s3, 0xFF
.L8006D1AC:
/* 485AC 8006D1AC 00001021 */  addu      $v0, $zero, $zero
.L8006D1B0:
/* 485B0 8006D1B0 8FBF012C */  lw        $ra, 0x12C($sp)
/* 485B4 8006D1B4 8FB60128 */  lw        $s6, 0x128($sp)
/* 485B8 8006D1B8 8FB50124 */  lw        $s5, 0x124($sp)
/* 485BC 8006D1BC 8FB40120 */  lw        $s4, 0x120($sp)
/* 485C0 8006D1C0 8FB3011C */  lw        $s3, 0x11C($sp)
/* 485C4 8006D1C4 8FB20118 */  lw        $s2, 0x118($sp)
/* 485C8 8006D1C8 8FB10114 */  lw        $s1, 0x114($sp)
/* 485CC 8006D1CC 8FB00110 */  lw        $s0, 0x110($sp)
/* 485D0 8006D1D0 03E00008 */  jr        $ra
/* 485D4 8006D1D4 27BD0130 */   addiu    $sp, $sp, 0x130

### DECOMPILED C INSTRUCTIONS:

    if ((ret = corrupted_init(pfs, &cache)) != 0) {
        return ret;
    }

    for (j = 0; j < pfs->dir_size; j++) {
        if ((ret = __osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tempDir)) != 0) {
            return ret;
        }
        if ((tempDir.company_code != 0) || (tempDir.game_code != 0)) {
            if ((tempDir.company_code == 0) || (tempDir.game_code == 0)) {
                cc = -1;
            } else {
                next = tempDir.start_page;
                cl = cc = 0;
                bank = 255;

                while (CHECK_IPAGE(next)) {
                    if (bank != next.inode_t.bank) {
                        bank = next.inode_t.bank;
                        if (prevBank != bank) {
                            ret = __osPfsRWInode(pfs, &tempInode, PFS_READ, bank);
                            prevBank = bank;
                        }
                        if ((ret != 0) && (ret != PFS_ERR_INCONSISTENT)) {
                            return ret;
                        }
                    }
                    if ((cc = corrupted(pfs, next, &cache) - cl) != 0) {
                        break;
                    }
                    cl = 1;
                    next = tempInode.inode_page[next.inode_t.page];
                }
            }
            if ((cc != 0) || (next.ipage != PFS_EOF)) {
                bzero(&tempDir, sizeof(__OSDir));
                if (pfs->activebank != 0) {
                    if ((ret = __osPfsSelectBank(pfs, 0)) != 0) {
                        return ret;
                    }
                }
                if ((ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tempDir, 0)) != 0) {
                    return ret;
                }

                fixed++;
            }
        }
    }

    for (j = 0; j < pfs->dir_size; j++) {
        if ((ret = __osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tempDir)) != 0) {
            return ret;
        }

        if ((tempDir.company_code != 0) && (tempDir.game_code != 0) &&
            (tempDir.start_page.ipage >= (u16)pfs->inode_start_page)) { // cast required
            nextNodeInFile[j].ipage = tempDir.start_page.ipage;
        } else {
            nextNodeInFile[j].ipage = 0;
        }
    }

    for (bank = 0; bank < pfs->banks; bank++) {
        ret = __osPfsRWInode(pfs, &tempInode, PFS_READ, bank);
        if ((ret != 0) && (ret != PFS_ERR_INCONSISTENT)) {
            return (ret);
        }
        offset = ((bank > PFS_ID_BANK_256K) ? 1 : pfs->inode_start_page);
        for (j = 0; j < offset; j++) {
            checkedInode.inode_page[j].ipage = tempInode.inode_page[j].ipage;
        }
        for (; j < PFS_INODE_SIZE_PER_PAGE; j++) {
            checkedInode.inode_page[j].ipage = PFS_PAGE_NOT_USED;
        }

        for (j = 0; j < pfs->dir_size; j++) {
            while (nextNodeInFile[j].inode_t.bank == bank &&
                   nextNodeInFile[j].ipage >= (u16)pfs->inode_start_page) { // cast required
                u8 val;
                val = nextNodeInFile[j].inode_t.page;
                nextNodeInFile[j] = checkedInode.inode_page[val] = tempInode.inode_page[val];
            }
        }
        if ((ret = __osPfsRWInode(pfs, &checkedInode, PFS_WRITE, bank)) != 0) {
            return ret;
        }
    }

    if (fixed != 0) {
        pfs->status |= PFS_CORRUPTED;
    } else {
        pfs->status &= ~PFS_CORRUPTED;
    }
    return 0;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_fx_param_hdl
/* 34CA0 800598A0 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 34CA4 800598A4 00063400 */  sll       $a2, $a2, 16
/* 34CA8 800598A8 00063403 */  sra       $a2, $a2, 16
/* 34CAC 800598AC 2CC20008 */  sltiu     $v0, $a2, 0x8
/* 34CB0 800598B0 1040007D */  beqz      $v0, .L80059AA8
/* 34CB4 800598B4 AFBF0010 */   sw       $ra, 0x10($sp)
/* 34CB8 800598B8 00061080 */  sll       $v0, $a2, 2
/* 34CBC 800598BC 3C01800A */  lui       $at, %hi(jtbl_80098970)
/* 34CC0 800598C0 00220821 */  addu      $at, $at, $v0
/* 34CC4 800598C4 8C228970 */  lw        $v0, %lo(jtbl_80098970)($at)
/* 34CC8 800598C8 00400008 */  jr        $v0
/* 34CCC 800598CC 00000000 */   nop
glabel .L800598D0
/* 34CD0 800598D0 00051400 */  sll       $v0, $a1, 16
/* 34CD4 800598D4 00021403 */  sra       $v0, $v0, 16
/* 34CD8 800598D8 00021840 */  sll       $v1, $v0, 1
/* 34CDC 800598DC 00621821 */  addu      $v1, $v1, $v0
/* 34CE0 800598E0 8C82000C */  lw        $v0, 0xC($a0)
/* 34CE4 800598E4 00031900 */  sll       $v1, $v1, 4
/* 34CE8 800598E8 00621821 */  addu      $v1, $v1, $v0
/* 34CEC 800598EC 2402FFF8 */  addiu     $v0, $zero, -0x8
/* 34CF0 800598F0 00E21024 */  and       $v0, $a3, $v0
/* 34CF4 800598F4 080166AA */  j         .L80059AA8
/* 34CF8 800598F8 AC620000 */   sw       $v0, 0x0($v1)
glabel .L800598FC
/* 34CFC 800598FC 00051400 */  sll       $v0, $a1, 16
/* 34D00 80059900 00021403 */  sra       $v0, $v0, 16
/* 34D04 80059904 00021840 */  sll       $v1, $v0, 1
/* 34D08 80059908 00621821 */  addu      $v1, $v1, $v0
/* 34D0C 8005990C 8C82000C */  lw        $v0, 0xC($a0)
/* 34D10 80059910 00031900 */  sll       $v1, $v1, 4
/* 34D14 80059914 00621821 */  addu      $v1, $v1, $v0
/* 34D18 80059918 2402FFF8 */  addiu     $v0, $zero, -0x8
/* 34D1C 8005991C 00E21024 */  and       $v0, $a3, $v0
/* 34D20 80059920 080166AA */  j         .L80059AA8
/* 34D24 80059924 AC620004 */   sw       $v0, 0x4($v1)
glabel .L80059928
/* 34D28 80059928 00051400 */  sll       $v0, $a1, 16
/* 34D2C 8005992C 00021403 */  sra       $v0, $v0, 16
/* 34D30 80059930 00021840 */  sll       $v1, $v0, 1
/* 34D34 80059934 00621821 */  addu      $v1, $v1, $v0
/* 34D38 80059938 8C82000C */  lw        $v0, 0xC($a0)
/* 34D3C 8005993C 00031900 */  sll       $v1, $v1, 4
/* 34D40 80059940 00621821 */  addu      $v1, $v1, $v0
/* 34D44 80059944 080166AA */  j         .L80059AA8
/* 34D48 80059948 A4670008 */   sh       $a3, 0x8($v1)
glabel .L8005994C
/* 34D4C 8005994C 00051400 */  sll       $v0, $a1, 16
/* 34D50 80059950 00021403 */  sra       $v0, $v0, 16
/* 34D54 80059954 00021840 */  sll       $v1, $v0, 1
/* 34D58 80059958 00621821 */  addu      $v1, $v1, $v0
/* 34D5C 8005995C 8C82000C */  lw        $v0, 0xC($a0)
/* 34D60 80059960 00031900 */  sll       $v1, $v1, 4
/* 34D64 80059964 00621821 */  addu      $v1, $v1, $v0
/* 34D68 80059968 080166AA */  j         .L80059AA8
/* 34D6C 8005996C A467000A */   sh       $a3, 0xA($v1)
glabel .L80059970
/* 34D70 80059970 00051400 */  sll       $v0, $a1, 16
/* 34D74 80059974 00021403 */  sra       $v0, $v0, 16
/* 34D78 80059978 00021840 */  sll       $v1, $v0, 1
/* 34D7C 8005997C 00621821 */  addu      $v1, $v1, $v0
/* 34D80 80059980 8C82000C */  lw        $v0, 0xC($a0)
/* 34D84 80059984 00031900 */  sll       $v1, $v1, 4
/* 34D88 80059988 00621821 */  addu      $v1, $v1, $v0
/* 34D8C 8005998C 080166AA */  j         .L80059AA8
/* 34D90 80059990 A467000C */   sh       $a3, 0xC($v1)
glabel .L80059994
/* 34D94 80059994 00051400 */  sll       $v0, $a1, 16
/* 34D98 80059998 00021403 */  sra       $v0, $v0, 16
/* 34D9C 8005999C 00021840 */  sll       $v1, $v0, 1
/* 34DA0 800599A0 00621821 */  addu      $v1, $v1, $v0
/* 34DA4 800599A4 00031900 */  sll       $v1, $v1, 4
/* 34DA8 800599A8 44870000 */  mtc1      $a3, $f0
/* 34DAC 800599AC 00000000 */  nop
/* 34DB0 800599B0 46800020 */  cvt.s.w   $f0, $f0
/* 34DB4 800599B4 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* 34DB8 800599B8 44811000 */  mtc1      $at, $f2
/* 34DBC 800599BC 8C82000C */  lw        $v0, 0xC($a0)
/* 34DC0 800599C0 3C048008 */  lui       $a0, %hi(gActiveSynDriverPtr)
/* 34DC4 800599C4 8C848E50 */  lw        $a0, %lo(gActiveSynDriverPtr)($a0)
/* 34DC8 800599C8 46020003 */  div.s     $f0, $f0, $f2
/* 34DCC 800599CC 46000021 */  cvt.d.s   $f0, $f0
/* 34DD0 800599D0 46200000 */  add.d     $f0, $f0, $f0
/* 34DD4 800599D4 00621821 */  addu      $v1, $v1, $v0
/* 34DD8 800599D8 C4820008 */  lwc1      $f2, 0x8($a0)
/* 34DDC 800599DC 468010A1 */  cvt.d.w   $f2, $f2
/* 34DE0 800599E0 46220003 */  div.d     $f0, $f0, $f2
/* 34DE4 800599E4 46200020 */  cvt.s.d   $f0, $f0
/* 34DE8 800599E8 080166AA */  j         .L80059AA8
/* 34DEC 800599EC E4600010 */   swc1     $f0, 0x10($v1)
glabel .L800599F0
/* 34DF0 800599F0 00051400 */  sll       $v0, $a1, 16
/* 34DF4 800599F4 00021403 */  sra       $v0, $v0, 16
/* 34DF8 800599F8 00021840 */  sll       $v1, $v0, 1
/* 34DFC 800599FC 00621821 */  addu      $v1, $v1, $v0
/* 34E00 80059A00 00031900 */  sll       $v1, $v1, 4
/* 34E04 80059A04 44870000 */  mtc1      $a3, $f0
/* 34E08 80059A08 00000000 */  nop
/* 34E0C 80059A0C 46800020 */  cvt.s.w   $f0, $f0
/* 34E10 80059A10 46000021 */  cvt.d.s   $f0, $f0
/* 34E14 80059A14 8C82000C */  lw        $v0, 0xC($a0)
/* 34E18 80059A18 3C01800A */  lui       $at, %hi(D_80098990)
/* 34E1C 80059A1C D4228990 */  ldc1      $f2, %lo(D_80098990)($at)
/* 34E20 80059A20 00622021 */  addu      $a0, $v1, $v0
/* 34E24 80059A24 8C830004 */  lw        $v1, 0x4($a0)
/* 34E28 80059A28 8C820000 */  lw        $v0, 0x0($a0)
/* 34E2C 80059A2C 00621823 */  subu      $v1, $v1, $v0
/* 34E30 80059A30 44832000 */  mtc1      $v1, $f4
/* 34E34 80059A34 00000000 */  nop
/* 34E38 80059A38 46802121 */  cvt.d.w   $f4, $f4
/* 34E3C 80059A3C 04610006 */  bgez      $v1, .L80059A58
/* 34E40 80059A40 46220083 */   div.d    $f2, $f0, $f2
/* 34E44 80059A44 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 34E48 80059A48 44810800 */  mtc1      $at, $f1
/* 34E4C 80059A4C 44800000 */  mtc1      $zero, $f0
/* 34E50 80059A50 00000000 */  nop
/* 34E54 80059A54 46202100 */  add.d     $f4, $f4, $f0
.L80059A58:
/* 34E58 80059A58 46241002 */  mul.d     $f0, $f2, $f4
/* 34E5C 80059A5C 00000000 */  nop
/* 34E60 80059A60 46200020 */  cvt.s.d   $f0, $f0
/* 34E64 80059A64 080166AA */  j         .L80059AA8
/* 34E68 80059A68 E480001C */   swc1     $f0, 0x1C($a0)
glabel .L80059A6C
/* 34E6C 80059A6C 00051400 */  sll       $v0, $a1, 16
/* 34E70 80059A70 00021403 */  sra       $v0, $v0, 16
/* 34E74 80059A74 00021840 */  sll       $v1, $v0, 1
/* 34E78 80059A78 00621821 */  addu      $v1, $v1, $v0
/* 34E7C 80059A7C 8C82000C */  lw        $v0, 0xC($a0)
/* 34E80 80059A80 00031900 */  sll       $v1, $v1, 4
/* 34E84 80059A84 00621021 */  addu      $v0, $v1, $v0
/* 34E88 80059A88 8C420020 */  lw        $v0, 0x20($v0)
/* 34E8C 80059A8C 10400006 */  beqz      $v0, .L80059AA8
/* 34E90 80059A90 00000000 */   nop
/* 34E94 80059A94 A4470000 */  sh        $a3, 0x0($v0)
/* 34E98 80059A98 8C82000C */  lw        $v0, 0xC($a0)
/* 34E9C 80059A9C 00621021 */  addu      $v0, $v1, $v0
/* 34EA0 80059AA0 0C016374 */  jal       _init_lpfilter
/* 34EA4 80059AA4 8C440020 */   lw       $a0, 0x20($v0)
.L80059AA8:
/* 34EA8 80059AA8 8FBF0010 */  lw        $ra, 0x10($sp)
/* 34EAC 80059AAC 0000102D */  daddu     $v0, $zero, $zero
/* 34EB0 80059AB0 03E00008 */  jr        $ra
/* 34EB4 80059AB4 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

s32 au_fx_param_hdl(AuFX* fx, s16 index, s16 paramID, s32 value) {
    switch (paramID) {
    case INPUT_PARAM:
        fx->delays[index].input = value & 0xFFFFFFF8;
        break;
    case OUTPUT_PARAM:
        fx->delays[index].output = value & 0xFFFFFFF8;
        break;
    case FFCOEF_PARAM:
        fx->delays[index].ffcoef = value;
        break;
    case FBCOEF_PARAM:
        fx->delays[index].fbcoef = value;
        break;
    case GAIN_PARAM:
        fx->delays[index].gain = value;
        break;
    case CHORUSRATE_PARAM:
        fx->delays[index].rsinc = (2.0 * (value / 1000.0f)) / gActiveSynDriverPtr->outputRate;
        break;
    case CHORUSDEPTH_PARAM:
        fx->delays[index].rsgain = ((f32)value / CONVERT) * (fx->delays[index].output - fx->delays[index].input);
        break;
    case LPFILT_PARAM:
        if (fx->delays[index].lowpass_20) {
            fx->delays[index].lowpass_20->fc = value;
            _init_lpfilter(fx->delays[index].lowpass_20);
        }
        break;
    }
    return 0;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel flower_splash_appendGfx
/* 32CCB0 E0010510 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 32CCB4 E0010514 0080602D */  daddu     $t4, $a0, $zero
/* 32CCB8 E0010518 3C05DB06 */  lui       $a1, (0xDB060024 >> 16)
/* 32CCBC E001051C 34A50024 */  ori       $a1, $a1, (0xDB060024 & 0xFFFF)
/* 32CCC0 E0010520 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* 32CCC4 E0010524 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* 32CCC8 E0010528 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 32CCCC E001052C AFB7001C */  sw        $s7, 0x1C($sp)
/* 32CCD0 E0010530 AFB60018 */  sw        $s6, 0x18($sp)
/* 32CCD4 E0010534 AFB50014 */  sw        $s5, 0x14($sp)
/* 32CCD8 E0010538 AFB40010 */  sw        $s4, 0x10($sp)
/* 32CCDC E001053C AFB3000C */  sw        $s3, 0xC($sp)
/* 32CCE0 E0010540 AFB20008 */  sw        $s2, 0x8($sp)
/* 32CCE4 E0010544 AFB10004 */  sw        $s1, 0x4($sp)
/* 32CCE8 E0010548 AFB00000 */  sw        $s0, 0x0($sp)
/* 32CCEC E001054C 8CC40000 */  lw        $a0, 0x0($a2)
/* 32CCF0 E0010550 8D88000C */  lw        $t0, 0xC($t4)
/* 32CCF4 E0010554 0080182D */  daddu     $v1, $a0, $zero
/* 32CCF8 E0010558 24840008 */  addiu     $a0, $a0, 0x8
/* 32CCFC E001055C AC620000 */  sw        $v0, 0x0($v1)
/* 32CD00 E0010560 AC600004 */  sw        $zero, 0x4($v1)
/* 32CD04 E0010564 AC850000 */  sw        $a1, 0x0($a0)
/* 32CD08 E0010568 8D820010 */  lw        $v0, 0x10($t4)
/* 32CD0C E001056C 0000482D */  daddu     $t1, $zero, $zero
/* 32CD10 E0010570 ACC40000 */  sw        $a0, 0x0($a2)
/* 32CD14 E0010574 8C42001C */  lw        $v0, 0x1C($v0)
/* 32CD18 E0010578 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 32CD1C E001057C 00431021 */  addu      $v0, $v0, $v1
/* 32CD20 E0010580 AC820004 */  sw        $v0, 0x4($a0)
/* 32CD24 E0010584 8D820008 */  lw        $v0, 0x8($t4)
/* 32CD28 E0010588 24840008 */  addiu     $a0, $a0, 0x8
/* 32CD2C E001058C 1840004A */  blez      $v0, .LE00106B8
/* 32CD30 E0010590 ACC40000 */   sw       $a0, 0x0($a2)
/* 32CD34 E0010594 3C0F800A */  lui       $t7, %hi(gDisplayContext)
/* 32CD38 E0010598 25EFA674 */  addiu     $t7, $t7, %lo(gDisplayContext)
/* 32CD3C E001059C 3C0D8007 */  lui       $t5, %hi(gMatrixListPos)
/* 32CD40 E00105A0 25AD41F0 */  addiu     $t5, $t5, %lo(gMatrixListPos)
/* 32CD44 E00105A4 3C0B0001 */  lui       $t3, (0x11630 >> 16)
/* 32CD48 E00105A8 356B1630 */  ori       $t3, $t3, (0x11630 & 0xFFFF)
/* 32CD4C E00105AC 00C0502D */  daddu     $t2, $a2, $zero
/* 32CD50 E00105B0 3C13FA00 */  lui       $s3, (0xFA000000 >> 16)
/* 32CD54 E00105B4 3C197060 */  lui       $t9, (0x70601800 >> 16)
/* 32CD58 E00105B8 37391800 */  ori       $t9, $t9, (0x70601800 & 0xFFFF)
/* 32CD5C E00105BC 3C12DA38 */  lui       $s2, (0xDA380000 >> 16)
/* 32CD60 E00105C0 3C11DE00 */  lui       $s1, (0xDE000000 >> 16)
/* 32CD64 E00105C4 3C18D838 */  lui       $t8, (0xD8380002 >> 16)
/* 32CD68 E00105C8 37180002 */  ori       $t8, $t8, (0xD8380002 & 0xFFFF)
/* 32CD6C E00105CC 24100040 */  addiu     $s0, $zero, 0x40
/* 32CD70 E00105D0 25070070 */  addiu     $a3, $t0, 0x70
.LE00105D4:
/* 32CD74 E00105D4 8D020000 */  lw        $v0, 0x0($t0)
/* 32CD78 E00105D8 50400032 */  beql      $v0, $zero, .LE00106A4
/* 32CD7C E00105DC 25290001 */   addiu    $t1, $t1, 0x1
/* 32CD80 E00105E0 3C0E0900 */  lui       $t6, %hi(D_09000E08_40E098)
/* 32CD84 E00105E4 25CE0E08 */  addiu     $t6, $t6, %lo(D_09000E08_40E098)
/* 32CD88 E00105E8 25040030 */  addiu     $a0, $t0, 0x30
/* 32CD8C E00105EC 00E0282D */  daddu     $a1, $a3, $zero
/* 32CD90 E00105F0 95A20000 */  lhu       $v0, 0x0($t5)
/* 32CD94 E00105F4 8DE30000 */  lw        $v1, 0x0($t7)
/* 32CD98 E00105F8 00021180 */  sll       $v0, $v0, 6
/* 32CD9C E00105FC 00621821 */  addu      $v1, $v1, $v0
/* 32CDA0 E0010600 006B1821 */  addu      $v1, $v1, $t3
.LE0010604:
/* 32CDA4 E0010604 8C940000 */  lw        $s4, 0x0($a0)
/* 32CDA8 E0010608 8C950004 */  lw        $s5, 0x4($a0)
/* 32CDAC E001060C 8C960008 */  lw        $s6, 0x8($a0)
/* 32CDB0 E0010610 8C97000C */  lw        $s7, 0xC($a0)
/* 32CDB4 E0010614 AC740000 */  sw        $s4, 0x0($v1)
/* 32CDB8 E0010618 AC750004 */  sw        $s5, 0x4($v1)
/* 32CDBC E001061C AC760008 */  sw        $s6, 0x8($v1)
/* 32CDC0 E0010620 AC77000C */  sw        $s7, 0xC($v1)
/* 32CDC4 E0010624 24840010 */  addiu     $a0, $a0, 0x10
/* 32CDC8 E0010628 1485FFF6 */  bne       $a0, $a1, .LE0010604
/* 32CDCC E001062C 24630010 */   addiu    $v1, $v1, 0x10
/* 32CDD0 E0010630 8D440000 */  lw        $a0, 0x0($t2)
/* 32CDD4 E0010634 0080302D */  daddu     $a2, $a0, $zero
/* 32CDD8 E0010638 24840008 */  addiu     $a0, $a0, 0x8
/* 32CDDC E001063C AD440000 */  sw        $a0, 0x0($t2)
/* 32CDE0 E0010640 ACD30000 */  sw        $s3, 0x0($a2)
/* 32CDE4 E0010644 90E5FF98 */  lbu       $a1, -0x68($a3)
/* 32CDE8 E0010648 95A30000 */  lhu       $v1, 0x0($t5)
/* 32CDEC E001064C 24820008 */  addiu     $v0, $a0, 0x8
/* 32CDF0 E0010650 AD420000 */  sw        $v0, 0x0($t2)
/* 32CDF4 E0010654 24620001 */  addiu     $v0, $v1, 0x1
/* 32CDF8 E0010658 A5A20000 */  sh        $v0, 0x0($t5)
/* 32CDFC E001065C 24820010 */  addiu     $v0, $a0, 0x10
/* 32CE00 E0010660 AD420000 */  sw        $v0, 0x0($t2)
/* 32CE04 E0010664 24820018 */  addiu     $v0, $a0, 0x18
/* 32CE08 E0010668 00B92825 */  or        $a1, $a1, $t9
/* 32CE0C E001066C 3063FFFF */  andi      $v1, $v1, 0xFFFF
/* 32CE10 E0010670 00031980 */  sll       $v1, $v1, 6
/* 32CE14 E0010674 AD420000 */  sw        $v0, 0x0($t2)
/* 32CE18 E0010678 ACC50004 */  sw        $a1, 0x4($a2)
/* 32CE1C E001067C AC920000 */  sw        $s2, 0x0($a0)
/* 32CE20 E0010680 8DE20000 */  lw        $v0, 0x0($t7)
/* 32CE24 E0010684 006B1821 */  addu      $v1, $v1, $t3
/* 32CE28 E0010688 AC910008 */  sw        $s1, 0x8($a0)
/* 32CE2C E001068C AC8E000C */  sw        $t6, 0xC($a0)
/* 32CE30 E0010690 AC980010 */  sw        $t8, 0x10($a0)
/* 32CE34 E0010694 AC900014 */  sw        $s0, 0x14($a0)
/* 32CE38 E0010698 00431021 */  addu      $v0, $v0, $v1
/* 32CE3C E001069C AC820004 */  sw        $v0, 0x4($a0)
/* 32CE40 E00106A0 25290001 */  addiu     $t1, $t1, 0x1
.LE00106A4:
/* 32CE44 E00106A4 24E70098 */  addiu     $a3, $a3, 0x98
/* 32CE48 E00106A8 8D820008 */  lw        $v0, 0x8($t4)
/* 32CE4C E00106AC 0122102A */  slt       $v0, $t1, $v0
/* 32CE50 E00106B0 1440FFC8 */  bnez      $v0, .LE00105D4
/* 32CE54 E00106B4 25080098 */   addiu    $t0, $t0, 0x98
.LE00106B8:
/* 32CE58 E00106B8 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 32CE5C E00106BC 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 32CE60 E00106C0 8C620000 */  lw        $v0, 0x0($v1)
/* 32CE64 E00106C4 0040202D */  daddu     $a0, $v0, $zero
/* 32CE68 E00106C8 24420008 */  addiu     $v0, $v0, 0x8
/* 32CE6C E00106CC AC620000 */  sw        $v0, 0x0($v1)
/* 32CE70 E00106D0 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 32CE74 E00106D4 AC820000 */  sw        $v0, 0x0($a0)
/* 32CE78 E00106D8 AC800004 */  sw        $zero, 0x4($a0)
/* 32CE7C E00106DC 8FB7001C */  lw        $s7, 0x1C($sp)
/* 32CE80 E00106E0 8FB60018 */  lw        $s6, 0x18($sp)
/* 32CE84 E00106E4 8FB50014 */  lw        $s5, 0x14($sp)
/* 32CE88 E00106E8 8FB40010 */  lw        $s4, 0x10($sp)
/* 32CE8C E00106EC 8FB3000C */  lw        $s3, 0xC($sp)
/* 32CE90 E00106F0 8FB20008 */  lw        $s2, 0x8($sp)
/* 32CE94 E00106F4 8FB10004 */  lw        $s1, 0x4($sp)
/* 32CE98 E00106F8 8FB00000 */  lw        $s0, 0x0($sp)
/* 32CE9C E00106FC 03E00008 */  jr        $ra
/* 32CEA0 E0010700 27BD0020 */   addiu    $sp, $sp, 0x20
/* 32CEA4 E0010704 00000000 */  nop
/* 32CEA8 E0010708 00000000 */  nop
/* 32CEAC E001070C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void flower_splash_appendGfx(void* effect) {
    EffectInstance* effectTemp = effect;
    FlowerFXData* data = effectTemp->data.flowerSplash;
    s32 i;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));

    for (i = 0; i < effectTemp->numParts; i++, data++) {
        if (data->alive) {
            Gfx* dlist = D_09000E08_32DCC8;

            gDisplayContext->matrixStack[gMatrixListPos] = data->transformMtx;

            gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, data->primAlpha);
            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                        G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gSPDisplayList(gMainGfxPos++, dlist);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_shattering_init_pieces
/* 103CEC 802E246C 27BDFF40 */  addiu     $sp, $sp, -0xC0
/* 103CF0 802E2470 AFB500A4 */  sw        $s5, 0xA4($sp)
/* 103CF4 802E2474 0080A82D */  daddu     $s5, $a0, $zero
/* 103CF8 802E2478 AFB600A8 */  sw        $s6, 0xA8($sp)
/* 103CFC 802E247C 00C0B02D */  daddu     $s6, $a2, $zero
/* 103D00 802E2480 27A40050 */  addiu     $a0, $sp, 0x50
/* 103D04 802E2484 30A5FFFF */  andi      $a1, $a1, 0xFFFF
/* 103D08 802E2488 AFBF00B0 */  sw        $ra, 0xB0($sp)
/* 103D0C 802E248C AFB700AC */  sw        $s7, 0xAC($sp)
/* 103D10 802E2490 AFB400A0 */  sw        $s4, 0xA0($sp)
/* 103D14 802E2494 AFB3009C */  sw        $s3, 0x9C($sp)
/* 103D18 802E2498 AFB20098 */  sw        $s2, 0x98($sp)
/* 103D1C 802E249C AFB10094 */  sw        $s1, 0x94($sp)
/* 103D20 802E24A0 AFB00090 */  sw        $s0, 0x90($sp)
/* 103D24 802E24A4 F7B400B8 */  sdc1      $f20, 0xB8($sp)
/* 103D28 802E24A8 8EA20044 */  lw        $v0, 0x44($s5)
/* 103D2C 802E24AC 8EB00040 */  lw        $s0, 0x40($s5)
/* 103D30 802E24B0 00451021 */  addu      $v0, $v0, $a1
/* 103D34 802E24B4 AE020034 */  sw        $v0, 0x34($s0)
/* 103D38 802E24B8 3C02802E */  lui       $v0, %hi(entity_shattering_setupGfx)
/* 103D3C 802E24BC 24422BA4 */  addiu     $v0, $v0, %lo(entity_shattering_setupGfx)
/* 103D40 802E24C0 AEA2003C */  sw        $v0, 0x3C($s5)
/* 103D44 802E24C4 240200FF */  addiu     $v0, $zero, 0xFF
/* 103D48 802E24C8 A2A2000B */  sb        $v0, 0xB($s5)
/* 103D4C 802E24CC C6000038 */  lwc1      $f0, 0x38($s0)
/* 103D50 802E24D0 8EA50048 */  lw        $a1, 0x48($s5)
/* 103D54 802E24D4 8EA70050 */  lw        $a3, 0x50($s5)
/* 103D58 802E24D8 44060000 */  mfc1      $a2, $f0
/* 103D5C 802E24DC 24170002 */  addiu     $s7, $zero, 0x2
/* 103D60 802E24E0 0C019E40 */  jal       guTranslateF
/* 103D64 802E24E4 AEA6004C */   sw       $a2, 0x4C($s5)
/* 103D68 802E24E8 0C044AC8 */  jal       is_block_on_ground
/* 103D6C 802E24EC 02A0202D */   daddu    $a0, $s5, $zero
/* 103D70 802E24F0 50400001 */  beql      $v0, $zero, .L802E24F8
/* 103D74 802E24F4 24170001 */   addiu    $s7, $zero, 0x1
.L802E24F8:
/* 103D78 802E24F8 0000A02D */  daddu     $s4, $zero, $zero
/* 103D7C 802E24FC 0200902D */  daddu     $s2, $s0, $zero
/* 103D80 802E2500 0240882D */  daddu     $s1, $s2, $zero
/* 103D84 802E2504 0240982D */  daddu     $s3, $s2, $zero
/* 103D88 802E2508 240200FF */  addiu     $v0, $zero, 0xFF
/* 103D8C 802E250C A640003E */  sh        $zero, 0x3E($s2)
/* 103D90 802E2510 A642003C */  sh        $v0, 0x3C($s2)
.L802E2514:
/* 103D94 802E2514 32C2FFFF */  andi      $v0, $s6, 0xFFFF
/* 103D98 802E2518 26D60040 */  addiu     $s6, $s6, 0x40
/* 103D9C 802E251C 8EA50044 */  lw        $a1, 0x44($s5)
/* 103DA0 802E2520 27A40010 */  addiu     $a0, $sp, 0x10
/* 103DA4 802E2524 0C019D60 */  jal       guMtxL2F
/* 103DA8 802E2528 00A22821 */   addu     $a1, $a1, $v0
/* 103DAC 802E252C 27A40050 */  addiu     $a0, $sp, 0x50
/* 103DB0 802E2530 27A50010 */  addiu     $a1, $sp, 0x10
/* 103DB4 802E2534 0C019D80 */  jal       guMtxCatF
/* 103DB8 802E2538 00A0302D */   daddu    $a2, $a1, $zero
/* 103DBC 802E253C C7A00040 */  lwc1      $f0, 0x40($sp)
/* 103DC0 802E2540 E64000C0 */  swc1      $f0, 0xC0($s2)
/* 103DC4 802E2544 C7A00044 */  lwc1      $f0, 0x44($sp)
/* 103DC8 802E2548 E6400124 */  swc1      $f0, 0x124($s2)
/* 103DCC 802E254C C7A00048 */  lwc1      $f0, 0x48($sp)
/* 103DD0 802E2550 240400FF */  addiu     $a0, $zero, 0xFF
/* 103DD4 802E2554 0C00A67F */  jal       rand_int
/* 103DD8 802E2558 E6400188 */   swc1     $f0, 0x188($s2)
/* 103DDC 802E255C 00021023 */  negu      $v0, $v0
/* 103DE0 802E2560 A2220072 */  sb        $v0, 0x72($s1)
/* 103DE4 802E2564 24020001 */  addiu     $v0, $zero, 0x1
/* 103DE8 802E2568 16E20008 */  bne       $s7, $v0, .L802E258C
/* 103DEC 802E256C 24100028 */   addiu    $s0, $zero, 0x28
/* 103DF0 802E2570 24100014 */  addiu     $s0, $zero, 0x14
/* 103DF4 802E2574 96620000 */  lhu       $v0, 0x0($s3)
/* 103DF8 802E2578 3C0140CC */  lui       $at, (0x40CCCCCD >> 16)
/* 103DFC 802E257C 3421CCCD */  ori       $at, $at, (0x40CCCCCD & 0xFFFF)
/* 103E00 802E2580 4481A000 */  mtc1      $at, $f20
/* 103E04 802E2584 080B8968 */  j         .L802E25A0
/* 103E08 802E2588 34420001 */   ori      $v0, $v0, 0x1
.L802E258C:
/* 103E0C 802E258C 96620000 */  lhu       $v0, 0x0($s3)
/* 103E10 802E2590 3C014109 */  lui       $at, (0x4109999A >> 16)
/* 103E14 802E2594 3421999A */  ori       $at, $at, (0x4109999A & 0xFFFF)
/* 103E18 802E2598 4481A000 */  mtc1      $at, $f20
/* 103E1C 802E259C 34420002 */  ori       $v0, $v0, 0x2
.L802E25A0:
/* 103E20 802E25A0 A6620000 */  sh        $v0, 0x0($s3)
/* 103E24 802E25A4 0C00A67F */  jal       rand_int
/* 103E28 802E25A8 2404000A */   addiu    $a0, $zero, 0xA
/* 103E2C 802E25AC 02028021 */  addu      $s0, $s0, $v0
/* 103E30 802E25B0 32820001 */  andi      $v0, $s4, 0x1
/* 103E34 802E25B4 14400003 */  bnez      $v0, .L802E25C4
/* 103E38 802E25B8 A2300059 */   sb       $s0, 0x59($s1)
/* 103E3C 802E25BC 00101023 */  negu      $v0, $s0
/* 103E40 802E25C0 A2220059 */  sb        $v0, 0x59($s1)
.L802E25C4:
/* 103E44 802E25C4 0C00A64D */  jal       rand_float
/* 103E48 802E25C8 26730002 */   addiu    $s3, $s3, 0x2
/* 103E4C 802E25CC 3C01802F */  lui       $at, %hi(D_802EB130)
/* 103E50 802E25D0 D422B130 */  ldc1      $f2, %lo(D_802EB130)($at)
/* 103E54 802E25D4 46000021 */  cvt.d.s   $f0, $f0
/* 103E58 802E25D8 46220002 */  mul.d     $f0, $f0, $f2
/* 103E5C 802E25DC 00000000 */  nop
/* 103E60 802E25E0 46200020 */  cvt.s.d   $f0, $f0
/* 103E64 802E25E4 4600A000 */  add.s     $f0, $f20, $f0
/* 103E68 802E25E8 26940001 */  addiu     $s4, $s4, 0x1
/* 103E6C 802E25EC 2A820018 */  slti      $v0, $s4, 0x18
/* 103E70 802E25F0 E64001EC */  swc1      $f0, 0x1EC($s2)
/* 103E74 802E25F4 26520004 */  addiu     $s2, $s2, 0x4
/* 103E78 802E25F8 A2200040 */  sb        $zero, 0x40($s1)
/* 103E7C 802E25FC A220008B */  sb        $zero, 0x8B($s1)
/* 103E80 802E2600 A22000A4 */  sb        $zero, 0xA4($s1)
/* 103E84 802E2604 1440FFC3 */  bnez      $v0, .L802E2514
/* 103E88 802E2608 26310001 */   addiu    $s1, $s1, 0x1
/* 103E8C 802E260C 8FBF00B0 */  lw        $ra, 0xB0($sp)
/* 103E90 802E2610 8FB700AC */  lw        $s7, 0xAC($sp)
/* 103E94 802E2614 8FB600A8 */  lw        $s6, 0xA8($sp)
/* 103E98 802E2618 8FB500A4 */  lw        $s5, 0xA4($sp)
/* 103E9C 802E261C 8FB400A0 */  lw        $s4, 0xA0($sp)
/* 103EA0 802E2620 8FB3009C */  lw        $s3, 0x9C($sp)
/* 103EA4 802E2624 8FB20098 */  lw        $s2, 0x98($sp)
/* 103EA8 802E2628 8FB10094 */  lw        $s1, 0x94($sp)
/* 103EAC 802E262C 8FB00090 */  lw        $s0, 0x90($sp)
/* 103EB0 802E2630 D7B400B8 */  ldc1      $f20, 0xB8($sp)
/* 103EB4 802E2634 03E00008 */  jr        $ra
/* 103EB8 802E2638 27BD00C0 */   addiu    $sp, $sp, 0xC0

### DECOMPILED C INSTRUCTIONS:

void entity_shattering_init_pieces(Entity* entity, Gfx** dlists, Mtx* matrices) {
    ShatteringBlockData* data = entity->dataBuf.shatteringBlock;
    s32 s7;
    s32 i;
    Matrix4f mtxFragment;
    Matrix4f mtxTrans;
    s32 rotSpeed;
    f32 fallSpeed;

    data->fragmentDisplayLists = ENTITY_ADDR(entity, Gfx**, dlists);
    entity->renderSetupFunc = entity_shattering_setupGfx;
    entity->alpha = 255;
    entity->position.y = data->originalPosY;
    guTranslateF(mtxTrans, entity->position.x, entity->position.y, entity->position.z);

    s7 = 2;
    if (!is_block_on_ground(entity)) {
        s7 = 1;
    }

    data->fadeOutCounter = 0;
    data->alpha = 255;

    for (i = 0; i < 24; i++) {
        guMtxL2F(mtxFragment, ENTITY_ADDR(entity, Mtx*, matrices++));
        guMtxCatF(mtxTrans, mtxFragment, mtxFragment);
        data->fragmentPosX[i] = mtxFragment[3][0];
        data->fragmentPosY[i] = mtxFragment[3][1];
        data->fragmentPosZ[i] = mtxFragment[3][2];
        data->fragmentMoveAngle[i] = -rand_int(255);

        if (s7 == 1) {
            rotSpeed = 20;
            fallSpeed = 6.4f;
            data->fragmentFlags[i] |= 1;
        } else {
            rotSpeed = 40;
            fallSpeed = 8.6f;
            data->fragmentFlags[i] |= 2;
        }
        rotSpeed += rand_int(10);
        data->fragmentRotSpeed[i] = rotSpeed;
        if ((i % 2) == 0) {
            data->fragmentRotSpeed[i] = -rotSpeed;
        }

        data->fragmentFallSpeed[i] = fallSpeed + (f32)(rand_float() * 2.7);
        data->fragmentRebounds[i] = 0;
        data->fragmentRotX[i] = 0;
        data->fragmentRotY[i] = 0;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_HeartBlockContent_anim_idle
/* 106490 802E4C10 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 106494 802E4C14 AFB10024 */  sw        $s1, 0x24($sp)
/* 106498 802E4C18 0080882D */  daddu     $s1, $a0, $zero
/* 10649C 802E4C1C AFBF0028 */  sw        $ra, 0x28($sp)
/* 1064A0 802E4C20 AFB00020 */  sw        $s0, 0x20($sp)
/* 1064A4 802E4C24 8E300040 */  lw        $s0, 0x40($s1)
/* 1064A8 802E4C28 92030001 */  lbu       $v1, 0x1($s0)
/* 1064AC 802E4C2C 24020001 */  addiu     $v0, $zero, 0x1
/* 1064B0 802E4C30 10620014 */  beq       $v1, $v0, .L802E4C84
/* 1064B4 802E4C34 28620002 */   slti     $v0, $v1, 0x2
/* 1064B8 802E4C38 10400005 */  beqz      $v0, .L802E4C50
/* 1064BC 802E4C3C 24020002 */   addiu    $v0, $zero, 0x2
/* 1064C0 802E4C40 50600009 */  beql      $v1, $zero, .L802E4C68
/* 1064C4 802E4C44 AE200054 */   sw       $zero, 0x54($s1)
/* 1064C8 802E4C48 080B935C */  j         .L802E4D70
/* 1064CC 802E4C4C 00000000 */   nop
.L802E4C50:
/* 1064D0 802E4C50 10620028 */  beq       $v1, $v0, .L802E4CF4
/* 1064D4 802E4C54 24020003 */   addiu    $v0, $zero, 0x3
/* 1064D8 802E4C58 1062002B */  beq       $v1, $v0, .L802E4D08
/* 1064DC 802E4C5C 00000000 */   nop
/* 1064E0 802E4C60 080B935C */  j         .L802E4D70
/* 1064E4 802E4C64 00000000 */   nop
.L802E4C68:
/* 1064E8 802E4C68 AE200058 */  sw        $zero, 0x58($s1)
/* 1064EC 802E4C6C 14A00057 */  bnez      $a1, .L802E4DCC
/* 1064F0 802E4C70 AE20005C */   sw       $zero, 0x5C($s1)
/* 1064F4 802E4C74 92020001 */  lbu       $v0, 0x1($s0)
/* 1064F8 802E4C78 24420001 */  addiu     $v0, $v0, 0x1
/* 1064FC 802E4C7C 080B935C */  j         .L802E4D70
/* 106500 802E4C80 A2020001 */   sb       $v0, 0x1($s0)
.L802E4C84:
/* 106504 802E4C84 C6200054 */  lwc1      $f0, 0x54($s1)
/* 106508 802E4C88 3C01802F */  lui       $at, %hi(D_802EB270)
/* 10650C 802E4C8C D422B270 */  ldc1      $f2, %lo(D_802EB270)($at)
/* 106510 802E4C90 46000021 */  cvt.d.s   $f0, $f0
/* 106514 802E4C94 46220000 */  add.d     $f0, $f0, $f2
/* 106518 802E4C98 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 10651C 802E4C9C 44811800 */  mtc1      $at, $f3
/* 106520 802E4CA0 44801000 */  mtc1      $zero, $f2
/* 106524 802E4CA4 46200020 */  cvt.s.d   $f0, $f0
/* 106528 802E4CA8 E6200054 */  swc1      $f0, 0x54($s1)
/* 10652C 802E4CAC 46000021 */  cvt.d.s   $f0, $f0
/* 106530 802E4CB0 4620103E */  c.le.d    $f2, $f0
/* 106534 802E4CB4 00000000 */  nop
/* 106538 802E4CB8 45000009 */  bc1f      .L802E4CE0
/* 10653C 802E4CBC 00000000 */   nop
/* 106540 802E4CC0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 106544 802E4CC4 44810000 */  mtc1      $at, $f0
/* 106548 802E4CC8 00000000 */  nop
/* 10654C 802E4CCC E6200054 */  swc1      $f0, 0x54($s1)
/* 106550 802E4CD0 92020001 */  lbu       $v0, 0x1($s0)
/* 106554 802E4CD4 A2000002 */  sb        $zero, 0x2($s0)
/* 106558 802E4CD8 24420001 */  addiu     $v0, $v0, 0x1
/* 10655C 802E4CDC A2020001 */  sb        $v0, 0x1($s0)
.L802E4CE0:
/* 106560 802E4CE0 C6200054 */  lwc1      $f0, 0x54($s1)
/* 106564 802E4CE4 46000086 */  mov.s     $f2, $f0
/* 106568 802E4CE8 E620005C */  swc1      $f0, 0x5C($s1)
/* 10656C 802E4CEC 080B935C */  j         .L802E4D70
/* 106570 802E4CF0 E6220058 */   swc1     $f2, 0x58($s1)
.L802E4CF4:
/* 106574 802E4CF4 0C0B92C4 */  jal       entity_HeartBlockContent_set_initial_pos
/* 106578 802E4CF8 0220202D */   daddu    $a0, $s1, $zero
/* 10657C 802E4CFC 92020001 */  lbu       $v0, 0x1($s0)
/* 106580 802E4D00 24420001 */  addiu     $v0, $v0, 0x1
/* 106584 802E4D04 A2020001 */  sb        $v0, 0x1($s0)
.L802E4D08:
/* 106588 802E4D08 3C02800A */  lui       $v0, %hi(gOverrideFlags)
/* 10658C 802E4D0C 8C42A650 */  lw        $v0, %lo(gOverrideFlags)($v0)
/* 106590 802E4D10 14400017 */  bnez      $v0, .L802E4D70
/* 106594 802E4D14 00000000 */   nop
/* 106598 802E4D18 92020002 */  lbu       $v0, 0x2($s0)
/* 10659C 802E4D1C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 1065A0 802E4D20 A2020002 */  sb        $v0, 0x2($s0)
/* 1065A4 802E4D24 00021600 */  sll       $v0, $v0, 24
/* 1065A8 802E4D28 1C400011 */  bgtz      $v0, .L802E4D70
/* 1065AC 802E4D2C 24020032 */   addiu    $v0, $zero, 0x32
/* 1065B0 802E4D30 9204000A */  lbu       $a0, 0xA($s0)
/* 1065B4 802E4D34 3C0141B0 */  lui       $at, (0x41B00000 >> 16)
/* 1065B8 802E4D38 44810000 */  mtc1      $at, $f0
/* 1065BC 802E4D3C 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 1065C0 802E4D40 44811000 */  mtc1      $at, $f2
/* 1065C4 802E4D44 A2020002 */  sb        $v0, 0x2($s0)
/* 1065C8 802E4D48 24020004 */  addiu     $v0, $zero, 0x4
/* 1065CC 802E4D4C AFA20018 */  sw        $v0, 0x18($sp)
/* 1065D0 802E4D50 24020014 */  addiu     $v0, $zero, 0x14
/* 1065D4 802E4D54 AFA2001C */  sw        $v0, 0x1C($sp)
/* 1065D8 802E4D58 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1065DC 802E4D5C E7A20014 */  swc1      $f2, 0x14($sp)
/* 1065E0 802E4D60 8E250048 */  lw        $a1, 0x48($s1)
/* 1065E4 802E4D64 8E26004C */  lw        $a2, 0x4C($s1)
/* 1065E8 802E4D68 0C01C154 */  jal       fx_stars_shimmer
/* 1065EC 802E4D6C 8E270050 */   lw       $a3, 0x50($s1)
.L802E4D70:
/* 1065F0 802E4D70 0C04417A */  jal       get_entity_by_index
/* 1065F4 802E4D74 92040000 */   lbu      $a0, 0x0($s0)
/* 1065F8 802E4D78 0C0B836C */  jal       entity_can_collide_with_jumping_player
/* 1065FC 802E4D7C 0040202D */   daddu    $a0, $v0, $zero
/* 106600 802E4D80 10400012 */  beqz      $v0, .L802E4DCC
/* 106604 802E4D84 00000000 */   nop
/* 106608 802E4D88 0C043F5A */  jal       exec_entity_commandlist
/* 10660C 802E4D8C 0220202D */   daddu    $a0, $s1, $zero
/* 106610 802E4D90 0C03805E */  jal       disable_player_input
/* 106614 802E4D94 00000000 */   nop
/* 106618 802E4D98 3C038011 */  lui       $v1, %hi(gPlayerStatus)
/* 10661C 802E4D9C 2463EFC8 */  addiu     $v1, $v1, %lo(gPlayerStatus)
/* 106620 802E4DA0 8C620004 */  lw        $v0, 0x4($v1)
/* 106624 802E4DA4 24040001 */  addiu     $a0, $zero, 0x1
/* 106628 802E4DA8 AC600054 */  sw        $zero, 0x54($v1)
/* 10662C 802E4DAC 34420200 */  ori       $v0, $v0, 0x200
/* 106630 802E4DB0 0C009C22 */  jal       set_time_freeze_mode
/* 106634 802E4DB4 AC620004 */   sw       $v0, 0x4($v1)
/* 106638 802E4DB8 3C03800A */  lui       $v1, %hi(gOverrideFlags)
/* 10663C 802E4DBC 2463A650 */  addiu     $v1, $v1, %lo(gOverrideFlags)
/* 106640 802E4DC0 8C620000 */  lw        $v0, 0x0($v1)
/* 106644 802E4DC4 34420040 */  ori       $v0, $v0, 0x40
/* 106648 802E4DC8 AC620000 */  sw        $v0, 0x0($v1)
.L802E4DCC:
/* 10664C 802E4DCC 8FBF0028 */  lw        $ra, 0x28($sp)
/* 106650 802E4DD0 8FB10024 */  lw        $s1, 0x24($sp)
/* 106654 802E4DD4 8FB00020 */  lw        $s0, 0x20($sp)
/* 106658 802E4DD8 03E00008 */  jr        $ra
/* 10665C 802E4DDC 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void entity_HeartBlockContent_anim_idle(Entity* entity, s32 arg1) {
    HeartBlockContentData* data = entity->dataBuf.heartBlockContent;
    switch (data->state) {
        case 0:
            entity->scale.x = 0.0f;
            entity->scale.y = 0.0f;
            entity->scale.z = 0.0f;
            if (arg1 == 0) {
                data->state++;
                break;
            }
            return;
        case 1:
            entity->scale.x += 0.01;
            if (entity->scale.x >= 1.0) {
                entity->scale.x = 1.0f;
                data->sparkleTimer = 0;
                data->state++;
            }
            entity->scale.z = entity->scale.x;
            entity->scale.y = entity->scale.x;
            break;
        case 2:
            entity_HeartBlockContent_set_initial_pos(entity);
            data->state++;
            // fallthrough
        case 3:
            if (gOverrideFlags == 0) {
                // create an effect every 50 frames
                data->sparkleTimer--;
                if (data->sparkleTimer <= 0) {
                    data->sparkleTimer = 50;
                    fx_stars_shimmer(data->sparkleEffectType, entity->position.x, entity->position.y, entity->position.z, 22.0f, 8.0f, 4, 20);
                }
            }
            break;
    }

    if (entity_can_collide_with_jumping_player(get_entity_by_index(data->parentEntityIndex))) {
        exec_entity_commandlist(entity);
        disable_player_input();
        gPlayerStatus.currentSpeed = 0;
        gPlayerStatus.animFlags |= PA_FLAG_RAISED_ARMS;
        set_time_freeze_mode(TIME_FREEZE_PARTIAL);
        gOverrideFlags |= GLOBAL_OVERRIDES_40;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel reset_status_bar
/* 83060 800E9BB0 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 83064 800E9BB4 AFB20018 */  sw        $s2, 0x18($sp)
/* 83068 800E9BB8 0000902D */  daddu     $s2, $zero, $zero
/* 8306C 800E9BBC AFB10014 */  sw        $s1, 0x14($sp)
/* 83070 800E9BC0 3C118011 */  lui       $s1, %hi(gUIStatus)
/* 83074 800E9BC4 2631EF58 */  addiu     $s1, $s1, %lo(gUIStatus)
/* 83078 800E9BC8 AFB00010 */  sw        $s0, 0x10($sp)
/* 8307C 800E9BCC 0220802D */  daddu     $s0, $s1, $zero
/* 83080 800E9BD0 2402000C */  addiu     $v0, $zero, 0xC
/* 83084 800E9BD4 AFBF001C */  sw        $ra, 0x1C($sp)
/* 83088 800E9BD8 A6220034 */  sh        $v0, 0x34($s1)
/* 8308C 800E9BDC 2402FF9C */  addiu     $v0, $zero, -0x64
/* 83090 800E9BE0 A6220036 */  sh        $v0, 0x36($s1)
/* 83094 800E9BE4 240200D2 */  addiu     $v0, $zero, 0xD2
/* 83098 800E9BE8 3C038011 */  lui       $v1, %hi(gPlayerData)
/* 8309C 800E9BEC 2463F290 */  addiu     $v1, $v1, %lo(gPlayerData)
/* 830A0 800E9BF0 A220003A */  sb        $zero, 0x3A($s1)
/* 830A4 800E9BF4 A6220038 */  sh        $v0, 0x38($s1)
/* 830A8 800E9BF8 A220003B */  sb        $zero, 0x3B($s1)
/* 830AC 800E9BFC A2200044 */  sb        $zero, 0x44($s1)
/* 830B0 800E9C00 A2200045 */  sb        $zero, 0x45($s1)
/* 830B4 800E9C04 A2200046 */  sb        $zero, 0x46($s1)
/* 830B8 800E9C08 A220004A */  sb        $zero, 0x4A($s1)
/* 830BC 800E9C0C A220004B */  sb        $zero, 0x4B($s1)
/* 830C0 800E9C10 A220004C */  sb        $zero, 0x4C($s1)
/* 830C4 800E9C14 A220004D */  sb        $zero, 0x4D($s1)
/* 830C8 800E9C18 A220004E */  sb        $zero, 0x4E($s1)
/* 830CC 800E9C1C A220004F */  sb        $zero, 0x4F($s1)
/* 830D0 800E9C20 A2200054 */  sb        $zero, 0x54($s1)
/* 830D4 800E9C24 A2200055 */  sb        $zero, 0x55($s1)
/* 830D8 800E9C28 A2200056 */  sb        $zero, 0x56($s1)
/* 830DC 800E9C2C A2200050 */  sb        $zero, 0x50($s1)
/* 830E0 800E9C30 A2200051 */  sb        $zero, 0x51($s1)
/* 830E4 800E9C34 A2200047 */  sb        $zero, 0x47($s1)
/* 830E8 800E9C38 A2200052 */  sb        $zero, 0x52($s1)
/* 830EC 800E9C3C A2200053 */  sb        $zero, 0x53($s1)
/* 830F0 800E9C40 90640010 */  lbu       $a0, 0x10($v1)
/* 830F4 800E9C44 2402FFFF */  addiu     $v0, $zero, -0x1
/* 830F8 800E9C48 A222006E */  sb        $v0, 0x6E($s1)
/* 830FC 800E9C4C 90620002 */  lbu       $v0, 0x2($v1)
/* 83100 800E9C50 90650005 */  lbu       $a1, 0x5($v1)
/* 83104 800E9C54 9466000C */  lhu       $a2, 0xC($v1)
/* 83108 800E9C58 94630290 */  lhu       $v1, 0x290($v1)
/* 8310C 800E9C5C 00042600 */  sll       $a0, $a0, 24
/* 83110 800E9C60 00042603 */  sra       $a0, $a0, 24
/* 83114 800E9C64 A222003D */  sb        $v0, 0x3D($s1)
/* 83118 800E9C68 A225003E */  sb        $a1, 0x3E($s1)
/* 8311C 800E9C6C A6260040 */  sh        $a2, 0x40($s1)
/* 83120 800E9C70 A6240042 */  sh        $a0, 0x42($s1)
/* 83124 800E9C74 A6230048 */  sh        $v1, 0x48($s1)
/* 83128 800E9C78 A220003C */  sb        $zero, 0x3C($s1)
.L800E9C7C:
/* 8312C 800E9C7C 8E040000 */  lw        $a0, 0x0($s0)
/* 83130 800E9C80 26100004 */  addiu     $s0, $s0, 0x4
/* 83134 800E9C84 26520001 */  addiu     $s2, $s2, 0x1
/* 83138 800E9C88 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 8313C 800E9C8C 0080282D */   daddu    $a1, $a0, $zero
/* 83140 800E9C90 2A420002 */  slti      $v0, $s2, 0x2
/* 83144 800E9C94 1440FFF9 */  bnez      $v0, .L800E9C7C
/* 83148 800E9C98 00000000 */   nop
/* 8314C 800E9C9C 0000902D */  daddu     $s2, $zero, $zero
/* 83150 800E9CA0 0220802D */  daddu     $s0, $s1, $zero
.L800E9CA4:
/* 83154 800E9CA4 8E040008 */  lw        $a0, 0x8($s0)
/* 83158 800E9CA8 26100004 */  addiu     $s0, $s0, 0x4
/* 8315C 800E9CAC 26520001 */  addiu     $s2, $s2, 0x1
/* 83160 800E9CB0 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 83164 800E9CB4 0080282D */   daddu    $a1, $a0, $zero
/* 83168 800E9CB8 2A420002 */  slti      $v0, $s2, 0x2
/* 8316C 800E9CBC 1440FFF9 */  bnez      $v0, .L800E9CA4
/* 83170 800E9CC0 00000000 */   nop
/* 83174 800E9CC4 8E240010 */  lw        $a0, 0x10($s1)
/* 83178 800E9CC8 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 8317C 800E9CCC 0080282D */   daddu    $a1, $a0, $zero
/* 83180 800E9CD0 8E240014 */  lw        $a0, 0x14($s1)
/* 83184 800E9CD4 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 83188 800E9CD8 0080282D */   daddu    $a1, $a0, $zero
/* 8318C 800E9CDC 8E240018 */  lw        $a0, 0x18($s1)
/* 83190 800E9CE0 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 83194 800E9CE4 0080282D */   daddu    $a1, $a0, $zero
/* 83198 800E9CE8 8E24001C */  lw        $a0, 0x1C($s1)
/* 8319C 800E9CEC 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 831A0 800E9CF0 0080282D */   daddu    $a1, $a0, $zero
/* 831A4 800E9CF4 8E240020 */  lw        $a0, 0x20($s1)
/* 831A8 800E9CF8 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 831AC 800E9CFC 0080282D */   daddu    $a1, $a0, $zero
/* 831B0 800E9D00 8E240024 */  lw        $a0, 0x24($s1)
/* 831B4 800E9D04 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 831B8 800E9D08 0080282D */   daddu    $a1, $a0, $zero
/* 831BC 800E9D0C 8E240028 */  lw        $a0, 0x28($s1)
/* 831C0 800E9D10 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 831C4 800E9D14 0080282D */   daddu    $a1, $a0, $zero
/* 831C8 800E9D18 8E24002C */  lw        $a0, 0x2C($s1)
/* 831CC 800E9D1C 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 831D0 800E9D20 0080282D */   daddu    $a1, $a0, $zero
/* 831D4 800E9D24 8E240030 */  lw        $a0, 0x30($s1)
/* 831D8 800E9D28 0C0514AD */  jal       copy_world_hud_element_ref_to_battle
/* 831DC 800E9D2C 0080282D */   daddu    $a1, $a0, $zero
/* 831E0 800E9D30 8FBF001C */  lw        $ra, 0x1C($sp)
/* 831E4 800E9D34 8FB20018 */  lw        $s2, 0x18($sp)
/* 831E8 800E9D38 8FB10014 */  lw        $s1, 0x14($sp)
/* 831EC 800E9D3C 8FB00010 */  lw        $s0, 0x10($sp)
/* 831F0 800E9D40 03E00008 */  jr        $ra
/* 831F4 800E9D44 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void reset_status_bar(void) {
    PlayerData* playerData = &gPlayerData;
    UiStatus* uiStatus = &gUIStatus;
    s32 i;

    uiStatus->drawPosX = 12;
    uiStatus->drawPosY = -100;
    uiStatus->hidden = 0;
    uiStatus->showTimer = 210;
    uiStatus->unk_3B[0] = 0;
    uiStatus->ignoreChanges = FALSE;
    uiStatus->unk_45[0] = 0;
    uiStatus->unk_45[1] = 0;
    uiStatus->hpBlinking = 0;
    uiStatus->hpBlinkCounter = 0;
    uiStatus->hpBlinkTimer = 0;
    uiStatus->fpBlinking = 0;
    uiStatus->fpBlinkCounter = 0;
    uiStatus->fpBlinkTimer = 0;
    uiStatus->coinsBlinking = 0;
    uiStatus->coinsBlinkCounter = 0;
    uiStatus->coinsBlinkTimer = 0;
    uiStatus->spBlinking = 0;
    uiStatus->spBlinkCounter = 0;
    uiStatus->disabled = 0;
    uiStatus->starpointsBlinking = 0;
    uiStatus->starpointsBlinkCounter = 0;
    uiStatus->unk_6C[2] = -1;
    uiStatus->displayHP = playerData->curHP;
    uiStatus->displayFP = playerData->curFP;
    uiStatus->displayCoins = playerData->coins;
    uiStatus->displayStarpoints = playerData->starPoints;
    uiStatus->displaySP = playerData->specialBarsFilled;
    uiStatus->unk_3B[1] = 0;

    for (i = 0; i < ARRAY_COUNT(uiStatus->hpIconIndices); i++) {
        copy_world_hud_element_ref_to_battle(uiStatus->hpIconIndices[i], uiStatus->hpIconIndices[i]);
    }

    for (i = 0; i < ARRAY_COUNT(uiStatus->fpIconIndices); i++) {
        copy_world_hud_element_ref_to_battle(uiStatus->fpIconIndices[i], uiStatus->fpIconIndices[i]);
    }

    copy_world_hud_element_ref_to_battle(uiStatus->coinIconIndex, uiStatus->coinIconIndex);
    copy_world_hud_element_ref_to_battle(uiStatus->coinSparkleIconIndex, uiStatus->coinSparkleIconIndex);
    copy_world_hud_element_ref_to_battle(uiStatus->starpointsIconIndex, uiStatus->starpointsIconIndex);
    copy_world_hud_element_ref_to_battle(uiStatus->starpointsShineIconIndex, uiStatus->starpointsShineIconIndex);
    copy_world_hud_element_ref_to_battle(uiStatus->iconIndex8, uiStatus->iconIndex8);
    copy_world_hud_element_ref_to_battle(uiStatus->iconIndex9, uiStatus->iconIndex9);
    copy_world_hud_element_ref_to_battle(uiStatus->iconIndexA, uiStatus->iconIndexA);
    copy_world_hud_element_ref_to_battle(uiStatus->iconIndexB, uiStatus->iconIndexB);
    copy_world_hud_element_ref_to_battle(uiStatus->starIconIndex, uiStatus->starIconIndex);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel throw_spiny_update
/* 3CF5C0 E00C8220 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 3CF5C4 E00C8224 AFBF0010 */  sw        $ra, 0x10($sp)
/* 3CF5C8 E00C8228 8C830000 */  lw        $v1, 0x0($a0)
/* 3CF5CC E00C822C 8C85000C */  lw        $a1, 0xC($a0)
/* 3CF5D0 E00C8230 30620010 */  andi      $v0, $v1, 0x10
/* 3CF5D4 E00C8234 10400005 */  beqz      $v0, .LE00C824C
/* 3CF5D8 E00C8238 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3CF5DC E00C823C 00621024 */  and       $v0, $v1, $v0
/* 3CF5E0 E00C8240 AC820000 */  sw        $v0, 0x0($a0)
/* 3CF5E4 E00C8244 24020010 */  addiu     $v0, $zero, 0x10
/* 3CF5E8 E00C8248 ACA20028 */  sw        $v0, 0x28($a1)
.LE00C824C:
/* 3CF5EC E00C824C 8CA30028 */  lw        $v1, 0x28($a1)
/* 3CF5F0 E00C8250 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3CF5F4 E00C8254 10400002 */  beqz      $v0, .LE00C8260
/* 3CF5F8 E00C8258 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3CF5FC E00C825C ACA20028 */  sw        $v0, 0x28($a1)
.LE00C8260:
/* 3CF600 E00C8260 8CA2002C */  lw        $v0, 0x2C($a1)
/* 3CF604 E00C8264 8CA30028 */  lw        $v1, 0x28($a1)
/* 3CF608 E00C8268 24420001 */  addiu     $v0, $v0, 0x1
/* 3CF60C E00C826C 04610005 */  bgez      $v1, .LE00C8284
/* 3CF610 E00C8270 ACA2002C */   sw       $v0, 0x2C($a1)
/* 3CF614 E00C8274 0C080128 */  jal       shim_remove_effect
/* 3CF618 E00C8278 00000000 */   nop
/* 3CF61C E00C827C 080320FE */  j         .LE00C83F8
/* 3CF620 E00C8280 00000000 */   nop
.LE00C8284:
/* 3CF624 E00C8284 8CA30060 */  lw        $v1, 0x60($a1)
/* 3CF628 E00C8288 0040202D */  daddu     $a0, $v0, $zero
/* 3CF62C E00C828C 2C620007 */  sltiu     $v0, $v1, 0x7
/* 3CF630 E00C8290 1040001F */  beqz      $v0, .LE00C8310
/* 3CF634 E00C8294 00000000 */   nop
/* 3CF638 E00C8298 3C02E00D */  lui       $v0, (0xE00D0000 >> 16)
/* 3CF63C E00C829C 00431021 */  addu      $v0, $v0, $v1
/* 3CF640 E00C82A0 90428718 */  lbu       $v0, -0x78E8($v0)
/* 3CF644 E00C82A4 3C013C23 */  lui       $at, (0x3C23D70A >> 16)
/* 3CF648 E00C82A8 3421D70A */  ori       $at, $at, (0x3C23D70A & 0xFFFF)
/* 3CF64C E00C82AC 44811000 */  mtc1      $at, $f2
/* 3CF650 E00C82B0 44820000 */  mtc1      $v0, $f0
/* 3CF654 E00C82B4 00000000 */  nop
/* 3CF658 E00C82B8 46800020 */  cvt.s.w   $f0, $f0
/* 3CF65C E00C82BC 46020002 */  mul.s     $f0, $f0, $f2
/* 3CF660 E00C82C0 00000000 */  nop
/* 3CF664 E00C82C4 E4A00058 */  swc1      $f0, 0x58($a1)
/* 3CF668 E00C82C8 3C02E00D */  lui       $v0, (0xE00D0000 >> 16)
/* 3CF66C E00C82CC 00431021 */  addu      $v0, $v0, $v1
/* 3CF670 E00C82D0 90428720 */  lbu       $v0, -0x78E0($v0)
/* 3CF674 E00C82D4 44822000 */  mtc1      $v0, $f4
/* 3CF678 E00C82D8 00000000 */  nop
/* 3CF67C E00C82DC 46802120 */  cvt.s.w   $f4, $f4
/* 3CF680 E00C82E0 46022102 */  mul.s     $f4, $f4, $f2
/* 3CF684 E00C82E4 00000000 */  nop
/* 3CF688 E00C82E8 C4A00050 */  lwc1      $f0, 0x50($a1)
/* 3CF68C E00C82EC 3C014220 */  lui       $at, (0x42200000 >> 16)
/* 3CF690 E00C82F0 44811000 */  mtc1      $at, $f2
/* 3CF694 E00C82F4 0060102D */  daddu     $v0, $v1, $zero
/* 3CF698 E00C82F8 46020001 */  sub.s     $f0, $f0, $f2
/* 3CF69C E00C82FC 24420001 */  addiu     $v0, $v0, 0x1
/* 3CF6A0 E00C8300 ACA20060 */  sw        $v0, 0x60($a1)
/* 3CF6A4 E00C8304 E4A00050 */  swc1      $f0, 0x50($a1)
/* 3CF6A8 E00C8308 080320D9 */  j         .LE00C8364
/* 3CF6AC E00C830C E4A4005C */   swc1     $f4, 0x5C($a1)
.LE00C8310:
/* 3CF6B0 E00C8310 C4A20048 */  lwc1      $f2, 0x48($a1)
/* 3CF6B4 E00C8314 3C01BE4C */  lui       $at, (0xBE4CCCCD >> 16)
/* 3CF6B8 E00C8318 3421CCCD */  ori       $at, $at, (0xBE4CCCCD & 0xFFFF)
/* 3CF6BC E00C831C 44810000 */  mtc1      $at, $f0
/* 3CF6C0 E00C8320 C4A80004 */  lwc1      $f8, 0x4($a1)
/* 3CF6C4 E00C8324 46001080 */  add.s     $f2, $f2, $f0
/* 3CF6C8 E00C8328 C4A00044 */  lwc1      $f0, 0x44($a1)
/* 3CF6CC E00C832C C4A6000C */  lwc1      $f6, 0xC($a1)
/* 3CF6D0 E00C8330 46004200 */  add.s     $f8, $f8, $f0
/* 3CF6D4 E00C8334 C4A0004C */  lwc1      $f0, 0x4C($a1)
/* 3CF6D8 E00C8338 C4A40050 */  lwc1      $f4, 0x50($a1)
/* 3CF6DC E00C833C 46003180 */  add.s     $f6, $f6, $f0
/* 3CF6E0 E00C8340 C4A00054 */  lwc1      $f0, 0x54($a1)
/* 3CF6E4 E00C8344 46002100 */  add.s     $f4, $f4, $f0
/* 3CF6E8 E00C8348 C4A00008 */  lwc1      $f0, 0x8($a1)
/* 3CF6EC E00C834C E4A20048 */  swc1      $f2, 0x48($a1)
/* 3CF6F0 E00C8350 E4A80004 */  swc1      $f8, 0x4($a1)
/* 3CF6F4 E00C8354 46020000 */  add.s     $f0, $f0, $f2
/* 3CF6F8 E00C8358 E4A6000C */  swc1      $f6, 0xC($a1)
/* 3CF6FC E00C835C E4A40050 */  swc1      $f4, 0x50($a1)
/* 3CF700 E00C8360 E4A00008 */  swc1      $f0, 0x8($a1)
.LE00C8364:
/* 3CF704 E00C8364 8CA30068 */  lw        $v1, 0x68($a1)
/* 3CF708 E00C8368 2482FFFF */  addiu     $v0, $a0, -0x1
/* 3CF70C E00C836C 1443000A */  bne       $v0, $v1, .LE00C8398
/* 3CF710 E00C8370 00000000 */   nop
/* 3CF714 E00C8374 C4A00048 */  lwc1      $f0, 0x48($a1)
/* 3CF718 E00C8378 C4A20044 */  lwc1      $f2, 0x44($a1)
/* 3CF71C E00C837C 3C01C080 */  lui       $at, (0xC0800000 >> 16)
/* 3CF720 E00C8380 44812000 */  mtc1      $at, $f4
/* 3CF724 E00C8384 ACA00060 */  sw        $zero, 0x60($a1)
/* 3CF728 E00C8388 46000007 */  neg.s     $f0, $f0
/* 3CF72C E00C838C E4A00048 */  swc1      $f0, 0x48($a1)
/* 3CF730 E00C8390 080320FE */  j         .LE00C83F8
/* 3CF734 E00C8394 E4A40054 */   swc1     $f4, 0x54($a1)
.LE00C8398:
/* 3CF738 E00C8398 C4A40048 */  lwc1      $f4, 0x48($a1)
/* 3CF73C E00C839C 44800000 */  mtc1      $zero, $f0
/* 3CF740 E00C83A0 00000000 */  nop
/* 3CF744 E00C83A4 4600203C */  c.lt.s    $f4, $f0
/* 3CF748 E00C83A8 00000000 */  nop
/* 3CF74C E00C83AC 45000012 */  bc1f      .LE00C83F8
/* 3CF750 E00C83B0 00000000 */   nop
/* 3CF754 E00C83B4 C4A00008 */  lwc1      $f0, 0x8($a1)
/* 3CF758 E00C83B8 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3CF75C E00C83BC D4228738 */  ldc1      $f2, -0x78C8($at)
/* 3CF760 E00C83C0 46000021 */  cvt.d.s   $f0, $f0
/* 3CF764 E00C83C4 4622003C */  c.lt.d    $f0, $f2
/* 3CF768 E00C83C8 00000000 */  nop
/* 3CF76C E00C83CC 4500000A */  bc1f      .LE00C83F8
/* 3CF770 E00C83D0 00000000 */   nop
/* 3CF774 E00C83D4 3C014164 */  lui       $at, (0x41649249 >> 16)
/* 3CF778 E00C83D8 34219249 */  ori       $at, $at, (0x41649249 & 0xFFFF)
/* 3CF77C E00C83DC 44810000 */  mtc1      $at, $f0
/* 3CF780 E00C83E0 3C01C1A0 */  lui       $at, (0xC1A00000 >> 16)
/* 3CF784 E00C83E4 44811000 */  mtc1      $at, $f2
/* 3CF788 E00C83E8 46042101 */  sub.s     $f4, $f4, $f4
/* 3CF78C E00C83EC E4A00008 */  swc1      $f0, 0x8($a1)
/* 3CF790 E00C83F0 E4A20054 */  swc1      $f2, 0x54($a1)
/* 3CF794 E00C83F4 E4A40048 */  swc1      $f4, 0x48($a1)
.LE00C83F8:
/* 3CF798 E00C83F8 8FBF0010 */  lw        $ra, 0x10($sp)
/* 3CF79C E00C83FC 03E00008 */  jr        $ra
/* 3CF7A0 E00C8400 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void throw_spiny_update(EffectInstance* effectInstance) {
    ThrowSpinyFXData* spinyObject = effectInstance->data.throwSpiny;
    u32 state;
    f32 gravity;
    s32 lifeDuration;

    if (effectInstance->flags & FX_INSTANCE_FLAG_DISMISS) {
        effectInstance->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        spinyObject->life = 16;
    }

    if (spinyObject->life < 1000) {
        spinyObject->life--;
    }

    spinyObject->lifeDuration++;

    if (spinyObject->life < 0) {
        shim_remove_effect(effectInstance);
        return;
    }

    lifeDuration = spinyObject->lifeDuration;
    state = spinyObject->state;

    if (state < 7) {
        spinyObject->xScale = D_E00C8718[state] * 0.01f;
        spinyObject->yScale = D_E00C8720[state] * 0.01f;
        spinyObject->state += 1;
        spinyObject->yaw -= 40.0f;
    } else {
        spinyObject->gravity += -0.2f;
        spinyObject->pos.x += spinyObject->unk_44;
        spinyObject->pos.y += spinyObject->gravity;
        spinyObject->pos.z += spinyObject->unk_4C;
        spinyObject->yaw += spinyObject->rotationSpeed;
    }

    if ((lifeDuration - 1) == spinyObject->timeUntilFall) {
        spinyObject->state = 0;
        spinyObject->gravity = -spinyObject->gravity;
        spinyObject->unk_44 = spinyObject->unk_44;
        spinyObject->rotationSpeed = -4.0f;
        return;
    }

    gravity = spinyObject->gravity;

    if ((gravity < 0.0f) && (spinyObject->pos.y < 100.0 / 7.0)) {
        spinyObject->pos.y = 100.0f / 7.0f;
        spinyObject->rotationSpeed = -20.0f;
        spinyObject->gravity = gravity - gravity;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel spr_update_player_sprite
/* 100B7C 802DDA8C 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 100B80 802DDA90 AFB70034 */  sw        $s7, 0x34($sp)
/* 100B84 802DDA94 0080B82D */  daddu     $s7, $a0, $zero
/* 100B88 802DDA98 AFB5002C */  sw        $s5, 0x2C($sp)
/* 100B8C 802DDA9C 00A0A82D */  daddu     $s5, $a1, $zero
/* 100B90 802DDAA0 00151403 */  sra       $v0, $s5, 16
/* 100B94 802DDAA4 304200FF */  andi      $v0, $v0, 0xFF
/* 100B98 802DDAA8 AFB40028 */  sw        $s4, 0x28($sp)
/* 100B9C 802DDAAC 2454FFFF */  addiu     $s4, $v0, -0x1
/* 100BA0 802DDAB0 AFB20020 */  sw        $s2, 0x20($sp)
/* 100BA4 802DDAB4 32F200FF */  andi      $s2, $s7, 0xFF
/* 100BA8 802DDAB8 3C03802E */  lui       $v1, %hi(spr_playerCurrentAnimInfo)
/* 100BAC 802DDABC 2463F588 */  addiu     $v1, $v1, %lo(spr_playerCurrentAnimInfo)
/* 100BB0 802DDAC0 00121040 */  sll       $v0, $s2, 1
/* 100BB4 802DDAC4 00521021 */  addu      $v0, $v0, $s2
/* 100BB8 802DDAC8 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 100BBC 802DDACC 4486A000 */  mtc1      $a2, $f20
/* 100BC0 802DDAD0 00021080 */  sll       $v0, $v0, 2
/* 100BC4 802DDAD4 AFB00018 */  sw        $s0, 0x18($sp)
/* 100BC8 802DDAD8 00438021 */  addu      $s0, $v0, $v1
/* 100BCC 802DDADC AFBF0038 */  sw        $ra, 0x38($sp)
/* 100BD0 802DDAE0 AFB60030 */  sw        $s6, 0x30($sp)
/* 100BD4 802DDAE4 AFB30024 */  sw        $s3, 0x24($sp)
/* 100BD8 802DDAE8 AFB1001C */  sw        $s1, 0x1C($sp)
/* 100BDC 802DDAEC 8E020000 */  lw        $v0, 0x0($s0)
/* 100BE0 802DDAF0 3C01802E */  lui       $at, %hi(D_802DF57C)
/* 100BE4 802DDAF4 AC34F57C */  sw        $s4, %lo(D_802DF57C)($at)
/* 100BE8 802DDAF8 14400013 */  bnez      $v0, .L802DDB48
/* 100BEC 802DDAFC 32B600FF */   andi     $s6, $s5, 0xFF
/* 100BF0 802DDB00 3C04802E */  lui       $a0, %hi(spr_playerMaxComponents)
/* 100BF4 802DDB04 8C84F580 */  lw        $a0, %lo(spr_playerMaxComponents)($a0)
/* 100BF8 802DDB08 0C0B7CB6 */  jal       spr_allocate_components
/* 100BFC 802DDB0C 00000000 */   nop
/* 100C00 802DDB10 0040882D */  daddu     $s1, $v0, $zero
/* 100C04 802DDB14 AE110000 */  sw        $s1, 0x0($s0)
/* 100C08 802DDB18 8E230000 */  lw        $v1, 0x0($s1)
/* 100C0C 802DDB1C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 100C10 802DDB20 10620009 */  beq       $v1, $v0, .L802DDB48
/* 100C14 802DDB24 0040982D */   daddu    $s3, $v0, $zero
.L802DDB28:
/* 100C18 802DDB28 8E300000 */  lw        $s0, 0x0($s1)
/* 100C1C 802DDB2C 0C04E9C1 */  jal       imgfx_get_free_instances
/* 100C20 802DDB30 24040001 */   addiu    $a0, $zero, 0x1
/* 100C24 802DDB34 26310004 */  addiu     $s1, $s1, 0x4
/* 100C28 802DDB38 AE02004C */  sw        $v0, 0x4C($s0)
/* 100C2C 802DDB3C 8E220000 */  lw        $v0, 0x0($s1)
/* 100C30 802DDB40 1453FFF9 */  bne       $v0, $s3, .L802DDB28
/* 100C34 802DDB44 00000000 */   nop
.L802DDB48:
/* 100C38 802DDB48 00141080 */  sll       $v0, $s4, 2
/* 100C3C 802DDB4C 3C03802E */  lui       $v1, %hi(spr_playerCurrentAnimInfo)
/* 100C40 802DDB50 2463F588 */  addiu     $v1, $v1, %lo(spr_playerCurrentAnimInfo)
/* 100C44 802DDB54 3C05802E */  lui       $a1, %hi(spr_playerSprites)
/* 100C48 802DDB58 00A22821 */  addu      $a1, $a1, $v0
/* 100C4C 802DDB5C 8CA5F548 */  lw        $a1, %lo(spr_playerSprites)($a1)
/* 100C50 802DDB60 00121040 */  sll       $v0, $s2, 1
/* 100C54 802DDB64 00521021 */  addu      $v0, $v0, $s2
/* 100C58 802DDB68 00021080 */  sll       $v0, $v0, 2
/* 100C5C 802DDB6C 00438021 */  addu      $s0, $v0, $v1
/* 100C60 802DDB70 8E110000 */  lw        $s1, 0x0($s0)
/* 100C64 802DDB74 10A00026 */  beqz      $a1, .L802DDC10
/* 100C68 802DDB78 0000102D */   daddu    $v0, $zero, $zero
/* 100C6C 802DDB7C 00161080 */  sll       $v0, $s6, 2
/* 100C70 802DDB80 24420010 */  addiu     $v0, $v0, 0x10
/* 100C74 802DDB84 8CB40000 */  lw        $s4, 0x0($a1)
/* 100C78 802DDB88 00A22821 */  addu      $a1, $a1, $v0
/* 100C7C 802DDB8C 8CB30000 */  lw        $s3, 0x0($a1)
/* 100C80 802DDB90 0C0B7623 */  jal       spr_set_anim_timescale
/* 100C84 802DDB94 4600A306 */   mov.s    $f12, $f20
/* 100C88 802DDB98 06E00007 */  bltz      $s7, .L802DDBB8
/* 100C8C 802DDB9C 3C02FEFF */   lui      $v0, (0xFEFFFFFF >> 16)
/* 100C90 802DDBA0 3442FFFF */  ori       $v0, $v0, (0xFEFFFFFF & 0xFFFF)
/* 100C94 802DDBA4 8E030004 */  lw        $v1, 0x4($s0)
/* 100C98 802DDBA8 02A22024 */  and       $a0, $s5, $v0
/* 100C9C 802DDBAC 00621824 */  and       $v1, $v1, $v0
/* 100CA0 802DDBB0 10830005 */  beq       $a0, $v1, .L802DDBC8
/* 100CA4 802DDBB4 00000000 */   nop
.L802DDBB8:
/* 100CA8 802DDBB8 0220202D */  daddu     $a0, $s1, $zero
/* 100CAC 802DDBBC 0C0B7608 */  jal       spr_init_anim_state
/* 100CB0 802DDBC0 0260282D */   daddu    $a1, $s3, $zero
/* 100CB4 802DDBC4 AE000008 */  sw        $zero, 0x8($s0)
.L802DDBC8:
/* 100CB8 802DDBC8 3C02802E */  lui       $v0, %hi(spr_playerCurrentAnimInfo)
/* 100CBC 802DDBCC 2442F588 */  addiu     $v0, $v0, %lo(spr_playerCurrentAnimInfo)
/* 100CC0 802DDBD0 00121840 */  sll       $v1, $s2, 1
/* 100CC4 802DDBD4 00721821 */  addu      $v1, $v1, $s2
/* 100CC8 802DDBD8 00031880 */  sll       $v1, $v1, 2
/* 100CCC 802DDBDC 00628021 */  addu      $s0, $v1, $v0
/* 100CD0 802DDBE0 3C024000 */  lui       $v0, (0x40000000 >> 16)
/* 100CD4 802DDBE4 02E21024 */  and       $v0, $s7, $v0
/* 100CD8 802DDBE8 14400008 */  bnez      $v0, .L802DDC0C
/* 100CDC 802DDBEC AE150004 */   sw       $s5, 0x4($s0)
/* 100CE0 802DDBF0 0220282D */  daddu     $a1, $s1, $zero
/* 100CE4 802DDBF4 0260302D */  daddu     $a2, $s3, $zero
/* 100CE8 802DDBF8 AFA00010 */  sw        $zero, 0x10($sp)
/* 100CEC 802DDBFC 8E040008 */  lw        $a0, 0x8($s0)
/* 100CF0 802DDC00 0C0B75B7 */  jal       spr_component_update
/* 100CF4 802DDC04 0280382D */   daddu    $a3, $s4, $zero
/* 100CF8 802DDC08 AE020008 */  sw        $v0, 0x8($s0)
.L802DDC0C:
/* 100CFC 802DDC0C 8E020008 */  lw        $v0, 0x8($s0)
.L802DDC10:
/* 100D00 802DDC10 8FBF0038 */  lw        $ra, 0x38($sp)
/* 100D04 802DDC14 8FB70034 */  lw        $s7, 0x34($sp)
/* 100D08 802DDC18 8FB60030 */  lw        $s6, 0x30($sp)
/* 100D0C 802DDC1C 8FB5002C */  lw        $s5, 0x2C($sp)
/* 100D10 802DDC20 8FB40028 */  lw        $s4, 0x28($sp)
/* 100D14 802DDC24 8FB30024 */  lw        $s3, 0x24($sp)
/* 100D18 802DDC28 8FB20020 */  lw        $s2, 0x20($sp)
/* 100D1C 802DDC2C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 100D20 802DDC30 8FB00018 */  lw        $s0, 0x18($sp)
/* 100D24 802DDC34 D7B40040 */  ldc1      $f20, 0x40($sp)
/* 100D28 802DDC38 03E00008 */  jr        $ra
/* 100D2C 802DDC3C 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

s32 spr_update_player_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale) {
    u32* spriteData;
    SpriteComponent** compList;
    SpriteComponent* component;
    SpriteAnimComponent** animList;
    SpriteRasterCacheEntry** rasterList;
    s32 spriteId = ((animID >> 16) & 0xFF) - 1;
    s32 instanceIdx = spriteInstanceID & 0xFF;
    s32 animIndex = animID & 0xFF;
    D_802DF57C = spriteId;

    if (spr_playerCurrentAnimInfo[instanceIdx].componentList == NULL) {
        compList = spr_allocate_components(spr_playerMaxComponents);
        spr_playerCurrentAnimInfo[instanceIdx].componentList = compList;
        while (*compList != PTR_LIST_END) {
            component = *compList;
            component->imgfxIdx = imgfx_get_free_instances(1);
            compList++;
        }
    }

    spriteData = (u32*)spr_playerSprites[spriteId];
    compList = spr_playerCurrentAnimInfo[instanceIdx].componentList;

    if (spriteData == NULL) {
        return 0;
    }

    rasterList = (SpriteRasterCacheEntry**)*spriteData;
    spriteData += 4 + animIndex;
    animList = (SpriteAnimComponent**)*spriteData;

    spr_set_anim_timescale(timeScale);
    if ((spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) ||
        (animID & ~SPRITE_ID_BACK_FACING) != (spr_playerCurrentAnimInfo[instanceIdx].animID & ~SPRITE_ID_BACK_FACING))
    {
        spr_init_anim_state(compList, animList);
        spr_playerCurrentAnimInfo[instanceIdx].notifyValue = 0;
    }

    spr_playerCurrentAnimInfo[instanceIdx].animID = animID;

    if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) {
        spr_playerCurrentAnimInfo[instanceIdx].notifyValue = spr_component_update(spr_playerCurrentAnimInfo[instanceIdx].notifyValue,
                compList, animList, rasterList, 0);
    }
    return spr_playerCurrentAnimInfo[instanceIdx].notifyValue;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel parasol_get_npc
/* E245D0 802B6000 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* E245D4 802B6004 AFB00020 */  sw        $s0, 0x20($sp)
/* E245D8 802B6008 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* E245DC 802B600C 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* E245E0 802B6010 AFBF0024 */  sw        $ra, 0x24($sp)
/* E245E4 802B6014 8E030000 */  lw        $v1, 0x0($s0)
.L802B6018:
/* E245E8 802B6018 04610024 */  bgez      $v1, .L802B60AC
/* E245EC 802B601C 3C027FFF */   lui      $v0, (0x7FFFFFFF >> 16)
/* E245F0 802B6020 3442FFFF */  ori       $v0, $v0, (0x7FFFFFFF & 0xFFFF)
/* E245F4 802B6024 00621024 */  and       $v0, $v1, $v0
/* E245F8 802B6028 0C03954C */  jal       phys_adjust_cam_on_landing
/* E245FC 802B602C AE020000 */   sw       $v0, 0x0($s0)
/* E24600 802B6030 8E030004 */  lw        $v1, 0x4($s0)
/* E24604 802B6034 30621000 */  andi      $v0, $v1, 0x1000
/* E24608 802B6038 14400009 */  bnez      $v0, action_update_sliding
/* E2460C 802B603C 30620001 */   andi     $v0, $v1, 0x1
.L802B6040:
/* E24610 802B6040 14400003 */  bnez      $v0, .L802B6050
.L802B6044:
/* E24614 802B6044 3C040006 */   lui      $a0, (0x60000 >> 16)
glabel action_hammer_play_hit_fx
/* E24618 802B6048 3C040001 */  lui       $a0, (0x10004 >> 16)
.L802B604C:
/* E2461C 802B604C 34840004 */  ori       $a0, $a0, (0x10004 & 0xFFFF)
.L802B6050:
/* E24620 802B6050 0C037FBF */  jal       suggest_player_anim_allow_backward
/* E24624 802B6054 00000000 */   nop
.L802B6058:
/* E24628 802B6058 080AD81A */  j         .L802B6068
/* E2462C 802B605C 00000000 */   nop
glabel action_update_sliding
/* E24630 802B6060 0C0AD866 */  jal       func_802B6198
/* E24634 802B6064 00000000 */   nop
.L802B6068:
/* E24638 802B6068 3C01418E */  lui       $at, (0x418E0D84 >> 16)
/* E2463C 802B606C 34210D84 */  ori       $at, $at, (0x418E0D84 & 0xFFFF)
/* E24640 802B6070 44810000 */  mtc1      $at, $f0
.L802B6074:
/* E24644 802B6074 3C01C136 */  lui       $at, (0xC1362DE0 >> 16)
/* E24648 802B6078 34212DE0 */  ori       $at, $at, (0xC1362DE0 & 0xFFFF)
glabel .L802B607C
/* E2464C 802B607C 44811000 */  mtc1      $at, $f2
.L802B6080:
/* E24650 802B6080 3C014060 */  lui       $at, (0x40600000 >> 16)
/* E24654 802B6084 44812000 */  mtc1      $at, $f4
/* E24658 802B6088 3C01BF40 */  lui       $at, (0xBF400000 >> 16)
.L802B608C:
/* E2465C 802B608C 44813000 */  mtc1      $at, $f6
.L802B6090:
/* E24660 802B6090 A20000B6 */  sb        $zero, 0xB6($s0)
.L802B6094:
/* E24664 802B6094 A60000C0 */  sh        $zero, 0xC0($s0)
/* E24668 802B6098 A60000C2 */  sh        $zero, 0xC2($s0)
glabel action_update_state_23
/* E2466C 802B609C E6000070 */  swc1      $f0, 0x70($s0)
/* E24670 802B60A0 E6020074 */  swc1      $f2, 0x74($s0)
glabel action_update_use_spinning_flower
/* E24674 802B60A4 E6040078 */  swc1      $f4, 0x78($s0)
.L802B60A8:
/* E24678 802B60A8 E606007C */  swc1      $f6, 0x7C($s0)
.L802B60AC:
/* E2467C 802B60AC 0C038D12 */  jal       integrate_gravity
/* E24680 802B60B0 00000000 */   nop
glabel action_update_jump
/* E24684 802B60B4 C60C0080 */  lwc1      $f12, 0x80($s0)
/* E24688 802B60B8 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* E2468C 802B60BC 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* E24690 802B60C0 44810000 */  mtc1      $at, $f0
/* E24694 802B60C4 00000000 */  nop
.L802B60C8:
/* E24698 802B60C8 46006302 */  mul.s     $f12, $f12, $f0
/* E2469C 802B60CC 00000000 */  nop
glabel .L802B60D0
/* E246A0 802B60D0 27A50010 */  addiu     $a1, $sp, 0x10
.L802B60D4:
/* E246A4 802B60D4 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* E246A8 802B60D8 44810000 */  mtc1      $at, $f0
/* E246AC 802B60DC 27A60014 */  addiu     $a2, $sp, 0x14
/* E246B0 802B60E0 0C00A82D */  jal       sin_cos_rad
/* E246B4 802B60E4 46006303 */   div.s    $f12, $f12, $f0
.L802B60E8:
/* E246B8 802B60E8 C7A00010 */  lwc1      $f0, 0x10($sp)
.L802B60EC:
/* E246BC 802B60EC 3C014040 */  lui       $at, (0x40400000 >> 16)
.L802B60F0:
/* E246C0 802B60F0 44811000 */  mtc1      $at, $f2
glabel .L802B60F4
/* E246C4 802B60F4 00000000 */  nop
/* E246C8 802B60F8 46020002 */  mul.s     $f0, $f0, $f2
/* E246CC 802B60FC 00000000 */  nop
.L802B6100:
/* E246D0 802B6100 C7A40014 */  lwc1      $f4, 0x14($sp)
.L802B6104:
/* E246D4 802B6104 46022102 */  mul.s     $f4, $f4, $f2
.L802B6108:
/* E246D8 802B6108 00000000 */  nop
glabel .L802B610C
/* E246DC 802B610C 2402FFFF */  addiu     $v0, $zero, -0x1
.L802B6110:
/* E246E0 802B6110 C6020028 */  lwc1      $f2, 0x28($s0)
/* E246E4 802B6114 C60C0070 */  lwc1      $f12, 0x70($s0)
.L802B6118:
/* E246E8 802B6118 46001080 */  add.s     $f2, $f2, $f0
/* E246EC 802B611C 44803000 */  mtc1      $zero, $f6
glabel action_update_parasol
/* E246F0 802B6120 C6000030 */  lwc1      $f0, 0x30($s0)
.L802B6124:
/* E246F4 802B6124 4606603C */  c.lt.s    $f12, $f6
.L802B6128:
/* E246F8 802B6128 46040001 */  sub.s     $f0, $f0, $f4
/* E246FC 802B612C AFA20018 */  sw        $v0, 0x18($sp)
/* E24700 802B6130 E6020028 */  swc1      $f2, 0x28($s0)
glabel .L802B6134
/* E24704 802B6134 45000005 */  bc1f      .L802B614C
/* E24708 802B6138 E6000030 */   swc1     $f0, 0x30($s0)
.L802B613C:
/* E2470C 802B613C 0C038D45 */  jal       player_check_collision_below
.L802B6140:
/* E24710 802B6140 27A50018 */   addiu    $a1, $sp, 0x18
.L802B6144:
/* E24714 802B6144 080AD856 */  j         .L802B6158
/* E24718 802B6148 E600002C */   swc1     $f0, 0x2C($s0)
.L802B614C:
/* E2471C 802B614C C600002C */  lwc1      $f0, 0x2C($s0)
.L802B6150:
/* E24720 802B6150 460C0000 */  add.s     $f0, $f0, $f12
.L802B6154:
/* E24724 802B6154 E600002C */  swc1      $f0, 0x2C($s0)
.L802B6158:
/* E24728 802B6158 8FA20018 */  lw        $v0, 0x18($sp)
.L802B615C:
/* E2472C 802B615C 0440000A */  bltz      $v0, .L802B6188
/* E24730 802B6160 2402001A */   addiu    $v0, $zero, 0x1A
.L802B6164:
/* E24734 802B6164 820400B5 */  lb        $a0, 0xB5($s0)
.L802B6168:
/* E24738 802B6168 10820005 */  beq       $a0, $v0, .L802B6180
/* E2473C 802B616C 00000000 */   nop
glabel .L802B6170
/* E24740 802B6170 0C039769 */  jal       set_action_state
glabel .L802B6174
/* E24744 802B6174 00000000 */   nop
/* E24748 802B6178 080AD862 */  j         .L802B6188
.L802B617C:
/* E2474C 802B617C 00000000 */   nop
.L802B6180:
/* E24750 802B6180 0C0397DA */  jal       update_locomotion_state
glabel .L802B6184
/* E24754 802B6184 00000000 */   nop
.L802B6188:
/* E24758 802B6188 8FBF0024 */  lw        $ra, 0x24($sp)
.L802B618C:
/* E2475C 802B618C 8FB00020 */  lw        $s0, 0x20($sp)
.L802B6190:
/* E24760 802B6190 03E00008 */  jr        $ra
.L802B6194:
/* E24764 802B6194 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void action_update_step_up(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 cosTheta;
    f32 sinTheta;
    s32 colliderID;
    AnimID anim;

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
        phys_adjust_cam_on_landing();
        if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
            if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
                anim = ANIM_Mario1_Walk;
            } else {
                anim = ANIM_MarioW1_CarryWalk;
            }
            suggest_player_anim_allow_backward(anim);
        } else {
            func_802B6198_E24768();
        }
        playerStatus->actionSubstate = 0;
        playerStatus->timeInAir = 0;
        playerStatus->peakJumpTime = 0;
        playerStatus->gravityIntegrator[0] = 17.7566f;
        playerStatus->gravityIntegrator[1] = -11.3862f;
        playerStatus->gravityIntegrator[2] = 3.5f;
        playerStatus->gravityIntegrator[3] = -0.75f;
    }

    integrate_gravity();
    sin_cos_rad(DEG_TO_RAD(playerStatus->targetYaw), &sinTheta, &cosTheta);
    colliderID = NO_COLLIDER;
    playerStatus->position.x += sinTheta * 3.0f;
    playerStatus->position.z -= cosTheta * 3.0f;

    if (playerStatus->gravityIntegrator[0] < 0.0f) {
        playerStatus->position.y = player_check_collision_below(playerStatus->gravityIntegrator[0], &colliderID);
    } else {
        playerStatus->position.y += playerStatus->gravityIntegrator[0];
    }

    if (colliderID >= 0) {
        if (playerStatus->prevActionState != ACTION_STATE_SPIN) {
            set_action_state(playerStatus->prevActionState);
        } else {
            update_locomotion_state();
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel basic_ai_loiter
/* 25004 80049C04 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 25008 80049C08 AFB40048 */  sw        $s4, 0x48($sp)
/* 2500C 80049C0C 0080A02D */  daddu     $s4, $a0, $zero
/* 25010 80049C10 AFBF004C */  sw        $ra, 0x4C($sp)
/* 25014 80049C14 AFB30044 */  sw        $s3, 0x44($sp)
/* 25018 80049C18 AFB20040 */  sw        $s2, 0x40($sp)
/* 2501C 80049C1C AFB1003C */  sw        $s1, 0x3C($sp)
/* 25020 80049C20 AFB00038 */  sw        $s0, 0x38($sp)
/* 25024 80049C24 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 25028 80049C28 8E920148 */  lw        $s2, 0x148($s4)
/* 2502C 80049C2C 00A0982D */  daddu     $s3, $a1, $zero
/* 25030 80049C30 86440008 */  lh        $a0, 0x8($s2)
/* 25034 80049C34 0C00EABB */  jal       get_npc_unsafe
/* 25038 80049C38 00C0882D */   daddu    $s1, $a2, $zero
/* 2503C 80049C3C 8E630014 */  lw        $v1, 0x14($s3)
/* 25040 80049C40 0460004F */  bltz      $v1, .L80049D80
/* 25044 80049C44 0040802D */   daddu    $s0, $v0, $zero
/* 25048 80049C48 0220202D */  daddu     $a0, $s1, $zero
/* 2504C 80049C4C AFA00010 */  sw        $zero, 0x10($sp)
/* 25050 80049C50 8E660024 */  lw        $a2, 0x24($s3)
/* 25054 80049C54 8E670028 */  lw        $a3, 0x28($s3)
/* 25058 80049C58 0C01242D */  jal       basic_ai_check_player_dist
/* 2505C 80049C5C 0240282D */   daddu    $a1, $s2, $zero
/* 25060 80049C60 10400047 */  beqz      $v0, .L80049D80
/* 25064 80049C64 00000000 */   nop
/* 25068 80049C68 3C02800F */  lui       $v0, %hi(gPlayerStatusPtr)
/* 2506C 80049C6C 8C427B30 */  lw        $v0, %lo(gPlayerStatusPtr)($v0)
/* 25070 80049C70 C60C0038 */  lwc1      $f12, 0x38($s0)
/* 25074 80049C74 C602003C */  lwc1      $f2, 0x3C($s0)
/* 25078 80049C78 C6040040 */  lwc1      $f4, 0x40($s0)
/* 2507C 80049C7C 46006006 */  mov.s     $f0, $f12
/* 25080 80049C80 8C460028 */  lw        $a2, 0x28($v0)
/* 25084 80049C84 8C470030 */  lw        $a3, 0x30($v0)
/* 25088 80049C88 46002386 */  mov.s     $f14, $f4
/* 2508C 80049C8C E7A00028 */  swc1      $f0, 0x28($sp)
/* 25090 80049C90 E7A2002C */  swc1      $f2, 0x2C($sp)
/* 25094 80049C94 0C00A720 */  jal       atan2
/* 25098 80049C98 E7A40030 */   swc1     $f4, 0x30($sp)
/* 2509C 80049C9C C6620018 */  lwc1      $f2, 0x18($s3)
/* 250A0 80049CA0 46000506 */  mov.s     $f20, $f0
/* 250A4 80049CA4 E7B40014 */  swc1      $f20, 0x14($sp)
/* 250A8 80049CA8 E7A20010 */  swc1      $f2, 0x10($sp)
/* 250AC 80049CAC 860200A8 */  lh        $v0, 0xA8($s0)
/* 250B0 80049CB0 27A50028 */  addiu     $a1, $sp, 0x28
/* 250B4 80049CB4 44820000 */  mtc1      $v0, $f0
/* 250B8 80049CB8 00000000 */  nop
/* 250BC 80049CBC 46800020 */  cvt.s.w   $f0, $f0
/* 250C0 80049CC0 E7A00018 */  swc1      $f0, 0x18($sp)
/* 250C4 80049CC4 860200A6 */  lh        $v0, 0xA6($s0)
/* 250C8 80049CC8 27A6002C */  addiu     $a2, $sp, 0x2C
/* 250CC 80049CCC 44820000 */  mtc1      $v0, $f0
/* 250D0 80049CD0 00000000 */  nop
/* 250D4 80049CD4 46800020 */  cvt.s.w   $f0, $f0
/* 250D8 80049CD8 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 250DC 80049CDC 8E040080 */  lw        $a0, 0x80($s0)
/* 250E0 80049CE0 0C037711 */  jal       npc_test_move_simple_with_slipping
/* 250E4 80049CE4 27A70030 */   addiu    $a3, $sp, 0x30
/* 250E8 80049CE8 14400025 */  bnez      $v0, .L80049D80
/* 250EC 80049CEC 0200202D */   daddu    $a0, $s0, $zero
/* 250F0 80049CF0 240502F4 */  addiu     $a1, $zero, 0x2F4
/* 250F4 80049CF4 3C060020 */  lui       $a2, (0x200000 >> 16)
/* 250F8 80049CF8 0C012530 */  jal       ai_enemy_play_sound
/* 250FC 80049CFC E614000C */   swc1     $f20, 0xC($s0)
/* 25100 80049D00 0000202D */  daddu     $a0, $zero, $zero
/* 25104 80049D04 0200282D */  daddu     $a1, $s0, $zero
/* 25108 80049D08 0000302D */  daddu     $a2, $zero, $zero
/* 2510C 80049D0C 84A300A8 */  lh        $v1, 0xA8($a1)
/* 25110 80049D10 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 25114 80049D14 44810000 */  mtc1      $at, $f0
/* 25118 80049D18 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 2511C 80049D1C 44811000 */  mtc1      $at, $f2
/* 25120 80049D20 3C01C1A0 */  lui       $at, (0xC1A00000 >> 16)
/* 25124 80049D24 44812000 */  mtc1      $at, $f4
/* 25128 80049D28 2402000F */  addiu     $v0, $zero, 0xF
/* 2512C 80049D2C AFA2001C */  sw        $v0, 0x1C($sp)
/* 25130 80049D30 44833000 */  mtc1      $v1, $f6
/* 25134 80049D34 00000000 */  nop
/* 25138 80049D38 468031A0 */  cvt.s.w   $f6, $f6
/* 2513C 80049D3C 44073000 */  mfc1      $a3, $f6
/* 25140 80049D40 27A20034 */  addiu     $v0, $sp, 0x34
/* 25144 80049D44 AFA20020 */  sw        $v0, 0x20($sp)
/* 25148 80049D48 E7A00010 */  swc1      $f0, 0x10($sp)
/* 2514C 80049D4C E7A20014 */  swc1      $f2, 0x14($sp)
/* 25150 80049D50 0C01BFA4 */  jal       fx_emote
/* 25154 80049D54 E7A40018 */   swc1     $f4, 0x18($sp)
/* 25158 80049D58 8E420018 */  lw        $v0, 0x18($s2)
/* 2515C 80049D5C 9442002A */  lhu       $v0, 0x2A($v0)
/* 25160 80049D60 30420001 */  andi      $v0, $v0, 0x1
/* 25164 80049D64 10400003 */  beqz      $v0, .L80049D74
/* 25168 80049D68 2402000A */   addiu    $v0, $zero, 0xA
/* 2516C 80049D6C 08012786 */  j         .L80049E18
/* 25170 80049D70 AE820070 */   sw       $v0, 0x70($s4)
.L80049D74:
/* 25174 80049D74 2402000C */  addiu     $v0, $zero, 0xC
/* 25178 80049D78 08012786 */  j         .L80049E18
/* 2517C 80049D7C AE820070 */   sw       $v0, 0x70($s4)
.L80049D80:
/* 25180 80049D80 8602008C */  lh        $v0, 0x8C($s0)
/* 25184 80049D84 14400024 */  bnez      $v0, .L80049E18
/* 25188 80049D88 00000000 */   nop
/* 2518C 80049D8C 9602008E */  lhu       $v0, 0x8E($s0)
/* 25190 80049D90 2442FFFF */  addiu     $v0, $v0, -0x1
/* 25194 80049D94 A602008E */  sh        $v0, 0x8E($s0)
/* 25198 80049D98 00021400 */  sll       $v0, $v0, 16
/* 2519C 80049D9C 1C40001E */  bgtz      $v0, .L80049E18
/* 251A0 80049DA0 00000000 */   nop
/* 251A4 80049DA4 8E820074 */  lw        $v0, 0x74($s4)
/* 251A8 80049DA8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 251AC 80049DAC 10400019 */  beqz      $v0, .L80049E14
/* 251B0 80049DB0 AE820074 */   sw       $v0, 0x74($s4)
/* 251B4 80049DB4 8E420018 */  lw        $v0, 0x18($s2)
/* 251B8 80049DB8 9442002A */  lhu       $v0, 0x2A($v0)
/* 251BC 80049DBC 30420010 */  andi      $v0, $v0, 0x10
/* 251C0 80049DC0 14400007 */  bnez      $v0, .L80049DE0
/* 251C4 80049DC4 00000000 */   nop
/* 251C8 80049DC8 C600000C */  lwc1      $f0, 0xC($s0)
/* 251CC 80049DCC 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 251D0 80049DD0 44816000 */  mtc1      $at, $f12
/* 251D4 80049DD4 0C00A6C9 */  jal       clamp_angle
/* 251D8 80049DD8 460C0300 */   add.s    $f12, $f0, $f12
/* 251DC 80049DDC E600000C */  swc1      $f0, 0xC($s0)
.L80049DE0:
/* 251E0 80049DE0 8E640008 */  lw        $a0, 0x8($s3)
/* 251E4 80049DE4 000417C2 */  srl       $v0, $a0, 31
/* 251E8 80049DE8 00822021 */  addu      $a0, $a0, $v0
/* 251EC 80049DEC 00042043 */  sra       $a0, $a0, 1
/* 251F0 80049DF0 0C00A67F */  jal       rand_int
/* 251F4 80049DF4 24840001 */   addiu    $a0, $a0, 0x1
/* 251F8 80049DF8 8E630008 */  lw        $v1, 0x8($s3)
/* 251FC 80049DFC 000327C2 */  srl       $a0, $v1, 31
/* 25200 80049E00 00641821 */  addu      $v1, $v1, $a0
/* 25204 80049E04 00031843 */  sra       $v1, $v1, 1
/* 25208 80049E08 00621821 */  addu      $v1, $v1, $v0
/* 2520C 80049E0C 08012786 */  j         .L80049E18
/* 25210 80049E10 A603008E */   sh       $v1, 0x8E($s0)
.L80049E14:
/* 25214 80049E14 AE800070 */  sw        $zero, 0x70($s4)
.L80049E18:
/* 25218 80049E18 8FBF004C */  lw        $ra, 0x4C($sp)
/* 2521C 80049E1C 8FB40048 */  lw        $s4, 0x48($sp)
/* 25220 80049E20 8FB30044 */  lw        $s3, 0x44($sp)
/* 25224 80049E24 8FB20040 */  lw        $s2, 0x40($sp)
/* 25228 80049E28 8FB1003C */  lw        $s1, 0x3C($sp)
/* 2522C 80049E2C 8FB00038 */  lw        $s0, 0x38($sp)
/* 25230 80049E30 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 25234 80049E34 03E00008 */  jr        $ra
/* 25238 80049E38 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

void basic_ai_loiter_init(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) {
    Enemy* enemy = script->owner1.enemy;
    Npc* npc = get_npc_unsafe(enemy->npcID);

    npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1);
    npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f);
    npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
    script->AI_TEMP_STATE = AI_STATE_LOITER;
}