### RAW ASSEMBLY INSTRUCTIONS:

glabel phys_main_collision_below
/* 7DBF4 800E4744 27BDFF88 */  addiu     $sp, $sp, -0x78
/* 7DBF8 800E4748 AFB00048 */  sw        $s0, 0x48($sp)
/* 7DBFC 800E474C 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* 7DC00 800E4750 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* 7DC04 800E4754 0200202D */  daddu     $a0, $s0, $zero
/* 7DC08 800E4758 27A50028 */  addiu     $a1, $sp, 0x28
/* 7DC0C 800E475C 27A6002C */  addiu     $a2, $sp, 0x2C
/* 7DC10 800E4760 AFBF005C */  sw        $ra, 0x5C($sp)
/* 7DC14 800E4764 AFB40058 */  sw        $s4, 0x58($sp)
/* 7DC18 800E4768 AFB30054 */  sw        $s3, 0x54($sp)
/* 7DC1C 800E476C AFB20050 */  sw        $s2, 0x50($sp)
/* 7DC20 800E4770 AFB1004C */  sw        $s1, 0x4C($sp)
/* 7DC24 800E4774 F7B80070 */  sdc1      $f24, 0x70($sp)
/* 7DC28 800E4778 F7B60068 */  sdc1      $f22, 0x68($sp)
/* 7DC2C 800E477C F7B40060 */  sdc1      $f20, 0x60($sp)
/* 7DC30 800E4780 860200B0 */  lh        $v0, 0xB0($s0)
/* 7DC34 800E4784 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 7DC38 800E4788 4481A000 */  mtc1      $at, $f20
/* 7DC3C 800E478C C6000028 */  lwc1      $f0, 0x28($s0)
/* 7DC40 800E4790 44822000 */  mtc1      $v0, $f4
/* 7DC44 800E4794 00000000 */  nop
/* 7DC48 800E4798 46802120 */  cvt.s.w   $f4, $f4
/* 7DC4C 800E479C 46142582 */  mul.s     $f22, $f4, $f20
/* 7DC50 800E47A0 00000000 */  nop
/* 7DC54 800E47A4 27A70030 */  addiu     $a3, $sp, 0x30
/* 7DC58 800E47A8 E7A00028 */  swc1      $f0, 0x28($sp)
/* 7DC5C 800E47AC C600002C */  lwc1      $f0, 0x2C($s0)
/* 7DC60 800E47B0 C6020030 */  lwc1      $f2, 0x30($s0)
/* 7DC64 800E47B4 46160000 */  add.s     $f0, $f0, $f22
/* 7DC68 800E47B8 27A20034 */  addiu     $v0, $sp, 0x34
/* 7DC6C 800E47BC E7A40034 */  swc1      $f4, 0x34($sp)
/* 7DC70 800E47C0 E7A0002C */  swc1      $f0, 0x2C($sp)
/* 7DC74 800E47C4 3C0140E0 */  lui       $at, (0x40E00000 >> 16)
/* 7DC78 800E47C8 44810000 */  mtc1      $at, $f0
/* 7DC7C 800E47CC 46042100 */  add.s     $f4, $f4, $f4
/* 7DC80 800E47D0 E7A20030 */  swc1      $f2, 0x30($sp)
/* 7DC84 800E47D4 AFA20010 */  sw        $v0, 0x10($sp)
/* 7DC88 800E47D8 27A20038 */  addiu     $v0, $sp, 0x38
/* 7DC8C 800E47DC AFA20014 */  sw        $v0, 0x14($sp)
/* 7DC90 800E47E0 27A2003C */  addiu     $v0, $sp, 0x3C
/* 7DC94 800E47E4 AFA20018 */  sw        $v0, 0x18($sp)
/* 7DC98 800E47E8 27A20040 */  addiu     $v0, $sp, 0x40
/* 7DC9C 800E47EC AFA2001C */  sw        $v0, 0x1C($sp)
/* 7DCA0 800E47F0 27A20044 */  addiu     $v0, $sp, 0x44
/* 7DCA4 800E47F4 AFA20020 */  sw        $v0, 0x20($sp)
/* 7DCA8 800E47F8 0C03791B */  jal       player_raycast_below_cam_relative
/* 7DCAC 800E47FC 46002603 */   div.s    $f24, $f4, $f0
/* 7DCB0 800E4800 0C00A794 */  jal       get_player_normal_pitch
/* 7DCB4 800E4804 0040882D */   daddu    $s1, $v0, $zero
/* 7DCB8 800E4808 4614C502 */  mul.s     $f20, $f24, $f20
/* 7DCBC 800E480C 00000000 */  nop
/* 7DCC0 800E4810 3C138011 */  lui       $s3, %hi(gPartnerStatus)
/* 7DCC4 800E4814 2673EBB0 */  addiu     $s3, $s3, %lo(gPartnerStatus)
/* 7DCC8 800E4818 C7A20034 */  lwc1      $f2, 0x34($sp)
/* 7DCCC 800E481C 4614B500 */  add.s     $f20, $f22, $f20
/* 7DCD0 800E4820 3C148016 */  lui       $s4, %hi(gCollisionStatus)
/* 7DCD4 800E4824 2694A550 */  addiu     $s4, $s4, %lo(gCollisionStatus)
/* 7DCD8 800E4828 4602A03C */  c.lt.s    $f20, $f2
/* 7DCDC 800E482C 00000000 */  nop
/* 7DCE0 800E4830 45000002 */  bc1f      .L800E483C
/* 7DCE4 800E4834 E6000068 */   swc1     $f0, 0x68($s0)
/* 7DCE8 800E4838 2411FFFF */  addiu     $s1, $zero, -0x1
.L800E483C:
/* 7DCEC 800E483C 860200C0 */  lh        $v0, 0xC0($s0)
/* 7DCF0 800E4840 50400001 */  beql      $v0, $zero, .L800E4848
/* 7DCF4 800E4844 A6910002 */   sh       $s1, 0x2($s4)
.L800E4848:
/* 7DCF8 800E4848 06200005 */  bltz      $s1, .L800E4860
/* 7DCFC 800E484C 00000000 */   nop
/* 7DD00 800E4850 C7A00040 */  lwc1      $f0, 0x40($sp)
/* 7DD04 800E4854 C7A20044 */  lwc1      $f2, 0x44($sp)
/* 7DD08 800E4858 E6000034 */  swc1      $f0, 0x34($s0)
/* 7DD0C 800E485C E6020038 */  swc1      $f2, 0x38($s0)
.L800E4860:
/* 7DD10 800E4860 0C038082 */  jal       func_800E0208
/* 7DD14 800E4864 00000000 */   nop
/* 7DD18 800E4868 14400090 */  bnez      $v0, .L800E4AAC
/* 7DD1C 800E486C 00000000 */   nop
/* 7DD20 800E4870 8E030000 */  lw        $v1, 0x0($s0)
/* 7DD24 800E4874 3062000E */  andi      $v0, $v1, 0xE
/* 7DD28 800E4878 1440008C */  bnez      $v0, .L800E4AAC
/* 7DD2C 800E487C 24120011 */   addiu    $s2, $zero, 0x11
/* 7DD30 800E4880 820200B4 */  lb        $v0, 0xB4($s0)
/* 7DD34 800E4884 10520089 */  beq       $v0, $s2, .L800E4AAC
/* 7DD38 800E4888 30620010 */   andi     $v0, $v1, 0x10
/* 7DD3C 800E488C 1040000C */  beqz      $v0, .L800E48C0
/* 7DD40 800E4890 00000000 */   nop
/* 7DD44 800E4894 0C03954C */  jal       phys_adjust_cam_on_landing
/* 7DD48 800E4898 00000000 */   nop
/* 7DD4C 800E489C 0C039178 */  jal       phys_should_player_be_sliding
/* 7DD50 800E48A0 00000000 */   nop
/* 7DD54 800E48A4 10400006 */  beqz      $v0, .L800E48C0
/* 7DD58 800E48A8 00000000 */   nop
/* 7DD5C 800E48AC 0C039769 */  jal       set_action_state
/* 7DD60 800E48B0 0240202D */   daddu    $a0, $s2, $zero
/* 7DD64 800E48B4 820200B4 */  lb        $v0, 0xB4($s0)
/* 7DD68 800E48B8 1052007C */  beq       $v0, $s2, .L800E4AAC
/* 7DD6C 800E48BC 00000000 */   nop
.L800E48C0:
/* 7DD70 800E48C0 0620005D */  bltz      $s1, .L800E4A38
/* 7DD74 800E48C4 00000000 */   nop
/* 7DD78 800E48C8 0C016F6A */  jal       get_collider_flags
/* 7DD7C 800E48CC 0220202D */   daddu    $a0, $s1, $zero
/* 7DD80 800E48D0 304400FF */  andi      $a0, $v0, 0xFF
/* 7DD84 800E48D4 24020002 */  addiu     $v0, $zero, 0x2
/* 7DD88 800E48D8 10820005 */  beq       $a0, $v0, .L800E48F0
/* 7DD8C 800E48DC 24020003 */   addiu    $v0, $zero, 0x3
/* 7DD90 800E48E0 10820011 */  beq       $a0, $v0, .L800E4928
/* 7DD94 800E48E4 0000282D */   daddu    $a1, $zero, $zero
/* 7DD98 800E48E8 0803925F */  j         .L800E497C
/* 7DD9C 800E48EC 00000000 */   nop
.L800E48F0:
/* 7DDA0 800E48F0 82620000 */  lb        $v0, 0x0($s3)
/* 7DDA4 800E48F4 10400004 */  beqz      $v0, .L800E4908
/* 7DDA8 800E48F8 24020009 */   addiu    $v0, $zero, 0x9
/* 7DDAC 800E48FC 82630003 */  lb        $v1, 0x3($s3)
/* 7DDB0 800E4900 1062006A */  beq       $v1, $v0, .L800E4AAC
/* 7DDB4 800E4904 00000000 */   nop
.L800E4908:
/* 7DDB8 800E4908 86020010 */  lh        $v0, 0x10($s0)
/* 7DDBC 800E490C 14400017 */  bnez      $v0, .L800E496C
/* 7DDC0 800E4910 24020017 */   addiu    $v0, $zero, 0x17
/* 7DDC4 800E4914 820300B4 */  lb        $v1, 0xB4($s0)
/* 7DDC8 800E4918 10620064 */  beq       $v1, $v0, .L800E4AAC
/* 7DDCC 800E491C 00000000 */   nop
/* 7DDD0 800E4920 08039257 */  j         .L800E495C
/* 7DDD4 800E4924 A20400BF */   sb       $a0, 0xBF($s0)
.L800E4928:
/* 7DDD8 800E4928 82620000 */  lb        $v0, 0x0($s3)
/* 7DDDC 800E492C 10400004 */  beqz      $v0, .L800E4940
/* 7DDE0 800E4930 24020009 */   addiu    $v0, $zero, 0x9
/* 7DDE4 800E4934 82630003 */  lb        $v1, 0x3($s3)
/* 7DDE8 800E4938 1062005C */  beq       $v1, $v0, .L800E4AAC
/* 7DDEC 800E493C 00000000 */   nop
.L800E4940:
/* 7DDF0 800E4940 86020010 */  lh        $v0, 0x10($s0)
/* 7DDF4 800E4944 14400009 */  bnez      $v0, .L800E496C
/* 7DDF8 800E4948 24020017 */   addiu    $v0, $zero, 0x17
/* 7DDFC 800E494C 820300B4 */  lb        $v1, 0xB4($s0)
/* 7DE00 800E4950 10620056 */  beq       $v1, $v0, .L800E4AAC
/* 7DE04 800E4954 24020001 */   addiu    $v0, $zero, 0x1
/* 7DE08 800E4958 A20200BF */  sb        $v0, 0xBF($s0)
.L800E495C:
/* 7DE0C 800E495C 0C039769 */  jal       set_action_state
/* 7DE10 800E4960 24040017 */   addiu    $a0, $zero, 0x17
/* 7DE14 800E4964 080392AB */  j         .L800E4AAC
/* 7DE18 800E4968 00000000 */   nop
.L800E496C:
/* 7DE1C 800E496C 0C039769 */  jal       set_action_state
/* 7DE20 800E4970 24040016 */   addiu    $a0, $zero, 0x16
/* 7DE24 800E4974 080392AB */  j         .L800E4AAC
/* 7DE28 800E4978 00000000 */   nop
.L800E497C:
/* 7DE2C 800E497C 96840002 */  lhu       $a0, 0x2($s4)
/* 7DE30 800E4980 30824000 */  andi      $v0, $a0, 0x4000
/* 7DE34 800E4984 10400006 */  beqz      $v0, .L800E49A0
/* 7DE38 800E4988 00000000 */   nop
/* 7DE3C 800E498C 00042400 */  sll       $a0, $a0, 16
/* 7DE40 800E4990 0C0441A9 */  jal       get_entity_type
/* 7DE44 800E4994 00042403 */   sra      $a0, $a0, 16
/* 7DE48 800E4998 38420030 */  xori      $v0, $v0, 0x30
/* 7DE4C 800E499C 2C450001 */  sltiu     $a1, $v0, 0x1
.L800E49A0:
/* 7DE50 800E49A0 820300B4 */  lb        $v1, 0xB4($s0)
/* 7DE54 800E49A4 24020022 */  addiu     $v0, $zero, 0x22
/* 7DE58 800E49A8 10620040 */  beq       $v1, $v0, .L800E4AAC
/* 7DE5C 800E49AC 00000000 */   nop
/* 7DE60 800E49B0 14A0003E */  bnez      $a1, .L800E4AAC
/* 7DE64 800E49B4 00000000 */   nop
/* 7DE68 800E49B8 8E020004 */  lw        $v0, 0x4($s0)
/* 7DE6C 800E49BC 30421000 */  andi      $v0, $v0, 0x1000
/* 7DE70 800E49C0 14400017 */  bnez      $v0, .L800E4A20
/* 7DE74 800E49C4 00000000 */   nop
/* 7DE78 800E49C8 C7A4002C */  lwc1      $f4, 0x2C($sp)
/* 7DE7C 800E49CC C600002C */  lwc1      $f0, 0x2C($s0)
/* 7DE80 800E49D0 46002001 */  sub.s     $f0, $f4, $f0
/* 7DE84 800E49D4 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
/* 7DE88 800E49D8 44811000 */  mtc1      $at, $f2
/* 7DE8C 800E49DC 00000000 */  nop
/* 7DE90 800E49E0 4602003C */  c.lt.s    $f0, $f2
/* 7DE94 800E49E4 00000000 */  nop
/* 7DE98 800E49E8 45000003 */  bc1f      .L800E49F8
/* 7DE9C 800E49EC 00000000 */   nop
/* 7DEA0 800E49F0 0803928A */  j         .L800E4A28
/* 7DEA4 800E49F4 E604002C */   swc1     $f4, 0x2C($s0)
.L800E49F8:
/* 7DEA8 800E49F8 0C039769 */  jal       set_action_state
/* 7DEAC 800E49FC 24040022 */   addiu    $a0, $zero, 0x22
/* 7DEB0 800E4A00 C7A0002C */  lwc1      $f0, 0x2C($sp)
/* 7DEB4 800E4A04 C6020080 */  lwc1      $f2, 0x80($s0)
/* 7DEB8 800E4A08 3C018011 */  lui       $at, %hi(D_8010C928)
/* 7DEBC 800E4A0C E420C928 */  swc1      $f0, %lo(D_8010C928)($at)
/* 7DEC0 800E4A10 3C018011 */  lui       $at, %hi(D_8010C984)
/* 7DEC4 800E4A14 E422C984 */  swc1      $f2, %lo(D_8010C984)($at)
/* 7DEC8 800E4A18 0803928A */  j         .L800E4A28
/* 7DECC 800E4A1C 00000000 */   nop
.L800E4A20:
/* 7DED0 800E4A20 C7A0002C */  lwc1      $f0, 0x2C($sp)
/* 7DED4 800E4A24 E600002C */  swc1      $f0, 0x2C($s0)
.L800E4A28:
/* 7DED8 800E4A28 0C039538 */  jal       phys_save_ground_pos
/* 7DEDC 800E4A2C 00000000 */   nop
/* 7DEE0 800E4A30 080392AB */  j         .L800E4AAC
/* 7DEE4 800E4A34 00000000 */   nop
.L800E4A38:
/* 7DEE8 800E4A38 8E020000 */  lw        $v0, 0x0($s0)
/* 7DEEC 800E4A3C 30420008 */  andi      $v0, $v0, 0x8
/* 7DEF0 800E4A40 1440001A */  bnez      $v0, .L800E4AAC
/* 7DEF4 800E4A44 2402001D */   addiu    $v0, $zero, 0x1D
/* 7DEF8 800E4A48 820300B4 */  lb        $v1, 0xB4($s0)
/* 7DEFC 800E4A4C 10620017 */  beq       $v1, $v0, .L800E4AAC
/* 7DF00 800E4A50 00000000 */   nop
/* 7DF04 800E4A54 4618B080 */  add.s     $f2, $f22, $f24
/* 7DF08 800E4A58 C7A00034 */  lwc1      $f0, 0x34($sp)
/* 7DF0C 800E4A5C 4602003E */  c.le.s    $f0, $f2
/* 7DF10 800E4A60 00000000 */  nop
/* 7DF14 800E4A64 4500000D */  bc1f      .L800E4A9C
/* 7DF18 800E4A68 24040008 */   addiu    $a0, $zero, 0x8
/* 7DF1C 800E4A6C C7A00040 */  lwc1      $f0, 0x40($sp)
/* 7DF20 800E4A70 44801000 */  mtc1      $zero, $f2
/* 7DF24 800E4A74 00000000 */  nop
/* 7DF28 800E4A78 46020032 */  c.eq.s    $f0, $f2
/* 7DF2C 800E4A7C 00000000 */  nop
/* 7DF30 800E4A80 45000006 */  bc1f      .L800E4A9C
/* 7DF34 800E4A84 00000000 */   nop
/* 7DF38 800E4A88 C7A00044 */  lwc1      $f0, 0x44($sp)
/* 7DF3C 800E4A8C 46020032 */  c.eq.s    $f0, $f2
/* 7DF40 800E4A90 00000000 */  nop
/* 7DF44 800E4A94 45030001 */  bc1tl     .L800E4A9C
/* 7DF48 800E4A98 24040009 */   addiu    $a0, $zero, 0x9
.L800E4A9C:
/* 7DF4C 800E4A9C 0C039769 */  jal       set_action_state
/* 7DF50 800E4AA0 00000000 */   nop
/* 7DF54 800E4AA4 0C038C1B */  jal       gravity_use_fall_parms
/* 7DF58 800E4AA8 00000000 */   nop
.L800E4AAC:
/* 7DF5C 800E4AAC 8FBF005C */  lw        $ra, 0x5C($sp)
/* 7DF60 800E4AB0 8FB40058 */  lw        $s4, 0x58($sp)
/* 7DF64 800E4AB4 8FB30054 */  lw        $s3, 0x54($sp)
/* 7DF68 800E4AB8 8FB20050 */  lw        $s2, 0x50($sp)
/* 7DF6C 800E4ABC 8FB1004C */  lw        $s1, 0x4C($sp)
/* 7DF70 800E4AC0 8FB00048 */  lw        $s0, 0x48($sp)
/* 7DF74 800E4AC4 D7B80070 */  ldc1      $f24, 0x70($sp)
/* 7DF78 800E4AC8 D7B60068 */  ldc1      $f22, 0x68($sp)
/* 7DF7C 800E4ACC D7B40060 */  ldc1      $f20, 0x60($sp)
/* 7DF80 800E4AD0 03E00008 */  jr        $ra
/* 7DF84 800E4AD4 27BD0078 */   addiu    $sp, $sp, 0x78

### DECOMPILED C INSTRUCTIONS:

void phys_main_collision_below(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    PartnerStatus* partnerStatus = &gPartnerStatus;
    CollisionStatus* collisionStatus = &gCollisionStatus;
    f32 collHeightHalf = playerStatus->colliderHeight * 0.5f;
    f32 playerX = playerStatus->position.x;
    f32 playerY = playerStatus->position.y + collHeightHalf;
    f32 playerZ = playerStatus->position.z;
    f32 outLength = playerStatus->colliderHeight;
    f32 temp_f24 = (2.0f * playerStatus->colliderHeight) / 7.0f;
    f32 hitRx, hitRz;
    f32 hitDirX, hitDirZ;
    s32 colliderID;
    s32 cond;

    colliderID = player_raycast_below_cam_relative(playerStatus, &playerX, &playerY, &playerZ, &outLength, &hitRx, &hitRz,
                                               &hitDirX, &hitDirZ);
    playerStatus->groundNormalPitch = get_player_normal_pitch();

    if (collHeightHalf + (temp_f24 * 0.5f) < outLength) {
        colliderID = NO_COLLIDER;
    }
    if (playerStatus->timeInAir == 0) {
        collisionStatus->currentFloor = colliderID;
    }
    if (colliderID >= 0) {
        playerStatus->groundAnglesXZ.x = hitDirX;
        playerStatus->groundAnglesXZ.y = hitDirZ;
    }

    if (game_scripts_disabled()) {
        return;
    }

    if (playerStatus->flags & PS_FLAG_AIRBORNE) {
        return;
    }

    if (playerStatus->actionState == ACTION_STATE_SLIDING) {
        return;
    }

    if ((!(playerStatus->flags & PS_FLAG_SLIDING) ||
        (phys_adjust_cam_on_landing(), !phys_should_player_be_sliding()) ||
        (set_action_state(ACTION_STATE_SLIDING), (playerStatus->actionState != ACTION_STATE_SLIDING))))
    {
        if (colliderID >= 0) {
            s32 surfaceType = get_collider_flags(colliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK;
            switch (surfaceType) {
                case SURFACE_TYPE_SPIKES:
                    if (partnerStatus->partnerActionState == PARTNER_ACTION_NONE || partnerStatus->actingPartner != PARTNER_BOW) {
                        if (playerStatus->blinkTimer == 0) {
                            if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
                                playerStatus->hazardType = HAZARD_TYPE_SPIKES;
                                set_action_state(ACTION_STATE_HIT_LAVA);
                            }
                        } else {
                            set_action_state(ACTION_STATE_KNOCKBACK);
                        }
                    }
                    break;
                case SURFACE_TYPE_LAVA:
                    if (partnerStatus->partnerActionState == PARTNER_ACTION_NONE || partnerStatus->actingPartner != PARTNER_BOW) {
                        if (playerStatus->blinkTimer == 0) {
                            if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
                                playerStatus->hazardType = HAZARD_TYPE_LAVA;
                                set_action_state(ACTION_STATE_HIT_LAVA);
                            }
                        } else {
                            set_action_state(ACTION_STATE_KNOCKBACK);
                        }
                    }
                    break;
                default:
                    cond = FALSE;
                    if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) {
                        cond = get_entity_type(collisionStatus->currentFloor) == ENTITY_TYPE_HIDDEN_PANEL;
                    }

                    if (playerStatus->actionState != ACTION_STATE_STEP_UP && !cond) {
                        if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
                            if (playerY - playerStatus->position.y < 6.0f) {
                                playerStatus->position.y = playerY;
                            } else {
                                set_action_state(ACTION_STATE_STEP_UP);
                                D_8010C928 = playerY;
                                D_8010C984 = playerStatus->targetYaw;
                            }
                        } else {
                            playerStatus->position.y = playerY;
                        }
                        phys_save_ground_pos();
                    }
                    break;
            }
        } else if (!(playerStatus->flags & PS_FLAG_FLYING)
             && playerStatus->actionState != ACTION_STATE_USE_SPINNING_FLOWER
        ) {
            if (outLength <= collHeightHalf + temp_f24 && hitDirX == 0.0f && hitDirZ == 0.0f) {
                set_action_state(ACTION_STATE_STEP_DOWN);
            } else {
                set_action_state(ACTION_STATE_FALLING);
            }
            gravity_use_fall_parms();
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel inflict_status
/* 194820 80265F40 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 194824 80265F44 AFB00018 */  sw        $s0, 0x18($sp)
/* 194828 80265F48 0080802D */  daddu     $s0, $a0, $zero
/* 19482C 80265F4C AFB1001C */  sw        $s1, 0x1C($sp)
/* 194830 80265F50 00A0882D */  daddu     $s1, $a1, $zero
/* 194834 80265F54 AFB20020 */  sw        $s2, 0x20($sp)
/* 194838 80265F58 00C0902D */  daddu     $s2, $a2, $zero
/* 19483C 80265F5C 2E22000F */  sltiu     $v0, $s1, 0xF
/* 194840 80265F60 104000B5 */  beqz      $v0, .L80266238
/* 194844 80265F64 AFBF0024 */   sw       $ra, 0x24($sp)
/* 194848 80265F68 00111080 */  sll       $v0, $s1, 2
/* 19484C 80265F6C 3C01802A */  lui       $at, %hi(jtbl_8029D5E0)
/* 194850 80265F70 00220821 */  addu      $at, $at, $v0
/* 194854 80265F74 8C22D5E0 */  lw        $v0, %lo(jtbl_8029D5E0)($at)
/* 194858 80265F78 00400008 */  jr        $v0
/* 19485C 80265F7C 00000000 */   nop
glabel .L80265F80
/* 194860 80265F80 86020192 */  lh        $v0, 0x192($s0)
/* 194864 80265F84 1440000E */  bnez      $v0, .L80265FC0
/* 194868 80265F88 00000000 */   nop
/* 19486C 80265F8C 0C03A752 */  jal       is_ability_active
/* 194870 80265F90 2404000E */   addiu    $a0, $zero, 0xE
/* 194874 80265F94 144000A9 */  bnez      $v0, .L8026623C
/* 194878 80265F98 0000102D */   daddu    $v0, $zero, $zero
/* 19487C 80265F9C 0C03A752 */  jal       is_ability_active
/* 194880 80265FA0 24040015 */   addiu    $a0, $zero, 0x15
/* 194884 80265FA4 144000A5 */  bnez      $v0, .L8026623C
/* 194888 80265FA8 0000102D */   daddu    $v0, $zero, $zero
/* 19488C 80265FAC 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 194890 80265FB0 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 194894 80265FB4 8042008B */  lb        $v0, 0x8B($v0)
/* 194898 80265FB8 144000A0 */  bnez      $v0, .L8026623C
/* 19489C 80265FBC 0000102D */   daddu    $v0, $zero, $zero
.L80265FC0:
/* 1948A0 80265FC0 86030192 */  lh        $v1, 0x192($s0)
/* 1948A4 80265FC4 24020100 */  addiu     $v0, $zero, 0x100
/* 1948A8 80265FC8 1062009C */  beq       $v1, $v0, .L8026623C
/* 1948AC 80265FCC 24020001 */   addiu    $v0, $zero, 0x1
/* 1948B0 80265FD0 82020210 */  lb        $v0, 0x210($s0)
/* 1948B4 80265FD4 54510001 */  bnel      $v0, $s1, .L80265FDC
/* 1948B8 80265FD8 A211021C */   sb       $s1, 0x21C($s0)
.L80265FDC:
/* 1948BC 80265FDC 8E020440 */  lw        $v0, 0x440($s0)
/* 1948C0 80265FE0 8C42000C */  lw        $v0, 0xC($v0)
/* 1948C4 80265FE4 AC40003C */  sw        $zero, 0x3C($v0)
/* 1948C8 80265FE8 00121600 */  sll       $v0, $s2, 24
/* 1948CC 80265FEC 00021603 */  sra       $v0, $v0, 24
/* 1948D0 80265FF0 2842000A */  slti      $v0, $v0, 0xA
/* 1948D4 80265FF4 A2110210 */  sb        $s1, 0x210($s0)
/* 1948D8 80265FF8 14400003 */  bnez      $v0, .L80266008
/* 1948DC 80265FFC A2120211 */   sb       $s2, 0x211($s0)
/* 1948E0 80266000 24020009 */  addiu     $v0, $zero, 0x9
/* 1948E4 80266004 A2020211 */  sb        $v0, 0x211($s0)
.L80266008:
/* 1948E8 80266008 2625FFFD */  addiu     $a1, $s1, -0x3
/* 1948EC 8026600C 2CA20008 */  sltiu     $v0, $a1, 0x8
/* 1948F0 80266010 10400089 */  beqz      $v0, .L80266238
/* 1948F4 80266014 00051080 */   sll      $v0, $a1, 2
/* 1948F8 80266018 3C01802A */  lui       $at, %hi(jtbl_8029D620)
/* 1948FC 8026601C 00220821 */  addu      $at, $at, $v0
/* 194900 80266020 8C22D620 */  lw        $v0, %lo(jtbl_8029D620)($at)
/* 194904 80266024 00400008 */  jr        $v0
/* 194908 80266028 00000000 */   nop
glabel .L8026602C
/* 19490C 8026602C 86030192 */  lh        $v1, 0x192($s0)
/* 194910 80266030 24020100 */  addiu     $v0, $zero, 0x100
/* 194914 80266034 10620081 */  beq       $v1, $v0, .L8026623C
/* 194918 80266038 24020001 */   addiu    $v0, $zero, 0x1
/* 19491C 8026603C 8E030228 */  lw        $v1, 0x228($s0)
/* 194920 80266040 10600004 */  beqz      $v1, .L80266054
/* 194924 80266044 00000000 */   nop
/* 194928 80266048 8C620000 */  lw        $v0, 0x0($v1)
/* 19492C 8026604C 34420010 */  ori       $v0, $v0, 0x10
/* 194930 80266050 AC620000 */  sw        $v0, 0x0($v1)
.L80266054:
/* 194934 80266054 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 194938 80266058 44810000 */  mtc1      $at, $f0
/* 19493C 8026605C AFA00014 */  sw        $zero, 0x14($sp)
/* 194940 80266060 E7A00010 */  swc1      $f0, 0x10($sp)
/* 194944 80266064 8E050144 */  lw        $a1, 0x144($s0)
/* 194948 80266068 8E060148 */  lw        $a2, 0x148($s0)
/* 19494C 8026606C 8E07014C */  lw        $a3, 0x14C($s0)
/* 194950 80266070 0C01CA3C */  jal       fx_ice_pillar
/* 194954 80266074 0000202D */   daddu    $a0, $zero, $zero
/* 194958 80266078 86040436 */  lh        $a0, 0x436($s0)
/* 19495C 8026607C 24050007 */  addiu     $a1, $zero, 0x7
/* 194960 80266080 0C011E08 */  jal       create_status_debuff
/* 194964 80266084 AE020228 */   sw       $v0, 0x228($s0)
/* 194968 80266088 0809988F */  j         .L8026623C
/* 19496C 8026608C 24020001 */   addiu    $v0, $zero, 0x1
glabel .L80266090
/* 194970 80266090 0200202D */  daddu     $a0, $s0, $zero
/* 194974 80266094 0C099B6B */  jal       set_actor_pal_adjustment
/* 194978 80266098 24050003 */   addiu    $a1, $zero, 0x3
/* 19497C 8026609C 86040436 */  lh        $a0, 0x436($s0)
/* 194980 802660A0 0C011E08 */  jal       create_status_debuff
/* 194984 802660A4 24050006 */   addiu    $a1, $zero, 0x6
/* 194988 802660A8 0809988F */  j         .L8026623C
/* 19498C 802660AC 24020001 */   addiu    $v0, $zero, 0x1
glabel .L802660B0
/* 194990 802660B0 0200202D */  daddu     $a0, $s0, $zero
/* 194994 802660B4 0C099B6B */  jal       set_actor_pal_adjustment
/* 194998 802660B8 24050007 */   addiu    $a1, $zero, 0x7
/* 19499C 802660BC 86040436 */  lh        $a0, 0x436($s0)
/* 1949A0 802660C0 0C011E08 */  jal       create_status_debuff
/* 1949A4 802660C4 24050005 */   addiu    $a1, $zero, 0x5
/* 1949A8 802660C8 0809988F */  j         .L8026623C
/* 1949AC 802660CC 24020001 */   addiu    $v0, $zero, 0x1
glabel .L802660D0
/* 1949B0 802660D0 86040436 */  lh        $a0, 0x436($s0)
/* 1949B4 802660D4 0C011E08 */  jal       create_status_debuff
/* 1949B8 802660D8 24050004 */   addiu    $a1, $zero, 0x4
/* 1949BC 802660DC 0809988F */  j         .L8026623C
/* 1949C0 802660E0 24020001 */   addiu    $v0, $zero, 0x1
glabel .L802660E4
/* 1949C4 802660E4 0200202D */  daddu     $a0, $s0, $zero
/* 1949C8 802660E8 0C099B6B */  jal       set_actor_pal_adjustment
/* 1949CC 802660EC 24050005 */   addiu    $a1, $zero, 0x5
/* 1949D0 802660F0 86040436 */  lh        $a0, 0x436($s0)
/* 1949D4 802660F4 0C011E08 */  jal       create_status_debuff
/* 1949D8 802660F8 24050003 */   addiu    $a1, $zero, 0x3
/* 1949DC 802660FC 0809988F */  j         .L8026623C
/* 1949E0 80266100 24020001 */   addiu    $v0, $zero, 0x1
glabel .L80266104
/* 1949E4 80266104 0200202D */  daddu     $a0, $s0, $zero
/* 1949E8 80266108 0C099B6B */  jal       set_actor_pal_adjustment
/* 1949EC 8026610C 24050006 */   addiu    $a1, $zero, 0x6
/* 1949F0 80266110 86040436 */  lh        $a0, 0x436($s0)
/* 1949F4 80266114 0C011E08 */  jal       create_status_debuff
/* 1949F8 80266118 24050009 */   addiu    $a1, $zero, 0x9
/* 1949FC 8026611C 0809988F */  j         .L8026623C
/* 194A00 80266120 24020001 */   addiu    $v0, $zero, 0x1
glabel .L80266124
/* 194A04 80266124 86040436 */  lh        $a0, 0x436($s0)
/* 194A08 80266128 0C011E08 */  jal       create_status_debuff
/* 194A0C 8026612C 2405000A */   addiu    $a1, $zero, 0xA
/* 194A10 80266130 0809988F */  j         .L8026623C
/* 194A14 80266134 24020001 */   addiu    $v0, $zero, 0x1
glabel .L80266138
/* 194A18 80266138 86030192 */  lh        $v1, 0x192($s0)
/* 194A1C 8026613C 24020100 */  addiu     $v0, $zero, 0x100
/* 194A20 80266140 1062003D */  beq       $v1, $v0, .L80266238
/* 194A24 80266144 00121600 */   sll      $v0, $s2, 24
/* 194A28 80266148 00021603 */  sra       $v0, $v0, 24
/* 194A2C 8026614C 2842000A */  slti      $v0, $v0, 0xA
/* 194A30 80266150 A2110212 */  sb        $s1, 0x212($s0)
/* 194A34 80266154 14400003 */  bnez      $v0, .L80266164
/* 194A38 80266158 A2120213 */   sb       $s2, 0x213($s0)
/* 194A3C 8026615C 24020009 */  addiu     $v0, $zero, 0x9
/* 194A40 80266160 A2020213 */  sb        $v0, 0x213($s0)
.L80266164:
/* 194A44 80266164 0200202D */  daddu     $a0, $s0, $zero
/* 194A48 80266168 24050004 */  addiu     $a1, $zero, 0x4
/* 194A4C 8026616C 2402000B */  addiu     $v0, $zero, 0xB
/* 194A50 80266170 0C099B6B */  jal       set_actor_pal_adjustment
/* 194A54 80266174 A202021C */   sb       $v0, 0x21C($s0)
/* 194A58 80266178 86040436 */  lh        $a0, 0x436($s0)
/* 194A5C 8026617C 0C011E4A */  jal       create_status_static
/* 194A60 80266180 2405000B */   addiu    $a1, $zero, 0xB
/* 194A64 80266184 0809988F */  j         .L8026623C
/* 194A68 80266188 24020001 */   addiu    $v0, $zero, 0x1
glabel .L8026618C
/* 194A6C 8026618C 86030192 */  lh        $v1, 0x192($s0)
/* 194A70 80266190 24020100 */  addiu     $v0, $zero, 0x100
/* 194A74 80266194 10620028 */  beq       $v1, $v0, .L80266238
/* 194A78 80266198 2403000C */   addiu    $v1, $zero, 0xC
/* 194A7C 8026619C 00121600 */  sll       $v0, $s2, 24
/* 194A80 802661A0 00021603 */  sra       $v0, $v0, 24
/* 194A84 802661A4 2842000A */  slti      $v0, $v0, 0xA
/* 194A88 802661A8 A2030214 */  sb        $v1, 0x214($s0)
/* 194A8C 802661AC 14400010 */  bnez      $v0, .L802661F0
/* 194A90 802661B0 A2120215 */   sb       $s2, 0x215($s0)
/* 194A94 802661B4 24020009 */  addiu     $v0, $zero, 0x9
/* 194A98 802661B8 0809987C */  j         .L802661F0
/* 194A9C 802661BC A2020215 */   sb       $v0, 0x215($s0)
glabel .L802661C0
/* 194AA0 802661C0 82020216 */  lb        $v0, 0x216($s0)
/* 194AA4 802661C4 0051102A */  slt       $v0, $v0, $s1
/* 194AA8 802661C8 1040001B */  beqz      $v0, .L80266238
/* 194AAC 802661CC 2403000D */   addiu    $v1, $zero, 0xD
/* 194AB0 802661D0 00121600 */  sll       $v0, $s2, 24
/* 194AB4 802661D4 00021603 */  sra       $v0, $v0, 24
/* 194AB8 802661D8 2842000A */  slti      $v0, $v0, 0xA
/* 194ABC 802661DC A2030216 */  sb        $v1, 0x216($s0)
/* 194AC0 802661E0 14400003 */  bnez      $v0, .L802661F0
/* 194AC4 802661E4 A2120217 */   sb       $s2, 0x217($s0)
/* 194AC8 802661E8 24020009 */  addiu     $v0, $zero, 0x9
/* 194ACC 802661EC A2020217 */  sb        $v0, 0x217($s0)
.L802661F0:
/* 194AD0 802661F0 0809988E */  j         .L80266238
/* 194AD4 802661F4 A203021C */   sb       $v1, 0x21C($s0)
glabel .L802661F8
/* 194AD8 802661F8 86030192 */  lh        $v1, 0x192($s0)
/* 194ADC 802661FC 24020100 */  addiu     $v0, $zero, 0x100
/* 194AE0 80266200 1062000D */  beq       $v1, $v0, .L80266238
/* 194AE4 80266204 2403000E */   addiu    $v1, $zero, 0xE
/* 194AE8 80266208 00121600 */  sll       $v0, $s2, 24
/* 194AEC 8026620C 00021603 */  sra       $v0, $v0, 24
/* 194AF0 80266210 2842000A */  slti      $v0, $v0, 0xA
/* 194AF4 80266214 A2030218 */  sb        $v1, 0x218($s0)
/* 194AF8 80266218 14400003 */  bnez      $v0, .L80266228
/* 194AFC 8026621C A2120219 */   sb       $s2, 0x219($s0)
/* 194B00 80266220 24020009 */  addiu     $v0, $zero, 0x9
/* 194B04 80266224 A2020219 */  sb        $v0, 0x219($s0)
.L80266228:
/* 194B08 80266228 86040436 */  lh        $a0, 0x436($s0)
/* 194B0C 8026622C 2405000E */  addiu     $a1, $zero, 0xE
/* 194B10 80266230 0C011E8C */  jal       create_status_transparent
/* 194B14 80266234 A203021C */   sb       $v1, 0x21C($s0)
glabel .L80266238
/* 194B18 80266238 24020001 */  addiu     $v0, $zero, 0x1
.L8026623C:
/* 194B1C 8026623C 8FBF0024 */  lw        $ra, 0x24($sp)
/* 194B20 80266240 8FB20020 */  lw        $s2, 0x20($sp)
/* 194B24 80266244 8FB1001C */  lw        $s1, 0x1C($sp)
/* 194B28 80266248 8FB00018 */  lw        $s0, 0x18($sp)
/* 194B2C 8026624C 03E00008 */  jr        $ra
/* 194B30 80266250 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) {
    BattleStatus* battleStatus = &gBattleStatus;
    EffectInstance* effect;

    switch (statusTypeKey) {
        case STATUS_KEY_FEAR:
        case STATUS_KEY_DIZZY:
        case STATUS_KEY_PARALYZE:
        case STATUS_KEY_SLEEP:
        case STATUS_KEY_FROZEN:
        case STATUS_KEY_STOP:
        case STATUS_KEY_POISON:
        case STATUS_KEY_SHRINK:
            if (target->actorID != ACTOR_PLAYER || (!is_ability_active(ABILITY_FEELING_FINE) &&
                !is_ability_active(ABILITY_BERSERKER) && battleStatus->hustleTurns == 0)) {

                if (target->actorID != ACTOR_PARTNER) {
                    if (target->debuff != statusTypeKey) {
                        target->statusAfflicted = statusTypeKey;
                    }
                    target->disableEffect->data.disableX->koDuration = 0;
                    target->debuff = statusTypeKey;
                    target->debuffDuration = duration;
                    if ((s8)duration > 9) {
                        target->debuffDuration = 9;
                    }

                    switch (statusTypeKey) {
                        case STATUS_KEY_FROZEN:
                            if (target->actorID != ACTOR_PARTNER) {
                                effect = target->icePillarEffect;
                                if (effect != NULL) {
                                    effect->flags |= FX_INSTANCE_FLAG_DISMISS;
                                }
                                target->icePillarEffect = fx_ice_pillar(0, target->currentPos.x, target->currentPos.y,
                                                            target->currentPos.z, 1.0f, 0);
                                create_status_debuff(target->hudElementDataIndex, STATUS_KEY_FROZEN);
                            }
                            return TRUE;
                        case STATUS_KEY_SLEEP:
                            set_actor_pal_adjustment(target, PAL_ADJUST_SLEEP);
                            create_status_debuff(target->hudElementDataIndex, STATUS_KEY_SLEEP);
                            return TRUE;
                        case STATUS_KEY_PARALYZE:
                            set_actor_pal_adjustment(target, PAL_ADJUST_PARALYZE);
                            create_status_debuff(target->hudElementDataIndex, STATUS_KEY_PARALYZE);
                            return TRUE;
                        case STATUS_KEY_DIZZY:
                            create_status_debuff(target->hudElementDataIndex, STATUS_KEY_DIZZY);
                            return TRUE;
                        case STATUS_KEY_FEAR:
                            set_actor_pal_adjustment(target, PAL_ADJUST_FEAR);
                            create_status_debuff(target->hudElementDataIndex, STATUS_KEY_FEAR);
                            return TRUE;
                        case STATUS_KEY_POISON:
                            set_actor_pal_adjustment(target, PAL_ADJUST_POISON);
                            create_status_debuff(target->hudElementDataIndex, STATUS_KEY_POISON);
                            return TRUE;
                        case STATUS_KEY_SHRINK:
                            create_status_debuff(target->hudElementDataIndex, STATUS_KEY_SHRINK);
                            return TRUE;
                    }
                }
                return TRUE;
            } else {
                return FALSE;
            }
            break;
        case STATUS_KEY_STATIC:
            if (target->actorID != ACTOR_PARTNER) {
                target->staticStatus = statusTypeKey;
                target->staticDuration = duration;
                if ((s8)duration > 9) {
                    target->staticDuration = 9;
                }
                target->statusAfflicted = STATUS_KEY_STATIC;
                set_actor_pal_adjustment(target, PAL_ADJUST_STATIC);
                create_status_static(target->hudElementDataIndex, STATUS_KEY_STATIC);
            }
            return TRUE;
        case STATUS_KEY_STONE:
            if (target->actorID != ACTOR_PARTNER) {
                target->stoneStatus = STATUS_KEY_STONE;
                target->stoneDuration = duration;
                if ((s8)duration > 9) {
                    target->stoneDuration = 9;
                }
                target->statusAfflicted = STATUS_KEY_STONE;
            }
            return TRUE;
        case STATUS_KEY_DAZE:
            if (target->koStatus < statusTypeKey) {
                target->koStatus = STATUS_KEY_DAZE;
                target->koDuration = duration;
                if ((s8)duration > 9) {
                    target->koDuration = 9;
                }
                target->statusAfflicted = STATUS_KEY_DAZE;
            }
            return TRUE;
        case STATUS_KEY_TRANSPARENT:
            if (target->actorID != ACTOR_PARTNER) {
                target->transparentStatus = STATUS_KEY_TRANSPARENT;
                target->transparentDuration = duration;
                if ((s8)duration > 9) {
                    target->transparentDuration = 9;
                }
                target->statusAfflicted = STATUS_KEY_TRANSPARENT;
                create_status_transparent(target->hudElementDataIndex, STATUS_KEY_TRANSPARENT);
            }
            return TRUE;
        case 0:
        case STATUS_KEY_NORMAL:
        case STATUS_KEY_DEFAULT:
        default:
            return TRUE;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel sparkles_update
/* 33778C E002254C 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* 337790 E0022550 AFB50024 */  sw        $s5, 0x24($sp)
/* 337794 E0022554 0080A82D */  daddu     $s5, $a0, $zero
/* 337798 E0022558 AFBF0034 */  sw        $ra, 0x34($sp)
/* 33779C E002255C AFBE0030 */  sw        $fp, 0x30($sp)
/* 3377A0 E0022560 AFB7002C */  sw        $s7, 0x2C($sp)
/* 3377A4 E0022564 AFB60028 */  sw        $s6, 0x28($sp)
/* 3377A8 E0022568 AFB40020 */  sw        $s4, 0x20($sp)
/* 3377AC E002256C AFB3001C */  sw        $s3, 0x1C($sp)
/* 3377B0 E0022570 AFB20018 */  sw        $s2, 0x18($sp)
/* 3377B4 E0022574 AFB10014 */  sw        $s1, 0x14($sp)
/* 3377B8 E0022578 AFB00010 */  sw        $s0, 0x10($sp)
/* 3377BC E002257C F7BC0058 */  sdc1      $f28, 0x58($sp)
/* 3377C0 E0022580 F7BA0050 */  sdc1      $f26, 0x50($sp)
/* 3377C4 E0022584 F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3377C8 E0022588 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 3377CC E002258C F7B40038 */  sdc1      $f20, 0x38($sp)
/* 3377D0 E0022590 8EA4000C */  lw        $a0, 0xC($s5)
/* 3377D4 E0022594 0000A02D */  daddu     $s4, $zero, $zero
/* 3377D8 E0022598 0080F02D */  daddu     $fp, $a0, $zero
/* 3377DC E002259C 8C830020 */  lw        $v1, 0x20($a0)
/* 3377E0 E00225A0 8C820024 */  lw        $v0, 0x24($a0)
/* 3377E4 E00225A4 8C930000 */  lw        $s3, 0x0($a0)
/* 3377E8 E00225A8 24630001 */  addiu     $v1, $v1, 0x1
/* 3377EC E00225AC 0060902D */  daddu     $s2, $v1, $zero
/* 3377F0 E00225B0 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3377F4 E00225B4 AC820024 */  sw        $v0, 0x24($a0)
/* 3377F8 E00225B8 12600004 */  beqz      $s3, .LE00225CC
/* 3377FC E00225BC AC920020 */   sw       $s2, 0x20($a0)
/* 337800 E00225C0 2402000A */  addiu     $v0, $zero, 0xA
/* 337804 E00225C4 56620004 */  bnel      $s3, $v0, .LE00225D8
/* 337808 E00225C8 24840030 */   addiu    $a0, $a0, 0x30
.LE00225CC:
/* 33780C E00225CC 8C820024 */  lw        $v0, 0x24($a0)
/* 337810 E00225D0 044000D0 */  bltz      $v0, .LE0022914
/* 337814 E00225D4 24840030 */   addiu    $a0, $a0, 0x30
.LE00225D8:
/* 337818 E00225D8 8EA20008 */  lw        $v0, 0x8($s5)
/* 33781C E00225DC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 337820 E00225E0 184000C3 */  blez      $v0, .LE00228F0
/* 337824 E00225E4 0000882D */   daddu    $s1, $zero, $zero
/* 337828 E00225E8 2417000A */  addiu     $s7, $zero, 0xA
/* 33782C E00225EC 3C16E002 */  lui       $s6, %hi(D_E0022D1C)
/* 337830 E00225F0 26D62D1C */  addiu     $s6, $s6, %lo(D_E0022D1C)
/* 337834 E00225F4 2490001C */  addiu     $s0, $a0, 0x1C
/* 337838 E00225F8 3C01E002 */  lui       $at, (0xE0022D58 >> 16)
/* 33783C E00225FC D43A2D58 */  ldc1      $f26, (0xE0022D58 & 0xFFFF)($at)
/* 337840 E0022600 3C01E002 */  lui       $at, (0xE0022D60 >> 16)
/* 337844 E0022604 D43C2D60 */  ldc1      $f28, (0xE0022D60 & 0xFFFF)($at)
/* 337848 E0022608 3C01E002 */  lui       $at, (0xE0022D68 >> 16)
/* 33784C E002260C D4382D68 */  ldc1      $f24, (0xE0022D68 & 0xFFFF)($at)
.LE0022610:
/* 337850 E0022610 02511021 */  addu      $v0, $s2, $s1
/* 337854 E0022614 30420007 */  andi      $v0, $v0, 0x7
/* 337858 E0022618 12600005 */  beqz      $s3, .LE0022630
/* 33785C E002261C AE020010 */   sw       $v0, 0x10($s0)
/* 337860 E0022620 12770057 */  beq       $s3, $s7, .LE0022780
/* 337864 E0022624 00000000 */   nop
/* 337868 E0022628 08008A00 */  j         .LE0022800
/* 33786C E002262C 00000000 */   nop
.LE0022630:
/* 337870 E0022630 C600FFFC */  lwc1      $f0, -0x4($s0)
/* 337874 E0022634 3C01E002 */  lui       $at, (0xE0022D70 >> 16)
/* 337878 E0022638 D4222D70 */  ldc1      $f2, (0xE0022D70 & 0xFFFF)($at)
/* 33787C E002263C 46000021 */  cvt.d.s   $f0, $f0
/* 337880 E0022640 46220000 */  add.d     $f0, $f0, $f2
/* 337884 E0022644 2644FFFF */  addiu     $a0, $s2, -0x1
/* 337888 E0022648 28820007 */  slti      $v0, $a0, 0x7
/* 33788C E002264C 46200020 */  cvt.s.d   $f0, $f0
/* 337890 E0022650 10400029 */  beqz      $v0, .LE00226F8
/* 337894 E0022654 E600FFFC */   swc1     $f0, -0x4($s0)
/* 337898 E0022658 3C03E002 */  lui       $v1, %hi(D_E0022D14)
/* 33789C E002265C 24632D14 */  addiu     $v1, $v1, %lo(D_E0022D14)
/* 3378A0 E0022660 00831821 */  addu      $v1, $a0, $v1
/* 3378A4 E0022664 90620000 */  lbu       $v0, 0x0($v1)
/* 3378A8 E0022668 C600FFF4 */  lwc1      $f0, -0xC($s0)
/* 3378AC E002266C 44821000 */  mtc1      $v0, $f2
/* 3378B0 E0022670 00000000 */  nop
/* 3378B4 E0022674 468010A0 */  cvt.s.w   $f2, $f2
/* 3378B8 E0022678 46020002 */  mul.s     $f0, $f0, $f2
/* 3378BC E002267C 00000000 */  nop
/* 3378C0 E0022680 46000021 */  cvt.d.s   $f0, $f0
/* 3378C4 E0022684 463A0002 */  mul.d     $f0, $f0, $f26
/* 3378C8 E0022688 00000000 */  nop
/* 3378CC E002268C 46200020 */  cvt.s.d   $f0, $f0
/* 3378D0 E0022690 E600FFE8 */  swc1      $f0, -0x18($s0)
/* 3378D4 E0022694 90620000 */  lbu       $v0, 0x0($v1)
/* 3378D8 E0022698 C602FFF8 */  lwc1      $f2, -0x8($s0)
/* 3378DC E002269C 44820000 */  mtc1      $v0, $f0
/* 3378E0 E00226A0 00000000 */  nop
/* 3378E4 E00226A4 46800020 */  cvt.s.w   $f0, $f0
/* 3378E8 E00226A8 46001082 */  mul.s     $f2, $f2, $f0
/* 3378EC E00226AC 00000000 */  nop
/* 3378F0 E00226B0 460010A1 */  cvt.d.s   $f2, $f2
/* 3378F4 E00226B4 463A1082 */  mul.d     $f2, $f2, $f26
/* 3378F8 E00226B8 00000000 */  nop
/* 3378FC E00226BC C600FFFC */  lwc1      $f0, -0x4($s0)
/* 337900 E00226C0 46000021 */  cvt.d.s   $f0, $f0
/* 337904 E00226C4 46201080 */  add.d     $f2, $f2, $f0
/* 337908 E00226C8 00961021 */  addu      $v0, $a0, $s6
/* 33790C E00226CC 462010A0 */  cvt.s.d   $f2, $f2
/* 337910 E00226D0 E602FFEC */  swc1      $f2, -0x14($s0)
/* 337914 E00226D4 90420000 */  lbu       $v0, 0x0($v0)
/* 337918 E00226D8 44820000 */  mtc1      $v0, $f0
/* 33791C E00226DC 00000000 */  nop
/* 337920 E00226E0 46800020 */  cvt.s.w   $f0, $f0
/* 337924 E00226E4 46000021 */  cvt.d.s   $f0, $f0
/* 337928 E00226E8 463A0002 */  mul.d     $f0, $f0, $f26
/* 33792C E00226EC 00000000 */  nop
/* 337930 E00226F0 08008A35 */  j         .LE00228D4
/* 337934 E00226F4 46200020 */   cvt.s.d  $f0, $f0
.LE00226F8:
/* 337938 E00226F8 24040168 */  addiu     $a0, $zero, 0x168
/* 33793C E00226FC 0C080011 */  jal       func_E0200044
/* 337940 E0022700 262500B1 */   addiu    $a1, $s1, 0xB1
/* 337944 E0022704 32230003 */  andi      $v1, $s1, 0x3
/* 337948 E0022708 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 33794C E002270C 44810000 */  mtc1      $at, $f0
/* 337950 E0022710 4483A000 */  mtc1      $v1, $f20
/* 337954 E0022714 00000000 */  nop
/* 337958 E0022718 4680A520 */  cvt.s.w   $f20, $f20
/* 33795C E002271C 4600A502 */  mul.s     $f20, $f20, $f0
/* 337960 E0022720 00000000 */  nop
/* 337964 E0022724 4482B000 */  mtc1      $v0, $f22
/* 337968 E0022728 00000000 */  nop
/* 33796C E002272C 4680B5A0 */  cvt.s.w   $f22, $f22
/* 337970 E0022730 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 337974 E0022734 44810000 */  mtc1      $at, $f0
/* 337978 E0022738 4600B306 */  mov.s     $f12, $f22
/* 33797C E002273C 4600A500 */  add.s     $f20, $f20, $f0
/* 337980 E0022740 0C080140 */  jal       shim_sin_deg
/* 337984 E0022744 AFD70000 */   sw       $s7, 0x0($fp)
/* 337988 E0022748 4600A002 */  mul.s     $f0, $f20, $f0
/* 33798C E002274C 00000000 */  nop
/* 337990 E0022750 4600B306 */  mov.s     $f12, $f22
/* 337994 E0022754 0C080144 */  jal       shim_cos_deg
/* 337998 E0022758 E600FFF4 */   swc1     $f0, -0xC($s0)
/* 33799C E002275C 4600A502 */  mul.s     $f20, $f20, $f0
/* 3379A0 E0022760 00000000 */  nop
/* 3379A4 E0022764 3C01BD4C */  lui       $at, (0xBD4CCCCD >> 16)
/* 3379A8 E0022768 3421CCCD */  ori       $at, $at, (0xBD4CCCCD & 0xFFFF)
/* 3379AC E002276C 44810000 */  mtc1      $at, $f0
/* 3379B0 E0022770 00000000 */  nop
/* 3379B4 E0022774 E600FFFC */  swc1      $f0, -0x4($s0)
/* 3379B8 E0022778 08008A36 */  j         .LE00228D8
/* 3379BC E002277C E614FFF8 */   swc1     $f20, -0x8($s0)
.LE0022780:
/* 3379C0 E0022780 C600FFF4 */  lwc1      $f0, -0xC($s0)
/* 3379C4 E0022784 46000021 */  cvt.d.s   $f0, $f0
/* 3379C8 E0022788 463C0002 */  mul.d     $f0, $f0, $f28
/* 3379CC E002278C 00000000 */  nop
/* 3379D0 E0022790 C602FFF8 */  lwc1      $f2, -0x8($s0)
/* 3379D4 E0022794 460010A1 */  cvt.d.s   $f2, $f2
/* 3379D8 E0022798 463C1082 */  mul.d     $f2, $f2, $f28
/* 3379DC E002279C 00000000 */  nop
/* 3379E0 E00227A0 C6040000 */  lwc1      $f4, 0x0($s0)
/* 3379E4 E00227A4 46002121 */  cvt.d.s   $f4, $f4
/* 3379E8 E00227A8 4624C181 */  sub.d     $f6, $f24, $f4
/* 3379EC E00227AC 46383182 */  mul.d     $f6, $f6, $f24
/* 3379F0 E00227B0 00000000 */  nop
/* 3379F4 E00227B4 C608FFE8 */  lwc1      $f8, -0x18($s0)
/* 3379F8 E00227B8 46200020 */  cvt.s.d   $f0, $f0
/* 3379FC E00227BC E600FFF4 */  swc1      $f0, -0xC($s0)
/* 337A00 E00227C0 C600FFFC */  lwc1      $f0, -0x4($s0)
/* 337A04 E00227C4 462010A0 */  cvt.s.d   $f2, $f2
/* 337A08 E00227C8 46001000 */  add.s     $f0, $f2, $f0
/* 337A0C E00227CC C60AFFF4 */  lwc1      $f10, -0xC($s0)
/* 337A10 E00227D0 460A4200 */  add.s     $f8, $f8, $f10
/* 337A14 E00227D4 E602FFF8 */  swc1      $f2, -0x8($s0)
/* 337A18 E00227D8 46262100 */  add.d     $f4, $f4, $f6
/* 337A1C E00227DC E600FFF8 */  swc1      $f0, -0x8($s0)
/* 337A20 E00227E0 C600FFEC */  lwc1      $f0, -0x14($s0)
/* 337A24 E00227E4 C602FFF8 */  lwc1      $f2, -0x8($s0)
/* 337A28 E00227E8 E608FFE8 */  swc1      $f8, -0x18($s0)
/* 337A2C E00227EC 46020000 */  add.s     $f0, $f0, $f2
/* 337A30 E00227F0 46202120 */  cvt.s.d   $f4, $f4
/* 337A34 E00227F4 E6040000 */  swc1      $f4, 0x0($s0)
/* 337A38 E00227F8 08008A36 */  j         .LE00228D8
/* 337A3C E00227FC E600FFEC */   swc1     $f0, -0x14($s0)
.LE0022800:
/* 337A40 E0022800 C600FFF4 */  lwc1      $f0, -0xC($s0)
/* 337A44 E0022804 3C01E002 */  lui       $at, (0xE0022D78 >> 16)
/* 337A48 E0022808 D4222D78 */  ldc1      $f2, (0xE0022D78 & 0xFFFF)($at)
/* 337A4C E002280C 46000021 */  cvt.d.s   $f0, $f0
/* 337A50 E0022810 46220002 */  mul.d     $f0, $f0, $f2
/* 337A54 E0022814 00000000 */  nop
/* 337A58 E0022818 C604FFF8 */  lwc1      $f4, -0x8($s0)
/* 337A5C E002281C C602FFFC */  lwc1      $f2, -0x4($s0)
/* 337A60 E0022820 46022100 */  add.s     $f4, $f4, $f2
/* 337A64 E0022824 8E020008 */  lw        $v0, 0x8($s0)
/* 337A68 E0022828 E604FFF8 */  swc1      $f4, -0x8($s0)
/* 337A6C E002282C 46200020 */  cvt.s.d   $f0, $f0
/* 337A70 E0022830 E600FFF4 */  swc1      $f0, -0xC($s0)
/* 337A74 E0022834 04410002 */  bgez      $v0, .LE0022840
/* 337A78 E0022838 46000086 */   mov.s    $f2, $f0
/* 337A7C E002283C 26940001 */  addiu     $s4, $s4, 0x1
.LE0022840:
/* 337A80 E0022840 C600FFE8 */  lwc1      $f0, -0x18($s0)
/* 337A84 E0022844 8E020008 */  lw        $v0, 0x8($s0)
/* 337A88 E0022848 46020000 */  add.s     $f0, $f0, $f2
/* 337A8C E002284C C602FFEC */  lwc1      $f2, -0x14($s0)
/* 337A90 E0022850 2442FFFF */  addiu     $v0, $v0, -0x1
/* 337A94 E0022854 AE020008 */  sw        $v0, 0x8($s0)
/* 337A98 E0022858 46041080 */  add.s     $f2, $f2, $f4
/* 337A9C E002285C 2C420015 */  sltiu     $v0, $v0, 0x15
/* 337AA0 E0022860 E600FFE8 */  swc1      $f0, -0x18($s0)
/* 337AA4 E0022864 14400004 */  bnez      $v0, .LE0022878
/* 337AA8 E0022868 E602FFEC */   swc1     $f2, -0x14($s0)
/* 337AAC E002286C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 337AB0 E0022870 08008A36 */  j         .LE00228D8
/* 337AB4 E0022874 AE020010 */   sw       $v0, 0x10($s0)
.LE0022878:
/* 337AB8 E0022878 8E030004 */  lw        $v1, 0x4($s0)
/* 337ABC E002287C 24620001 */  addiu     $v0, $v1, 0x1
/* 337AC0 E0022880 0040902D */  daddu     $s2, $v0, $zero
/* 337AC4 E0022884 28620007 */  slti      $v0, $v1, 0x7
/* 337AC8 E0022888 1040000B */  beqz      $v0, .LE00228B8
/* 337ACC E002288C AE120004 */   sw       $s2, 0x4($s0)
/* 337AD0 E0022890 00761021 */  addu      $v0, $v1, $s6
/* 337AD4 E0022894 90420000 */  lbu       $v0, 0x0($v0)
/* 337AD8 E0022898 44820000 */  mtc1      $v0, $f0
/* 337ADC E002289C 00000000 */  nop
/* 337AE0 E00228A0 46800020 */  cvt.s.w   $f0, $f0
/* 337AE4 E00228A4 46000021 */  cvt.d.s   $f0, $f0
/* 337AE8 E00228A8 463A0002 */  mul.d     $f0, $f0, $f26
/* 337AEC E00228AC 00000000 */  nop
/* 337AF0 E00228B0 08008A35 */  j         .LE00228D4
/* 337AF4 E00228B4 46200020 */   cvt.s.d  $f0, $f0
.LE00228B8:
/* 337AF8 E00228B8 C6000000 */  lwc1      $f0, 0x0($s0)
/* 337AFC E00228BC 46000021 */  cvt.d.s   $f0, $f0
/* 337B00 E00228C0 4620C081 */  sub.d     $f2, $f24, $f0
/* 337B04 E00228C4 46381082 */  mul.d     $f2, $f2, $f24
/* 337B08 E00228C8 00000000 */  nop
/* 337B0C E00228CC 46220000 */  add.d     $f0, $f0, $f2
/* 337B10 E00228D0 46200020 */  cvt.s.d   $f0, $f0
.LE00228D4:
/* 337B14 E00228D4 E6000000 */  swc1      $f0, 0x0($s0)
.LE00228D8:
/* 337B18 E00228D8 26310001 */  addiu     $s1, $s1, 0x1
/* 337B1C E00228DC 8EA20008 */  lw        $v0, 0x8($s5)
/* 337B20 E00228E0 2442FFFF */  addiu     $v0, $v0, -0x1
/* 337B24 E00228E4 0222102A */  slt       $v0, $s1, $v0
/* 337B28 E00228E8 1440FF49 */  bnez      $v0, .LE0022610
/* 337B2C E00228EC 26100030 */   addiu    $s0, $s0, 0x30
.LE00228F0:
/* 337B30 E00228F0 1260000A */  beqz      $s3, .LE002291C
/* 337B34 E00228F4 2402000A */   addiu    $v0, $zero, 0xA
/* 337B38 E00228F8 12620008 */  beq       $s3, $v0, .LE002291C
/* 337B3C E00228FC 00000000 */   nop
/* 337B40 E0022900 8EA20008 */  lw        $v0, 0x8($s5)
/* 337B44 E0022904 2442FFFF */  addiu     $v0, $v0, -0x1
/* 337B48 E0022908 0282102A */  slt       $v0, $s4, $v0
/* 337B4C E002290C 14400003 */  bnez      $v0, .LE002291C
/* 337B50 E0022910 00000000 */   nop
.LE0022914:
/* 337B54 E0022914 0C080128 */  jal       shim_remove_effect
/* 337B58 E0022918 02A0202D */   daddu    $a0, $s5, $zero
.LE002291C:
/* 337B5C E002291C 8FBF0034 */  lw        $ra, 0x34($sp)
/* 337B60 E0022920 8FBE0030 */  lw        $fp, 0x30($sp)
/* 337B64 E0022924 8FB7002C */  lw        $s7, 0x2C($sp)
/* 337B68 E0022928 8FB60028 */  lw        $s6, 0x28($sp)
/* 337B6C E002292C 8FB50024 */  lw        $s5, 0x24($sp)
/* 337B70 E0022930 8FB40020 */  lw        $s4, 0x20($sp)
/* 337B74 E0022934 8FB3001C */  lw        $s3, 0x1C($sp)
/* 337B78 E0022938 8FB20018 */  lw        $s2, 0x18($sp)
/* 337B7C E002293C 8FB10014 */  lw        $s1, 0x14($sp)
/* 337B80 E0022940 8FB00010 */  lw        $s0, 0x10($sp)
/* 337B84 E0022944 D7BC0058 */  ldc1      $f28, 0x58($sp)
/* 337B88 E0022948 D7BA0050 */  ldc1      $f26, 0x50($sp)
/* 337B8C E002294C D7B80048 */  ldc1      $f24, 0x48($sp)
/* 337B90 E0022950 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 337B94 E0022954 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 337B98 E0022958 03E00008 */  jr        $ra
/* 337B9C E002295C 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

void sparkles_update(EffectInstance *effect) {
    SparklesFXData* part = effect->data.sparkles;
    SparklesFXData* firstPart = part;
    s32 unk_00 = part->unk_00;
    f32 unk_10;
    f32 unk_14;
    s32 unk_20;
    s32 count = 0;
    f32 temp_f20;
    f32 angle;
    s32 i;

    part->unk_24--;
    part->unk_20++;

    unk_20 = part->unk_20;

    if ((unk_00 == 0 || unk_00 == 10) && part->unk_24 < 0) {
        shim_remove_effect(effect);
        return;
    }

    part++;
    for (i = 0; i < effect->numParts - 1; i++, part++) {
        part->unk_2C = (unk_20 + i) & 7;
        switch (unk_00) {
            case 0:
                part->unk_18 += -0.02;
                if (unk_20 - 1 < 7) {
                    part->unk_04 = part->unk_10 * D_E0022D14[unk_20 - 1] * 0.01;
                    part->unk_08 = part->unk_14 * D_E0022D14[unk_20 - 1] * 0.01 + part->unk_18;
                    part->unk_1C = (f32) D_E0022D1C[unk_20 - 1] * 0.01;
                } else {
                    angle = func_E0200044(360, i + 177);
                    temp_f20 = (i & 3) * 0.5f + 1.0f;
                    firstPart->unk_00 = 10;
                    part->unk_10 = temp_f20 * shim_sin_deg(angle);
                    part->unk_14 = temp_f20 * shim_cos_deg(angle);
                    part->unk_18 = -0.05f;
                }
                break;
            case 10:
                part->unk_10 *= 0.96;
                part->unk_1C += (0.1 - part->unk_1C) * 0.1;
                part->unk_14 *= 0.96;
                part->unk_14 += part->unk_18;
                part->unk_04 += part->unk_10;
                part->unk_08 += part->unk_14;
                break;
            default:
                part->unk_10 *= 0.9;
                part->unk_14 += part->unk_18;
                unk_10 = part->unk_10;
                unk_14 = part->unk_14;
                if (part->unk_24 < 0) {
                    count++;
                }
                part->unk_04 += unk_10;
                part->unk_08 += unk_14;
                part->unk_24--;
                if (part->unk_24 < 0 || part->unk_24 >= 21) {
                    part->unk_2C = -1;
                } else {
                    part->unk_20++;
                    unk_20 = part->unk_20;
                    if (unk_20 - 1 < 7) {
                        part->unk_1C = (f32) D_E0022D1C[unk_20 - 1] * 0.01;
                    } else {
                        part->unk_1C += (0.1 - part->unk_1C) * 0.1;
                    }
                }
                break;
        }
    }

    if (unk_00 != 0 && unk_00 != 10 && count >= effect->numParts - 1) {
        shim_remove_effect(effect);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel imgfx_update
/* D119C 8013AA9C 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* D11A0 8013AAA0 AFB00010 */  sw        $s0, 0x10($sp)
/* D11A4 8013AAA4 00C0802D */  daddu     $s0, $a2, $zero
/* D11A8 8013AAA8 00041140 */  sll       $v0, $a0, 5
/* D11AC 8013AAAC 00441023 */  subu      $v0, $v0, $a0
/* D11B0 8013AAB0 3C038015 */  lui       $v1, %hi(ImgFXInstances)
/* D11B4 8013AAB4 8C636954 */  lw        $v1, %lo(ImgFXInstances)($v1)
/* D11B8 8013AAB8 8FA80030 */  lw        $t0, 0x30($sp)
/* D11BC 8013AABC 8FA60034 */  lw        $a2, 0x34($sp)
/* D11C0 8013AAC0 00021080 */  sll       $v0, $v0, 2
/* D11C4 8013AAC4 AFBF001C */  sw        $ra, 0x1C($sp)
/* D11C8 8013AAC8 AFB20018 */  sw        $s2, 0x18($sp)
/* D11CC 8013AACC AFB10014 */  sw        $s1, 0x14($sp)
/* D11D0 8013AAD0 00628821 */  addu      $s1, $v1, $v0
/* D11D4 8013AAD4 8E220014 */  lw        $v0, 0x14($s1)
/* D11D8 8013AAD8 8FB20038 */  lw        $s2, 0x38($sp)
/* D11DC 8013AADC 30420001 */  andi      $v0, $v0, 0x1
/* D11E0 8013AAE0 10400109 */  beqz      $v0, .L8013AF08
/* D11E4 8013AAE4 2C82005A */   sltiu    $v0, $a0, 0x5A
/* D11E8 8013AAE8 10400107 */  beqz      $v0, .L8013AF08
/* D11EC 8013AAEC 2CA20012 */   sltiu    $v0, $a1, 0x12
/* D11F0 8013AAF0 10400048 */  beqz      $v0, .L8013AC14
/* D11F4 8013AAF4 00051080 */   sll      $v0, $a1, 2
/* D11F8 8013AAF8 3C018015 */  lui       $at, %hi(jtbl_80150FB0)
/* D11FC 8013AAFC 00220821 */  addu      $at, $at, $v0
/* D1200 8013AB00 8C220FB0 */  lw        $v0, %lo(jtbl_80150FB0)($at)
/* D1204 8013AB04 00400008 */  jr        $v0
/* D1208 8013AB08 00000000 */   nop
glabel .L8013AB0C
/* D120C 8013AB0C 8E300014 */  lw        $s0, 0x14($s1)
/* D1210 8013AB10 0C04EA4F */  jal       imgfx_cache_instance_data
/* D1214 8013AB14 0220202D */   daddu    $a0, $s1, $zero
/* D1218 8013AB18 0C04EA7A */  jal       imgfx_init_instance
/* D121C 8013AB1C 0220202D */   daddu    $a0, $s1, $zero
/* D1220 8013AB20 2402FFFF */  addiu     $v0, $zero, -0x1
/* D1224 8013AB24 A2200005 */  sb        $zero, 0x5($s1)
/* D1228 8013AB28 A2200006 */  sb        $zero, 0x6($s1)
/* D122C 8013AB2C A2200001 */  sb        $zero, 0x1($s1)
/* D1230 8013AB30 A2200002 */  sb        $zero, 0x2($s1)
/* D1234 8013AB34 AE22001C */  sw        $v0, 0x1C($s1)
/* D1238 8013AB38 AE22002C */  sw        $v0, 0x2C($s1)
/* D123C 8013AB3C AE300014 */  sw        $s0, 0x14($s1)
/* D1240 8013AB40 0200182D */  daddu     $v1, $s0, $zero
/* D1244 8013AB44 30620001 */  andi      $v0, $v1, 0x1
/* D1248 8013AB48 12400002 */  beqz      $s2, .L8013AB54
/* D124C 8013AB4C AE220014 */   sw       $v0, 0x14($s1)
/* D1250 8013AB50 00521025 */  or        $v0, $v0, $s2
.L8013AB54:
/* D1254 8013AB54 0804EBC2 */  j         .L8013AF08
/* D1258 8013AB58 AE220014 */   sw       $v0, 0x14($s1)
glabel .L8013AB5C
/* D125C 8013AB5C 2402FFFF */  addiu     $v0, $zero, -0x1
/* D1260 8013AB60 A2200005 */  sb        $zero, 0x5($s1)
/* D1264 8013AB64 A2200002 */  sb        $zero, 0x2($s1)
/* D1268 8013AB68 0804EBC2 */  j         .L8013AF08
/* D126C 8013AB6C AE22001C */   sw       $v0, 0x1C($s1)
glabel .L8013AB70
/* D1270 8013AB70 2402FFFF */  addiu     $v0, $zero, -0x1
/* D1274 8013AB74 A2200006 */  sb        $zero, 0x6($s1)
/* D1278 8013AB78 A2200001 */  sb        $zero, 0x1($s1)
/* D127C 8013AB7C 0804EBC2 */  j         .L8013AF08
/* D1280 8013AB80 AE22002C */   sw       $v0, 0x2C($s1)
glabel .L8013AB84
/* D1284 8013AB84 8E24005C */  lw        $a0, 0x5C($s1)
/* D1288 8013AB88 10800004 */  beqz      $a0, .L8013AB9C
/* D128C 8013AB8C 00101080 */   sll      $v0, $s0, 2
/* D1290 8013AB90 0C00AB4B */  jal       heap_free
/* D1294 8013AB94 00000000 */   nop
/* D1298 8013AB98 00101080 */  sll       $v0, $s0, 2
.L8013AB9C:
/* D129C 8013AB9C A6220060 */  sh        $v0, 0x60($s1)
/* D12A0 8013ABA0 0C00AB39 */  jal       heap_malloc
/* D12A4 8013ABA4 3044FFFF */   andi     $a0, $v0, 0xFFFF
/* D12A8 8013ABA8 0804EBC2 */  j         .L8013AF08
/* D12AC 8013ABAC AE22005C */   sw       $v0, 0x5C($s1)
glabel .L8013ABB0
/* D12B0 8013ABB0 82220006 */  lb        $v0, 0x6($s1)
/* D12B4 8013ABB4 14A20021 */  bne       $a1, $v0, .L8013AC3C
/* D12B8 8013ABB8 24030005 */   addiu    $v1, $zero, 0x5
/* D12BC 8013ABBC 8E22002C */  lw        $v0, 0x2C($s1)
/* D12C0 8013ABC0 1602001E */  bne       $s0, $v0, .L8013AC3C
/* D12C4 8013ABC4 00000000 */   nop
/* D12C8 8013ABC8 8E220030 */  lw        $v0, 0x30($s1)
/* D12CC 8013ABCC 10E200CE */  beq       $a3, $v0, .L8013AF08
/* D12D0 8013ABD0 00000000 */   nop
/* D12D4 8013ABD4 0804EB0F */  j         .L8013AC3C
/* D12D8 8013ABD8 00000000 */   nop
glabel .L8013ABDC
/* D12DC 8013ABDC 82220005 */  lb        $v0, 0x5($s1)
/* D12E0 8013ABE0 14450016 */  bne       $v0, $a1, .L8013AC3C
/* D12E4 8013ABE4 24030005 */   addiu    $v1, $zero, 0x5
/* D12E8 8013ABE8 8E22001C */  lw        $v0, 0x1C($s1)
/* D12EC 8013ABEC 14500013 */  bne       $v0, $s0, .L8013AC3C
/* D12F0 8013ABF0 00000000 */   nop
/* D12F4 8013ABF4 8E220020 */  lw        $v0, 0x20($s1)
/* D12F8 8013ABF8 14470010 */  bne       $v0, $a3, .L8013AC3C
/* D12FC 8013ABFC 00000000 */   nop
/* D1300 8013AC00 8E220024 */  lw        $v0, 0x24($s1)
/* D1304 8013AC04 104800C0 */  beq       $v0, $t0, .L8013AF08
/* D1308 8013AC08 00000000 */   nop
/* D130C 8013AC0C 0804EB0F */  j         .L8013AC3C
/* D1310 8013AC10 00000000 */   nop
glabel .L8013AC14
/* D1314 8013AC14 2403000D */  addiu     $v1, $zero, 0xD
/* D1318 8013AC18 50A30008 */  beql      $a1, $v1, .L8013AC3C
/* D131C 8013AC1C 24030005 */   addiu    $v1, $zero, 0x5
/* D1320 8013AC20 82220006 */  lb        $v0, 0x6($s1)
/* D1324 8013AC24 14430005 */  bne       $v0, $v1, .L8013AC3C
/* D1328 8013AC28 24030005 */   addiu    $v1, $zero, 0x5
/* D132C 8013AC2C 24020001 */  addiu     $v0, $zero, 0x1
/* D1330 8013AC30 A2200001 */  sb        $zero, 0x1($s1)
/* D1334 8013AC34 A2220003 */  sb        $v0, 0x3($s1)
/* D1338 8013AC38 A2220004 */  sb        $v0, 0x4($s1)
.L8013AC3C:
/* D133C 8013AC3C 10A30005 */  beq       $a1, $v1, .L8013AC54
/* D1340 8013AC40 24A2FFFC */   addiu    $v0, $a1, -0x4
/* D1344 8013AC44 82220005 */  lb        $v0, 0x5($s1)
/* D1348 8013AC48 50430001 */  beql      $v0, $v1, .L8013AC50
/* D134C 8013AC4C A2200005 */   sb       $zero, 0x5($s1)
.L8013AC50:
/* D1350 8013AC50 24A2FFFC */  addiu     $v0, $a1, -0x4
.L8013AC54:
/* D1354 8013AC54 2C420002 */  sltiu     $v0, $v0, 0x2
/* D1358 8013AC58 10400007 */  beqz      $v0, .L8013AC78
/* D135C 8013AC5C 24A2FFFA */   addiu    $v0, $a1, -0x6
/* D1360 8013AC60 A2250005 */  sb        $a1, 0x5($s1)
/* D1364 8013AC64 AE30001C */  sw        $s0, 0x1C($s1)
/* D1368 8013AC68 AE270020 */  sw        $a3, 0x20($s1)
/* D136C 8013AC6C AE280024 */  sw        $t0, 0x24($s1)
/* D1370 8013AC70 0804EB26 */  j         .L8013AC98
/* D1374 8013AC74 AE260028 */   sw       $a2, 0x28($s1)
.L8013AC78:
/* D1378 8013AC78 2C42000B */  sltiu     $v0, $v0, 0xB
/* D137C 8013AC7C 10400006 */  beqz      $v0, .L8013AC98
/* D1380 8013AC80 00000000 */   nop
/* D1384 8013AC84 A2250006 */  sb        $a1, 0x6($s1)
/* D1388 8013AC88 AE30002C */  sw        $s0, 0x2C($s1)
/* D138C 8013AC8C AE270030 */  sw        $a3, 0x30($s1)
/* D1390 8013AC90 AE280034 */  sw        $t0, 0x34($s1)
/* D1394 8013AC94 AE260038 */  sw        $a2, 0x38($s1)
.L8013AC98:
/* D1398 8013AC98 8E220014 */  lw        $v0, 0x14($s1)
/* D139C 8013AC9C 30420001 */  andi      $v0, $v0, 0x1
/* D13A0 8013ACA0 12400003 */  beqz      $s2, .L8013ACB0
/* D13A4 8013ACA4 AE220014 */   sw       $v0, 0x14($s1)
/* D13A8 8013ACA8 00521025 */  or        $v0, $v0, $s2
/* D13AC 8013ACAC AE220014 */  sw        $v0, 0x14($s1)
.L8013ACB0:
/* D13B0 8013ACB0 24A5FFFD */  addiu     $a1, $a1, -0x3
/* D13B4 8013ACB4 2CA2000E */  sltiu     $v0, $a1, 0xE
/* D13B8 8013ACB8 10400093 */  beqz      $v0, .L8013AF08
/* D13BC 8013ACBC A2200001 */   sb       $zero, 0x1($s1)
/* D13C0 8013ACC0 00051080 */  sll       $v0, $a1, 2
/* D13C4 8013ACC4 3C018015 */  lui       $at, %hi(jtbl_80150FF8)
/* D13C8 8013ACC8 00220821 */  addu      $at, $at, $v0
/* D13CC 8013ACCC 8C220FF8 */  lw        $v0, %lo(jtbl_80150FF8)($at)
/* D13D0 8013ACD0 00400008 */  jr        $v0
/* D13D4 8013ACD4 00000000 */   nop
glabel .L8013ACD8
/* D13D8 8013ACD8 A2200001 */  sb        $zero, 0x1($s1)
/* D13DC 8013ACDC 0804EBC2 */  j         .L8013AF08
/* D13E0 8013ACE0 A2200002 */   sb       $zero, 0x2($s1)
glabel .L8013ACE4
/* D13E4 8013ACE4 0220202D */  daddu     $a0, $s1, $zero
/* D13E8 8013ACE8 24020004 */  addiu     $v0, $zero, 0x4
/* D13EC 8013ACEC A0820003 */  sb        $v0, 0x3($a0)
/* D13F0 8013ACF0 A0820004 */  sb        $v0, 0x4($a0)
/* D13F4 8013ACF4 24020001 */  addiu     $v0, $zero, 0x1
/* D13F8 8013ACF8 0C04FB92 */  jal       imgfx_wavy_init
/* D13FC 8013ACFC A0820001 */   sb       $v0, 0x1($a0)
/* D1400 8013AD00 0804EBC2 */  j         .L8013AF08
/* D1404 8013AD04 00000000 */   nop
glabel .L8013AD08
/* D1408 8013AD08 8E230014 */  lw        $v1, 0x14($s1)
/* D140C 8013AD0C 24020002 */  addiu     $v0, $zero, 0x2
/* D1410 8013AD10 A2220001 */  sb        $v0, 0x1($s1)
/* D1414 8013AD14 2402000B */  addiu     $v0, $zero, 0xB
/* D1418 8013AD18 A2220002 */  sb        $v0, 0x2($s1)
/* D141C 8013AD1C AE20003C */  sw        $zero, 0x3C($s1)
/* D1420 8013AD20 AE200040 */  sw        $zero, 0x40($s1)
/* D1424 8013AD24 34630200 */  ori       $v1, $v1, 0x200
/* D1428 8013AD28 0804EBC2 */  j         .L8013AF08
/* D142C 8013AD2C AE230014 */   sw       $v1, 0x14($s1)
glabel .L8013AD30
/* D1430 8013AD30 2A0200FF */  slti      $v0, $s0, 0xFF
/* D1434 8013AD34 1440000B */  bnez      $v0, .L8013AD64
/* D1438 8013AD38 28C200FF */   slti     $v0, $a2, 0xFF
/* D143C 8013AD3C 28E200FF */  slti      $v0, $a3, 0xFF
/* D1440 8013AD40 14400008 */  bnez      $v0, .L8013AD64
/* D1444 8013AD44 28C200FF */   slti     $v0, $a2, 0xFF
/* D1448 8013AD48 290200FF */  slti      $v0, $t0, 0xFF
/* D144C 8013AD4C 14400005 */  bnez      $v0, .L8013AD64
/* D1450 8013AD50 28C200FF */   slti     $v0, $a2, 0xFF
/* D1454 8013AD54 14400008 */  bnez      $v0, .L8013AD78
/* D1458 8013AD58 2A0200FF */   slti     $v0, $s0, 0xFF
/* D145C 8013AD5C 0804EBC2 */  j         .L8013AF08
/* D1460 8013AD60 A2200002 */   sb       $zero, 0x2($s1)
.L8013AD64:
/* D1464 8013AD64 14400004 */  bnez      $v0, .L8013AD78
/* D1468 8013AD68 2A0200FF */   slti     $v0, $s0, 0xFF
/* D146C 8013AD6C 24020001 */  addiu     $v0, $zero, 0x1
/* D1470 8013AD70 0804EBC2 */  j         .L8013AF08
/* D1474 8013AD74 A2220002 */   sb       $v0, 0x2($s1)
.L8013AD78:
/* D1478 8013AD78 1440000A */  bnez      $v0, .L8013ADA4
/* D147C 8013AD7C 24020003 */   addiu    $v0, $zero, 0x3
/* D1480 8013AD80 28E200FF */  slti      $v0, $a3, 0xFF
/* D1484 8013AD84 14400007 */  bnez      $v0, .L8013ADA4
/* D1488 8013AD88 24020003 */   addiu    $v0, $zero, 0x3
/* D148C 8013AD8C 290200FF */  slti      $v0, $t0, 0xFF
/* D1490 8013AD90 14400004 */  bnez      $v0, .L8013ADA4
/* D1494 8013AD94 24020003 */   addiu    $v0, $zero, 0x3
/* D1498 8013AD98 24020002 */  addiu     $v0, $zero, 0x2
/* D149C 8013AD9C 0804EBC2 */  j         .L8013AF08
/* D14A0 8013ADA0 A2220002 */   sb       $v0, 0x2($s1)
.L8013ADA4:
/* D14A4 8013ADA4 0804EBC2 */  j         .L8013AF08
/* D14A8 8013ADA8 A2220002 */   sb       $v0, 0x2($s1)
glabel .L8013ADAC
/* D14AC 8013ADAC 3C018015 */  lui       $at, %hi(D_80151030)
/* D14B0 8013ADB0 D4221030 */  ldc1      $f2, %lo(D_80151030)($at)
/* D14B4 8013ADB4 44860000 */  mtc1      $a2, $f0
/* D14B8 8013ADB8 00000000 */  nop
/* D14BC 8013ADBC 46800021 */  cvt.d.w   $f0, $f0
/* D14C0 8013ADC0 46220032 */  c.eq.d    $f0, $f2
/* D14C4 8013ADC4 00000000 */  nop
/* D14C8 8013ADC8 45000003 */  bc1f      .L8013ADD8
/* D14CC 8013ADCC 24020004 */   addiu    $v0, $zero, 0x4
/* D14D0 8013ADD0 0804EBC2 */  j         .L8013AF08
/* D14D4 8013ADD4 A2220002 */   sb       $v0, 0x2($s1)
.L8013ADD8:
/* D14D8 8013ADD8 24020005 */  addiu     $v0, $zero, 0x5
/* D14DC 8013ADDC 0804EBC2 */  j         .L8013AF08
/* D14E0 8013ADE0 A2220002 */   sb       $v0, 0x2($s1)
glabel .L8013ADE4
/* D14E4 8013ADE4 96220060 */  lhu       $v0, 0x60($s1)
/* D14E8 8013ADE8 0202102A */  slt       $v0, $s0, $v0
/* D14EC 8013ADEC 10400046 */  beqz      $v0, .L8013AF08
/* D14F0 8013ADF0 00072602 */   srl      $a0, $a3, 24
/* D14F4 8013ADF4 8E22005C */  lw        $v0, 0x5C($s1)
/* D14F8 8013ADF8 00101880 */  sll       $v1, $s0, 2
/* D14FC 8013ADFC 00621021 */  addu      $v0, $v1, $v0
/* D1500 8013AE00 A0440000 */  sb        $a0, 0x0($v0)
/* D1504 8013AE04 8E22005C */  lw        $v0, 0x5C($s1)
/* D1508 8013AE08 00072402 */  srl       $a0, $a3, 16
/* D150C 8013AE0C 00621021 */  addu      $v0, $v1, $v0
/* D1510 8013AE10 A0440001 */  sb        $a0, 0x1($v0)
/* D1514 8013AE14 8E22005C */  lw        $v0, 0x5C($s1)
/* D1518 8013AE18 00072202 */  srl       $a0, $a3, 8
/* D151C 8013AE1C 00621021 */  addu      $v0, $v1, $v0
/* D1520 8013AE20 A0440002 */  sb        $a0, 0x2($v0)
/* D1524 8013AE24 8E22005C */  lw        $v0, 0x5C($s1)
/* D1528 8013AE28 00621821 */  addu      $v1, $v1, $v0
/* D152C 8013AE2C A0670003 */  sb        $a3, 0x3($v1)
/* D1530 8013AE30 30E300FF */  andi      $v1, $a3, 0xFF
/* D1534 8013AE34 240200FF */  addiu     $v0, $zero, 0xFF
/* D1538 8013AE38 14620004 */  bne       $v1, $v0, .L8013AE4C
/* D153C 8013AE3C A2200001 */   sb       $zero, 0x1($s1)
/* D1540 8013AE40 24020006 */  addiu     $v0, $zero, 0x6
/* D1544 8013AE44 0804EBC2 */  j         .L8013AF08
/* D1548 8013AE48 A2220002 */   sb       $v0, 0x2($s1)
.L8013AE4C:
/* D154C 8013AE4C 24020008 */  addiu     $v0, $zero, 0x8
/* D1550 8013AE50 0804EBC2 */  j         .L8013AF08
/* D1554 8013AE54 A2220002 */   sb       $v0, 0x2($s1)
glabel .L8013AE58
/* D1558 8013AE58 96220060 */  lhu       $v0, 0x60($s1)
/* D155C 8013AE5C 0202102A */  slt       $v0, $s0, $v0
/* D1560 8013AE60 10400029 */  beqz      $v0, .L8013AF08
/* D1564 8013AE64 00072602 */   srl      $a0, $a3, 24
/* D1568 8013AE68 8E22005C */  lw        $v0, 0x5C($s1)
/* D156C 8013AE6C 00101880 */  sll       $v1, $s0, 2
/* D1570 8013AE70 00621021 */  addu      $v0, $v1, $v0
/* D1574 8013AE74 A0440000 */  sb        $a0, 0x0($v0)
/* D1578 8013AE78 8E22005C */  lw        $v0, 0x5C($s1)
/* D157C 8013AE7C 00072402 */  srl       $a0, $a3, 16
/* D1580 8013AE80 00621021 */  addu      $v0, $v1, $v0
/* D1584 8013AE84 A0440001 */  sb        $a0, 0x1($v0)
/* D1588 8013AE88 8E22005C */  lw        $v0, 0x5C($s1)
/* D158C 8013AE8C 00072202 */  srl       $a0, $a3, 8
/* D1590 8013AE90 00621021 */  addu      $v0, $v1, $v0
/* D1594 8013AE94 A0440002 */  sb        $a0, 0x2($v0)
/* D1598 8013AE98 8E22005C */  lw        $v0, 0x5C($s1)
/* D159C 8013AE9C 00621821 */  addu      $v1, $v1, $v0
/* D15A0 8013AEA0 A0670003 */  sb        $a3, 0x3($v1)
/* D15A4 8013AEA4 30E300FF */  andi      $v1, $a3, 0xFF
/* D15A8 8013AEA8 240200FF */  addiu     $v0, $zero, 0xFF
/* D15AC 8013AEAC 14620004 */  bne       $v1, $v0, .L8013AEC0
/* D15B0 8013AEB0 A2200001 */   sb       $zero, 0x1($s1)
/* D15B4 8013AEB4 24020009 */  addiu     $v0, $zero, 0x9
/* D15B8 8013AEB8 0804EBC2 */  j         .L8013AF08
/* D15BC 8013AEBC A2220002 */   sb       $v0, 0x2($s1)
.L8013AEC0:
/* D15C0 8013AEC0 2402000A */  addiu     $v0, $zero, 0xA
/* D15C4 8013AEC4 0804EBC2 */  j         .L8013AF08
/* D15C8 8013AEC8 A2220002 */   sb       $v0, 0x2($s1)
glabel .L8013AECC
/* D15CC 8013AECC 2402000C */  addiu     $v0, $zero, 0xC
/* D15D0 8013AED0 0804EBC2 */  j         .L8013AF08
/* D15D4 8013AED4 A2220002 */   sb       $v0, 0x2($s1)
glabel .L8013AED8
/* D15D8 8013AED8 2402000D */  addiu     $v0, $zero, 0xD
/* D15DC 8013AEDC 0804EBC2 */  j         .L8013AF08
/* D15E0 8013AEE0 A2220002 */   sb       $v0, 0x2($s1)
glabel .L8013AEE4
/* D15E4 8013AEE4 24020004 */  addiu     $v0, $zero, 0x4
/* D15E8 8013AEE8 A2220001 */  sb        $v0, 0x1($s1)
/* D15EC 8013AEEC 28E200FF */  slti      $v0, $a3, 0xFF
/* D15F0 8013AEF0 14400002 */  bnez      $v0, .L8013AEFC
/* D15F4 8013AEF4 2402000F */   addiu    $v0, $zero, 0xF
/* D15F8 8013AEF8 2402000E */  addiu     $v0, $zero, 0xE
.L8013AEFC:
/* D15FC 8013AEFC A2220002 */  sb        $v0, 0x2($s1)
/* D1600 8013AF00 AE20004C */  sw        $zero, 0x4C($s1)
/* D1604 8013AF04 AE200050 */  sw        $zero, 0x50($s1)
.L8013AF08:
/* D1608 8013AF08 8FBF001C */  lw        $ra, 0x1C($sp)
/* D160C 8013AF0C 8FB20018 */  lw        $s2, 0x18($sp)
/* D1610 8013AF10 8FB10014 */  lw        $s1, 0x14($sp)
/* D1614 8013AF14 8FB00010 */  lw        $s0, 0x10($sp)
/* D1618 8013AF18 03E00008 */  jr        $ra
/* D161C 8013AF1C 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void imgfx_update_cache_impl(void) {
    s32 i;

    for (i = 0; i < ARRAY_COUNT(ImgFXDataCache); i++) {
        if (ImgFXDataCache[i].data != NULL) {
            ImgFXDataCache[i].staleCooldownTimer--;

            if (ImgFXDataCache[i].staleCooldownTimer == 0) {
                if (ImgFXDataCache[i].usingContextualHeap) {
                    heap_free(ImgFXDataCache[i].data);
                    ImgFXDataCache[i].data = NULL;
                } else {
                    general_heap_free(ImgFXDataCache[i].data);
                    ImgFXDataCache[i].data = NULL;
                }

                ImgFXDataCache[i].staleCooldownTimer = 0;
                ImgFXDataCache[i].usingContextualHeap = FALSE;
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel load_demo_battle
/* 4E214 80072E14 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 4E218 80072E18 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 4E21C 80072E1C 2463419C */  addiu     $v1, $v1, %lo(gGameStatusPtr)
/* 4E220 80072E20 AFBF0018 */  sw        $ra, 0x18($sp)
/* 4E224 80072E24 AFB10014 */  sw        $s1, 0x14($sp)
/* 4E228 80072E28 AFB00010 */  sw        $s0, 0x10($sp)
/* 4E22C 80072E2C 8C620000 */  lw        $v0, 0x0($v1)
/* 4E230 80072E30 A04000AA */  sb        $zero, 0xAA($v0)
/* 4E234 80072E34 8C620000 */  lw        $v0, 0x0($v1)
/* 4E238 80072E38 0080882D */  daddu     $s1, $a0, $zero
/* 4E23C 80072E3C A4400086 */  sh        $zero, 0x86($v0)
/* 4E240 80072E40 A440008C */  sh        $zero, 0x8C($v0)
/* 4E244 80072E44 0C00AB00 */  jal       general_heap_create
/* 4E248 80072E48 A0400070 */   sb       $zero, 0x70($v0)
/* 4E24C 80072E4C 0C048C2E */  jal       clear_worker_list
/* 4E250 80072E50 00000000 */   nop
/* 4E254 80072E54 0C0B0C77 */  jal       clear_script_list
/* 4E258 80072E58 00000000 */   nop
/* 4E25C 80072E5C 0C00B7BD */  jal       create_cameras_a
/* 4E260 80072E60 00000000 */   nop
/* 4E264 80072E64 0C0B763E */  jal       spr_init_sprites
/* 4E268 80072E68 0000202D */   daddu    $a0, $zero, $zero
/* 4E26C 80072E6C 0C047889 */  jal       clear_animator_list
/* 4E270 80072E70 00000000 */   nop
/* 4E274 80072E74 0C0482EC */  jal       clear_entity_models
/* 4E278 80072E78 00000000 */   nop
/* 4E27C 80072E7C 0C00E12F */  jal       clear_npcs
/* 4E280 80072E80 00000000 */   nop
/* 4E284 80072E84 0C050440 */  jal       hud_element_clear_cache
/* 4E288 80072E88 00000000 */   nop
/* 4E28C 80072E8C 0C0515A0 */  jal       clear_trigger_data
/* 4E290 80072E90 00000000 */   nop
/* 4E294 80072E94 0C045751 */  jal       clear_model_data
/* 4E298 80072E98 00000000 */   nop
/* 4E29C 80072E9C 0C052010 */  jal       clear_sprite_shading_data
/* 4E2A0 80072EA0 00000000 */   nop
/* 4E2A4 80072EA4 0C05177E */  jal       reset_background_settings
/* 4E2A8 80072EA8 00000000 */   nop
/* 4E2AC 80072EAC 0C04E062 */  jal       func_80138188
/* 4E2B0 80072EB0 00000000 */   nop
/* 4E2B4 80072EB4 0C01CACC */  jal       reset_battle_status
/* 4E2B8 80072EB8 00000000 */   nop
/* 4E2BC 80072EBC 0C00F900 */  jal       clear_encounter_status
/* 4E2C0 80072EC0 00000000 */   nop
/* 4E2C4 80072EC4 0C04432E */  jal       clear_entity_data
/* 4E2C8 80072EC8 24040001 */   addiu    $a0, $zero, 0x1
/* 4E2CC 80072ECC 0C016727 */  jal       clear_effect_data
/* 4E2D0 80072ED0 00000000 */   nop
/* 4E2D4 80072ED4 0C037F14 */  jal       clear_player_status
/* 4E2D8 80072ED8 00000000 */   nop
/* 4E2DC 80072EDC 0C048D9D */  jal       clear_printers
/* 4E2E0 80072EE0 00000000 */   nop
/* 4E2E4 80072EE4 0C04C3FC */  jal       clear_item_entity_data
/* 4E2E8 80072EE8 00000000 */   nop
/* 4E2EC 80072EEC 0C039CE8 */  jal       clear_player_data
/* 4E2F0 80072EF0 00000000 */   nop
/* 4E2F4 80072EF4 0C039E4D */  jal       initialize_status_bar
/* 4E2F8 80072EF8 00000000 */   nop
/* 4E2FC 80072EFC 0C04C3FC */  jal       clear_item_entity_data
/* 4E300 80072F00 00000000 */   nop
/* 4E304 80072F04 3C05437F */  lui       $a1, (0x437F0000 >> 16)
/* 4E308 80072F08 0C04DF62 */  jal       set_screen_overlay_params_front
/* 4E30C 80072F0C 24040009 */   addiu    $a0, $zero, 0x9
/* 4E310 80072F10 3C108011 */  lui       $s0, %hi(gPlayerData)
/* 4E314 80072F14 2610F290 */  addiu     $s0, $s0, %lo(gPlayerData)
/* 4E318 80072F18 2E220005 */  sltiu     $v0, $s1, 0x5
/* 4E31C 80072F1C 1040002D */  beqz      $v0, .L80072FD4
/* 4E320 80072F20 00111080 */   sll      $v0, $s1, 2
/* 4E324 80072F24 3C01800A */  lui       $at, %hi(jtbl_8009A578)
/* 4E328 80072F28 00220821 */  addu      $at, $at, $v0
/* 4E32C 80072F2C 8C22A578 */  lw        $v0, %lo(jtbl_8009A578)($at)
/* 4E330 80072F30 00400008 */  jr        $v0
/* 4E334 80072F34 00000000 */   nop
glabel .L80072F38
/* 4E338 80072F38 0C01CB4B */  jal       setup_demo_player
/* 4E33C 80072F3C 24112700 */   addiu    $s1, $zero, 0x2700
/* 4E340 80072F40 0000202D */  daddu     $a0, $zero, $zero
/* 4E344 80072F44 0801CBF8 */  j         .L80072FE0
/* 4E348 80072F48 A200000A */   sb       $zero, 0xA($s0)
glabel .L80072F4C
/* 4E34C 80072F4C 0C01CB4B */  jal       setup_demo_player
/* 4E350 80072F50 24112701 */   addiu    $s1, $zero, 0x2701
/* 4E354 80072F54 0000202D */  daddu     $a0, $zero, $zero
/* 4E358 80072F58 24020009 */  addiu     $v0, $zero, 0x9
/* 4E35C 80072F5C 0801CBF8 */  j         .L80072FE0
/* 4E360 80072F60 A2020012 */   sb       $v0, 0x12($s0)
glabel .L80072F64
/* 4E364 80072F64 0C01CB4B */  jal       setup_demo_player
/* 4E368 80072F68 24112702 */   addiu    $s1, $zero, 0x2702
/* 4E36C 80072F6C 0000202D */  daddu     $a0, $zero, $zero
/* 4E370 80072F70 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 4E374 80072F74 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 4E378 80072F78 24020004 */  addiu     $v0, $zero, 0x4
/* 4E37C 80072F7C A2020012 */  sb        $v0, 0x12($s0)
/* 4E380 80072F80 906200AA */  lbu       $v0, 0xAA($v1)
/* 4E384 80072F84 34420002 */  ori       $v0, $v0, 0x2
/* 4E388 80072F88 0801CBF8 */  j         .L80072FE0
/* 4E38C 80072F8C A06200AA */   sb       $v0, 0xAA($v1)
glabel .L80072F90
/* 4E390 80072F90 0C01CB4B */  jal       setup_demo_player
/* 4E394 80072F94 24112703 */   addiu    $s1, $zero, 0x2703
/* 4E398 80072F98 0000202D */  daddu     $a0, $zero, $zero
/* 4E39C 80072F9C 24020006 */  addiu     $v0, $zero, 0x6
/* 4E3A0 80072FA0 0801CBF8 */  j         .L80072FE0
/* 4E3A4 80072FA4 A2020012 */   sb       $v0, 0x12($s0)
glabel .L80072FA8
/* 4E3A8 80072FA8 0C01CB4B */  jal       setup_demo_player
/* 4E3AC 80072FAC 24112704 */   addiu    $s1, $zero, 0x2704
/* 4E3B0 80072FB0 0000202D */  daddu     $a0, $zero, $zero
/* 4E3B4 80072FB4 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 4E3B8 80072FB8 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 4E3BC 80072FBC 24020002 */  addiu     $v0, $zero, 0x2
/* 4E3C0 80072FC0 A2020012 */  sb        $v0, 0x12($s0)
/* 4E3C4 80072FC4 906200AA */  lbu       $v0, 0xAA($v1)
/* 4E3C8 80072FC8 34420004 */  ori       $v0, $v0, 0x4
/* 4E3CC 80072FCC 0801CBF8 */  j         .L80072FE0
/* 4E3D0 80072FD0 A06200AA */   sb       $v0, 0xAA($v1)
.L80072FD4:
/* 4E3D4 80072FD4 0C01CB4B */  jal       setup_demo_player
/* 4E3D8 80072FD8 24112700 */   addiu    $s1, $zero, 0x2700
/* 4E3DC 80072FDC 24040002 */  addiu     $a0, $zero, 0x2
.L80072FE0:
/* 4E3E0 80072FE0 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 4E3E4 80072FE4 2463419C */  addiu     $v1, $v1, %lo(gGameStatusPtr)
/* 4E3E8 80072FE8 8C620000 */  lw        $v0, 0x0($v1)
/* 4E3EC 80072FEC A0400074 */  sb        $zero, 0x74($v0)
/* 4E3F0 80072FF0 8C630000 */  lw        $v1, 0x0($v1)
/* 4E3F4 80072FF4 24020001 */  addiu     $v0, $zero, 0x1
/* 4E3F8 80072FF8 A062007C */  sb        $v0, 0x7C($v1)
/* 4E3FC 80072FFC 2C820005 */  sltiu     $v0, $a0, 0x5
/* 4E400 80073000 10400049 */  beqz      $v0, .L80073128
/* 4E404 80073004 00041080 */   sll      $v0, $a0, 2
/* 4E408 80073008 3C01800A */  lui       $at, %hi(jtbl_8009A590)
/* 4E40C 8007300C 00220821 */  addu      $at, $at, $v0
/* 4E410 80073010 8C22A590 */  lw        $v0, %lo(jtbl_8009A590)($at)
/* 4E414 80073014 00400008 */  jr        $v0
/* 4E418 80073018 00000000 */   nop
glabel .L8007301C
/* 4E41C 8007301C 3C03800B */  lui       $v1, %hi(gCurrentEncounter)
/* 4E420 80073020 24630F10 */  addiu     $v1, $v1, %lo(gCurrentEncounter)
/* 4E424 80073024 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* 4E428 80073028 2484419C */  addiu     $a0, $a0, %lo(gGameStatusPtr)
/* 4E42C 8007302C A0600004 */  sb        $zero, 0x4($v1)
/* 4E430 80073030 8C850000 */  lw        $a1, 0x0($a0)
/* 4E434 80073034 24020001 */  addiu     $v0, $zero, 0x1
/* 4E438 80073038 A0620005 */  sb        $v0, 0x5($v1)
/* 4E43C 8007303C A0600006 */  sb        $zero, 0x6($v1)
/* 4E440 80073040 90A200AA */  lbu       $v0, 0xAA($a1)
/* 4E444 80073044 34420010 */  ori       $v0, $v0, 0x10
/* 4E448 80073048 A0A200AA */  sb        $v0, 0xAA($a1)
/* 4E44C 8007304C 8C830000 */  lw        $v1, 0x0($a0)
/* 4E450 80073050 906200AA */  lbu       $v0, 0xAA($v1)
/* 4E454 80073054 34420020 */  ori       $v0, $v0, 0x20
/* 4E458 80073058 A06200AA */  sb        $v0, 0xAA($v1)
/* 4E45C 8007305C 8C830000 */  lw        $v1, 0x0($a0)
/* 4E460 80073060 906200AA */  lbu       $v0, 0xAA($v1)
/* 4E464 80073064 34420040 */  ori       $v0, $v0, 0x40
/* 4E468 80073068 0801CC4A */  j         .L80073128
/* 4E46C 8007306C A06200AA */   sb       $v0, 0xAA($v1)
glabel .L80073070
/* 4E470 80073070 3C03800B */  lui       $v1, %hi(gCurrentEncounter)
/* 4E474 80073074 24630F10 */  addiu     $v1, $v1, %lo(gCurrentEncounter)
/* 4E478 80073078 24020001 */  addiu     $v0, $zero, 0x1
/* 4E47C 8007307C A0620004 */  sb        $v0, 0x4($v1)
/* 4E480 80073080 92040001 */  lbu       $a0, 0x1($s0)
/* 4E484 80073084 3C058007 */  lui       $a1, %hi(gGameStatusPtr)
/* 4E488 80073088 8CA5419C */  lw        $a1, %lo(gGameStatusPtr)($a1)
/* 4E48C 8007308C 0801CC2D */  j         .L800730B4
/* 4E490 80073090 24020004 */   addiu    $v0, $zero, 0x4
glabel .L80073094
/* 4E494 80073094 3C03800B */  lui       $v1, %hi(gCurrentEncounter)
/* 4E498 80073098 24630F10 */  addiu     $v1, $v1, %lo(gCurrentEncounter)
/* 4E49C 8007309C 24020001 */  addiu     $v0, $zero, 0x1
/* 4E4A0 800730A0 A0620004 */  sb        $v0, 0x4($v1)
/* 4E4A4 800730A4 92040000 */  lbu       $a0, 0x0($s0)
/* 4E4A8 800730A8 3C058007 */  lui       $a1, %hi(gGameStatusPtr)
/* 4E4AC 800730AC 8CA5419C */  lw        $a1, %lo(gGameStatusPtr)($a1)
/* 4E4B0 800730B0 24020002 */  addiu     $v0, $zero, 0x2
.L800730B4:
/* 4E4B4 800730B4 A0620005 */  sb        $v0, 0x5($v1)
/* 4E4B8 800730B8 A0640006 */  sb        $a0, 0x6($v1)
/* 4E4BC 800730BC 90A200AA */  lbu       $v0, 0xAA($a1)
/* 4E4C0 800730C0 34420010 */  ori       $v0, $v0, 0x10
/* 4E4C4 800730C4 0801CC4A */  j         .L80073128
/* 4E4C8 800730C8 A0A200AA */   sb       $v0, 0xAA($a1)
glabel .L800730CC
/* 4E4CC 800730CC 3C03800B */  lui       $v1, %hi(gCurrentEncounter)
/* 4E4D0 800730D0 24630F10 */  addiu     $v1, $v1, %lo(gCurrentEncounter)
/* 4E4D4 800730D4 24020001 */  addiu     $v0, $zero, 0x1
/* 4E4D8 800730D8 A0620004 */  sb        $v0, 0x4($v1)
/* 4E4DC 800730DC 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* 4E4E0 800730E0 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* 4E4E4 800730E4 24020006 */  addiu     $v0, $zero, 0x6
/* 4E4E8 800730E8 A0620005 */  sb        $v0, 0x5($v1)
/* 4E4EC 800730EC 908200AA */  lbu       $v0, 0xAA($a0)
/* 4E4F0 800730F0 0801CC49 */  j         .L80073124
/* 4E4F4 800730F4 34420020 */   ori      $v0, $v0, 0x20
glabel .L800730F8
/* 4E4F8 800730F8 3C03800B */  lui       $v1, %hi(gCurrentEncounter)
/* 4E4FC 800730FC 24630F10 */  addiu     $v1, $v1, %lo(gCurrentEncounter)
/* 4E500 80073100 24020002 */  addiu     $v0, $zero, 0x2
/* 4E504 80073104 A0620004 */  sb        $v0, 0x4($v1)
/* 4E508 80073108 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* 4E50C 8007310C 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* 4E510 80073110 24020001 */  addiu     $v0, $zero, 0x1
/* 4E514 80073114 A0620005 */  sb        $v0, 0x5($v1)
/* 4E518 80073118 A0600006 */  sb        $zero, 0x6($v1)
/* 4E51C 8007311C 908200AA */  lbu       $v0, 0xAA($a0)
/* 4E520 80073120 34420040 */  ori       $v0, $v0, 0x40
.L80073124:
/* 4E524 80073124 A08200AA */  sb        $v0, 0xAA($a0)
.L80073128:
/* 4E528 80073128 0000202D */  daddu     $a0, $zero, $zero
/* 4E52C 8007312C 3C05F840 */  lui       $a1, (0xF8406299 >> 16)
/* 4E530 80073130 34A56299 */  ori       $a1, $a1, (0xF8406299 & 0xFFFF)
/* 4E534 80073134 0C0B2026 */  jal       evt_set_variable
/* 4E538 80073138 24060001 */   addiu    $a2, $zero, 0x1
/* 4E53C 8007313C 2404FFFF */  addiu     $a0, $zero, -0x1
/* 4E540 80073140 3C02800B */  lui       $v0, %hi(gCurrentEncounter)
/* 4E544 80073144 24420F10 */  addiu     $v0, $v0, %lo(gCurrentEncounter)
/* 4E548 80073148 A0400007 */  sb        $zero, 0x7($v0)
/* 4E54C 8007314C 0C01CB33 */  jal       set_battle_stage
/* 4E550 80073150 A0400010 */   sb       $zero, 0x10($v0)
/* 4E554 80073154 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 4E558 80073158 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 4E55C 8007315C 0220202D */  daddu     $a0, $s1, $zero
/* 4E560 80073160 906200AA */  lbu       $v0, 0xAA($v1)
/* 4E564 80073164 3C05800A */  lui       $a1, %hi(gOverrideFlags)
/* 4E568 80073168 24A5A650 */  addiu     $a1, $a1, %lo(gOverrideFlags)
/* 4E56C 8007316C 34420001 */  ori       $v0, $v0, 0x1
/* 4E570 80073170 A06200AA */  sb        $v0, 0xAA($v1)
/* 4E574 80073174 8CA20000 */  lw        $v0, 0x0($a1)
/* 4E578 80073178 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 4E57C 8007317C 00431024 */  and       $v0, $v0, $v1
/* 4E580 80073180 0C01CB24 */  jal       load_battle
/* 4E584 80073184 ACA20000 */   sw       $v0, 0x0($a1)
/* 4E588 80073188 8FBF0018 */  lw        $ra, 0x18($sp)
/* 4E58C 8007318C 8FB10014 */  lw        $s1, 0x14($sp)
/* 4E590 80073190 8FB00010 */  lw        $s0, 0x10($sp)
/* 4E594 80073194 03E00008 */  jr        $ra
/* 4E598 80073198 27BD0020 */   addiu    $sp, $sp, 0x20
/* 4E59C 8007319C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void load_demo_battle(u32 index) {
    PlayerData* playerData = &gPlayerData;
    u32 mode;
    s32 battleID;

    gGameStatusPtr->demoFlags = 0;
    gGameStatusPtr->areaID = 0;
    gGameStatusPtr->mapID = 0;
    gGameStatusPtr->isBattle = FALSE;

    general_heap_create();
    clear_worker_list();
    clear_script_list();
    create_cameras_a();
    spr_init_sprites(PLAYER_SPRITES_MARIO_WORLD);
    clear_animator_list();
    clear_entity_models();
    clear_npcs();
    hud_element_clear_cache();
    clear_trigger_data();
    clear_model_data();
    clear_sprite_shading_data();
    reset_background_settings();
    func_80138188();
    reset_battle_status();
    clear_encounter_status();
    clear_entity_data(1);
    clear_effect_data();
    clear_player_status();
    clear_printers();
    clear_item_entity_data();
    clear_player_data();
    initialize_status_bar();
    clear_item_entity_data();
    set_screen_overlay_params_front(OVERLAY_TYPE_9, 255.0f);

    switch (index) {
        case 0:
            setup_demo_player();
            mode = 0;
            playerData->hasActionCommands = FALSE;
            battleID = BTL_DIG_FORMATION_00;
            break;
        case 1:
            setup_demo_player();
            mode = 0;
            playerData->currentPartner = PARTNER_BOW;
            battleID = BTL_DIG_FORMATION_01;
            break;
        case 2:
            setup_demo_player();
            mode = 0;
            playerData->currentPartner = PARTNER_PARAKARRY;
            gGameStatusPtr->demoFlags |= 2;
            battleID = BTL_DIG_FORMATION_02;
            break;
        case 3:
            setup_demo_player();
            mode = 0;
            playerData->currentPartner = PARTNER_WATT;
            battleID = BTL_DIG_FORMATION_03;
            break;
        case 4:
            setup_demo_player();
            playerData->currentPartner = PARTNER_KOOPER;
            gGameStatusPtr->demoFlags |= 4;
            mode = 0;
            battleID = BTL_DIG_FORMATION_04;
            break;
        default:
            setup_demo_player();
            mode = 2;
            battleID = BTL_DIG_FORMATION_00;
    }

    gGameStatusPtr->debugEnemyContact = DEBUG_CONTACT_NONE;
    gGameStatusPtr->unk_7C = 1;

    switch (mode) {
        case 0:
            gCurrentEncounter.firstStrikeType = FIRST_STRIKE_NONE;
            gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_NONE;
            gCurrentEncounter.hitTier = 0;
            gGameStatusPtr->demoFlags |= 0x10;
            gGameStatusPtr->demoFlags |= 0x20;
            gGameStatusPtr->demoFlags |= 0x40;
            break;
        case 1:
            gCurrentEncounter.firstStrikeType = FIRST_STRIKE_PLAYER;
            gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_HAMMER;
            gCurrentEncounter.hitTier = playerData->hammerLevel;
            gGameStatusPtr->demoFlags |= 0x10;
            break;
        case 2:
            gCurrentEncounter.firstStrikeType = FIRST_STRIKE_PLAYER;
            gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_JUMP;
            gCurrentEncounter.hitTier = playerData->bootsLevel;
            gGameStatusPtr->demoFlags |= 0x10;
            break;
        case 3:
            gCurrentEncounter.firstStrikeType = FIRST_STRIKE_PLAYER;
            gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_PARTNER;
            gGameStatusPtr->demoFlags |= 0x20;
            break;
        case 4:
            gCurrentEncounter.firstStrikeType = FIRST_STRIKE_ENEMY;
            gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_NONE;
            gCurrentEncounter.hitTier = 0;
            gGameStatusPtr->demoFlags |= 0x40;
            break;
    }

    evt_set_variable(NULL, GF_Tutorial_SwapTurnOrder, 1);
    gCurrentEncounter.unk_07 = 0;
    gCurrentEncounter.instigatorValue = 0;
    set_battle_stage(BTL_STAGE_DEFAULT);
    gGameStatusPtr->demoFlags |= 1;
    gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
    load_battle(battleID);
}