### RAW ASSEMBLY INSTRUCTIONS:

glabel fire_flower_main
/* 37F720 E007E000 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 37F724 E007E004 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 37F728 E007E008 4485A000 */  mtc1      $a1, $f20
/* 37F72C E007E00C AFB00028 */  sw        $s0, 0x28($sp)
/* 37F730 E007E010 0080802D */  daddu     $s0, $a0, $zero
/* 37F734 E007E014 F7B60058 */  sdc1      $f22, 0x58($sp)
/* 37F738 E007E018 4486B000 */  mtc1      $a2, $f22
/* 37F73C E007E01C 27A40010 */  addiu     $a0, $sp, 0x10
/* 37F740 E007E020 F7B80060 */  sdc1      $f24, 0x60($sp)
/* 37F744 E007E024 4487C000 */  mtc1      $a3, $f24
/* 37F748 E007E028 3C02E008 */  lui       $v0, %hi(fire_flower_init)
/* 37F74C E007E02C 2442E1FC */  addiu     $v0, $v0, %lo(fire_flower_init)
/* 37F750 E007E030 AFA20018 */  sw        $v0, 0x18($sp)
/* 37F754 E007E034 3C02E008 */  lui       $v0, %hi(fire_flower_update)
/* 37F758 E007E038 2442E204 */  addiu     $v0, $v0, %lo(fire_flower_update)
/* 37F75C E007E03C AFA2001C */  sw        $v0, 0x1C($sp)
/* 37F760 E007E040 3C02E008 */  lui       $v0, %hi(fire_flower_render)
/* 37F764 E007E044 2442E508 */  addiu     $v0, $v0, %lo(fire_flower_render)
/* 37F768 E007E048 AFA20020 */  sw        $v0, 0x20($sp)
/* 37F76C E007E04C 2402003F */  addiu     $v0, $zero, 0x3F
/* 37F770 E007E050 AFBF0048 */  sw        $ra, 0x48($sp)
/* 37F774 E007E054 AFB70044 */  sw        $s7, 0x44($sp)
/* 37F778 E007E058 AFB60040 */  sw        $s6, 0x40($sp)
/* 37F77C E007E05C AFB5003C */  sw        $s5, 0x3C($sp)
/* 37F780 E007E060 AFB40038 */  sw        $s4, 0x38($sp)
/* 37F784 E007E064 AFB30034 */  sw        $s3, 0x34($sp)
/* 37F788 E007E068 AFB20030 */  sw        $s2, 0x30($sp)
/* 37F78C E007E06C AFB1002C */  sw        $s1, 0x2C($sp)
/* 37F790 E007E070 AFA00010 */  sw        $zero, 0x10($sp)
/* 37F794 E007E074 AFA00024 */  sw        $zero, 0x24($sp)
/* 37F798 E007E078 0C080124 */  jal       shim_create_effect_instance
/* 37F79C E007E07C AFA20014 */   sw       $v0, 0x14($sp)
/* 37F7A0 E007E080 24040934 */  addiu     $a0, $zero, 0x934
/* 37F7A4 E007E084 2414001F */  addiu     $s4, $zero, 0x1F
/* 37F7A8 E007E088 0040982D */  daddu     $s3, $v0, $zero
/* 37F7AC E007E08C 0C08012C */  jal       shim_general_heap_malloc
/* 37F7B0 E007E090 AE740008 */   sw       $s4, 0x8($s3)
/* 37F7B4 E007E094 0040882D */  daddu     $s1, $v0, $zero
/* 37F7B8 E007E098 16200003 */  bnez      $s1, .LE007E0A8
/* 37F7BC E007E09C AE71000C */   sw       $s1, 0xC($s3)
.LE007E0A0:
/* 37F7C0 E007E0A0 0801F828 */  j         .LE007E0A0
/* 37F7C4 E007E0A4 00000000 */   nop
.LE007E0A8:
/* 37F7C8 E007E0A8 AE200004 */  sw        $zero, 0x4($s1)
/* 37F7CC E007E0AC AE300000 */  sw        $s0, 0x0($s1)
/* 37F7D0 E007E0B0 E6340008 */  swc1      $f20, 0x8($s1)
/* 37F7D4 E007E0B4 E636000C */  swc1      $f22, 0xC($s1)
/* 37F7D8 E007E0B8 E6380010 */  swc1      $f24, 0x10($s1)
/* 37F7DC E007E0BC 8FA20078 */  lw        $v0, 0x78($sp)
/* 37F7E0 E007E0C0 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 37F7E4 E007E0C4 44810000 */  mtc1      $at, $f0
/* 37F7E8 E007E0C8 3C01C120 */  lui       $at, (0xC1200000 >> 16)
/* 37F7EC E007E0CC 44811000 */  mtc1      $at, $f2
/* 37F7F0 E007E0D0 24120001 */  addiu     $s2, $zero, 0x1
/* 37F7F4 E007E0D4 AE200044 */  sw        $zero, 0x44($s1)
/* 37F7F8 E007E0D8 AE200034 */  sw        $zero, 0x34($s1)
/* 37F7FC E007E0DC AE200038 */  sw        $zero, 0x38($s1)
/* 37F800 E007E0E0 AE200028 */  sw        $zero, 0x28($s1)
/* 37F804 E007E0E4 AE220040 */  sw        $v0, 0x40($s1)
/* 37F808 E007E0E8 240200FF */  addiu     $v0, $zero, 0xFF
/* 37F80C E007E0EC AE22003C */  sw        $v0, 0x3C($s1)
/* 37F810 E007E0F0 E6200030 */  swc1      $f0, 0x30($s1)
/* 37F814 E007E0F4 E622002C */  swc1      $f2, 0x2C($s1)
/* 37F818 E007E0F8 0254102A */  slt       $v0, $s2, $s4
/* 37F81C E007E0FC 10400030 */  beqz      $v0, .LE007E1C0
/* 37F820 E007E100 2631004C */   addiu    $s1, $s1, 0x4C
/* 37F824 E007E104 0240B82D */  daddu     $s7, $s2, $zero
/* 37F828 E007E108 241600FF */  addiu     $s6, $zero, 0xFF
/* 37F82C E007E10C 2415000A */  addiu     $s5, $zero, 0xA
/* 37F830 E007E110 26300040 */  addiu     $s0, $s1, 0x40
/* 37F834 E007E114 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 37F838 E007E118 4481B000 */  mtc1      $at, $f22
/* 37F83C E007E11C 3C01E008 */  lui       $at, (0xE0080000 >> 16)
/* 37F840 E007E120 D434EC40 */  ldc1      $f20, -0x13C0($at)
.LE007E124:
/* 37F844 E007E124 24040014 */  addiu     $a0, $zero, 0x14
/* 37F848 E007E128 AE370000 */  sw        $s7, 0x0($s1)
/* 37F84C E007E12C AE00FFC8 */  sw        $zero, -0x38($s0)
/* 37F850 E007E130 AE00FFCC */  sw        $zero, -0x34($s0)
/* 37F854 E007E134 AE00FFD0 */  sw        $zero, -0x30($s0)
/* 37F858 E007E138 E616FFD4 */  swc1      $f22, -0x2C($s0)
/* 37F85C E007E13C 0C080000 */  jal       effect_rand_int
/* 37F860 E007E140 AE00FFD8 */   sw       $zero, -0x28($s0)
/* 37F864 E007E144 2404000A */  addiu     $a0, $zero, 0xA
/* 37F868 E007E148 2442FFF8 */  addiu     $v0, $v0, -0x8
/* 37F86C E007E14C 44820000 */  mtc1      $v0, $f0
/* 37F870 E007E150 00000000 */  nop
/* 37F874 E007E154 46800020 */  cvt.s.w   $f0, $f0
/* 37F878 E007E158 0C080000 */  jal       effect_rand_int
/* 37F87C E007E15C E600FFDC */   swc1     $f0, -0x24($s0)
/* 37F880 E007E160 2442FFFB */  addiu     $v0, $v0, -0x5
/* 37F884 E007E164 44820000 */  mtc1      $v0, $f0
/* 37F888 E007E168 00000000 */  nop
/* 37F88C E007E16C 46800021 */  cvt.d.w   $f0, $f0
/* 37F890 E007E170 46340002 */  mul.d     $f0, $f0, $f20
/* 37F894 E007E174 00000000 */  nop
/* 37F898 E007E178 24040050 */  addiu     $a0, $zero, 0x50
/* 37F89C E007E17C 2631004C */  addiu     $s1, $s1, 0x4C
/* 37F8A0 E007E180 46200020 */  cvt.s.d   $f0, $f0
/* 37F8A4 E007E184 0C080000 */  jal       effect_rand_int
/* 37F8A8 E007E188 E600FFE0 */   swc1     $f0, -0x20($s0)
/* 37F8AC E007E18C 2643FFFF */  addiu     $v1, $s2, -0x1
/* 37F8B0 E007E190 26520001 */  addiu     $s2, $s2, 0x1
/* 37F8B4 E007E194 24420005 */  addiu     $v0, $v0, 0x5
/* 37F8B8 E007E198 44820000 */  mtc1      $v0, $f0
/* 37F8BC E007E19C 00000000 */  nop
/* 37F8C0 E007E1A0 46800020 */  cvt.s.w   $f0, $f0
/* 37F8C4 E007E1A4 E600FFE4 */  swc1      $f0, -0x1C($s0)
/* 37F8C8 E007E1A8 AE16FFFC */  sw        $s6, -0x4($s0)
/* 37F8CC E007E1AC AE030008 */  sw        $v1, 0x8($s0)
/* 37F8D0 E007E1B0 AE150000 */  sw        $s5, 0x0($s0)
/* 37F8D4 E007E1B4 0254102A */  slt       $v0, $s2, $s4
/* 37F8D8 E007E1B8 1440FFDA */  bnez      $v0, .LE007E124
/* 37F8DC E007E1BC 2610004C */   addiu    $s0, $s0, 0x4C
.LE007E1C0:
/* 37F8E0 E007E1C0 0260102D */  daddu     $v0, $s3, $zero
/* 37F8E4 E007E1C4 8FBF0048 */  lw        $ra, 0x48($sp)
/* 37F8E8 E007E1C8 8FB70044 */  lw        $s7, 0x44($sp)
/* 37F8EC E007E1CC 8FB60040 */  lw        $s6, 0x40($sp)
/* 37F8F0 E007E1D0 8FB5003C */  lw        $s5, 0x3C($sp)
/* 37F8F4 E007E1D4 8FB40038 */  lw        $s4, 0x38($sp)
/* 37F8F8 E007E1D8 8FB30034 */  lw        $s3, 0x34($sp)
/* 37F8FC E007E1DC 8FB20030 */  lw        $s2, 0x30($sp)
/* 37F900 E007E1E0 8FB1002C */  lw        $s1, 0x2C($sp)
/* 37F904 E007E1E4 8FB00028 */  lw        $s0, 0x28($sp)
/* 37F908 E007E1E8 D7B80060 */  ldc1      $f24, 0x60($sp)
/* 37F90C E007E1EC D7B60058 */  ldc1      $f22, 0x58($sp)
/* 37F910 E007E1F0 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 37F914 E007E1F4 03E00008 */  jr        $ra
/* 37F918 E007E1F8 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

EffectInstance* fire_flower_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    FireFlowerFXData* part;
    Vec3i* partData;
    s32 numParts = 31;
    s32 i;

    bp.unk_00 = 0;
    bp.init = fire_flower_init;
    bp.update = fire_flower_update;
    bp.renderWorld = fire_flower_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_FIRE_FLOWER;

    effect = shim_create_effect_instance(&bp);
    effect->numParts = numParts;
    part = shim_general_heap_malloc(numParts * sizeof(*part));
    effect->data.fireFlower = part;

    ASSERT(effect->data.fireFlower != NULL);

    part->unk_04 = 0;
    part->unk_00 = arg0;
    part->pos.x = arg1;
    part->pos.y = arg2;
    part->pos.z = arg3;
    part->unk_40.x = arg4;
    part->unk_40.y = 0;
    part->unk_34 = 0;
    part->unk_38 = 0;
    part->unk_28 = 0;

    part->unk_3C = 255;
    part->unk_30 = 0.5f;
    part->unk_2C = -10.0f;

    part++;

    for (i = 1; i < numParts; i++, part++) {
        partData = &part->unk_40;
        part->unk_00 = 1;
        part->pos.x = 0;
        part->pos.y = 0;
        part->pos.z = 0;
        part->unk_14 = 8.0f;
        part->unk_18 = 0;
        part->unk_1C = effect_rand_int(20) - 8;
        part->unk_20 = (effect_rand_int(10) - 5) * 0.05;
        part->unk_24 = effect_rand_int(80) + 5;
        part->unk_3C = 255;
        partData->z = i - 1;
        partData->x = 10;
    }

    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel NpcMoveTo
/* F2BDC 802CE22C 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* F2BE0 802CE230 AFB20018 */  sw        $s2, 0x18($sp)
/* F2BE4 802CE234 0080902D */  daddu     $s2, $a0, $zero
/* F2BE8 802CE238 AFBF001C */  sw        $ra, 0x1C($sp)
/* F2BEC 802CE23C AFB10014 */  sw        $s1, 0x14($sp)
/* F2BF0 802CE240 AFB00010 */  sw        $s0, 0x10($sp)
/* F2BF4 802CE244 F7B60028 */  sdc1      $f22, 0x28($sp)
/* F2BF8 802CE248 F7B40020 */  sdc1      $f20, 0x20($sp)
/* F2BFC 802CE24C 8E51000C */  lw        $s1, 0xC($s2)
/* F2C00 802CE250 54A00001 */  bnel      $a1, $zero, .L802CE258
/* F2C04 802CE254 AE400070 */   sw       $zero, 0x70($s2)
.L802CE258:
/* F2C08 802CE258 8E420070 */  lw        $v0, 0x70($s2)
/* F2C0C 802CE25C 1440003D */  bnez      $v0, .L802CE354
/* F2C10 802CE260 00000000 */   nop
/* F2C14 802CE264 8E250000 */  lw        $a1, 0x0($s1)
/* F2C18 802CE268 26310004 */  addiu     $s1, $s1, 0x4
/* F2C1C 802CE26C 0C0B1EAF */  jal       evt_get_variable
/* F2C20 802CE270 0240202D */   daddu    $a0, $s2, $zero
/* F2C24 802CE274 8E250000 */  lw        $a1, 0x0($s1)
/* F2C28 802CE278 26310004 */  addiu     $s1, $s1, 0x4
/* F2C2C 802CE27C 0240202D */  daddu     $a0, $s2, $zero
/* F2C30 802CE280 0C0B1EAF */  jal       evt_get_variable
/* F2C34 802CE284 0040802D */   daddu    $s0, $v0, $zero
/* F2C38 802CE288 8E250000 */  lw        $a1, 0x0($s1)
/* F2C3C 802CE28C 26310004 */  addiu     $s1, $s1, 0x4
/* F2C40 802CE290 4482B000 */  mtc1      $v0, $f22
/* F2C44 802CE294 00000000 */  nop
/* F2C48 802CE298 4680B5A0 */  cvt.s.w   $f22, $f22
/* F2C4C 802CE29C 0C0B1EAF */  jal       evt_get_variable
/* F2C50 802CE2A0 0240202D */   daddu    $a0, $s2, $zero
/* F2C54 802CE2A4 8E250000 */  lw        $a1, 0x0($s1)
/* F2C58 802CE2A8 4482A000 */  mtc1      $v0, $f20
/* F2C5C 802CE2AC 00000000 */  nop
/* F2C60 802CE2B0 4680A520 */  cvt.s.w   $f20, $f20
/* F2C64 802CE2B4 0C0B1EAF */  jal       evt_get_variable
/* F2C68 802CE2B8 0240202D */   daddu    $a0, $s2, $zero
/* F2C6C 802CE2BC 0240202D */  daddu     $a0, $s2, $zero
/* F2C70 802CE2C0 0200282D */  daddu     $a1, $s0, $zero
/* F2C74 802CE2C4 0C0B36B0 */  jal       resolve_npc
/* F2C78 802CE2C8 0040882D */   daddu    $s1, $v0, $zero
/* F2C7C 802CE2CC 0040802D */  daddu     $s0, $v0, $zero
/* F2C80 802CE2D0 56000003 */  bnel      $s0, $zero, .L802CE2E0
/* F2C84 802CE2D4 AE500074 */   sw       $s0, 0x74($s2)
/* F2C88 802CE2D8 080B3905 */  j         .L802CE414
/* F2C8C 802CE2DC 24020002 */   addiu    $v0, $zero, 0x2
.L802CE2E0:
/* F2C90 802CE2E0 C60C0038 */  lwc1      $f12, 0x38($s0)
/* F2C94 802CE2E4 C60E0040 */  lwc1      $f14, 0x40($s0)
/* F2C98 802CE2E8 E6160060 */  swc1      $f22, 0x60($s0)
/* F2C9C 802CE2EC 4406B000 */  mfc1      $a2, $f22
/* F2CA0 802CE2F0 E6140068 */  swc1      $f20, 0x68($s0)
/* F2CA4 802CE2F4 4407A000 */  mfc1      $a3, $f20
/* F2CA8 802CE2F8 0C00A7B5 */  jal       dist2D
/* F2CAC 802CE2FC A611008E */   sh       $s1, 0x8E($s0)
/* F2CB0 802CE300 8602008E */  lh        $v0, 0x8E($s0)
/* F2CB4 802CE304 14400007 */  bnez      $v0, .L802CE324
/* F2CB8 802CE308 46000186 */   mov.s    $f6, $f0
/* F2CBC 802CE30C C6000018 */  lwc1      $f0, 0x18($s0)
/* F2CC0 802CE310 46003003 */  div.s     $f0, $f6, $f0
/* F2CC4 802CE314 4600020D */  trunc.w.s $f8, $f0
/* F2CC8 802CE318 44024000 */  mfc1      $v0, $f8
/* F2CCC 802CE31C 080B38CE */  j         .L802CE338
/* F2CD0 802CE320 A602008E */   sh       $v0, 0x8E($s0)
.L802CE324:
/* F2CD4 802CE324 44820000 */  mtc1      $v0, $f0
/* F2CD8 802CE328 00000000 */  nop
/* F2CDC 802CE32C 46800020 */  cvt.s.w   $f0, $f0
/* F2CE0 802CE330 46003003 */  div.s     $f0, $f6, $f0
/* F2CE4 802CE334 E6000018 */  swc1      $f0, 0x18($s0)
.L802CE338:
/* F2CE8 802CE338 8602008E */  lh        $v0, 0x8E($s0)
/* F2CEC 802CE33C 14400004 */  bnez      $v0, .L802CE350
/* F2CF0 802CE340 24020001 */   addiu    $v0, $zero, 0x1
/* F2CF4 802CE344 24020001 */  addiu     $v0, $zero, 0x1
/* F2CF8 802CE348 A602008E */  sh        $v0, 0x8E($s0)
/* F2CFC 802CE34C 24020001 */  addiu     $v0, $zero, 0x1
.L802CE350:
/* F2D00 802CE350 AE420070 */  sw        $v0, 0x70($s2)
.L802CE354:
/* F2D04 802CE354 8E500074 */  lw        $s0, 0x74($s2)
/* F2D08 802CE358 C60C0038 */  lwc1      $f12, 0x38($s0)
/* F2D0C 802CE35C C60E0040 */  lwc1      $f14, 0x40($s0)
/* F2D10 802CE360 8E060060 */  lw        $a2, 0x60($s0)
/* F2D14 802CE364 0C00A720 */  jal       atan2
/* F2D18 802CE368 8E070068 */   lw       $a3, 0x68($s0)
/* F2D1C 802CE36C 8E050018 */  lw        $a1, 0x18($s0)
/* F2D20 802CE370 44060000 */  mfc1      $a2, $f0
/* F2D24 802CE374 0200202D */  daddu     $a0, $s0, $zero
/* F2D28 802CE378 0C00EA95 */  jal       npc_move_heading
/* F2D2C 802CE37C AE06000C */   sw       $a2, 0xC($s0)
/* F2D30 802CE380 C6000018 */  lwc1      $f0, 0x18($s0)
/* F2D34 802CE384 3C014010 */  lui       $at, (0x40100000 >> 16)
/* F2D38 802CE388 44811800 */  mtc1      $at, $f3
/* F2D3C 802CE38C 44801000 */  mtc1      $zero, $f2
/* F2D40 802CE390 46000021 */  cvt.d.s   $f0, $f0
/* F2D44 802CE394 4622003C */  c.lt.d    $f0, $f2
/* F2D48 802CE398 00000000 */  nop
/* F2D4C 802CE39C 45000003 */  bc1f      .L802CE3AC
/* F2D50 802CE3A0 0200202D */   daddu    $a0, $s0, $zero
/* F2D54 802CE3A4 080B38EC */  j         .L802CE3B0
/* F2D58 802CE3A8 0000282D */   daddu    $a1, $zero, $zero
.L802CE3AC:
/* F2D5C 802CE3AC 24050001 */  addiu     $a1, $zero, 0x1
.L802CE3B0:
/* F2D60 802CE3B0 0C00F598 */  jal       spawn_surface_effects
/* F2D64 802CE3B4 00000000 */   nop
/* F2D68 802CE3B8 C60C0038 */  lwc1      $f12, 0x38($s0)
/* F2D6C 802CE3BC C60E0040 */  lwc1      $f14, 0x40($s0)
/* F2D70 802CE3C0 8E060060 */  lw        $a2, 0x60($s0)
/* F2D74 802CE3C4 0C00A7B5 */  jal       dist2D
/* F2D78 802CE3C8 8E070068 */   lw       $a3, 0x68($s0)
/* F2D7C 802CE3CC 46000186 */  mov.s     $f6, $f0
/* F2D80 802CE3D0 C6040018 */  lwc1      $f4, 0x18($s0)
/* F2D84 802CE3D4 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* F2D88 802CE3D8 44811800 */  mtc1      $at, $f3
/* F2D8C 802CE3DC 44801000 */  mtc1      $zero, $f2
/* F2D90 802CE3E0 46002021 */  cvt.d.s   $f0, $f4
/* F2D94 802CE3E4 4622003C */  c.lt.d    $f0, $f2
/* F2D98 802CE3E8 00000000 */  nop
/* F2D9C 802CE3EC 45000004 */  bc1f      .L802CE400
/* F2DA0 802CE3F0 00000000 */   nop
/* F2DA4 802CE3F4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F2DA8 802CE3F8 44812000 */  mtc1      $at, $f4
/* F2DAC 802CE3FC 00000000 */  nop
.L802CE400:
/* F2DB0 802CE400 4604303E */  c.le.s    $f6, $f4
/* F2DB4 802CE404 00000000 */  nop
/* F2DB8 802CE408 45010002 */  bc1t      .L802CE414
/* F2DBC 802CE40C 24020001 */   addiu    $v0, $zero, 0x1
/* F2DC0 802CE410 0000102D */  daddu     $v0, $zero, $zero
.L802CE414:
/* F2DC4 802CE414 8FBF001C */  lw        $ra, 0x1C($sp)
/* F2DC8 802CE418 8FB20018 */  lw        $s2, 0x18($sp)
/* F2DCC 802CE41C 8FB10014 */  lw        $s1, 0x14($sp)
/* F2DD0 802CE420 8FB00010 */  lw        $s0, 0x10($sp)
/* F2DD4 802CE424 D7B60028 */  ldc1      $f22, 0x28($sp)
/* F2DD8 802CE428 D7B40020 */  ldc1      $f20, 0x20($sp)
/* F2DDC 802CE42C 03E00008 */  jr        $ra
/* F2DE0 802CE430 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

ApiStatus NpcMoveTo(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    Npc* npc;
    f32 dist;
    f32 moveSpeed;

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

    if (script->functionTemp[0] == 0) {
        s32 npcID = evt_get_variable(script, *args++);
        f32 goalX = evt_get_variable(script, *args++);
        f32 goalZ = evt_get_variable(script, *args++);
        s32 duration = evt_get_variable(script, *args++);

        npc = resolve_npc(script, npcID);
        if (npc == NULL) {
            return ApiStatus_DONE2;
        }

        script->functionTempPtr[1] = npc;
        npc->moveToPos.x = goalX;
        npc->moveToPos.z = goalZ;
        npc->duration = duration;
        dist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);

        if (npc->duration == 0) {
            npc->duration = dist / npc->moveSpeed;
        } else {
            npc->moveSpeed = dist / npc->duration;
        }
        if (npc->duration == 0) {
            npc->duration = 1;
        }
        script->functionTemp[0] = 1;
    }

    npc = script->functionTempPtr[1];
    npc->yaw = atan2(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
    npc_move_heading(npc, npc->moveSpeed, npc->yaw);

    if (npc->moveSpeed < 4.0) {
        spawn_surface_effects(npc, SURFACE_INTERACT_WALK);
    } else {
        spawn_surface_effects(npc, SURFACE_INTERACT_RUN);
    }

    dist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);

    moveSpeed = npc->moveSpeed;
    if (moveSpeed < 1.0) {
        moveSpeed = 1.0f;
    }

    if (dist <= moveSpeed) {
        return ApiStatus_DONE1;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel squirt_main
/* 3B4790 E00B2000 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 3B4794 E00B2004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 3B4798 E00B2008 4485A000 */  mtc1      $a1, $f20
/* 3B479C E00B200C F7B60040 */  sdc1      $f22, 0x40($sp)
/* 3B47A0 E00B2010 4486B000 */  mtc1      $a2, $f22
/* 3B47A4 E00B2014 AFB20030 */  sw        $s2, 0x30($sp)
/* 3B47A8 E00B2018 0080902D */  daddu     $s2, $a0, $zero
/* 3B47AC E00B201C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3B47B0 E00B2020 4487C000 */  mtc1      $a3, $f24
/* 3B47B4 E00B2024 27A40010 */  addiu     $a0, $sp, 0x10
/* 3B47B8 E00B2028 AFB00028 */  sw        $s0, 0x28($sp)
/* 3B47BC E00B202C 8FB00070 */  lw        $s0, 0x70($sp)
/* 3B47C0 E00B2030 3C02E00B */  lui       $v0, %hi(squirt_init)
/* 3B47C4 E00B2034 244221DC */  addiu     $v0, $v0, %lo(squirt_init)
/* 3B47C8 E00B2038 AFA20018 */  sw        $v0, 0x18($sp)
/* 3B47CC E00B203C 3C02E00B */  lui       $v0, %hi(squirt_update)
/* 3B47D0 E00B2040 244221E4 */  addiu     $v0, $v0, %lo(squirt_update)
/* 3B47D4 E00B2044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 3B47D8 E00B2048 3C02E00B */  lui       $v0, %hi(squirt_render)
/* 3B47DC E00B204C 24422460 */  addiu     $v0, $v0, %lo(squirt_render)
/* 3B47E0 E00B2050 AFA20020 */  sw        $v0, 0x20($sp)
/* 3B47E4 E00B2054 24020059 */  addiu     $v0, $zero, 0x59
/* 3B47E8 E00B2058 AFBF0034 */  sw        $ra, 0x34($sp)
/* 3B47EC E00B205C AFB1002C */  sw        $s1, 0x2C($sp)
/* 3B47F0 E00B2060 AFA00010 */  sw        $zero, 0x10($sp)
/* 3B47F4 E00B2064 AFA00024 */  sw        $zero, 0x24($sp)
/* 3B47F8 E00B2068 0C080124 */  jal       shim_create_effect_instance
/* 3B47FC E00B206C AFA20014 */   sw       $v0, 0x14($sp)
/* 3B4800 E00B2070 240401E4 */  addiu     $a0, $zero, 0x1E4
/* 3B4804 E00B2074 24030001 */  addiu     $v1, $zero, 0x1
/* 3B4808 E00B2078 0040882D */  daddu     $s1, $v0, $zero
/* 3B480C E00B207C 0C08012C */  jal       shim_general_heap_malloc
/* 3B4810 E00B2080 AE230008 */   sw       $v1, 0x8($s1)
/* 3B4814 E00B2084 0040182D */  daddu     $v1, $v0, $zero
/* 3B4818 E00B2088 14600003 */  bnez      $v1, .LE00B2098
/* 3B481C E00B208C AE22000C */   sw       $v0, 0xC($s1)
.LE00B2090:
/* 3B4820 E00B2090 0802C824 */  j         .LE00B2090
/* 3B4824 E00B2094 00000000 */   nop
.LE00B2098:
/* 3B4828 E00B2098 AC720000 */  sw        $s2, 0x0($v1)
/* 3B482C E00B209C 1E000003 */  bgtz      $s0, .LE00B20AC
/* 3B4830 E00B20A0 AC600030 */   sw       $zero, 0x30($v1)
/* 3B4834 E00B20A4 0802C82E */  j         .LE00B20B8
/* 3B4838 E00B20A8 240203E8 */   addiu    $v0, $zero, 0x3E8
.LE00B20AC:
/* 3B483C E00B20AC 16400002 */  bnez      $s2, .LE00B20B8
/* 3B4840 E00B20B0 00101080 */   sll      $v0, $s0, 2
/* 3B4844 E00B20B4 00101040 */  sll       $v0, $s0, 1
.LE00B20B8:
/* 3B4848 E00B20B8 AC62002C */  sw        $v0, 0x2C($v1)
/* 3B484C E00B20BC 16400003 */  bnez      $s2, .LE00B20CC
/* 3B4850 E00B20C0 AC700028 */   sw       $s0, 0x28($v1)
/* 3B4854 E00B20C4 0802C834 */  j         .LE00B20D0
/* 3B4858 E00B20C8 240200C8 */   addiu    $v0, $zero, 0xC8
.LE00B20CC:
/* 3B485C E00B20CC 240200FF */  addiu     $v0, $zero, 0xFF
.LE00B20D0:
/* 3B4860 E00B20D0 AC620040 */  sw        $v0, 0x40($v1)
/* 3B4864 E00B20D4 0000282D */  daddu     $a1, $zero, $zero
/* 3B4868 E00B20D8 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3B486C E00B20DC 44814000 */  mtc1      $at, $f8
/* 3B4870 E00B20E0 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3B4874 E00B20E4 44813000 */  mtc1      $at, $f6
/* 3B4878 E00B20E8 0060202D */  daddu     $a0, $v1, $zero
/* 3B487C E00B20EC E4740010 */  swc1      $f20, 0x10($v1)
/* 3B4880 E00B20F0 E4760014 */  swc1      $f22, 0x14($v1)
/* 3B4884 E00B20F4 E4780018 */  swc1      $f24, 0x18($v1)
/* 3B4888 E00B20F8 C7A00060 */  lwc1      $f0, 0x60($sp)
/* 3B488C E00B20FC 24060001 */  addiu     $a2, $zero, 0x1
/* 3B4890 E00B2100 E460001C */  swc1      $f0, 0x1C($v1)
/* 3B4894 E00B2104 C7A00064 */  lwc1      $f0, 0x64($sp)
/* 3B4898 E00B2108 240200D2 */  addiu     $v0, $zero, 0xD2
/* 3B489C E00B210C E4600020 */  swc1      $f0, 0x20($v1)
/* 3B48A0 E00B2110 C7A00068 */  lwc1      $f0, 0x68($sp)
/* 3B48A4 E00B2114 4600B086 */  mov.s     $f2, $f22
/* 3B48A8 E00B2118 E4600024 */  swc1      $f0, 0x24($v1)
/* 3B48AC E00B211C C7A0006C */  lwc1      $f0, 0x6C($sp)
/* 3B48B0 E00B2120 4600C106 */  mov.s     $f4, $f24
/* 3B48B4 E00B2124 AC620034 */  sw        $v0, 0x34($v1)
/* 3B48B8 E00B2128 240200E6 */  addiu     $v0, $zero, 0xE6
/* 3B48BC E00B212C AC620038 */  sw        $v0, 0x38($v1)
/* 3B48C0 E00B2130 240200FF */  addiu     $v0, $zero, 0xFF
/* 3B48C4 E00B2134 AC62003C */  sw        $v0, 0x3C($v1)
/* 3B48C8 E00B2138 2402001E */  addiu     $v0, $zero, 0x1E
/* 3B48CC E00B213C AC620048 */  sw        $v0, 0x48($v1)
/* 3B48D0 E00B2140 240200CD */  addiu     $v0, $zero, 0xCD
/* 3B48D4 E00B2144 AC600044 */  sw        $zero, 0x44($v1)
/* 3B48D8 E00B2148 AC62004C */  sw        $v0, 0x4C($v1)
/* 3B48DC E00B214C AC600054 */  sw        $zero, 0x54($v1)
/* 3B48E0 E00B2150 E4620008 */  swc1      $f2, 0x8($v1)
/* 3B48E4 E00B2154 E464000C */  swc1      $f4, 0xC($v1)
/* 3B48E8 E00B2158 E4600050 */  swc1      $f0, 0x50($v1)
/* 3B48EC E00B215C 4600A006 */  mov.s     $f0, $f20
/* 3B48F0 E00B2160 E4600004 */  swc1      $f0, 0x4($v1)
.LE00B2164:
/* 3B48F4 E00B2164 E4880058 */  swc1      $f8, 0x58($a0)
/* 3B48F8 E00B2168 E4860088 */  swc1      $f6, 0x88($a0)
/* 3B48FC E00B216C 16400004 */  bnez      $s2, .LE00B2180
/* 3B4900 E00B2170 AC8000B8 */   sw       $zero, 0xB8($a0)
/* 3B4904 E00B2174 24A20001 */  addiu     $v0, $a1, 0x1
/* 3B4908 E00B2178 0802C861 */  j         .LE00B2184
/* 3B490C E00B217C AC820178 */   sw       $v0, 0x178($a0)
.LE00B2180:
/* 3B4910 E00B2180 AC860178 */  sw        $a2, 0x178($a0)
.LE00B2184:
/* 3B4914 E00B2184 C4600004 */  lwc1      $f0, 0x4($v1)
/* 3B4918 E00B2188 24C60005 */  addiu     $a2, $a2, 0x5
/* 3B491C E00B218C E48000E8 */  swc1      $f0, 0xE8($a0)
/* 3B4920 E00B2190 C4600008 */  lwc1      $f0, 0x8($v1)
/* 3B4924 E00B2194 24A50001 */  addiu     $a1, $a1, 0x1
/* 3B4928 E00B2198 E4800118 */  swc1      $f0, 0x118($a0)
/* 3B492C E00B219C C460000C */  lwc1      $f0, 0xC($v1)
/* 3B4930 E00B21A0 28A2000C */  slti      $v0, $a1, 0xC
/* 3B4934 E00B21A4 AC8001A8 */  sw        $zero, 0x1A8($a0)
/* 3B4938 E00B21A8 E4800148 */  swc1      $f0, 0x148($a0)
/* 3B493C E00B21AC 1440FFED */  bnez      $v0, .LE00B2164
/* 3B4940 E00B21B0 24840004 */   addiu    $a0, $a0, 0x4
/* 3B4944 E00B21B4 0220102D */  daddu     $v0, $s1, $zero
/* 3B4948 E00B21B8 8FBF0034 */  lw        $ra, 0x34($sp)
/* 3B494C E00B21BC 8FB20030 */  lw        $s2, 0x30($sp)
/* 3B4950 E00B21C0 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3B4954 E00B21C4 8FB00028 */  lw        $s0, 0x28($sp)
/* 3B4958 E00B21C8 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 3B495C E00B21CC D7B60040 */  ldc1      $f22, 0x40($sp)
/* 3B4960 E00B21D0 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 3B4964 E00B21D4 03E00008 */  jr        $ra
/* 3B4968 E00B21D8 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

EffectInstance* squirt_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, s32 arg8) {
    EffectBlueprint bp;
    EffectInstance* effect;
    SquirtFXData* data;
    s32 numParts = 1;
    s32 i;

    bp.init = squirt_init;
    bp.update = squirt_update;
    bp.renderWorld = squirt_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_SQUIRT;

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

    data->unk_00 = arg0;
    data->unk_30 = 0;
    if (arg8 <= 0) {
        data->unk_2C = 1000;
    } else if (arg0 == 0) {
        data->unk_2C = arg8 * 2;
    } else {
        data->unk_2C = arg8 * 4;
    }
    data->unk_28 = arg8;
    if (arg0 == 0) {
        data->unk_40 = 200;
    } else {
        data->unk_40 = 255;
    }
    data->unk_10 = arg1;
    data->unk_14 = arg2;
    data->unk_18 = arg3;
    data->unk_04 = data->unk_10;
    data->unk_08 = data->unk_14;
    data->unk_0C = data->unk_18;
    data->unk_1C = arg4;
    data->unk_20 = arg5;
    data->unk_24 = arg6;
    data->unk_50 = arg7;
    data->unk_34 = 210;
    data->unk_38 = 230;
    data->unk_3C = 255;
    data->unk_44 = 0;
    data->unk_48 = 30;
    data->unk_4C = 205;
    data->unk_54 = 0;

    for (i = 0; i < 12; i++) {
        data->unk_58[i] = 10.0f;
        data->unk_88[i] = 2.0f;
        data->unk_B8[i] = 0;
        if (arg0 == 0) {
            data->unk_178[i] = i + 1;
        } else {
            data->unk_178[i] = i * 5 + 1;
        }
        data->unk_E8[i] = data->unk_04;
        data->unk_118[i] = data->unk_08;
        data->unk_148[i] = data->unk_0C;
        data->unk_1A8[i] = 0;
    }

    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel chapter_change_appendGfx
/* 3EBA38 E010E558 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 3EBA3C E010E55C 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3EBA40 E010E560 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* 3EBA44 E010E564 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* 3EBA48 E010E568 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3EBA4C E010E56C AFBF0024 */  sw        $ra, 0x24($sp)
/* 3EBA50 E010E570 AFB20020 */  sw        $s2, 0x20($sp)
/* 3EBA54 E010E574 AFB1001C */  sw        $s1, 0x1C($sp)
/* 3EBA58 E010E578 AFB00018 */  sw        $s0, 0x18($sp)
/* 3EBA5C E010E57C 8CC50000 */  lw        $a1, 0x0($a2)
/* 3EBA60 E010E580 8C90000C */  lw        $s0, 0xC($a0)
/* 3EBA64 E010E584 00A0182D */  daddu     $v1, $a1, $zero
/* 3EBA68 E010E588 24A50008 */  addiu     $a1, $a1, 0x8
/* 3EBA6C E010E58C ACC50000 */  sw        $a1, 0x0($a2)
/* 3EBA70 E010E590 8E0B002C */  lw        $t3, 0x2C($s0)
/* 3EBA74 E010E594 8E080000 */  lw        $t0, 0x0($s0)
/* 3EBA78 E010E598 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3EBA7C E010E59C AC620000 */  sw        $v0, 0x0($v1)
/* 3EBA80 E010E5A0 AC600004 */  sw        $zero, 0x4($v1)
/* 3EBA84 E010E5A4 ACA70000 */  sw        $a3, 0x0($a1)
/* 3EBA88 E010E5A8 8C830010 */  lw        $v1, 0x10($a0)
/* 3EBA8C E010E5AC 24A20008 */  addiu     $v0, $a1, 0x8
/* 3EBA90 E010E5B0 ACC20000 */  sw        $v0, 0x0($a2)
/* 3EBA94 E010E5B4 8C62001C */  lw        $v0, 0x1C($v1)
/* 3EBA98 E010E5B8 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3EBA9C E010E5BC 00431021 */  addu      $v0, $v0, $v1
/* 3EBAA0 E010E5C0 ACA20004 */  sw        $v0, 0x4($a1)
/* 3EBAA4 E010E5C4 2D020013 */  sltiu     $v0, $t0, 0x13
/* 3EBAA8 E010E5C8 1040001A */  beqz      $v0, .LE010E634
/* 3EBAAC E010E5CC 00081080 */   sll      $v0, $t0, 2
/* 3EBAB0 E010E5D0 3C01E011 */  lui       $at, (0xE0110000 >> 16)
/* 3EBAB4 E010E5D4 00220821 */  addu      $at, $at, $v0
/* 3EBAB8 E010E5D8 8C22E930 */  lw        $v0, -0x16D0($at)
/* 3EBABC E010E5DC 00400008 */  jr        $v0
/* 3EBAC0 E010E5E0 00000000 */   nop
/* 3EBAC4 E010E5E4 3C06E011 */  lui       $a2, %hi(D_E010E7FC)
/* 3EBAC8 E010E5E8 24C6E7FC */  addiu     $a2, $a2, %lo(D_E010E7FC)
/* 3EBACC E010E5EC 3C04E011 */  lui       $a0, %hi(D_E010E868)
/* 3EBAD0 E010E5F0 2484E868 */  addiu     $a0, $a0, %lo(D_E010E868)
/* 3EBAD4 E010E5F4 2503FFFF */  addiu     $v1, $t0, -0x1
/* 3EBAD8 E010E5F8 00031040 */  sll       $v0, $v1, 1
/* 3EBADC E010E5FC 00431021 */  addu      $v0, $v0, $v1
/* 3EBAE0 E010E600 000210C0 */  sll       $v0, $v0, 3
/* 3EBAE4 E010E604 0804398F */  j         .LE010E63C
/* 3EBAE8 E010E608 00448821 */   addu     $s1, $v0, $a0
/* 3EBAEC E010E60C 3C06E011 */  lui       $a2, %hi(D_E010E7D8)
/* 3EBAF0 E010E610 24C6E7D8 */  addiu     $a2, $a2, %lo(D_E010E7D8)
/* 3EBAF4 E010E614 0804398F */  j         .LE010E63C
/* 3EBAF8 E010E618 0000882D */   daddu    $s1, $zero, $zero
/* 3EBAFC E010E61C 3C06E011 */  lui       $a2, %hi(D_E010E79C)
/* 3EBB00 E010E620 24C6E79C */  addiu     $a2, $a2, %lo(D_E010E79C)
/* 3EBB04 E010E624 3C11E011 */  lui       $s1, %hi(D_E010E838)
/* 3EBB08 E010E628 2631E838 */  addiu     $s1, $s1, %lo(D_E010E838)
/* 3EBB0C E010E62C 08043990 */  j         .LE010E640
/* 3EBB10 E010E630 0200202D */   daddu    $a0, $s0, $zero
.LE010E634:
/* 3EBB14 E010E634 0000882D */  daddu     $s1, $zero, $zero
/* 3EBB18 E010E638 0220302D */  daddu     $a2, $s1, $zero
.LE010E63C:
/* 3EBB1C E010E63C 0200202D */  daddu     $a0, $s0, $zero
.LE010E640:
/* 3EBB20 E010E640 0000282D */  daddu     $a1, $zero, $zero
/* 3EBB24 E010E644 3C12800A */  lui       $s2, %hi(gMainGfxPos)
/* 3EBB28 E010E648 2652A66C */  addiu     $s2, $s2, %lo(gMainGfxPos)
/* 3EBB2C E010E64C 8E490000 */  lw        $t1, 0x0($s2)
/* 3EBB30 E010E650 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3EBB34 E010E654 0120502D */  daddu     $t2, $t1, $zero
/* 3EBB38 E010E658 25290008 */  addiu     $t1, $t1, 0x8
/* 3EBB3C E010E65C AE490000 */  sw        $t1, 0x0($s2)
/* 3EBB40 E010E660 AD420000 */  sw        $v0, 0x0($t2)
/* 3EBB44 E010E664 92020023 */  lbu       $v0, 0x23($s0)
/* 3EBB48 E010E668 92070027 */  lbu       $a3, 0x27($s0)
/* 3EBB4C E010E66C 9208002B */  lbu       $t0, 0x2B($s0)
/* 3EBB50 E010E670 25230008 */  addiu     $v1, $t1, 0x8
/* 3EBB54 E010E674 AE430000 */  sw        $v1, 0x0($s2)
/* 3EBB58 E010E678 316300FF */  andi      $v1, $t3, 0xFF
/* 3EBB5C E010E67C 00021600 */  sll       $v0, $v0, 24
/* 3EBB60 E010E680 00073C00 */  sll       $a3, $a3, 16
/* 3EBB64 E010E684 00471025 */  or        $v0, $v0, $a3
/* 3EBB68 E010E688 00084200 */  sll       $t0, $t0, 8
/* 3EBB6C E010E68C 00481025 */  or        $v0, $v0, $t0
/* 3EBB70 E010E690 00431025 */  or        $v0, $v0, $v1
/* 3EBB74 E010E694 AD420004 */  sw        $v0, 0x4($t2)
/* 3EBB78 E010E698 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 3EBB7C E010E69C AD220000 */  sw        $v0, 0x0($t1)
/* 3EBB80 E010E6A0 92020033 */  lbu       $v0, 0x33($s0)
/* 3EBB84 E010E6A4 92030037 */  lbu       $v1, 0x37($s0)
/* 3EBB88 E010E6A8 9207003B */  lbu       $a3, 0x3B($s0)
/* 3EBB8C E010E6AC 00021600 */  sll       $v0, $v0, 24
/* 3EBB90 E010E6B0 00031C00 */  sll       $v1, $v1, 16
/* 3EBB94 E010E6B4 00431025 */  or        $v0, $v0, $v1
/* 3EBB98 E010E6B8 00073A00 */  sll       $a3, $a3, 8
/* 3EBB9C E010E6BC 9203003F */  lbu       $v1, 0x3F($s0)
/* 3EBBA0 E010E6C0 00471025 */  or        $v0, $v0, $a3
/* 3EBBA4 E010E6C4 00431025 */  or        $v0, $v0, $v1
/* 3EBBA8 E010E6C8 0C043800 */  jal       func_E010E000
/* 3EBBAC E010E6CC AD220004 */   sw       $v0, 0x4($t1)
/* 3EBBB0 E010E6D0 0200202D */  daddu     $a0, $s0, $zero
/* 3EBBB4 E010E6D4 24050001 */  addiu     $a1, $zero, 0x1
/* 3EBBB8 E010E6D8 0C043800 */  jal       func_E010E000
/* 3EBBBC E010E6DC 0220302D */   daddu    $a2, $s1, $zero
/* 3EBBC0 E010E6E0 8E020054 */  lw        $v0, 0x54($s0)
/* 3EBBC4 E010E6E4 0440000A */  bltz      $v0, .LE010E710
/* 3EBBC8 E010E6E8 24020015 */   addiu    $v0, $zero, 0x15
/* 3EBBCC E010E6EC 8E030040 */  lw        $v1, 0x40($s0)
/* 3EBBD0 E010E6F0 8E050048 */  lw        $a1, 0x48($s0)
/* 3EBBD4 E010E6F4 240700FF */  addiu     $a3, $zero, 0xFF
/* 3EBBD8 E010E6F8 AFA20010 */  sw        $v0, 0x10($sp)
/* 3EBBDC E010E6FC AFA00014 */  sw        $zero, 0x14($sp)
/* 3EBBE0 E010E700 8E040054 */  lw        $a0, 0x54($s0)
/* 3EBBE4 E010E704 8E060044 */  lw        $a2, 0x44($s0)
/* 3EBBE8 E010E708 0C080194 */  jal       shim_draw_msg
/* 3EBBEC E010E70C 00652823 */   subu     $a1, $v1, $a1
.LE010E710:
/* 3EBBF0 E010E710 8E420000 */  lw        $v0, 0x0($s2)
/* 3EBBF4 E010E714 0040182D */  daddu     $v1, $v0, $zero
/* 3EBBF8 E010E718 24420008 */  addiu     $v0, $v0, 0x8
/* 3EBBFC E010E71C AE420000 */  sw        $v0, 0x0($s2)
/* 3EBC00 E010E720 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3EBC04 E010E724 AC620000 */  sw        $v0, 0x0($v1)
/* 3EBC08 E010E728 AC600004 */  sw        $zero, 0x4($v1)
/* 3EBC0C E010E72C 8FBF0024 */  lw        $ra, 0x24($sp)
/* 3EBC10 E010E730 8FB20020 */  lw        $s2, 0x20($sp)
/* 3EBC14 E010E734 8FB1001C */  lw        $s1, 0x1C($sp)
/* 3EBC18 E010E738 8FB00018 */  lw        $s0, 0x18($sp)
/* 3EBC1C E010E73C 03E00008 */  jr        $ra
/* 3EBC20 E010E740 27BD0028 */   addiu    $sp, $sp, 0x28
/* 3EBC24 E010E744 00000000 */  nop
/* 3EBC28 E010E748 00000000 */  nop
/* 3EBC2C E010E74C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void chapter_change_appendGfx(void* effect) {
    ChapterChangeFXData* data = ((EffectInstance*)effect)->data.chapterChange;
    s32 unk_2C = data->unk_2C;
    u32 unk_00 = data->unk_00;
    UnkStruct* ptr0;
    UnkStruct* ptr1;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));

    switch (unk_00) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
            ptr0 = D_E010E7FC;
            ptr1 = &D_E010E868[(unk_00 - 1) * 2];
            break;
        case 9:
            ptr0 = D_E010E7D8;
            ptr1 = NULL;
            break;
        case 0:
        case 10:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
        case 16:
        case 17:
        case 18:
            ptr0 = D_E010E79C;
            ptr1 = D_E010E838;
            break;
        default:
            ptr1 = NULL;
            ptr0 = NULL;
            break;
    }

    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_20, data->unk_24, data->unk_28, unk_2C);
    gDPSetEnvColor(gMainGfxPos++, data->unk_30, data->unk_34, data->unk_38, data->unk_3C);

    func_E010E000(data, 0, ptr0);
    func_E010E000(data, 1, ptr1);

    if (data->unk_54 >= 0) {
        shim_draw_msg(data->unk_54, data->unk_40 - data->unk_48, data->unk_44, 255, 21, 0);
    }

    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel music_note_main
/* 359F20 E004C000 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 359F24 E004C004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 359F28 E004C008 4485A000 */  mtc1      $a1, $f20
/* 359F2C E004C00C AFB1002C */  sw        $s1, 0x2C($sp)
/* 359F30 E004C010 0080882D */  daddu     $s1, $a0, $zero
/* 359F34 E004C014 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 359F38 E004C018 4486B000 */  mtc1      $a2, $f22
/* 359F3C E004C01C 27A40010 */  addiu     $a0, $sp, 0x10
/* 359F40 E004C020 F7B80048 */  sdc1      $f24, 0x48($sp)
/* 359F44 E004C024 4487C000 */  mtc1      $a3, $f24
/* 359F48 E004C028 3C02E005 */  lui       $v0, %hi(music_note_init)
/* 359F4C E004C02C 2442C204 */  addiu     $v0, $v0, %lo(music_note_init)
/* 359F50 E004C030 AFA20018 */  sw        $v0, 0x18($sp)
/* 359F54 E004C034 3C02E005 */  lui       $v0, %hi(music_note_update)
/* 359F58 E004C038 2442C20C */  addiu     $v0, $v0, %lo(music_note_update)
/* 359F5C E004C03C AFA2001C */  sw        $v0, 0x1C($sp)
/* 359F60 E004C040 3C02E005 */  lui       $v0, %hi(music_note_render)
/* 359F64 E004C044 2442C364 */  addiu     $v0, $v0, %lo(music_note_render)
/* 359F68 E004C048 AFA20020 */  sw        $v0, 0x20($sp)
/* 359F6C E004C04C 24020026 */  addiu     $v0, $zero, 0x26
/* 359F70 E004C050 AFBF0030 */  sw        $ra, 0x30($sp)
/* 359F74 E004C054 AFB00028 */  sw        $s0, 0x28($sp)
/* 359F78 E004C058 AFA00010 */  sw        $zero, 0x10($sp)
/* 359F7C E004C05C AFA00024 */  sw        $zero, 0x24($sp)
/* 359F80 E004C060 0C080124 */  jal       shim_create_effect_instance
/* 359F84 E004C064 AFA20014 */   sw       $v0, 0x14($sp)
/* 359F88 E004C068 24040034 */  addiu     $a0, $zero, 0x34
/* 359F8C E004C06C 24030001 */  addiu     $v1, $zero, 0x1
/* 359F90 E004C070 0040802D */  daddu     $s0, $v0, $zero
/* 359F94 E004C074 0C08012C */  jal       shim_general_heap_malloc
/* 359F98 E004C078 AE030008 */   sw       $v1, 0x8($s0)
/* 359F9C E004C07C AE02000C */  sw        $v0, 0xC($s0)
/* 359FA0 E004C080 0040802D */  daddu     $s0, $v0, $zero
/* 359FA4 E004C084 16000003 */  bnez      $s0, .LE004C094
/* 359FA8 E004C088 24040006 */   addiu    $a0, $zero, 0x6
.LE004C08C:
/* 359FAC E004C08C 08013023 */  j         .LE004C08C
/* 359FB0 E004C090 00000000 */   nop
.LE004C094:
/* 359FB4 E004C094 24020040 */  addiu     $v0, $zero, 0x40
/* 359FB8 E004C098 AE110000 */  sw        $s1, 0x0($s0)
/* 359FBC E004C09C E6140004 */  swc1      $f20, 0x4($s0)
/* 359FC0 E004C0A0 E6160008 */  swc1      $f22, 0x8($s0)
/* 359FC4 E004C0A4 E618000C */  swc1      $f24, 0xC($s0)
/* 359FC8 E004C0A8 AE000010 */  sw        $zero, 0x10($s0)
/* 359FCC E004C0AC AE020018 */  sw        $v0, 0x18($s0)
/* 359FD0 E004C0B0 AE000014 */  sw        $zero, 0x14($s0)
/* 359FD4 E004C0B4 0C080138 */  jal       shim_rand_int
/* 359FD8 E004C0B8 AE00001C */   sw       $zero, 0x1C($s0)
/* 359FDC E004C0BC 12200006 */  beqz      $s1, .LE004C0D8
/* 359FE0 E004C0C0 AE020020 */   sw       $v0, 0x20($s0)
/* 359FE4 E004C0C4 24020001 */  addiu     $v0, $zero, 0x1
/* 359FE8 E004C0C8 1222000A */  beq       $s1, $v0, .LE004C0F4
/* 359FEC E004C0CC 00000000 */   nop
/* 359FF0 E004C0D0 08013059 */  j         .LE004C164
/* 359FF4 E004C0D4 00000000 */   nop
.LE004C0D8:
/* 359FF8 E004C0D8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 359FFC E004C0DC 44810000 */  mtc1      $at, $f0
/* 35A000 E004C0E0 AE000024 */  sw        $zero, 0x24($s0)
/* 35A004 E004C0E4 AE00002C */  sw        $zero, 0x2C($s0)
/* 35A008 E004C0E8 E6000028 */  swc1      $f0, 0x28($s0)
/* 35A00C E004C0EC 08013079 */  j         .LE004C1E4
/* 35A010 E004C0F0 E6000030 */   swc1     $f0, 0x30($s0)
.LE004C0F4:
/* 35A014 E004C0F4 0C080138 */  jal       shim_rand_int
/* 35A018 E004C0F8 2404000A */   addiu    $a0, $zero, 0xA
/* 35A01C E004C0FC 3C01E005 */  lui       $at, (0xE0050000 >> 16)
/* 35A020 E004C100 D434C6A0 */  ldc1      $f20, -0x3960($at)
/* 35A024 E004C104 44820000 */  mtc1      $v0, $f0
/* 35A028 E004C108 00000000 */  nop
/* 35A02C E004C10C 46800021 */  cvt.d.w   $f0, $f0
/* 35A030 E004C110 46340002 */  mul.d     $f0, $f0, $f20
/* 35A034 E004C114 00000000 */  nop
/* 35A038 E004C118 3C01C014 */  lui       $at, (0xC0140000 >> 16)
/* 35A03C E004C11C 44811800 */  mtc1      $at, $f3
/* 35A040 E004C120 44801000 */  mtc1      $zero, $f2
/* 35A044 E004C124 00000000 */  nop
/* 35A048 E004C128 46220000 */  add.d     $f0, $f0, $f2
/* 35A04C E004C12C 2404000A */  addiu     $a0, $zero, 0xA
/* 35A050 E004C130 46200020 */  cvt.s.d   $f0, $f0
/* 35A054 E004C134 0C080138 */  jal       shim_rand_int
/* 35A058 E004C138 E6000024 */   swc1     $f0, 0x24($s0)
/* 35A05C E004C13C 44820000 */  mtc1      $v0, $f0
/* 35A060 E004C140 00000000 */  nop
/* 35A064 E004C144 46800021 */  cvt.d.w   $f0, $f0
/* 35A068 E004C148 46340002 */  mul.d     $f0, $f0, $f20
/* 35A06C E004C14C 00000000 */  nop
/* 35A070 E004C150 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 35A074 E004C154 44811800 */  mtc1      $at, $f3
/* 35A078 E004C158 44801000 */  mtc1      $zero, $f2
/* 35A07C E004C15C 08013075 */  j         .LE004C1D4
/* 35A080 E004C160 46220000 */   add.d    $f0, $f0, $f2
.LE004C164:
/* 35A084 E004C164 0C080138 */  jal       shim_rand_int
/* 35A088 E004C168 2404000A */   addiu    $a0, $zero, 0xA
/* 35A08C E004C16C 3C01E005 */  lui       $at, (0xE0050000 >> 16)
/* 35A090 E004C170 D434C6A8 */  ldc1      $f20, -0x3958($at)
/* 35A094 E004C174 44821000 */  mtc1      $v0, $f2
/* 35A098 E004C178 00000000 */  nop
/* 35A09C E004C17C 468010A1 */  cvt.d.w   $f2, $f2
/* 35A0A0 E004C180 46341082 */  mul.d     $f2, $f2, $f20
/* 35A0A4 E004C184 00000000 */  nop
/* 35A0A8 E004C188 3C014014 */  lui       $at, (0x40140000 >> 16)
/* 35A0AC E004C18C 44810800 */  mtc1      $at, $f1
/* 35A0B0 E004C190 44800000 */  mtc1      $zero, $f0
/* 35A0B4 E004C194 00000000 */  nop
/* 35A0B8 E004C198 46220001 */  sub.d     $f0, $f0, $f2
/* 35A0BC E004C19C 2404000A */  addiu     $a0, $zero, 0xA
/* 35A0C0 E004C1A0 46200020 */  cvt.s.d   $f0, $f0
/* 35A0C4 E004C1A4 0C080138 */  jal       shim_rand_int
/* 35A0C8 E004C1A8 E6000024 */   swc1     $f0, 0x24($s0)
/* 35A0CC E004C1AC 44820000 */  mtc1      $v0, $f0
/* 35A0D0 E004C1B0 00000000 */  nop
/* 35A0D4 E004C1B4 46800021 */  cvt.d.w   $f0, $f0
/* 35A0D8 E004C1B8 46340002 */  mul.d     $f0, $f0, $f20
/* 35A0DC E004C1BC 00000000 */  nop
/* 35A0E0 E004C1C0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 35A0E4 E004C1C4 44811800 */  mtc1      $at, $f3
/* 35A0E8 E004C1C8 44801000 */  mtc1      $zero, $f2
/* 35A0EC E004C1CC 00000000 */  nop
/* 35A0F0 E004C1D0 46220000 */  add.d     $f0, $f0, $f2
.LE004C1D4:
/* 35A0F4 E004C1D4 AE00002C */  sw        $zero, 0x2C($s0)
/* 35A0F8 E004C1D8 AE000030 */  sw        $zero, 0x30($s0)
/* 35A0FC E004C1DC 46200020 */  cvt.s.d   $f0, $f0
/* 35A100 E004C1E0 E6000028 */  swc1      $f0, 0x28($s0)
.LE004C1E4:
/* 35A104 E004C1E4 8FBF0030 */  lw        $ra, 0x30($sp)
/* 35A108 E004C1E8 8FB1002C */  lw        $s1, 0x2C($sp)
/* 35A10C E004C1EC 8FB00028 */  lw        $s0, 0x28($sp)
/* 35A110 E004C1F0 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 35A114 E004C1F4 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 35A118 E004C1F8 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 35A11C E004C1FC 03E00008 */  jr        $ra
/* 35A120 E004C200 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    MusicNoteFXData* part;
    s32 numParts = 1;
    s32 randInt;

    bp.unk_00 = 0;
    bp.init = music_note_init;
    bp.update = music_note_update;
    bp.renderWorld = music_note_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_MUSIC_NOTE;

    effect = shim_create_effect_instance(bpPtr);
    effect->numParts = numParts;

    part = effect->data.musicNote = shim_general_heap_malloc(numParts * sizeof(*part));

    ASSERT(effect->data.musicNote != NULL);

    part->unk_00 = arg0;
    part->pos.x = arg1;
    part->pos.y = arg2;
    part->pos.z = arg3;
    part->unk_10 = 0;
    part->timeLeft = 0x40;
    part->unk_14 = 0;
    part->unk_1C = 0;
    part->unk_20 = shim_rand_int(6);
    switch (arg0) {
        case 0:
            part->unk_24 = 0.0f;
            part->unk_28 = 1.0f;
            part->unk_2C = 0;
            part->unk_30 = 1.0f;
            break;
        case 1:
            randInt = shim_rand_int(10);
            part->unk_24 = (randInt * 0.1) + -5.0;
            part->unk_28 = (shim_rand_int(10) * 0.1) + 0.5;
            part->unk_2C = 0;
            part->unk_30 = 0.0f;
            break;
        default:
            randInt = shim_rand_int(10);
            part->unk_24 = 5.0 - (randInt * 0.1);
            part->unk_28 = (shim_rand_int(10) * 0.1) + 1.0;
            part->unk_2C = 0;
            part->unk_30 = 0.0f;
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel confetti_update
/* 38B398 E00885A8 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 38B39C E00885AC AFBF0028 */  sw        $ra, 0x28($sp)
/* 38B3A0 E00885B0 AFB50024 */  sw        $s5, 0x24($sp)
/* 38B3A4 E00885B4 AFB40020 */  sw        $s4, 0x20($sp)
/* 38B3A8 E00885B8 AFB3001C */  sw        $s3, 0x1C($sp)
/* 38B3AC E00885BC AFB20018 */  sw        $s2, 0x18($sp)
/* 38B3B0 E00885C0 AFB10014 */  sw        $s1, 0x14($sp)
/* 38B3B4 E00885C4 AFB00010 */  sw        $s0, 0x10($sp)
/* 38B3B8 E00885C8 F7B40030 */  sdc1      $f20, 0x30($sp)
/* 38B3BC E00885CC 8C91000C */  lw        $s1, 0xC($a0)
/* 38B3C0 E00885D0 8E220020 */  lw        $v0, 0x20($s1)
/* 38B3C4 E00885D4 2442FFFF */  addiu     $v0, $v0, -0x1
/* 38B3C8 E00885D8 04410005 */  bgez      $v0, .LE00885F0
/* 38B3CC E00885DC AE220020 */   sw       $v0, 0x20($s1)
/* 38B3D0 E00885E0 0C080128 */  jal       shim_remove_effect
/* 38B3D4 E00885E4 00000000 */   nop
/* 38B3D8 E00885E8 080221E0 */  j         .LE0088780
/* 38B3DC E00885EC 00000000 */   nop
.LE00885F0:
/* 38B3E0 E00885F0 3C030004 */  lui       $v1, (0x4F1A0 >> 16)
/* 38B3E4 E00885F4 8E220024 */  lw        $v0, 0x24($s1)
/* 38B3E8 E00885F8 3463F1A0 */  ori       $v1, $v1, (0x4F1A0 & 0xFFFF)
/* 38B3EC E00885FC 24420001 */  addiu     $v0, $v0, 0x1
/* 38B3F0 E0088600 0062182A */  slt       $v1, $v1, $v0
/* 38B3F4 E0088604 10600003 */  beqz      $v1, .LE0088614
/* 38B3F8 E0088608 AE220024 */   sw       $v0, 0x24($s1)
/* 38B3FC E008860C 2402000A */  addiu     $v0, $zero, 0xA
/* 38B400 E0088610 AE220024 */  sw        $v0, 0x24($s1)
.LE0088614:
/* 38B404 E0088614 8E230020 */  lw        $v1, 0x20($s1)
/* 38B408 E0088618 8E350024 */  lw        $s5, 0x24($s1)
/* 38B40C E008861C 8E330000 */  lw        $s3, 0x0($s1)
/* 38B410 E0088620 8E34002C */  lw        $s4, 0x2C($s1)
/* 38B414 E0088624 2862000A */  slti      $v0, $v1, 0xA
/* 38B418 E0088628 10400005 */  beqz      $v0, .LE0088640
/* 38B41C E008862C 00031040 */   sll      $v0, $v1, 1
/* 38B420 E0088630 00431021 */  addu      $v0, $v0, $v1
/* 38B424 E0088634 000210C0 */  sll       $v0, $v0, 3
/* 38B428 E0088638 00431021 */  addu      $v0, $v0, $v1
/* 38B42C E008863C AE220028 */  sw        $v0, 0x28($s1)
.LE0088640:
/* 38B430 E0088640 26310034 */  addiu     $s1, $s1, 0x34
/* 38B434 E0088644 1A80004E */  blez      $s4, .LE0088780
/* 38B438 E0088648 0000902D */   daddu    $s2, $zero, $zero
/* 38B43C E008864C 3C01E009 */  lui       $at, (0xE0090000 >> 16)
/* 38B440 E0088650 D4348DA0 */  ldc1      $f20, -0x7260($at)
/* 38B444 E0088654 2630000C */  addiu     $s0, $s1, 0xC
.LE0088658:
/* 38B448 E0088658 24020003 */  addiu     $v0, $zero, 0x3
/* 38B44C E008865C 16620010 */  bne       $s3, $v0, .LE00886A0
/* 38B450 E0088660 00000000 */   nop
/* 38B454 E0088664 8E020024 */  lw        $v0, 0x24($s0)
/* 38B458 E0088668 18400003 */  blez      $v0, .LE0088678
/* 38B45C E008866C 2442FFFF */   addiu    $v0, $v0, -0x1
/* 38B460 E0088670 1C40003E */  bgtz      $v0, .LE008876C
/* 38B464 E0088674 AE020024 */   sw       $v0, 0x24($s0)
.LE0088678:
/* 38B468 E0088678 8E020014 */  lw        $v0, 0x14($s0)
/* 38B46C E008867C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 38B470 E0088680 0441002E */  bgez      $v0, .LE008873C
/* 38B474 E0088684 AE020014 */   sw       $v0, 0x14($s0)
/* 38B478 E0088688 0C022000 */  jal       func_E0088000
/* 38B47C E008868C 0220202D */   daddu    $a0, $s1, $zero
/* 38B480 E0088690 8E020014 */  lw        $v0, 0x14($s0)
/* 38B484 E0088694 2442FFFF */  addiu     $v0, $v0, -0x1
/* 38B488 E0088698 080221CF */  j         .LE008873C
/* 38B48C E008869C AE020014 */   sw       $v0, 0x14($s0)
.LE00886A0:
/* 38B490 E00886A0 8E020024 */  lw        $v0, 0x24($s0)
/* 38B494 E00886A4 18400003 */  blez      $v0, .LE00886B4
/* 38B498 E00886A8 2442FFFF */   addiu    $v0, $v0, -0x1
/* 38B49C E00886AC 1C40002F */  bgtz      $v0, .LE008876C
/* 38B4A0 E00886B0 AE020024 */   sw       $v0, 0x24($s0)
.LE00886B4:
/* 38B4A4 E00886B4 2A620004 */  slti      $v0, $s3, 0x4
/* 38B4A8 E00886B8 14400020 */  bnez      $v0, .LE008873C
/* 38B4AC E00886BC 2AA20006 */   slti     $v0, $s5, 0x6
/* 38B4B0 E00886C0 C6040004 */  lwc1      $f4, 0x4($s0)
/* 38B4B4 E00886C4 46002121 */  cvt.d.s   $f4, $f4
/* 38B4B8 E00886C8 46342102 */  mul.d     $f4, $f4, $f20
/* 38B4BC E00886CC 00000000 */  nop
/* 38B4C0 E00886D0 C6020008 */  lwc1      $f2, 0x8($s0)
/* 38B4C4 E00886D4 460010A1 */  cvt.d.s   $f2, $f2
/* 38B4C8 E00886D8 46341082 */  mul.d     $f2, $f2, $f20
/* 38B4CC E00886DC 00000000 */  nop
/* 38B4D0 E00886E0 C600000C */  lwc1      $f0, 0xC($s0)
/* 38B4D4 E00886E4 46000021 */  cvt.d.s   $f0, $f0
/* 38B4D8 E00886E8 46340002 */  mul.d     $f0, $f0, $f20
/* 38B4DC E00886EC 00000000 */  nop
/* 38B4E0 E00886F0 46202120 */  cvt.s.d   $f4, $f4
/* 38B4E4 E00886F4 462010A0 */  cvt.s.d   $f2, $f2
/* 38B4E8 E00886F8 46200020 */  cvt.s.d   $f0, $f0
/* 38B4EC E00886FC E6040004 */  swc1      $f4, 0x4($s0)
/* 38B4F0 E0088700 E6020008 */  swc1      $f2, 0x8($s0)
/* 38B4F4 E0088704 1440000D */  bnez      $v0, .LE008873C
/* 38B4F8 E0088708 E600000C */   swc1     $f0, 0xC($s0)
/* 38B4FC E008870C 46001106 */  mov.s     $f4, $f2
/* 38B500 E0088710 3C01BFE0 */  lui       $at, (0xBFE00000 >> 16)
/* 38B504 E0088714 44811800 */  mtc1      $at, $f3
/* 38B508 E0088718 44801000 */  mtc1      $zero, $f2
/* 38B50C E008871C 46002021 */  cvt.d.s   $f0, $f4
/* 38B510 E0088720 4620103C */  c.lt.d    $f2, $f0
/* 38B514 E0088724 00000000 */  nop
/* 38B518 E0088728 45000004 */  bc1f      .LE008873C
/* 38B51C E008872C 00000000 */   nop
/* 38B520 E0088730 C6000010 */  lwc1      $f0, 0x10($s0)
/* 38B524 E0088734 46002000 */  add.s     $f0, $f4, $f0
/* 38B528 E0088738 E6000008 */  swc1      $f0, 0x8($s0)
.LE008873C:
/* 38B52C E008873C C606FFF8 */  lwc1      $f6, -0x8($s0)
/* 38B530 E0088740 C6000004 */  lwc1      $f0, 0x4($s0)
/* 38B534 E0088744 C604FFFC */  lwc1      $f4, -0x4($s0)
/* 38B538 E0088748 46003180 */  add.s     $f6, $f6, $f0
/* 38B53C E008874C C6000008 */  lwc1      $f0, 0x8($s0)
/* 38B540 E0088750 C6020000 */  lwc1      $f2, 0x0($s0)
/* 38B544 E0088754 46002100 */  add.s     $f4, $f4, $f0
/* 38B548 E0088758 C600000C */  lwc1      $f0, 0xC($s0)
/* 38B54C E008875C 46001080 */  add.s     $f2, $f2, $f0
/* 38B550 E0088760 E606FFF8 */  swc1      $f6, -0x8($s0)
/* 38B554 E0088764 E604FFFC */  swc1      $f4, -0x4($s0)
/* 38B558 E0088768 E6020000 */  swc1      $f2, 0x0($s0)
.LE008876C:
/* 38B55C E008876C 26520001 */  addiu     $s2, $s2, 0x1
/* 38B560 E0088770 26100034 */  addiu     $s0, $s0, 0x34
/* 38B564 E0088774 0254102A */  slt       $v0, $s2, $s4
/* 38B568 E0088778 1440FFB7 */  bnez      $v0, .LE0088658
/* 38B56C E008877C 26310034 */   addiu    $s1, $s1, 0x34
.LE0088780:
/* 38B570 E0088780 8FBF0028 */  lw        $ra, 0x28($sp)
/* 38B574 E0088784 8FB50024 */  lw        $s5, 0x24($sp)
/* 38B578 E0088788 8FB40020 */  lw        $s4, 0x20($sp)
/* 38B57C E008878C 8FB3001C */  lw        $s3, 0x1C($sp)
/* 38B580 E0088790 8FB20018 */  lw        $s2, 0x18($sp)
/* 38B584 E0088794 8FB10014 */  lw        $s1, 0x14($sp)
/* 38B588 E0088798 8FB00010 */  lw        $s0, 0x10($sp)
/* 38B58C E008879C D7B40030 */  ldc1      $f20, 0x30($sp)
/* 38B590 E00887A0 03E00008 */  jr        $ra
/* 38B594 E00887A4 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void confetti_update(EffectInstance* effect) {
    ConfettiFXData* part = effect->data.confetti;
    s32 unk_00;
    s32 unk_24;
    s32 unk_2C;
    s32 i;

    part->unk_20--;
    if (part->unk_20 < 0) {
        shim_remove_effect(effect);
        return;
    }

    part->unk_24++;
    if (part->unk_24 > 324000) {
        part->unk_24 = 10;
    }

    unk_24 = part->unk_24;
    unk_00 = part->unk_00;
    unk_2C = part->unk_2C;

    if (part->unk_20 < 10) {
        part->unk_28 = part->unk_20 * 25;
    }

    part++;
    for (i = 0; i < unk_2C; i++, part++) {
        if (unk_00 == 3) {
            if (part->unk_30 <= 0 || --part->unk_30 <= 0) {
                part->unk_20--;
                if (part->unk_20 < 0) {
                    func_E0088000(part);
                    part->unk_20--;
                }
                part->unk_04 += part->unk_10;
                part->unk_08 += part->unk_14;
                part->unk_0C += part->unk_18;
            }
        } else {
            if (part->unk_30 <= 0 || --part->unk_30 <= 0) {
                if (unk_00 >= 4) {
                    part->unk_10 *= 0.98;
                    part->unk_14 *= 0.98;
                    part->unk_18 *= 0.98;
                    if (unk_24 >= 6 && part->unk_14 > -0.5) {
                        part->unk_14 += part->unk_1C;
                    }
                }
                part->unk_04 += part->unk_10;
                part->unk_08 += part->unk_14;
                part->unk_0C += part->unk_18;
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_E00826C4
/* 385D04 E00826C4 27BDFF48 */  addiu     $sp, $sp, -0xB8
/* 385D08 E00826C8 AFB1009C */  sw        $s1, 0x9C($sp)
/* 385D0C E00826CC 0080882D */  daddu     $s1, $a0, $zero
/* 385D10 E00826D0 27A40018 */  addiu     $a0, $sp, 0x18
/* 385D14 E00826D4 AFB300A4 */  sw        $s3, 0xA4($sp)
/* 385D18 E00826D8 3C130001 */  lui       $s3, (0x11630 >> 16)
/* 385D1C E00826DC AFBF00A8 */  sw        $ra, 0xA8($sp)
/* 385D20 E00826E0 AFB200A0 */  sw        $s2, 0xA0($sp)
/* 385D24 E00826E4 AFB00098 */  sw        $s0, 0x98($sp)
/* 385D28 E00826E8 F7B400B0 */  sdc1      $f20, 0xB0($sp)
/* 385D2C E00826EC 8E250008 */  lw        $a1, 0x8($s1)
/* 385D30 E00826F0 8E26000C */  lw        $a2, 0xC($s1)
/* 385D34 E00826F4 8E270010 */  lw        $a3, 0x10($s1)
/* 385D38 E00826F8 0C080108 */  jal       shim_guTranslateF
/* 385D3C E00826FC 36731630 */   ori      $s3, $s3, (0x11630 & 0xFFFF)
/* 385D40 E0082700 27B00058 */  addiu     $s0, $sp, 0x58
/* 385D44 E0082704 0200202D */  daddu     $a0, $s0, $zero
/* 385D48 E0082708 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 385D4C E008270C 4481A000 */  mtc1      $at, $f20
/* 385D50 E0082710 8E250030 */  lw        $a1, 0x30($s1)
/* 385D54 E0082714 4407A000 */  mfc1      $a3, $f20
/* 385D58 E0082718 0C080110 */  jal       shim_guScaleF
/* 385D5C E008271C 00A0302D */   daddu    $a2, $a1, $zero
/* 385D60 E0082720 0200202D */  daddu     $a0, $s0, $zero
/* 385D64 E0082724 27A50018 */  addiu     $a1, $sp, 0x18
/* 385D68 E0082728 0C080114 */  jal       shim_guMtxCatF
/* 385D6C E008272C 00A0302D */   daddu    $a2, $a1, $zero
/* 385D70 E0082730 E7B40010 */  swc1      $f20, 0x10($sp)
/* 385D74 E0082734 4480A000 */  mtc1      $zero, $f20
/* 385D78 E0082738 8E250040 */  lw        $a1, 0x40($s1)
/* 385D7C E008273C 4406A000 */  mfc1      $a2, $f20
/* 385D80 E0082740 4407A000 */  mfc1      $a3, $f20
/* 385D84 E0082744 0C080104 */  jal       shim_guRotateF
/* 385D88 E0082748 0200202D */   daddu    $a0, $s0, $zero
/* 385D8C E008274C 0200202D */  daddu     $a0, $s0, $zero
/* 385D90 E0082750 27A50018 */  addiu     $a1, $sp, 0x18
/* 385D94 E0082754 0C080114 */  jal       shim_guMtxCatF
/* 385D98 E0082758 00A0302D */   daddu    $a2, $a1, $zero
/* 385D9C E008275C 0200202D */  daddu     $a0, $s0, $zero
/* 385DA0 E0082760 4405A000 */  mfc1      $a1, $f20
/* 385DA4 E0082764 8E260020 */  lw        $a2, 0x20($s1)
/* 385DA8 E0082768 0C080108 */  jal       shim_guTranslateF
/* 385DAC E008276C 00A0382D */   daddu    $a3, $a1, $zero
/* 385DB0 E0082770 0200202D */  daddu     $a0, $s0, $zero
/* 385DB4 E0082774 27A50018 */  addiu     $a1, $sp, 0x18
/* 385DB8 E0082778 0C080114 */  jal       shim_guMtxCatF
/* 385DBC E008277C 00A0302D */   daddu    $a2, $a1, $zero
/* 385DC0 E0082780 27A40018 */  addiu     $a0, $sp, 0x18
/* 385DC4 E0082784 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 385DC8 E0082788 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 385DCC E008278C 3C12800A */  lui       $s2, %hi(gDisplayContext)
/* 385DD0 E0082790 2652A674 */  addiu     $s2, $s2, %lo(gDisplayContext)
/* 385DD4 E0082794 96050000 */  lhu       $a1, 0x0($s0)
/* 385DD8 E0082798 8E420000 */  lw        $v0, 0x0($s2)
/* 385DDC E008279C 00052980 */  sll       $a1, $a1, 6
/* 385DE0 E00827A0 00B32821 */  addu      $a1, $a1, $s3
/* 385DE4 E00827A4 0C080118 */  jal       shim_guMtxF2L
/* 385DE8 E00827A8 00452821 */   addu     $a1, $v0, $a1
/* 385DEC E00827AC 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* 385DF0 E00827B0 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* 385DF4 E00827B4 8D070000 */  lw        $a3, 0x0($t0)
/* 385DF8 E00827B8 00E0202D */  daddu     $a0, $a3, $zero
/* 385DFC E00827BC 24E70008 */  addiu     $a3, $a3, 0x8
/* 385E00 E00827C0 AD070000 */  sw        $a3, 0x0($t0)
/* 385E04 E00827C4 96020000 */  lhu       $v0, 0x0($s0)
/* 385E08 E00827C8 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 385E0C E00827CC AC830000 */  sw        $v1, 0x0($a0)
/* 385E10 E00827D0 24430001 */  addiu     $v1, $v0, 0x1
/* 385E14 E00827D4 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 385E18 E00827D8 00021180 */  sll       $v0, $v0, 6
/* 385E1C E00827DC A6030000 */  sh        $v1, 0x0($s0)
/* 385E20 E00827E0 8E430000 */  lw        $v1, 0x0($s2)
/* 385E24 E00827E4 00531021 */  addu      $v0, $v0, $s3
/* 385E28 E00827E8 00621821 */  addu      $v1, $v1, $v0
/* 385E2C E00827EC 24E20008 */  addiu     $v0, $a3, 0x8
/* 385E30 E00827F0 AC830004 */  sw        $v1, 0x4($a0)
/* 385E34 E00827F4 AD020000 */  sw        $v0, 0x0($t0)
/* 385E38 E00827F8 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 385E3C E00827FC ACE20000 */  sw        $v0, 0x0($a3)
/* 385E40 E0082800 92220027 */  lbu       $v0, 0x27($s1)
/* 385E44 E0082804 ACE20004 */  sw        $v0, 0x4($a3)
/* 385E48 E0082808 8E230024 */  lw        $v1, 0x24($s1)
/* 385E4C E008280C 240200FF */  addiu     $v0, $zero, 0xFF
/* 385E50 E0082810 14620011 */  bne       $v1, $v0, .LE0082858
/* 385E54 E0082814 3C05E200 */   lui      $a1, (0xE200001C >> 16)
/* 385E58 E0082818 3C04E200 */  lui       $a0, (0xE200001C >> 16)
/* 385E5C E008281C 3484001C */  ori       $a0, $a0, (0xE200001C & 0xFFFF)
/* 385E60 E0082820 3C030055 */  lui       $v1, (0x551208 >> 16)
/* 385E64 E0082824 34631208 */  ori       $v1, $v1, (0x551208 & 0xFFFF)
/* 385E68 E0082828 3C05FC12 */  lui       $a1, (0xFC127E24 >> 16)
/* 385E6C E008282C 34A57E24 */  ori       $a1, $a1, (0xFC127E24 & 0xFFFF)
/* 385E70 E0082830 24E20010 */  addiu     $v0, $a3, 0x10
/* 385E74 E0082834 AD020000 */  sw        $v0, 0x0($t0)
/* 385E78 E0082838 24E20018 */  addiu     $v0, $a3, 0x18
/* 385E7C E008283C ACE40008 */  sw        $a0, 0x8($a3)
/* 385E80 E0082840 ACE3000C */  sw        $v1, 0xC($a3)
/* 385E84 E0082844 AD020000 */  sw        $v0, 0x0($t0)
/* 385E88 E0082848 2402F3F9 */  addiu     $v0, $zero, -0xC07
/* 385E8C E008284C ACE50010 */  sw        $a1, 0x10($a3)
/* 385E90 E0082850 08020A25 */  j         .LE0082894
/* 385E94 E0082854 ACE20014 */   sw       $v0, 0x14($a3)
.LE0082858:
/* 385E98 E0082858 34A5001C */  ori       $a1, $a1, (0xE200001C & 0xFFFF)
/* 385E9C E008285C 3C030050 */  lui       $v1, (0x504340 >> 16)
/* 385EA0 E0082860 34634340 */  ori       $v1, $v1, (0x504340 & 0xFFFF)
/* 385EA4 E0082864 3C06FC12 */  lui       $a2, (0xFC123224 >> 16)
/* 385EA8 E0082868 34C63224 */  ori       $a2, $a2, (0xFC123224 & 0xFFFF)
/* 385EAC E008286C 3C04FF67 */  lui       $a0, (0xFF67FFFF >> 16)
/* 385EB0 E0082870 3484FFFF */  ori       $a0, $a0, (0xFF67FFFF & 0xFFFF)
/* 385EB4 E0082874 24E20010 */  addiu     $v0, $a3, 0x10
/* 385EB8 E0082878 AD020000 */  sw        $v0, 0x0($t0)
/* 385EBC E008287C 24E20018 */  addiu     $v0, $a3, 0x18
/* 385EC0 E0082880 ACE50008 */  sw        $a1, 0x8($a3)
/* 385EC4 E0082884 ACE3000C */  sw        $v1, 0xC($a3)
/* 385EC8 E0082888 AD020000 */  sw        $v0, 0x0($t0)
/* 385ECC E008288C ACE60010 */  sw        $a2, 0x10($a3)
/* 385ED0 E0082890 ACE40014 */  sw        $a0, 0x14($a3)
.LE0082894:
/* 385ED4 E0082894 8FBF00A8 */  lw        $ra, 0xA8($sp)
/* 385ED8 E0082898 8FB300A4 */  lw        $s3, 0xA4($sp)
/* 385EDC E008289C 8FB200A0 */  lw        $s2, 0xA0($sp)
/* 385EE0 E00828A0 8FB1009C */  lw        $s1, 0x9C($sp)
/* 385EE4 E00828A4 8FB00098 */  lw        $s0, 0x98($sp)
/* 385EE8 E00828A8 D7B400B0 */  ldc1      $f20, 0xB0($sp)
/* 385EEC E00828AC 03E00008 */  jr        $ra
/* 385EF0 E00828B0 27BD00B8 */   addiu    $sp, $sp, 0xB8

### DECOMPILED C INSTRUCTIONS:

void func_E00826C4(DisableXFXData* data) {
    Matrix4f sp18, sp58;

    shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
    shim_guScaleF(sp58, data->unk_30, data->unk_30, 1.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guRotateF(sp58, data->unk_40, 0.0f, 0.0f, 1.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guTranslateF(sp58, 0.0f, data->unk_20, 0.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
              G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, data->alpha);

    if (data->alpha == 255) {
        gDPSetRenderMode(gMainGfxPos++, AA_EN | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
                         GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM),
                         AA_EN | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
                         GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM));
        gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
    } else {
        gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
        gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel big_snowflakes_update
/* 363340 E00601E0 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 363344 E00601E4 AFB3001C */  sw        $s3, 0x1C($sp)
/* 363348 E00601E8 0080982D */  daddu     $s3, $a0, $zero
/* 36334C E00601EC AFBF0020 */  sw        $ra, 0x20($sp)
/* 363350 E00601F0 AFB20018 */  sw        $s2, 0x18($sp)
/* 363354 E00601F4 AFB10014 */  sw        $s1, 0x14($sp)
/* 363358 E00601F8 AFB00010 */  sw        $s0, 0x10($sp)
/* 36335C E00601FC F7B60030 */  sdc1      $f22, 0x30($sp)
/* 363360 E0060200 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 363364 E0060204 8E64000C */  lw        $a0, 0xC($s3)
/* 363368 E0060208 8C820028 */  lw        $v0, 0x28($a0)
/* 36336C E006020C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 363370 E0060210 AC820028 */  sw        $v0, 0x28($a0)
/* 363374 E0060214 8C82002C */  lw        $v0, 0x2C($a0)
/* 363378 E0060218 8C850028 */  lw        $a1, 0x28($a0)
/* 36337C E006021C 24420001 */  addiu     $v0, $v0, 0x1
/* 363380 E0060220 04A10005 */  bgez      $a1, .LE0060238
/* 363384 E0060224 AC82002C */   sw       $v0, 0x2C($a0)
/* 363388 E0060228 0C080128 */  jal       shim_remove_effect
/* 36338C E006022C 0260202D */   daddu    $a0, $s3, $zero
/* 363390 E0060230 080180FA */  j         .LE00603E8
/* 363394 E0060234 00000000 */   nop
.LE0060238:
/* 363398 E0060238 2842000A */  slti      $v0, $v0, 0xA
/* 36339C E006023C 10400011 */  beqz      $v0, .LE0060284
/* 3633A0 E0060240 00A0302D */   daddu    $a2, $a1, $zero
/* 3633A4 E0060244 240200FF */  addiu     $v0, $zero, 0xFF
/* 3633A8 E0060248 8C830024 */  lw        $v1, 0x24($a0)
/* 3633AC E006024C 3C01E006 */  lui       $at, (0xE0060740 >> 16)
/* 3633B0 E0060250 D4200740 */  ldc1      $f0, (0xE0060740 & 0xFFFF)($at)
/* 3633B4 E0060254 00431023 */  subu      $v0, $v0, $v1
/* 3633B8 E0060258 44821000 */  mtc1      $v0, $f2
/* 3633BC E006025C 00000000 */  nop
/* 3633C0 E0060260 468010A1 */  cvt.d.w   $f2, $f2
/* 3633C4 E0060264 46201082 */  mul.d     $f2, $f2, $f0
/* 3633C8 E0060268 00000000 */  nop
/* 3633CC E006026C 44830000 */  mtc1      $v1, $f0
/* 3633D0 E0060270 00000000 */  nop
/* 3633D4 E0060274 46800021 */  cvt.d.w   $f0, $f0
/* 3633D8 E0060278 46220000 */  add.d     $f0, $f0, $f2
/* 3633DC E006027C 4620020D */  trunc.w.d $f8, $f0
/* 3633E0 E0060280 E4880024 */  swc1      $f8, 0x24($a0)
.LE0060284:
/* 3633E4 E0060284 28C2000A */  slti      $v0, $a2, 0xA
/* 3633E8 E0060288 10400009 */  beqz      $v0, .LE00602B0
/* 3633EC E006028C 00000000 */   nop
/* 3633F0 E0060290 3C01E006 */  lui       $at, (0xE0060748 >> 16)
/* 3633F4 E0060294 D4220748 */  ldc1      $f2, (0xE0060748 & 0xFFFF)($at)
/* 3633F8 E0060298 C4800024 */  lwc1      $f0, 0x24($a0)
/* 3633FC E006029C 46800021 */  cvt.d.w   $f0, $f0
/* 363400 E00602A0 46220002 */  mul.d     $f0, $f0, $f2
/* 363404 E00602A4 00000000 */  nop
/* 363408 E00602A8 4620020D */  trunc.w.d $f8, $f0
/* 36340C E00602AC E4880024 */  swc1      $f8, 0x24($a0)
.LE00602B0:
/* 363410 E00602B0 8E620008 */  lw        $v0, 0x8($s3)
/* 363414 E00602B4 24110001 */  addiu     $s1, $zero, 0x1
/* 363418 E00602B8 0222102A */  slt       $v0, $s1, $v0
/* 36341C E00602BC 1040004A */  beqz      $v0, .LE00603E8
/* 363420 E00602C0 24840030 */   addiu    $a0, $a0, 0x30
/* 363424 E00602C4 24900008 */  addiu     $s0, $a0, 0x8
/* 363428 E00602C8 24B20014 */  addiu     $s2, $a1, 0x14
/* 36342C E00602CC 3C01BD4C */  lui       $at, (0xBD4CCCCD >> 16)
/* 363430 E00602D0 3421CCCD */  ori       $at, $at, (0xBD4CCCCD & 0xFFFF)
/* 363434 E00602D4 4481B000 */  mtc1      $at, $f22
/* 363438 E00602D8 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 36343C E00602DC 4481A000 */  mtc1      $at, $f20
.LE00602E0:
/* 363440 E00602E0 C60C0010 */  lwc1      $f12, 0x10($s0)
/* 363444 E00602E4 0C080140 */  jal       shim_sin_deg
/* 363448 E00602E8 460C6300 */   add.s    $f12, $f12, $f12
/* 36344C E00602EC 3C01E006 */  lui       $at, (0xE0060750 >> 16)
/* 363450 E00602F0 D4220750 */  ldc1      $f2, (0xE0060750 & 0xFFFF)($at)
/* 363454 E00602F4 46000021 */  cvt.d.s   $f0, $f0
/* 363458 E00602F8 46220002 */  mul.d     $f0, $f0, $f2
/* 36345C E00602FC 00000000 */  nop
/* 363460 E0060300 C6020008 */  lwc1      $f2, 0x8($s0)
/* 363464 E0060304 46200020 */  cvt.s.d   $f0, $f0
/* 363468 E0060308 46001080 */  add.s     $f2, $f2, $f0
/* 36346C E006030C 3C01E006 */  lui       $at, (0xE0060758 >> 16)
/* 363470 E0060310 D4200758 */  ldc1      $f0, (0xE0060758 & 0xFFFF)($at)
/* 363474 E0060314 E6020008 */  swc1      $f2, 0x8($s0)
/* 363478 E0060318 460010A1 */  cvt.d.s   $f2, $f2
/* 36347C E006031C 46201082 */  mul.d     $f2, $f2, $f0
/* 363480 E0060320 00000000 */  nop
/* 363484 E0060324 C600000C */  lwc1      $f0, 0xC($s0)
/* 363488 E0060328 46160000 */  add.s     $f0, $f0, $f22
/* 36348C E006032C E600000C */  swc1      $f0, 0xC($s0)
/* 363490 E0060330 46160000 */  add.s     $f0, $f0, $f22
/* 363494 E0060334 24040032 */  addiu     $a0, $zero, 0x32
/* 363498 E0060338 0240282D */  daddu     $a1, $s2, $zero
/* 36349C E006033C E600000C */  swc1      $f0, 0xC($s0)
/* 3634A0 E0060340 462010A0 */  cvt.s.d   $f2, $f2
/* 3634A4 E0060344 0C080011 */  jal       func_E0200044
/* 3634A8 E0060348 E6020008 */   swc1     $f2, 0x8($s0)
/* 3634AC E006034C 2442FFE7 */  addiu     $v0, $v0, -0x19
/* 3634B0 E0060350 C60C0014 */  lwc1      $f12, 0x14($s0)
/* 3634B4 E0060354 44820000 */  mtc1      $v0, $f0
/* 3634B8 E0060358 00000000 */  nop
/* 3634BC E006035C 46800020 */  cvt.s.w   $f0, $f0
/* 3634C0 E0060360 46006300 */  add.s     $f12, $f12, $f0
/* 3634C4 E0060364 0C080140 */  jal       shim_sin_deg
/* 3634C8 E0060368 E60C0014 */   swc1     $f12, 0x14($s0)
/* 3634CC E006036C 46140002 */  mul.s     $f0, $f0, $f20
/* 3634D0 E0060370 00000000 */  nop
/* 3634D4 E0060374 C6020014 */  lwc1      $f2, 0x14($s0)
/* 3634D8 E0060378 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 3634DC E006037C 44816000 */  mtc1      $at, $f12
/* 3634E0 E0060380 00000000 */  nop
/* 3634E4 E0060384 460C1302 */  mul.s     $f12, $f2, $f12
/* 3634E8 E0060388 00000000 */  nop
/* 3634EC E006038C C6020010 */  lwc1      $f2, 0x10($s0)
/* 3634F0 E0060390 46001080 */  add.s     $f2, $f2, $f0
/* 3634F4 E0060394 0C080144 */  jal       shim_cos_deg
/* 3634F8 E0060398 E6020010 */   swc1     $f2, 0x10($s0)
/* 3634FC E006039C 46140002 */  mul.s     $f0, $f0, $f20
/* 363500 E00603A0 00000000 */  nop
/* 363504 E00603A4 C606FFFC */  lwc1      $f6, -0x4($s0)
/* 363508 E00603A8 C6020008 */  lwc1      $f2, 0x8($s0)
/* 36350C E00603AC C6040000 */  lwc1      $f4, 0x0($s0)
/* 363510 E00603B0 46023180 */  add.s     $f6, $f6, $f2
/* 363514 E00603B4 C602000C */  lwc1      $f2, 0xC($s0)
/* 363518 E00603B8 26310001 */  addiu     $s1, $s1, 0x1
/* 36351C E00603BC 46022100 */  add.s     $f4, $f4, $f2
/* 363520 E00603C0 C6020018 */  lwc1      $f2, 0x18($s0)
/* 363524 E00603C4 26520014 */  addiu     $s2, $s2, 0x14
/* 363528 E00603C8 46001080 */  add.s     $f2, $f2, $f0
/* 36352C E00603CC E606FFFC */  swc1      $f6, -0x4($s0)
/* 363530 E00603D0 E6040000 */  swc1      $f4, 0x0($s0)
/* 363534 E00603D4 E6020018 */  swc1      $f2, 0x18($s0)
/* 363538 E00603D8 8E620008 */  lw        $v0, 0x8($s3)
/* 36353C E00603DC 0222102A */  slt       $v0, $s1, $v0
/* 363540 E00603E0 1440FFBF */  bnez      $v0, .LE00602E0
/* 363544 E00603E4 26100030 */   addiu    $s0, $s0, 0x30
.LE00603E8:
/* 363548 E00603E8 8FBF0020 */  lw        $ra, 0x20($sp)
/* 36354C E00603EC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 363550 E00603F0 8FB20018 */  lw        $s2, 0x18($sp)
/* 363554 E00603F4 8FB10014 */  lw        $s1, 0x14($sp)
/* 363558 E00603F8 8FB00010 */  lw        $s0, 0x10($sp)
/* 36355C E00603FC D7B60030 */  ldc1      $f22, 0x30($sp)
/* 363560 E0060400 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 363564 E0060404 03E00008 */  jr        $ra
/* 363568 E0060408 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void big_snowflakes_update(EffectInstance* effect) {
    BigSnowflakesFXData* data = effect->data.bigSnowflakes;
    s32 unk_28;
    s32 i;

    data->unk_28--;
    data->unk_2C++;
    if (data->unk_28 < 0) {
        shim_remove_effect(effect);
        return;
    }

    unk_28 = data->unk_28;
    if (data->unk_2C < 10) {
        data->unk_24 += (255 - data->unk_24) * 0.3;
    }
    if (unk_28 < 10) {
        data->unk_24 *= 0.8;
    }

    data++;
    for (i = 1; i < effect->numParts; i++, data++) {
        data->unk_10 += (f32) (shim_sin_deg(2.0f * data->unk_18) * 0.2);
        data->unk_14 += -0.05f;
        data->unk_10 *= 0.92;
        data->unk_14 += -0.05f;
        data->unk_1C += func_E0200044(50, unk_28 + (i * 20)) - 25;
        data->unk_18 += shim_sin_deg(data->unk_1C) * 10.0f;
        data->unk_20 += shim_cos_deg(data->unk_1C * 0.5f) * 10.0f;
        data->unk_04 += data->unk_10;
        data->unk_08 += data->unk_14;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_80257BAC
/* 18648C 80257BAC 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 186490 80257BB0 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 186494 80257BB4 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 186498 80257BB8 AFBF0038 */  sw        $ra, 0x38($sp)
/* 18649C 80257BBC AFB30034 */  sw        $s3, 0x34($sp)
/* 1864A0 80257BC0 AFB20030 */  sw        $s2, 0x30($sp)
/* 1864A4 80257BC4 AFB1002C */  sw        $s1, 0x2C($sp)
/* 1864A8 80257BC8 AFB00028 */  sw        $s0, 0x28($sp)
/* 1864AC 80257BCC 8C5000D8 */  lw        $s0, 0xD8($v0)
/* 1864B0 80257BD0 8E1201F4 */  lw        $s2, 0x1F4($s0)
/* 1864B4 80257BD4 0000202D */  daddu     $a0, $zero, $zero
/* 1864B8 80257BD8 8E450088 */  lw        $a1, 0x88($s2)
/* 1864BC 80257BDC 8E460090 */  lw        $a2, 0x90($s2)
/* 1864C0 80257BE0 0C0B76A3 */  jal       spr_update_player_sprite
/* 1864C4 80257BE4 0040982D */   daddu    $s3, $v0, $zero
/* 1864C8 80257BE8 AE42008C */  sw        $v0, 0x8C($s2)
/* 1864CC 80257BEC 8E020000 */  lw        $v0, 0x0($s0)
/* 1864D0 80257BF0 3C031000 */  lui       $v1, (0x10000000 >> 16)
/* 1864D4 80257BF4 00431024 */  and       $v0, $v0, $v1
/* 1864D8 80257BF8 10400003 */  beqz      $v0, .L80257C08
/* 1864DC 80257BFC 00000000 */   nop
/* 1864E0 80257C00 0C09527D */  jal       func_802549F4
/* 1864E4 80257C04 0200202D */   daddu    $a0, $s0, $zero
.L80257C08:
/* 1864E8 80257C08 8E04042C */  lw        $a0, 0x42C($s0)
/* 1864EC 80257C0C 0C044181 */  jal       get_shadow_by_index
/* 1864F0 80257C10 00000000 */   nop
/* 1864F4 80257C14 0040882D */  daddu     $s1, $v0, $zero
/* 1864F8 80257C18 8E220000 */  lw        $v0, 0x0($s1)
/* 1864FC 80257C1C 2403FFFE */  addiu     $v1, $zero, -0x2
/* 186500 80257C20 00431024 */  and       $v0, $v0, $v1
/* 186504 80257C24 AE220000 */  sw        $v0, 0x0($s1)
/* 186508 80257C28 8262009A */  lb        $v0, 0x9A($s3)
/* 18650C 80257C2C 14400002 */  bnez      $v0, .L80257C38
/* 186510 80257C30 24020028 */   addiu    $v0, $zero, 0x28
/* 186514 80257C34 24020080 */  addiu     $v0, $zero, 0x80
.L80257C38:
/* 186518 80257C38 A2220005 */  sb        $v0, 0x5($s1)
/* 18651C 80257C3C 0000202D */  daddu     $a0, $zero, $zero
/* 186520 80257C40 27A50018 */  addiu     $a1, $sp, 0x18
/* 186524 80257C44 27A6001C */  addiu     $a2, $sp, 0x1C
/* 186528 80257C48 3C0146FF */  lui       $at, (0x46FFFE00 >> 16)
/* 18652C 80257C4C 3421FE00 */  ori       $at, $at, (0x46FFFE00 & 0xFFFF)
/* 186530 80257C50 44810000 */  mtc1      $at, $f0
/* 186534 80257C54 27A70020 */  addiu     $a3, $sp, 0x20
/* 186538 80257C58 E7A00024 */  swc1      $f0, 0x24($sp)
/* 18653C 80257C5C 86020150 */  lh        $v0, 0x150($s0)
/* 186540 80257C60 C6060144 */  lwc1      $f6, 0x144($s0)
/* 186544 80257C64 C604014C */  lwc1      $f4, 0x14C($s0)
/* 186548 80257C68 44820000 */  mtc1      $v0, $f0
/* 18654C 80257C6C 00000000 */  nop
/* 186550 80257C70 46800020 */  cvt.s.w   $f0, $f0
/* 186554 80257C74 46003180 */  add.s     $f6, $f6, $f0
/* 186558 80257C78 86020152 */  lh        $v0, 0x152($s0)
/* 18655C 80257C7C C6000148 */  lwc1      $f0, 0x148($s0)
/* 186560 80257C80 44821000 */  mtc1      $v0, $f2
/* 186564 80257C84 00000000 */  nop
/* 186568 80257C88 468010A0 */  cvt.s.w   $f2, $f2
/* 18656C 80257C8C 86020154 */  lh        $v0, 0x154($s0)
/* 186570 80257C90 46020000 */  add.s     $f0, $f0, $f2
/* 186574 80257C94 44821000 */  mtc1      $v0, $f2
/* 186578 80257C98 00000000 */  nop
/* 18657C 80257C9C 468010A0 */  cvt.s.w   $f2, $f2
/* 186580 80257CA0 27A20024 */  addiu     $v0, $sp, 0x24
/* 186584 80257CA4 46022100 */  add.s     $f4, $f4, $f2
/* 186588 80257CA8 3C014028 */  lui       $at, (0x40280000 >> 16)
/* 18658C 80257CAC 44811800 */  mtc1      $at, $f3
/* 186590 80257CB0 44801000 */  mtc1      $zero, $f2
/* 186594 80257CB4 46000021 */  cvt.d.s   $f0, $f0
/* 186598 80257CB8 46220000 */  add.d     $f0, $f0, $f2
/* 18659C 80257CBC E7A60018 */  swc1      $f6, 0x18($sp)
/* 1865A0 80257CC0 E7A40020 */  swc1      $f4, 0x20($sp)
/* 1865A4 80257CC4 46200020 */  cvt.s.d   $f0, $f0
/* 1865A8 80257CC8 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 1865AC 80257CCC 0C0372DF */  jal       npc_raycast_down_sides
/* 1865B0 80257CD0 AFA20010 */   sw       $v0, 0x10($sp)
/* 1865B4 80257CD4 C7A20024 */  lwc1      $f2, 0x24($sp)
/* 1865B8 80257CD8 3C014348 */  lui       $at, (0x43480000 >> 16)
/* 1865BC 80257CDC 44810000 */  mtc1      $at, $f0
/* 1865C0 80257CE0 00000000 */  nop
/* 1865C4 80257CE4 4602003C */  c.lt.s    $f0, $f2
/* 1865C8 80257CE8 00000000 */  nop
/* 1865CC 80257CEC 45000004 */  bc1f      D_80257D00
/* 1865D0 80257CF0 00000000 */   nop
/* 1865D4 80257CF4 8E220000 */  lw        $v0, 0x0($s1)
/* 1865D8 80257CF8 34420001 */  ori       $v0, $v0, 0x1
/* 1865DC 80257CFC AE220000 */  sw        $v0, 0x0($s1)
D_80257D00:
/* 1865E0 80257D00 C7A00018 */  lwc1      $f0, 0x18($sp)
/* 1865E4 80257D04 C7A2001C */  lwc1      $f2, 0x1C($sp)
/* 1865E8 80257D08 C7A40020 */  lwc1      $f4, 0x20($sp)
/* 1865EC 80257D0C 3C02800B */  lui       $v0, %hi(gCameras + 0x558)
/* 1865F0 80257D10 244222D8 */  addiu     $v0, $v0, %lo(gCameras + 0x558)
/* 1865F4 80257D14 E6200010 */  swc1      $f0, 0x10($s1)
/* 1865F8 80257D18 E6220014 */  swc1      $f2, 0x14($s1)
D_80257D1C:
/* 1865FC 80257D1C E6240018 */  swc1      $f4, 0x18($s1)
D_80257D20:
/* 186600 80257D20 C600018C */  lwc1      $f0, 0x18C($s0)
/* 186604 80257D24 C44C006C */  lwc1      $f12, 0x6C($v0)
D_80257D28:
/* 186608 80257D28 0C00A6C9 */  jal       clamp_angle
/* 18660C 80257D2C 460C0301 */   sub.s    $f12, $f0, $f12
D_80257D30:
/* 186610 80257D30 8FA50024 */  lw        $a1, 0x24($sp)
/* 186614 80257D34 0220202D */  daddu     $a0, $s1, $zero
/* 186618 80257D38 0C044A17 */  jal       set_standard_shadow_scale
/* 18661C 80257D3C E620002C */   swc1     $f0, 0x2C($s1)
D_80257D40:
/* 186620 80257D40 C6020430 */  lwc1      $f2, 0x430($s0)
/* 186624 80257D44 C6000188 */  lwc1      $f0, 0x188($s0)
D_80257D48:
/* 186628 80257D48 46001082 */  mul.s     $f2, $f2, $f0
/* 18662C 80257D4C 00000000 */  nop
D_80257D50:
/* 186630 80257D50 C620001C */  lwc1      $f0, 0x1C($s1)
/* 186634 80257D54 46020002 */  mul.s     $f0, $f0, $f2
jtbl_80257D58:
/* 186638 80257D58 00000000 */  nop
/* 18663C 80257D5C E620001C */  swc1      $f0, 0x1C($s1)
/* 186640 80257D60 86420098 */  lh        $v0, 0x98($s2)
/* 186644 80257D64 284200FF */  slti      $v0, $v0, 0xFF
/* 186648 80257D68 14400006 */  bnez      $v0, .L80257D84
/* 18664C 80257D6C 24020022 */   addiu    $v0, $zero, 0x22
/* 186650 80257D70 8E420000 */  lw        $v0, 0x0($s2)
/* 186654 80257D74 30420100 */  andi      $v0, $v0, 0x100
/* 186658 80257D78 14400002 */  bnez      $v0, .L80257D84
/* 18665C 80257D7C 24020022 */   addiu    $v0, $zero, 0x22
/* 186660 80257D80 2402000D */  addiu     $v0, $zero, 0xD
.L80257D84:
/* 186664 80257D84 A6020434 */  sh        $v0, 0x434($s0)
/* 186668 80257D88 8FBF0038 */  lw        $ra, 0x38($sp)
/* 18666C 80257D8C 8FB30034 */  lw        $s3, 0x34($sp)
/* 186670 80257D90 8FB20030 */  lw        $s2, 0x30($sp)
/* 186674 80257D94 8FB1002C */  lw        $s1, 0x2C($sp)
/* 186678 80257D98 8FB00028 */  lw        $s0, 0x28($sp)
/* 18667C 80257D9C 03E00008 */  jr        $ra
/* 186680 80257DA0 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void update_player_actor_shadow(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    Camera* camera = &gCameras[CAM_BATTLE];
    Actor* player = battleStatus->playerActor;
    ActorPart* parts = player->partsTable;
    Shadow* shadow;
    f32 x, y, z, distance;

    parts->animNotifyValue = spr_update_player_sprite(PLAYER_SPRITE_MAIN, parts->currentAnimation, parts->animationRate);

    if (player->flags & ACTOR_FLAG_BLUR_ENABLED) {
        func_802549F4(player);
    }

    shadow = get_shadow_by_index(player->shadow.id);
    shadow->flags &= ~ENTITY_FLAG_HIDDEN;

    if (!battleStatus->outtaSightActive) {
        shadow->alpha = 128;
    } else {
        shadow->alpha = 40;
    }

    distance = 32767.0f;
    x = player->currentPos.x + player->headOffset.x;
    z = player->currentPos.z + player->headOffset.z;
    y = player->currentPos.y + player->headOffset.y + 12.0;
    npc_raycast_down_sides(0, &x, &y, &z, &distance);

    if (distance > 200.0f) {
        shadow->flags |= ENTITY_FLAG_HIDDEN;
    }
    shadow->position.x = x;
    shadow->position.y = y;
    shadow->position.z = z;
    shadow->rotation.y = clamp_angle(player->yaw - camera->currentYaw);
    set_standard_shadow_scale(shadow, distance);
    shadow->scale.x *= player->shadowScale * player->scalingFactor;

    if (parts->opacity >= 255 && !(parts->flags & ACTOR_PART_FLAG_100)) {
        player->renderMode = RENDER_MODE_ALPHATEST;
    } else {
        player->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_Chest_open
/* 108AB0 802E7230 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 108AB4 802E7234 AFBF0014 */  sw        $ra, 0x14($sp)
/* 108AB8 802E7238 AFB00010 */  sw        $s0, 0x10($sp)
/* 108ABC 802E723C 8C900040 */  lw        $s0, 0x40($a0)
/* 108AC0 802E7240 92030005 */  lbu       $v1, 0x5($s0)
/* 108AC4 802E7244 2C620006 */  sltiu     $v0, $v1, 0x6
/* 108AC8 802E7248 10400074 */  beqz      $v0, .L802E741C
/* 108ACC 802E724C 00031080 */   sll      $v0, $v1, 2
/* 108AD0 802E7250 3C01802F */  lui       $at, %hi(jtbl_802EB2F0)
/* 108AD4 802E7254 00220821 */  addu      $at, $at, $v0
/* 108AD8 802E7258 8C22B2F0 */  lw        $v0, %lo(jtbl_802EB2F0)($at)
/* 108ADC 802E725C 00400008 */  jr        $v0
/* 108AE0 802E7260 00000000 */   nop
glabel .L802E7264
/* 108AE4 802E7264 C6020008 */  lwc1      $f2, 0x8($s0)
/* 108AE8 802E7268 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 108AEC 802E726C 44810000 */  mtc1      $at, $f0
/* 108AF0 802E7270 92020006 */  lbu       $v0, 0x6($s0)
/* 108AF4 802E7274 46001081 */  sub.s     $f2, $f2, $f0
/* 108AF8 802E7278 3C01C000 */  lui       $at, (0xC0000000 >> 16)
/* 108AFC 802E727C 44810000 */  mtc1      $at, $f0
/* 108B00 802E7280 2442FFFF */  addiu     $v0, $v0, -0x1
/* 108B04 802E7284 A2020006 */  sb        $v0, 0x6($s0)
/* 108B08 802E7288 4600103C */  c.lt.s    $f2, $f0
/* 108B0C 802E728C 00000000 */  nop
/* 108B10 802E7290 45000002 */  bc1f      .L802E729C
/* 108B14 802E7294 E6020008 */   swc1     $f2, 0x8($s0)
/* 108B18 802E7298 E6000008 */  swc1      $f0, 0x8($s0)
.L802E729C:
/* 108B1C 802E729C 82020006 */  lb        $v0, 0x6($s0)
/* 108B20 802E72A0 1440005E */  bnez      $v0, .L802E741C
/* 108B24 802E72A4 24030008 */   addiu    $v1, $zero, 0x8
/* 108B28 802E72A8 92020005 */  lbu       $v0, 0x5($s0)
/* 108B2C 802E72AC 080B9D05 */  j         .L802E7414
/* 108B30 802E72B0 A2030006 */   sb       $v1, 0x6($s0)
glabel .L802E72B4
/* 108B34 802E72B4 92020006 */  lbu       $v0, 0x6($s0)
/* 108B38 802E72B8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 108B3C 802E72BC A2020006 */  sb        $v0, 0x6($s0)
/* 108B40 802E72C0 00021600 */  sll       $v0, $v0, 24
/* 108B44 802E72C4 14400055 */  bnez      $v0, .L802E741C
/* 108B48 802E72C8 00000000 */   nop
/* 108B4C 802E72CC 92020005 */  lbu       $v0, 0x5($s0)
/* 108B50 802E72D0 080B9D05 */  j         .L802E7414
/* 108B54 802E72D4 AE00000C */   sw       $zero, 0xC($s0)
glabel .L802E72D8
/* 108B58 802E72D8 C600000C */  lwc1      $f0, 0xC($s0)
/* 108B5C 802E72DC 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 108B60 802E72E0 44811000 */  mtc1      $at, $f2
/* 108B64 802E72E4 00000000 */  nop
/* 108B68 802E72E8 46020000 */  add.s     $f0, $f0, $f2
/* 108B6C 802E72EC 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 108B70 802E72F0 44811000 */  mtc1      $at, $f2
/* 108B74 802E72F4 00000000 */  nop
/* 108B78 802E72F8 4600103E */  c.le.s    $f2, $f0
/* 108B7C 802E72FC 00000000 */  nop
/* 108B80 802E7300 45000004 */  bc1f      .L802E7314
/* 108B84 802E7304 E600000C */   swc1     $f0, 0xC($s0)
/* 108B88 802E7308 92020005 */  lbu       $v0, 0x5($s0)
/* 108B8C 802E730C 24420001 */  addiu     $v0, $v0, 0x1
/* 108B90 802E7310 A2020005 */  sb        $v0, 0x5($s0)
.L802E7314:
/* 108B94 802E7314 C60C000C */  lwc1      $f12, 0xC($s0)
/* 108B98 802E7318 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 108B9C 802E731C 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 108BA0 802E7320 44810000 */  mtc1      $at, $f0
/* 108BA4 802E7324 00000000 */  nop
/* 108BA8 802E7328 46006302 */  mul.s     $f12, $f12, $f0
/* 108BAC 802E732C 00000000 */  nop
/* 108BB0 802E7330 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 108BB4 802E7334 44810000 */  mtc1      $at, $f0
/* 108BB8 802E7338 0C00A85B */  jal       sin_rad
/* 108BBC 802E733C 46006303 */   div.s    $f12, $f12, $f0
/* 108BC0 802E7340 3C014040 */  lui       $at, (0x40400000 >> 16)
/* 108BC4 802E7344 44811000 */  mtc1      $at, $f2
/* 108BC8 802E7348 00000000 */  nop
/* 108BCC 802E734C 46020082 */  mul.s     $f2, $f0, $f2
/* 108BD0 802E7350 080B9CF3 */  j         .L802E73CC
/* 108BD4 802E7354 00000000 */   nop
glabel .L802E7358
/* 108BD8 802E7358 C600000C */  lwc1      $f0, 0xC($s0)
/* 108BDC 802E735C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 108BE0 802E7360 44811000 */  mtc1      $at, $f2
/* 108BE4 802E7364 00000000 */  nop
/* 108BE8 802E7368 46020000 */  add.s     $f0, $f0, $f2
/* 108BEC 802E736C 3C01433E */  lui       $at, (0x433E0000 >> 16)
/* 108BF0 802E7370 44811000 */  mtc1      $at, $f2
/* 108BF4 802E7374 00000000 */  nop
/* 108BF8 802E7378 4600103E */  c.le.s    $f2, $f0
/* 108BFC 802E737C 00000000 */  nop
/* 108C00 802E7380 45000006 */  bc1f      .L802E739C
/* 108C04 802E7384 E600000C */   swc1     $f0, 0xC($s0)
/* 108C08 802E7388 92020005 */  lbu       $v0, 0x5($s0)
/* 108C0C 802E738C 2403000A */  addiu     $v1, $zero, 0xA
/* 108C10 802E7390 A2030006 */  sb        $v1, 0x6($s0)
/* 108C14 802E7394 24420001 */  addiu     $v0, $v0, 0x1
/* 108C18 802E7398 A2020005 */  sb        $v0, 0x5($s0)
.L802E739C:
/* 108C1C 802E739C C60C000C */  lwc1      $f12, 0xC($s0)
/* 108C20 802E73A0 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 108C24 802E73A4 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 108C28 802E73A8 44810000 */  mtc1      $at, $f0
/* 108C2C 802E73AC 00000000 */  nop
/* 108C30 802E73B0 46006302 */  mul.s     $f12, $f12, $f0
/* 108C34 802E73B4 00000000 */  nop
/* 108C38 802E73B8 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 108C3C 802E73BC 44810000 */  mtc1      $at, $f0
/* 108C40 802E73C0 0C00A85B */  jal       sin_rad
/* 108C44 802E73C4 46006303 */   div.s    $f12, $f12, $f0
/* 108C48 802E73C8 46000080 */  add.s     $f2, $f0, $f0
.L802E73CC:
/* 108C4C 802E73CC C6000008 */  lwc1      $f0, 0x8($s0)
/* 108C50 802E73D0 46020001 */  sub.s     $f0, $f0, $f2
/* 108C54 802E73D4 080B9D07 */  j         .L802E741C
/* 108C58 802E73D8 E6000008 */   swc1     $f0, 0x8($s0)
glabel .L802E73DC
/* 108C5C 802E73DC 92020006 */  lbu       $v0, 0x6($s0)
/* 108C60 802E73E0 2442FFFF */  addiu     $v0, $v0, -0x1
/* 108C64 802E73E4 A2020006 */  sb        $v0, 0x6($s0)
/* 108C68 802E73E8 00021600 */  sll       $v0, $v0, 24
/* 108C6C 802E73EC 1440000B */  bnez      $v0, .L802E741C
/* 108C70 802E73F0 00000000 */   nop
/* 108C74 802E73F4 82020007 */  lb        $v0, 0x7($s0)
/* 108C78 802E73F8 10400005 */  beqz      $v0, .L802E7410
/* 108C7C 802E73FC 00000000 */   nop
/* 108C80 802E7400 0C043F5A */  jal       exec_entity_commandlist
/* 108C84 802E7404 00000000 */   nop
/* 108C88 802E7408 080B9D07 */  j         .L802E741C
/* 108C8C 802E740C 00000000 */   nop
.L802E7410:
/* 108C90 802E7410 92020005 */  lbu       $v0, 0x5($s0)
.L802E7414:
/* 108C94 802E7414 24420001 */  addiu     $v0, $v0, 0x1
/* 108C98 802E7418 A2020005 */  sb        $v0, 0x5($s0)
glabel .L802E741C
/* 108C9C 802E741C 8FBF0014 */  lw        $ra, 0x14($sp)
/* 108CA0 802E7420 8FB00010 */  lw        $s0, 0x10($sp)
/* 108CA4 802E7424 03E00008 */  jr        $ra
/* 108CA8 802E7428 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void entity_Chest_open(Entity* entity) {
    ChestData* data = entity->dataBuf.chest;
    f32 temp;

    switch (data->openState) {
        case 0:
            data->postLidAnimDelay--;
            data->lidAngle -= 1.0f;
            if (data->lidAngle < -2.0f) {
                data->lidAngle = -2.0f;
            }

            if (data->postLidAnimDelay == 0) {
                data->postLidAnimDelay = 8;
                data->openState++;
            }
            break;
        case 1:
            data->postLidAnimDelay--;
            if (data->postLidAnimDelay == 0) {
                data->lidAnimInterpPhase = 0.0f;
                data->openState++;
            }
            break;
        case 2:
            data->lidAnimInterpPhase += 4.0f;
            if (data->lidAnimInterpPhase >= 180.0f) {
                data->openState++;
            }
            temp = sin_rad(DEG_TO_RAD(data->lidAnimInterpPhase)) * 3.0f;
            data->lidAngle -= temp;
            break;
        case 3:
            data->lidAnimInterpPhase += 1.0f;
            if (data->lidAnimInterpPhase >= 190.0f) {
                data->postLidAnimDelay = 10;
                data->openState++;
            }
            temp = sin_rad(DEG_TO_RAD(data->lidAnimInterpPhase)) * 2.0f;
            data->lidAngle -= temp;
            break;
        case 4:
            data->postLidAnimDelay--;
            if (data->postLidAnimDelay == 0) {
                if (data->unk_07 != 0) {
                    exec_entity_commandlist(entity);
                } else {
                    data->openState++;
                }
            }
            break;
        case 5:
            break;

    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_HiddenPanel_idle
/* 107C28 802E63A8 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 107C2C 802E63AC AFB3001C */  sw        $s3, 0x1C($sp)
/* 107C30 802E63B0 0080982D */  daddu     $s3, $a0, $zero
/* 107C34 802E63B4 AFBF0020 */  sw        $ra, 0x20($sp)
/* 107C38 802E63B8 AFB20018 */  sw        $s2, 0x18($sp)
/* 107C3C 802E63BC AFB10014 */  sw        $s1, 0x14($sp)
/* 107C40 802E63C0 AFB00010 */  sw        $s0, 0x10($sp)
/* 107C44 802E63C4 92620006 */  lbu       $v0, 0x6($s3)
/* 107C48 802E63C8 8E720040 */  lw        $s2, 0x40($s3)
/* 107C4C 802E63CC 30420001 */  andi      $v0, $v0, 0x1
/* 107C50 802E63D0 5040000A */  beql      $v0, $zero, .L802E63FC
/* 107C54 802E63D4 A2400004 */   sb       $zero, 0x4($s2)
/* 107C58 802E63D8 82420004 */  lb        $v0, 0x4($s2)
/* 107C5C 802E63DC 14400008 */  bnez      $v0, .L802E6400
/* 107C60 802E63E0 2402FFFF */   addiu    $v0, $zero, -0x1
/* 107C64 802E63E4 24020001 */  addiu     $v0, $zero, 0x1
/* 107C68 802E63E8 A2420004 */  sb        $v0, 0x4($s2)
/* 107C6C 802E63EC 0C03BCF5 */  jal       func_800EF3D4
/* 107C70 802E63F0 24040001 */   addiu    $a0, $zero, 0x1
/* 107C74 802E63F4 080B9900 */  j         .L802E6400
/* 107C78 802E63F8 2402FFFF */   addiu    $v0, $zero, -0x1
.L802E63FC:
/* 107C7C 802E63FC 2402FFFF */  addiu     $v0, $zero, -0x1
.L802E6400:
/* 107C80 802E6400 3C038016 */  lui       $v1, %hi(gCurrentHiddenPanels)
/* 107C84 802E6404 2463A578 */  addiu     $v1, $v1, %lo(gCurrentHiddenPanels)
/* 107C88 802E6408 AE420008 */  sw        $v0, 0x8($s2)
/* 107C8C 802E640C AE40000C */  sw        $zero, 0xC($s2)
/* 107C90 802E6410 80620000 */  lb        $v0, 0x0($v1)
/* 107C94 802E6414 10400050 */  beqz      $v0, .L802E6558
/* 107C98 802E6418 00000000 */   nop
/* 107C9C 802E641C C4600008 */  lwc1      $f0, 0x8($v1)
/* 107CA0 802E6420 C662004C */  lwc1      $f2, 0x4C($s3)
/* 107CA4 802E6424 46020001 */  sub.s     $f0, $f0, $f2
/* 107CA8 802E6428 3C014024 */  lui       $at, (0x40240000 >> 16)
/* 107CAC 802E642C 44811800 */  mtc1      $at, $f3
/* 107CB0 802E6430 44801000 */  mtc1      $zero, $f2
/* 107CB4 802E6434 46000021 */  cvt.d.s   $f0, $f0
/* 107CB8 802E6438 46200005 */  abs.d     $f0, $f0
/* 107CBC 802E643C 4622003E */  c.le.d    $f0, $f2
/* 107CC0 802E6440 00000000 */  nop
/* 107CC4 802E6444 45000044 */  bc1f      .L802E6558
/* 107CC8 802E6448 2402000A */   addiu    $v0, $zero, 0xA
/* 107CCC 802E644C A2420000 */  sb        $v0, 0x0($s2)
/* 107CD0 802E6450 C66C0048 */  lwc1      $f12, 0x48($s3)
/* 107CD4 802E6454 0C038022 */  jal       get_xz_dist_to_player
/* 107CD8 802E6458 C66E0050 */   lwc1     $f14, 0x50($s3)
/* 107CDC 802E645C 4600010D */  trunc.w.s $f4, $f0
/* 107CE0 802E6460 44102000 */  mfc1      $s0, $f4
/* 107CE4 802E6464 00000000 */  nop
/* 107CE8 802E6468 2A020065 */  slti      $v0, $s0, 0x65
/* 107CEC 802E646C 1040003A */  beqz      $v0, .L802E6558
/* 107CF0 802E6470 00000000 */   nop
/* 107CF4 802E6474 92620006 */  lbu       $v0, 0x6($s3)
/* 107CF8 802E6478 30420001 */  andi      $v0, $v0, 0x1
/* 107CFC 802E647C 10400005 */  beqz      $v0, .L802E6494
/* 107D00 802E6480 0260202D */   daddu    $a0, $s3, $zero
/* 107D04 802E6484 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 107D08 802E6488 44810000 */  mtc1      $at, $f0
/* 107D0C 802E648C 080B9954 */  j         .L802E6550
/* 107D10 802E6490 00000000 */   nop
.L802E6494:
/* 107D14 802E6494 0C0B9ADB */  jal       entity_HiddenPanel_is_item_on_top
/* 107D18 802E6498 0260202D */   daddu    $a0, $s3, $zero
/* 107D1C 802E649C 10400005 */  beqz      $v0, .L802E64B4
/* 107D20 802E64A0 0260202D */   daddu    $a0, $s3, $zero
/* 107D24 802E64A4 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 107D28 802E64A8 44810000 */  mtc1      $at, $f0
/* 107D2C 802E64AC 080B9954 */  j         .L802E6550
/* 107D30 802E64B0 00000000 */   nop
.L802E64B4:
/* 107D34 802E64B4 0C00F475 */  jal       npc_find_standing_on_entity
/* 107D38 802E64B8 92640004 */   lbu      $a0, 0x4($s3)
/* 107D3C 802E64BC 0040882D */  daddu     $s1, $v0, $zero
/* 107D40 802E64C0 06200016 */  bltz      $s1, .L802E651C
/* 107D44 802E64C4 00000000 */   nop
/* 107D48 802E64C8 0C00E2B7 */  jal       get_npc_by_index
/* 107D4C 802E64CC 0220202D */   daddu    $a0, $s1, $zero
/* 107D50 802E64D0 0040802D */  daddu     $s0, $v0, $zero
/* 107D54 802E64D4 C66C0048 */  lwc1      $f12, 0x48($s3)
/* 107D58 802E64D8 C66E0050 */  lwc1      $f14, 0x50($s3)
/* 107D5C 802E64DC 8E060038 */  lw        $a2, 0x38($s0)
/* 107D60 802E64E0 0C00A7B5 */  jal       dist2D
/* 107D64 802E64E4 8E070040 */   lw       $a3, 0x40($s0)
/* 107D68 802E64E8 0260202D */  daddu     $a0, $s3, $zero
/* 107D6C 802E64EC AE510008 */  sw        $s1, 0x8($s2)
/* 107D70 802E64F0 8E020000 */  lw        $v0, 0x0($s0)
/* 107D74 802E64F4 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 107D78 802E64F8 30420208 */  andi      $v0, $v0, 0x208
/* 107D7C 802E64FC AE42000C */  sw        $v0, 0xC($s2)
/* 107D80 802E6500 8E020000 */  lw        $v0, 0x0($s0)
/* 107D84 802E6504 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 107D88 802E6508 44810000 */  mtc1      $at, $f0
/* 107D8C 802E650C 00431024 */  and       $v0, $v0, $v1
/* 107D90 802E6510 34420200 */  ori       $v0, $v0, 0x200
/* 107D94 802E6514 080B9954 */  j         .L802E6550
/* 107D98 802E6518 AE020000 */   sw       $v0, 0x0($s0)
.L802E651C:
/* 107D9C 802E651C 8E620000 */  lw        $v0, 0x0($s3)
/* 107DA0 802E6520 34420020 */  ori       $v0, $v0, 0x20
/* 107DA4 802E6524 AE620000 */  sw        $v0, 0x0($s3)
/* 107DA8 802E6528 2A02003D */  slti      $v0, $s0, 0x3D
/* 107DAC 802E652C 14400005 */  bnez      $v0, .L802E6544
/* 107DB0 802E6530 0260202D */   daddu    $a0, $s3, $zero
/* 107DB4 802E6534 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 107DB8 802E6538 44810000 */  mtc1      $at, $f0
/* 107DBC 802E653C 080B9954 */  j         .L802E6550
/* 107DC0 802E6540 00000000 */   nop
.L802E6544:
/* 107DC4 802E6544 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 107DC8 802E6548 44810000 */  mtc1      $at, $f0
/* 107DCC 802E654C A2400000 */  sb        $zero, 0x0($s2)
.L802E6550:
/* 107DD0 802E6550 0C043F5A */  jal       exec_entity_commandlist
/* 107DD4 802E6554 E6400028 */   swc1     $f0, 0x28($s2)
.L802E6558:
/* 107DD8 802E6558 8FBF0020 */  lw        $ra, 0x20($sp)
/* 107DDC 802E655C 8FB3001C */  lw        $s3, 0x1C($sp)
/* 107DE0 802E6560 8FB20018 */  lw        $s2, 0x18($sp)
/* 107DE4 802E6564 8FB10014 */  lw        $s1, 0x14($sp)
/* 107DE8 802E6568 8FB00010 */  lw        $s0, 0x10($sp)
/* 107DEC 802E656C 03E00008 */  jr        $ra
/* 107DF0 802E6570 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void entity_HiddenPanel_idle(Entity* entity) {
    HiddenPanelData* data = entity->dataBuf.hiddenPanel;
    s32 distToPlayer;

    if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) {
        if (!data->unk_04) {
            data->unk_04 = TRUE;
            func_800EF3D4(1);
        }
    } else {
        data->unk_04 = FALSE;
    }

    data->standingNpcIndex = -1;
    data->npcFlags = 0;

    if (gCurrentHiddenPanels.tryFlipTrigger && fabs(gCurrentHiddenPanels.flipTriggerPosY - entity->position.y) <= 10.0) {
        data->state = 10;
        distToPlayer = get_xz_dist_to_player(entity->position.x, entity->position.z);
        if (distToPlayer <= 100) {
            if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) {
                data->riseVelocity = 0.5f;
                exec_entity_commandlist(entity);
            } else if (entity_HiddenPanel_is_item_on_top(entity)) {
                data->riseVelocity = 0.5f;
                exec_entity_commandlist(entity);
            } else {
                s32 npcIndex = npc_find_standing_on_entity(entity->listIndex);
                if (npcIndex >= 0) {
                    Npc* npc = get_npc_by_index(npcIndex);
                    dist2D(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
                    data->standingNpcIndex = npcIndex;
                    data->npcFlags = npc->flags & (NPC_FLAG_GRAVITY | NPC_FLAG_8);
                    npc->flags &= ~NPC_FLAG_8;
                    npc->flags |= NPC_FLAG_GRAVITY;
                    data->riseVelocity = 0.5f;
                    exec_entity_commandlist(entity);
                } else {
                    entity->flags |= ENTITY_FLAG_DISABLE_COLLISION;
                    if (distToPlayer > 60) {
                        data->riseVelocity = 0.5f;
                        exec_entity_commandlist(entity);
                    } else {
                        data->state = 0;
                        data->riseVelocity = 10.0f;
                        exec_entity_commandlist(entity);
                    }
                }
            }
        }
    }
}