### RAW ASSEMBLY INSTRUCTIONS:

glabel lil_oink_update
/* 3FEBBC E01140DC 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 3FEBC0 E01140E0 AFBF0028 */  sw        $ra, 0x28($sp)
/* 3FEBC4 E01140E4 AFB50024 */  sw        $s5, 0x24($sp)
/* 3FEBC8 E01140E8 AFB40020 */  sw        $s4, 0x20($sp)
/* 3FEBCC E01140EC AFB3001C */  sw        $s3, 0x1C($sp)
/* 3FEBD0 E01140F0 AFB20018 */  sw        $s2, 0x18($sp)
/* 3FEBD4 E01140F4 AFB10014 */  sw        $s1, 0x14($sp)
/* 3FEBD8 E01140F8 AFB00010 */  sw        $s0, 0x10($sp)
/* 3FEBDC E01140FC 8C94000C */  lw        $s4, 0xC($a0)
/* 3FEBE0 E0114100 3C15E011 */  lui       $s5, %hi(D_E0114740)
/* 3FEBE4 E0114104 26B54740 */  addiu     $s5, $s5, %lo(D_E0114740)
/* 3FEBE8 E0114108 0280902D */  daddu     $s2, $s4, $zero
/* 3FEBEC E011410C 8E820004 */  lw        $v0, 0x4($s4)
/* 3FEBF0 E0114110 0280882D */  daddu     $s1, $s4, $zero
/* 3FEBF4 E0114114 24420001 */  addiu     $v0, $v0, 0x1
/* 3FEBF8 E0114118 AE820004 */  sw        $v0, 0x4($s4)
.LE011411C:
/* 3FEBFC E011411C 922300FA */  lbu       $v1, 0xFA($s1)
/* 3FEC00 E0114120 8230013C */  lb        $s0, 0x13C($s1)
/* 3FEC04 E0114124 2C620006 */  sltiu     $v0, $v1, 0x6
/* 3FEC08 E0114128 10400050 */  beqz      $v0, .LE011426C
/* 3FEC0C E011412C 0000982D */   daddu    $s3, $zero, $zero
/* 3FEC10 E0114130 00031080 */  sll       $v0, $v1, 2
/* 3FEC14 E0114134 3C01E011 */  lui       $at, (0xE0114750 >> 16)
/* 3FEC18 E0114138 00220821 */  addu      $at, $at, $v0
/* 3FEC1C E011413C 8C224750 */  lw        $v0, (0xE0114750 & 0xFFFF)($at)
/* 3FEC20 E0114140 00400008 */  jr        $v0
/* 3FEC24 E0114144 00000000 */   nop
/* 3FEC28 E0114148 24020001 */  addiu     $v0, $zero, 0x1
/* 3FEC2C E011414C A2220105 */  sb        $v0, 0x105($s1)
/* 3FEC30 E0114150 080450B5 */  j         .LE01142D4
/* 3FEC34 E0114154 24130001 */   addiu    $s3, $zero, 0x1
/* 3FEC38 E0114158 06010002 */  bgez      $s0, .LE0114164
/* 3FEC3C E011415C 0200102D */   daddu    $v0, $s0, $zero
/* 3FEC40 E0114160 26020003 */  addiu     $v0, $s0, 0x3
.LE0114164:
/* 3FEC44 E0114164 00021083 */  sra       $v0, $v0, 2
/* 3FEC48 E0114168 00021080 */  sll       $v0, $v0, 2
/* 3FEC4C E011416C 02021023 */  subu      $v0, $s0, $v0
/* 3FEC50 E0114170 00551021 */  addu      $v0, $v0, $s5
/* 3FEC54 E0114174 00101880 */  sll       $v1, $s0, 2
/* 3FEC58 E0114178 00701821 */  addu      $v1, $v1, $s0
/* 3FEC5C E011417C 00031840 */  sll       $v1, $v1, 1
/* 3FEC60 E0114180 90420000 */  lbu       $v0, 0x0($v0)
/* 3FEC64 E0114184 44836000 */  mtc1      $v1, $f12
/* 3FEC68 E0114188 00000000 */  nop
/* 3FEC6C E011418C 46806320 */  cvt.s.w   $f12, $f12
/* 3FEC70 E0114190 0C080140 */  jal       shim_sin_deg
/* 3FEC74 E0114194 A2220105 */   sb       $v0, 0x105($s1)
/* 3FEC78 E0114198 C64200B8 */  lwc1      $f2, 0xB8($s2)
/* 3FEC7C E011419C 46001080 */  add.s     $f2, $f2, $f0
/* 3FEC80 E01141A0 2A020024 */  slti      $v0, $s0, 0x24
/* 3FEC84 E01141A4 1440004B */  bnez      $v0, .LE01142D4
/* 3FEC88 E01141A8 E64200B8 */   swc1     $f2, 0xB8($s2)
/* 3FEC8C E01141AC 080450B4 */  j         .LE01142D0
/* 3FEC90 E01141B0 24130001 */   addiu    $s3, $zero, 0x1
/* 3FEC94 E01141B4 06010002 */  bgez      $s0, .LE01141C0
/* 3FEC98 E01141B8 0200102D */   daddu    $v0, $s0, $zero
/* 3FEC9C E01141BC 26020003 */  addiu     $v0, $s0, 0x3
.LE01141C0:
/* 3FECA0 E01141C0 00021083 */  sra       $v0, $v0, 2
/* 3FECA4 E01141C4 00021080 */  sll       $v0, $v0, 2
/* 3FECA8 E01141C8 02021023 */  subu      $v0, $s0, $v0
/* 3FECAC E01141CC 00551021 */  addu      $v0, $v0, $s5
/* 3FECB0 E01141D0 00101880 */  sll       $v1, $s0, 2
/* 3FECB4 E01141D4 00701821 */  addu      $v1, $v1, $s0
/* 3FECB8 E01141D8 00031880 */  sll       $v1, $v1, 2
/* 3FECBC E01141DC 90420000 */  lbu       $v0, 0x0($v0)
/* 3FECC0 E01141E0 44836000 */  mtc1      $v1, $f12
/* 3FECC4 E01141E4 00000000 */  nop
/* 3FECC8 E01141E8 46806320 */  cvt.s.w   $f12, $f12
/* 3FECCC E01141EC 0C080140 */  jal       shim_sin_deg
/* 3FECD0 E01141F0 A2220105 */   sb       $v0, 0x105($s1)
/* 3FECD4 E01141F4 46000000 */  add.s     $f0, $f0, $f0
/* 3FECD8 E01141F8 24130001 */  addiu     $s3, $zero, 0x1
/* 3FECDC E01141FC 2A020009 */  slti      $v0, $s0, 0x9
/* 3FECE0 E0114200 14400034 */  bnez      $v0, .LE01142D4
/* 3FECE4 E0114204 E6400110 */   swc1     $f0, 0x110($s2)
/* 3FECE8 E0114208 080450B4 */  j         .LE01142D0
/* 3FECEC E011420C AE400110 */   sw       $zero, 0x110($s2)
/* 3FECF0 E0114210 06010002 */  bgez      $s0, .LE011421C
/* 3FECF4 E0114214 0200102D */   daddu    $v0, $s0, $zero
/* 3FECF8 E0114218 26020003 */  addiu     $v0, $s0, 0x3
.LE011421C:
/* 3FECFC E011421C 00021083 */  sra       $v0, $v0, 2
/* 3FED00 E0114220 00021080 */  sll       $v0, $v0, 2
/* 3FED04 E0114224 02021023 */  subu      $v0, $s0, $v0
/* 3FED08 E0114228 00551021 */  addu      $v0, $v0, $s5
/* 3FED0C E011422C 00101880 */  sll       $v1, $s0, 2
/* 3FED10 E0114230 00701821 */  addu      $v1, $v1, $s0
/* 3FED14 E0114234 00031880 */  sll       $v1, $v1, 2
/* 3FED18 E0114238 90420000 */  lbu       $v0, 0x0($v0)
/* 3FED1C E011423C 44836000 */  mtc1      $v1, $f12
/* 3FED20 E0114240 00000000 */  nop
/* 3FED24 E0114244 46806320 */  cvt.s.w   $f12, $f12
/* 3FED28 E0114248 0C080140 */  jal       shim_sin_deg
/* 3FED2C E011424C A2220105 */   sb       $v0, 0x105($s1)
/* 3FED30 E0114250 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3FED34 E0114254 44811000 */  mtc1      $at, $f2
/* 3FED38 E0114258 00000000 */  nop
/* 3FED3C E011425C 46020002 */  mul.s     $f0, $f0, $f2
/* 3FED40 E0114260 00000000 */  nop
/* 3FED44 E0114264 080450B0 */  j         .LE01142C0
/* 3FED48 E0114268 2A020009 */   slti     $v0, $s0, 0x9
.LE011426C:
/* 3FED4C E011426C 06010002 */  bgez      $s0, .LE0114278
/* 3FED50 E0114270 0200102D */   daddu    $v0, $s0, $zero
/* 3FED54 E0114274 26020003 */  addiu     $v0, $s0, 0x3
.LE0114278:
/* 3FED58 E0114278 00021083 */  sra       $v0, $v0, 2
/* 3FED5C E011427C 00021080 */  sll       $v0, $v0, 2
/* 3FED60 E0114280 02021023 */  subu      $v0, $s0, $v0
/* 3FED64 E0114284 00551021 */  addu      $v0, $v0, $s5
/* 3FED68 E0114288 00101880 */  sll       $v1, $s0, 2
/* 3FED6C E011428C 00701821 */  addu      $v1, $v1, $s0
/* 3FED70 E0114290 90420000 */  lbu       $v0, 0x0($v0)
/* 3FED74 E0114294 44836000 */  mtc1      $v1, $f12
/* 3FED78 E0114298 00000000 */  nop
/* 3FED7C E011429C 46806320 */  cvt.s.w   $f12, $f12
/* 3FED80 E01142A0 0C080140 */  jal       shim_sin_deg
/* 3FED84 E01142A4 A2220105 */   sb       $v0, 0x105($s1)
/* 3FED88 E01142A8 3C014140 */  lui       $at, (0x41400000 >> 16)
/* 3FED8C E01142AC 44811000 */  mtc1      $at, $f2
/* 3FED90 E01142B0 00000000 */  nop
/* 3FED94 E01142B4 46020002 */  mul.s     $f0, $f0, $f2
/* 3FED98 E01142B8 00000000 */  nop
/* 3FED9C E01142BC 2A020024 */  slti      $v0, $s0, 0x24
.LE01142C0:
/* 3FEDA0 E01142C0 14400004 */  bnez      $v0, .LE01142D4
/* 3FEDA4 E01142C4 E6400110 */   swc1     $f0, 0x110($s2)
/* 3FEDA8 E01142C8 24130001 */  addiu     $s3, $zero, 0x1
/* 3FEDAC E01142CC AE400110 */  sw        $zero, 0x110($s2)
.LE01142D0:
/* 3FEDB0 E01142D0 A220013C */  sb        $zero, 0x13C($s1)
.LE01142D4:
/* 3FEDB4 E01142D4 9222013C */  lbu       $v0, 0x13C($s1)
/* 3FEDB8 E01142D8 24420001 */  addiu     $v0, $v0, 0x1
/* 3FEDBC E01142DC 1260000A */  beqz      $s3, .LE0114308
/* 3FEDC0 E01142E0 A222013C */   sb       $v0, 0x13C($s1)
/* 3FEDC4 E01142E4 8E430008 */  lw        $v1, 0x8($s2)
/* 3FEDC8 E01142E8 30620002 */  andi      $v0, $v1, 0x2
/* 3FEDCC E01142EC 10400006 */  beqz      $v0, .LE0114308
/* 3FEDD0 E01142F0 2402FFFD */   addiu    $v0, $zero, -0x3
/* 3FEDD4 E01142F4 00621024 */  and       $v0, $v1, $v0
/* 3FEDD8 E01142F8 AE420008 */  sw        $v0, 0x8($s2)
/* 3FEDDC E01142FC 922200EF */  lbu       $v0, 0xEF($s1)
/* 3FEDE0 E0114300 A220013C */  sb        $zero, 0x13C($s1)
/* 3FEDE4 E0114304 A22200FA */  sb        $v0, 0xFA($s1)
.LE0114308:
/* 3FEDE8 E0114308 26310001 */  addiu     $s1, $s1, 0x1
/* 3FEDEC E011430C 2682000B */  addiu     $v0, $s4, 0xB
/* 3FEDF0 E0114310 0222102A */  slt       $v0, $s1, $v0
/* 3FEDF4 E0114314 1440FF81 */  bnez      $v0, .LE011411C
/* 3FEDF8 E0114318 26520004 */   addiu    $s2, $s2, 0x4
/* 3FEDFC E011431C 8FBF0028 */  lw        $ra, 0x28($sp)
/* 3FEE00 E0114320 8FB50024 */  lw        $s5, 0x24($sp)
/* 3FEE04 E0114324 8FB40020 */  lw        $s4, 0x20($sp)
/* 3FEE08 E0114328 8FB3001C */  lw        $s3, 0x1C($sp)
/* 3FEE0C E011432C 8FB20018 */  lw        $s2, 0x18($sp)
/* 3FEE10 E0114330 8FB10014 */  lw        $s1, 0x14($sp)
/* 3FEE14 E0114334 8FB00010 */  lw        $s0, 0x10($sp)
/* 3FEE18 E0114338 03E00008 */  jr        $ra
/* 3FEE1C E011433C 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void lil_oink_update(EffectInstance* effect) {
    LilOinkFXData* data = effect->data.lilOink;
    s32 i;

    data->lifetime++;

    for (i = 0; i < MAX_LIL_OINKS; i++) {
        s32 time = data->animTime[i];
        s32 animDone = FALSE;

        switch (data->anim[i]) {
            case LIL_OINK_ANIM_0:
                animDone = TRUE;
                break;
            case LIL_OINK_ANIM_1:
                data->gfxFrame[i] = 1;
                animDone = TRUE;
                break;
            case LIL_OINK_ANIM_3:
                data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
                data->rot[i] = data->rot[i] + shim_sin_deg(time * 10);
                if (time >= 36) {
                    animDone = TRUE;
                    data->animTime[i] = 0;
                }
                break;
            case LIL_OINK_ANIM_2:
                data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
                data->jumpOffset[i] = shim_sin_deg(time * 20) * 2.0f;
                animDone = TRUE;
                if (time >= 9) {
                    data->jumpOffset[i] = 0.0f;
                    data->animTime[i] = 0;
                }
                break;
            case LIL_OINK_ANIM_4:
                data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
                data->jumpOffset[i] = shim_sin_deg(time * 20) * 4.0f;
                if (!(time < 9)) {
                    animDone = TRUE;
                    data->jumpOffset[i] = 0.0f;
                    data->animTime[i] = 0;
                }
                break;
            case LIL_OINK_ANIM_5:
            default:
                data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
                data->jumpOffset[i] = shim_sin_deg(time * 5) * 12.0f;
                if (!(time < 36)) {
                    animDone = TRUE;
                    data->jumpOffset[i] = 0.0f;
                    data->animTime[i] = 0;
                }
                break;
        }
        data->animTime[i]++;
        if (animDone) {
            if (data->flags[i] & LIL_OINK_FLAG_ANIM_CHANGED) {
                data->flags[i] &= ~LIL_OINK_FLAG_ANIM_CHANGED;
                data->animTime[i] = 0;
                data->anim[i] = data->nextAnim[i];
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_syn_update
/* 2EA54 80053654 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 2EA58 80053658 AFB3002C */  sw        $s3, 0x2C($sp)
/* 2EA5C 8005365C 0080982D */  daddu     $s3, $a0, $zero
/* 2EA60 80053660 AFBF0034 */  sw        $ra, 0x34($sp)
/* 2EA64 80053664 AFB40030 */  sw        $s4, 0x30($sp)
/* 2EA68 80053668 AFB20028 */  sw        $s2, 0x28($sp)
/* 2EA6C 8005366C AFB10024 */  sw        $s1, 0x24($sp)
/* 2EA70 80053670 AFB00020 */  sw        $s0, 0x20($sp)
/* 2EA74 80053674 9262130C */  lbu       $v0, 0x130C($s3)
/* 2EA78 80053678 24100002 */  addiu     $s0, $zero, 0x2
/* 2EA7C 8005367C 14500003 */  bne       $v0, $s0, .L8005368C
/* 2EA80 80053680 24020001 */   addiu    $v0, $zero, 0x1
/* 2EA84 80053684 0C015FAC */  jal       au_disable_channel_delay
/* 2EA88 80053688 A262130C */   sb       $v0, 0x130C($s3)
.L8005368C:
/* 2EA8C 8005368C 92620050 */  lbu       $v0, 0x50($s3)
/* 2EA90 80053690 1040001B */  beqz      $v0, .L80053700
/* 2EA94 80053694 00000000 */   nop
/* 2EA98 80053698 9262130C */  lbu       $v0, 0x130C($s3)
/* 2EA9C 8005369C 14400018 */  bnez      $v0, .L80053700
/* 2EAA0 800536A0 24020001 */   addiu    $v0, $zero, 0x1
/* 2EAA4 800536A4 92630053 */  lbu       $v1, 0x53($s3)
/* 2EAA8 800536A8 10620005 */  beq       $v1, $v0, .L800536C0
/* 2EAAC 800536AC 00000000 */   nop
/* 2EAB0 800536B0 10700009 */  beq       $v1, $s0, .L800536D8
/* 2EAB4 800536B4 00000000 */   nop
/* 2EAB8 800536B8 08014DBD */  j         .L800536F4
/* 2EABC 800536BC 00000000 */   nop
.L800536C0:
/* 2EAC0 800536C0 0C015F72 */  jal       au_set_delay_time
/* 2EAC4 800536C4 92640052 */   lbu      $a0, 0x52($s3)
/* 2EAC8 800536C8 0C015F82 */  jal       au_delay_left_channel
/* 2EACC 800536CC 92640051 */   lbu      $a0, 0x51($s3)
/* 2EAD0 800536D0 08014DC0 */  j         .L80053700
/* 2EAD4 800536D4 A2600050 */   sb       $zero, 0x50($s3)
.L800536D8:
/* 2EAD8 800536D8 92640052 */  lbu       $a0, 0x52($s3)
/* 2EADC 800536DC 0C015F72 */  jal       au_set_delay_time
/* 2EAE0 800536E0 00000000 */   nop
/* 2EAE4 800536E4 0C015F97 */  jal       au_delay_right_channel
/* 2EAE8 800536E8 92640051 */   lbu      $a0, 0x51($s3)
/* 2EAEC 800536EC 08014DC0 */  j         .L80053700
/* 2EAF0 800536F0 A2600050 */   sb       $zero, 0x50($s3)
.L800536F4:
/* 2EAF4 800536F4 0C015FAC */  jal       au_disable_channel_delay
/* 2EAF8 800536F8 00000000 */   nop
/* 2EAFC 800536FC A2600050 */  sb        $zero, 0x50($s3)
.L80053700:
/* 2EB00 80053700 92620041 */  lbu       $v0, 0x41($s3)
/* 2EB04 80053704 10400005 */  beqz      $v0, .L8005371C
/* 2EB08 80053708 00000000 */   nop
/* 2EB0C 8005370C 92650040 */  lbu       $a1, 0x40($s3)
/* 2EB10 80053710 0C015B73 */  jal       au_bus_set_effect
/* 2EB14 80053714 0000202D */   daddu    $a0, $zero, $zero
/* 2EB18 80053718 A2600041 */  sb        $zero, 0x41($s3)
.L8005371C:
/* 2EB1C 8005371C 92620045 */  lbu       $v0, 0x45($s3)
/* 2EB20 80053720 10400005 */  beqz      $v0, .L80053738
/* 2EB24 80053724 00000000 */   nop
/* 2EB28 80053728 92650044 */  lbu       $a1, 0x44($s3)
/* 2EB2C 8005372C 0C015B73 */  jal       au_bus_set_effect
/* 2EB30 80053730 24040001 */   addiu    $a0, $zero, 0x1
/* 2EB34 80053734 A2600045 */  sb        $zero, 0x45($s3)
.L80053738:
/* 2EB38 80053738 92620049 */  lbu       $v0, 0x49($s3)
/* 2EB3C 8005373C 10400005 */  beqz      $v0, .L80053754
/* 2EB40 80053740 00000000 */   nop
/* 2EB44 80053744 92650048 */  lbu       $a1, 0x48($s3)
/* 2EB48 80053748 0C015B73 */  jal       au_bus_set_effect
/* 2EB4C 8005374C 24040002 */   addiu    $a0, $zero, 0x2
/* 2EB50 80053750 A2600049 */  sb        $zero, 0x49($s3)
.L80053754:
/* 2EB54 80053754 9262004D */  lbu       $v0, 0x4D($s3)
/* 2EB58 80053758 10400006 */  beqz      $v0, .L80053774
/* 2EB5C 8005375C 0000902D */   daddu    $s2, $zero, $zero
/* 2EB60 80053760 9265004C */  lbu       $a1, 0x4C($s3)
/* 2EB64 80053764 0C015B73 */  jal       au_bus_set_effect
/* 2EB68 80053768 24040003 */   addiu    $a0, $zero, 0x3
/* 2EB6C 8005376C A260004D */  sb        $zero, 0x4D($s3)
/* 2EB70 80053770 0000902D */  daddu     $s2, $zero, $zero
.L80053774:
/* 2EB74 80053774 24141320 */  addiu     $s4, $zero, 0x1320
.L80053778:
/* 2EB78 80053778 02748021 */  addu      $s0, $s3, $s4
/* 2EB7C 8005377C 92020042 */  lbu       $v0, 0x42($s0)
/* 2EB80 80053780 92110043 */  lbu       $s1, 0x43($s0)
/* 2EB84 80053784 10400007 */  beqz      $v0, .L800537A4
/* 2EB88 80053788 32220002 */   andi     $v0, $s1, 0x2
/* 2EB8C 8005378C 0C015BBA */  jal       func_80056EE8
/* 2EB90 80053790 324400FF */   andi     $a0, $s2, 0xFF
/* 2EB94 80053794 A2000042 */  sb        $zero, 0x42($s0)
/* 2EB98 80053798 AE00001C */  sw        $zero, 0x1C($s0)
/* 2EB9C 8005379C A2000045 */  sb        $zero, 0x45($s0)
/* 2EBA0 800537A0 32220002 */  andi      $v0, $s1, 0x2
.L800537A4:
/* 2EBA4 800537A4 10400013 */  beqz      $v0, .L800537F4
/* 2EBA8 800537A8 0200202D */   daddu    $a0, $s0, $zero
/* 2EBAC 800537AC 0C014AFE */  jal       au_voice_start
/* 2EBB0 800537B0 26050014 */   addiu    $a1, $s0, 0x14
/* 2EBB4 800537B4 8602000C */  lh        $v0, 0xC($s0)
/* 2EBB8 800537B8 92050010 */  lbu       $a1, 0x10($s0)
/* 2EBBC 800537BC AFA20010 */  sw        $v0, 0x10($sp)
/* 2EBC0 800537C0 9202000E */  lbu       $v0, 0xE($s0)
/* 2EBC4 800537C4 AFA20014 */  sw        $v0, 0x14($sp)
/* 2EBC8 800537C8 9202000F */  lbu       $v0, 0xF($s0)
/* 2EBCC 800537CC AFA20018 */  sw        $v0, 0x18($sp)
/* 2EBD0 800537D0 8E020008 */  lw        $v0, 0x8($s0)
/* 2EBD4 800537D4 AFA2001C */  sw        $v0, 0x1C($sp)
/* 2EBD8 800537D8 8E060000 */  lw        $a2, 0x0($s0)
/* 2EBDC 800537DC 8E070004 */  lw        $a3, 0x4($s0)
/* 2EBE0 800537E0 0C015BE9 */  jal       func_80056FA4
/* 2EBE4 800537E4 324400FF */   andi     $a0, $s2, 0xFF
/* 2EBE8 800537E8 92020044 */  lbu       $v0, 0x44($s0)
/* 2EBEC 800537EC 08014E15 */  j         .L80053854
/* 2EBF0 800537F0 A2020045 */   sb       $v0, 0x45($s0)
.L800537F4:
/* 2EBF4 800537F4 32220008 */  andi      $v0, $s1, 0x8
/* 2EBF8 800537F8 10400005 */  beqz      $v0, .L80053810
/* 2EBFC 800537FC 32220004 */   andi     $v0, $s1, 0x4
/* 2EC00 80053800 8E050004 */  lw        $a1, 0x4($s0)
/* 2EC04 80053804 0C015CD1 */  jal       func_80057344
/* 2EC08 80053808 324400FF */   andi     $a0, $s2, 0xFF
/* 2EC0C 8005380C 32220004 */  andi      $v0, $s1, 0x4
.L80053810:
/* 2EC10 80053810 1040000A */  beqz      $v0, .L8005383C
/* 2EC14 80053814 32220010 */   andi     $v0, $s1, 0x10
/* 2EC18 80053818 9202000F */  lbu       $v0, 0xF($s0)
/* 2EC1C 8005381C 8605000C */  lh        $a1, 0xC($s0)
/* 2EC20 80053820 9207000E */  lbu       $a3, 0xE($s0)
/* 2EC24 80053824 AFA20010 */  sw        $v0, 0x10($sp)
/* 2EC28 80053828 8E060008 */  lw        $a2, 0x8($s0)
/* 2EC2C 8005382C 0C015CDB */  jal       au_syn_set_mixer_params
/* 2EC30 80053830 324400FF */   andi     $a0, $s2, 0xFF
/* 2EC34 80053834 08014E16 */  j         .L80053858
/* 2EC38 80053838 A2000043 */   sb       $zero, 0x43($s0)
.L8005383C:
/* 2EC3C 8005383C 50400006 */  beql      $v0, $zero, .L80053858
/* 2EC40 80053840 A2000043 */   sb       $zero, 0x43($s0)
/* 2EC44 80053844 9205000E */  lbu       $a1, 0xE($s0)
/* 2EC48 80053848 9206000F */  lbu       $a2, 0xF($s0)
/* 2EC4C 8005384C 0C015D52 */  jal       au_syn_set_pan_fxmix
/* 2EC50 80053850 324400FF */   andi     $a0, $s2, 0xFF
.L80053854:
/* 2EC54 80053854 A2000043 */  sb        $zero, 0x43($s0)
.L80053858:
/* 2EC58 80053858 26520001 */  addiu     $s2, $s2, 0x1
/* 2EC5C 8005385C 2E420018 */  sltiu     $v0, $s2, 0x18
/* 2EC60 80053860 1440FFC5 */  bnez      $v0, .L80053778
/* 2EC64 80053864 26940048 */   addiu    $s4, $s4, 0x48
/* 2EC68 80053868 8FBF0034 */  lw        $ra, 0x34($sp)
/* 2EC6C 8005386C 8FB40030 */  lw        $s4, 0x30($sp)
/* 2EC70 80053870 8FB3002C */  lw        $s3, 0x2C($sp)
/* 2EC74 80053874 8FB20028 */  lw        $s2, 0x28($sp)
/* 2EC78 80053878 8FB10024 */  lw        $s1, 0x24($sp)
/* 2EC7C 8005387C 8FB00020 */  lw        $s0, 0x20($sp)
/* 2EC80 80053880 03E00008 */  jr        $ra
/* 2EC84 80053884 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void au_syn_update(AuGlobals* globals) {
    u32 i;

    if (globals->unk_130C == 2) {
        globals->unk_130C = 1;
        au_disable_channel_delay();
    }

    if (globals->channelDelayPending && (globals->unk_130C == 0)) {
        switch (globals->channelDelaySide) {
            case 1:
                au_set_delay_time(globals->channelDelayTime);
                au_delay_left_channel(globals->channelDelayBusId);
                globals->channelDelayPending = FALSE;
                break;
            case 2:
                au_set_delay_time(globals->channelDelayTime);
                au_delay_right_channel(globals->channelDelayBusId);
                globals->channelDelayPending = FALSE;
                break;
            default:
                au_disable_channel_delay();
                globals->channelDelayPending = FALSE;
                break;
        }
    }

    if (globals->effectChanges[FX_BUS_BGMA_MAIN].changed) {
        au_bus_set_effect(FX_BUS_BGMA_MAIN, globals->effectChanges[FX_BUS_BGMA_MAIN].type);
        globals->effectChanges[FX_BUS_BGMA_MAIN].changed = FALSE;
    }
    if (globals->effectChanges[FX_BUS_SOUND].changed) {
        au_bus_set_effect(FX_BUS_SOUND, globals->effectChanges[FX_BUS_SOUND].type);
        globals->effectChanges[FX_BUS_SOUND].changed = FALSE;

    } if (globals->effectChanges[FX_BUS_BGMB].changed) {
        au_bus_set_effect(FX_BUS_BGMB, globals->effectChanges[FX_BUS_BGMB].type);
        globals->effectChanges[FX_BUS_BGMB].changed = FALSE;
    }
    if (globals->effectChanges[FX_BUS_BGMA_AUX].changed) {
        au_bus_set_effect(FX_BUS_BGMA_AUX, globals->effectChanges[FX_BUS_BGMA_AUX].type);
        globals->effectChanges[FX_BUS_BGMA_AUX].changed = FALSE;
    }

    for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
        AuVoice* voice = &globals->voices[i];
        u8 voiceUpdateFlags = voice->syncFlags;

        if (voice->stopPending) {
            au_syn_stop_voice(i);
            voice->stopPending = FALSE;
            voice->cmdPtr = NULL;
            voice->priority = AU_PRIORITY_FREE;
        }

        if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_ALL) {
            au_voice_start(voice, &voice->envelope);
            au_syn_start_voice_params(i, voice->busId, voice->instrument, voice->pitchRatio, voice->p_volume, voice->pan, voice->reverb, voice->delta);
            // priority may be AU_PRIORITY_FREE if this voice was stolen and reset
            voice->priority = voice->clientPriority;
        } else {
            if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PITCH) {
                au_syn_set_pitch(i, voice->pitchRatio);
            }

            if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PARAMS) {
                au_syn_set_mixer_params(i, voice->p_volume, voice->delta, voice->pan, voice->reverb);
            } else if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PAN_FXMIX) {
                au_syn_set_pan_fxmix(i, voice->pan, voice->reverb);
            }
        }
        voice->syncFlags = 0;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel status_bar_draw_stat
/* 812E4 800E7E34 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 812E8 800E7E38 AFB40030 */  sw        $s4, 0x30($sp)
/* 812EC 800E7E3C 0080A02D */  daddu     $s4, $a0, $zero
/* 812F0 800E7E40 AFB00020 */  sw        $s0, 0x20($sp)
/* 812F4 800E7E44 00A0802D */  daddu     $s0, $a1, $zero
/* 812F8 800E7E48 AFB10024 */  sw        $s1, 0x24($sp)
/* 812FC 800E7E4C 00C0882D */  daddu     $s1, $a2, $zero
/* 81300 800E7E50 AFB3002C */  sw        $s3, 0x2C($sp)
/* 81304 800E7E54 00E0982D */  daddu     $s3, $a3, $zero
/* 81308 800E7E58 AFB60038 */  sw        $s6, 0x38($sp)
/* 8130C 800E7E5C 24160002 */  addiu     $s6, $zero, 0x2
/* 81310 800E7E60 AFB20028 */  sw        $s2, 0x28($sp)
/* 81314 800E7E64 0000902D */  daddu     $s2, $zero, $zero
/* 81318 800E7E68 AFB50034 */  sw        $s5, 0x34($sp)
/* 8131C 800E7E6C 8FB50058 */  lw        $s5, 0x58($sp)
/* 81320 800E7E70 3C05800F */  lui       $a1, %hi(SlashHudScript)
/* 81324 800E7E74 8CA57FAC */  lw        $a1, %lo(SlashHudScript)($a1)
/* 81328 800E7E78 26080008 */  addiu     $t0, $s0, 0x8
/* 8132C 800E7E7C AFA80018 */  sw        $t0, 0x18($sp)
/* 81330 800E7E80 26280008 */  addiu     $t0, $s1, 0x8
/* 81334 800E7E84 AFBF0044 */  sw        $ra, 0x44($sp)
/* 81338 800E7E88 AFBE0040 */  sw        $fp, 0x40($sp)
/* 8133C 800E7E8C AFB7003C */  sw        $s7, 0x3C($sp)
/* 81340 800E7E90 0C0511FF */  jal       hud_element_set_script
/* 81344 800E7E94 AFA8001C */   sw       $t0, 0x1C($sp)
/* 81348 800E7E98 0280202D */  daddu     $a0, $s4, $zero
/* 8134C 800E7E9C 26050016 */  addiu     $a1, $s0, 0x16
/* 81350 800E7EA0 0C051261 */  jal       hud_element_set_render_pos
/* 81354 800E7EA4 26260009 */   addiu    $a2, $s1, 0x9
/* 81358 800E7EA8 0280202D */  daddu     $a0, $s4, $zero
/* 8135C 800E7EAC 0C05128B */  jal       hud_element_clear_flags
/* 81360 800E7EB0 02C0282D */   daddu    $a1, $s6, $zero
/* 81364 800E7EB4 0C0511F1 */  jal       hud_element_draw_next
/* 81368 800E7EB8 0280202D */   daddu    $a0, $s4, $zero
/* 8136C 800E7EBC 3C066666 */  lui       $a2, (0x66666667 >> 16)
/* 81370 800E7EC0 34C66667 */  ori       $a2, $a2, (0x66666667 & 0xFFFF)
/* 81374 800E7EC4 27A50010 */  addiu     $a1, $sp, 0x10
.L800E7EC8:
/* 81378 800E7EC8 02660018 */  mult      $s3, $a2
/* 8137C 800E7ECC 02D22023 */  subu      $a0, $s6, $s2
/* 81380 800E7ED0 26520001 */  addiu     $s2, $s2, 0x1
/* 81384 800E7ED4 001317C3 */  sra       $v0, $s3, 31
/* 81388 800E7ED8 00852021 */  addu      $a0, $a0, $a1
/* 8138C 800E7EDC 00004010 */  mfhi      $t0
/* 81390 800E7EE0 00081883 */  sra       $v1, $t0, 2
/* 81394 800E7EE4 00621023 */  subu      $v0, $v1, $v0
/* 81398 800E7EE8 0040182D */  daddu     $v1, $v0, $zero
/* 8139C 800E7EEC 00031080 */  sll       $v0, $v1, 2
/* 813A0 800E7EF0 00431021 */  addu      $v0, $v0, $v1
/* 813A4 800E7EF4 00021040 */  sll       $v0, $v0, 1
/* 813A8 800E7EF8 02621023 */  subu      $v0, $s3, $v0
/* 813AC 800E7EFC A082FFFF */  sb        $v0, -0x1($a0)
/* 813B0 800E7F00 0256102A */  slt       $v0, $s2, $s6
/* 813B4 800E7F04 1440FFF0 */  bnez      $v0, .L800E7EC8
/* 813B8 800E7F08 0060982D */   daddu    $s3, $v1, $zero
/* 813BC 800E7F0C 8FB00018 */  lw        $s0, 0x18($sp)
/* 813C0 800E7F10 0000882D */  daddu     $s1, $zero, $zero
/* 813C4 800E7F14 8FB3001C */  lw        $s3, 0x1C($sp)
/* 813C8 800E7F18 12C00020 */  beqz      $s6, .L800E7F9C
/* 813CC 800E7F1C 0220902D */   daddu    $s2, $s1, $zero
/* 813D0 800E7F20 27BE0010 */  addiu     $fp, $sp, 0x10
/* 813D4 800E7F24 26D7FFFF */  addiu     $s7, $s6, -0x1
.L800E7F28:
/* 813D8 800E7F28 03D21021 */  addu      $v0, $fp, $s2
/* 813DC 800E7F2C 80420000 */  lb        $v0, 0x0($v0)
/* 813E0 800E7F30 54400006 */  bnel      $v0, $zero, .L800E7F4C
/* 813E4 800E7F34 24110001 */   addiu    $s1, $zero, 0x1
/* 813E8 800E7F38 56200004 */  bnel      $s1, $zero, .L800E7F4C
/* 813EC 800E7F3C 24110001 */   addiu    $s1, $zero, 0x1
/* 813F0 800E7F40 56570013 */  bnel      $s2, $s7, .L800E7F90
/* 813F4 800E7F44 26520001 */   addiu    $s2, $s2, 0x1
/* 813F8 800E7F48 24110001 */  addiu     $s1, $zero, 0x1
.L800E7F4C:
/* 813FC 800E7F4C 00021080 */  sll       $v0, $v0, 2
/* 81400 800E7F50 3C08800F */  lui       $t0, %hi(DigitHudScripts)
/* 81404 800E7F54 25087F80 */  addiu     $t0, $t0, %lo(DigitHudScripts)
/* 81408 800E7F58 00481021 */  addu      $v0, $v0, $t0
/* 8140C 800E7F5C 8C450000 */  lw        $a1, 0x0($v0)
/* 81410 800E7F60 0C0511FF */  jal       hud_element_set_script
/* 81414 800E7F64 0280202D */   daddu    $a0, $s4, $zero
/* 81418 800E7F68 0280202D */  daddu     $a0, $s4, $zero
/* 8141C 800E7F6C 0200282D */  daddu     $a1, $s0, $zero
/* 81420 800E7F70 0C051261 */  jal       hud_element_set_render_pos
/* 81424 800E7F74 0260302D */   daddu    $a2, $s3, $zero
/* 81428 800E7F78 0280202D */  daddu     $a0, $s4, $zero
/* 8142C 800E7F7C 0C05128B */  jal       hud_element_clear_flags
/* 81430 800E7F80 24050002 */   addiu    $a1, $zero, 0x2
/* 81434 800E7F84 0C0511F1 */  jal       hud_element_draw_next
/* 81438 800E7F88 0280202D */   daddu    $a0, $s4, $zero
/* 8143C 800E7F8C 26520001 */  addiu     $s2, $s2, 0x1
.L800E7F90:
/* 81440 800E7F90 0256102A */  slt       $v0, $s2, $s6
/* 81444 800E7F94 1440FFE4 */  bnez      $v0, .L800E7F28
/* 81448 800E7F98 26100008 */   addiu    $s0, $s0, 0x8
.L800E7F9C:
/* 8144C 800E7F9C 12C00014 */  beqz      $s6, .L800E7FF0
/* 81450 800E7FA0 0000902D */   daddu    $s2, $zero, $zero
/* 81454 800E7FA4 27A60010 */  addiu     $a2, $sp, 0x10
/* 81458 800E7FA8 3C056666 */  lui       $a1, (0x66666667 >> 16)
/* 8145C 800E7FAC 34A56667 */  ori       $a1, $a1, (0x66666667 & 0xFFFF)
.L800E7FB0:
/* 81460 800E7FB0 02A50018 */  mult      $s5, $a1
/* 81464 800E7FB4 02D22023 */  subu      $a0, $s6, $s2
/* 81468 800E7FB8 26520001 */  addiu     $s2, $s2, 0x1
/* 8146C 800E7FBC 00862021 */  addu      $a0, $a0, $a2
/* 81470 800E7FC0 001517C3 */  sra       $v0, $s5, 31
/* 81474 800E7FC4 00004010 */  mfhi      $t0
/* 81478 800E7FC8 00081883 */  sra       $v1, $t0, 2
/* 8147C 800E7FCC 00621823 */  subu      $v1, $v1, $v0
/* 81480 800E7FD0 00031080 */  sll       $v0, $v1, 2
/* 81484 800E7FD4 00431021 */  addu      $v0, $v0, $v1
/* 81488 800E7FD8 00021040 */  sll       $v0, $v0, 1
/* 8148C 800E7FDC 02A21023 */  subu      $v0, $s5, $v0
/* 81490 800E7FE0 A082FFFF */  sb        $v0, -0x1($a0)
/* 81494 800E7FE4 0256102A */  slt       $v0, $s2, $s6
/* 81498 800E7FE8 1440FFF1 */  bnez      $v0, .L800E7FB0
/* 8149C 800E7FEC 0060A82D */   daddu    $s5, $v1, $zero
.L800E7FF0:
/* 814A0 800E7FF0 0000882D */  daddu     $s1, $zero, $zero
/* 814A4 800E7FF4 0220902D */  daddu     $s2, $s1, $zero
/* 814A8 800E7FF8 8FA80018 */  lw        $t0, 0x18($sp)
/* 814AC 800E7FFC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 814B0 800E8000 12C00020 */  beqz      $s6, .L800E8084
/* 814B4 800E8004 2510001A */   addiu    $s0, $t0, 0x1A
/* 814B8 800E8008 27B70010 */  addiu     $s7, $sp, 0x10
/* 814BC 800E800C 26D5FFFF */  addiu     $s5, $s6, -0x1
/* 814C0 800E8010 3C1E800F */  lui       $fp, %hi(DigitHudScripts)
/* 814C4 800E8014 27DE7F80 */  addiu     $fp, $fp, %lo(DigitHudScripts)
.L800E8018:
/* 814C8 800E8018 02F21021 */  addu      $v0, $s7, $s2
/* 814CC 800E801C 80420000 */  lb        $v0, 0x0($v0)
/* 814D0 800E8020 54400006 */  bnel      $v0, $zero, .L800E803C
/* 814D4 800E8024 24110001 */   addiu    $s1, $zero, 0x1
/* 814D8 800E8028 56200004 */  bnel      $s1, $zero, .L800E803C
/* 814DC 800E802C 24110001 */   addiu    $s1, $zero, 0x1
/* 814E0 800E8030 56550011 */  bnel      $s2, $s5, .L800E8078
/* 814E4 800E8034 26520001 */   addiu    $s2, $s2, 0x1
/* 814E8 800E8038 24110001 */  addiu     $s1, $zero, 0x1
.L800E803C:
/* 814EC 800E803C 00021080 */  sll       $v0, $v0, 2
/* 814F0 800E8040 005E1021 */  addu      $v0, $v0, $fp
/* 814F4 800E8044 8C450000 */  lw        $a1, 0x0($v0)
/* 814F8 800E8048 0C0511FF */  jal       hud_element_set_script
/* 814FC 800E804C 0280202D */   daddu    $a0, $s4, $zero
/* 81500 800E8050 0280202D */  daddu     $a0, $s4, $zero
/* 81504 800E8054 0200282D */  daddu     $a1, $s0, $zero
/* 81508 800E8058 0C051261 */  jal       hud_element_set_render_pos
/* 8150C 800E805C 0260302D */   daddu    $a2, $s3, $zero
/* 81510 800E8060 0280202D */  daddu     $a0, $s4, $zero
/* 81514 800E8064 0C05128B */  jal       hud_element_clear_flags
/* 81518 800E8068 24050002 */   addiu    $a1, $zero, 0x2
/* 8151C 800E806C 0C0511F1 */  jal       hud_element_draw_next
/* 81520 800E8070 0280202D */   daddu    $a0, $s4, $zero
/* 81524 800E8074 26520001 */  addiu     $s2, $s2, 0x1
.L800E8078:
/* 81528 800E8078 0256102A */  slt       $v0, $s2, $s6
/* 8152C 800E807C 1440FFE6 */  bnez      $v0, .L800E8018
/* 81530 800E8080 26100008 */   addiu    $s0, $s0, 0x8
.L800E8084:
/* 81534 800E8084 8FBF0044 */  lw        $ra, 0x44($sp)
/* 81538 800E8088 8FBE0040 */  lw        $fp, 0x40($sp)
/* 8153C 800E808C 8FB7003C */  lw        $s7, 0x3C($sp)
/* 81540 800E8090 8FB60038 */  lw        $s6, 0x38($sp)
/* 81544 800E8094 8FB50034 */  lw        $s5, 0x34($sp)
/* 81548 800E8098 8FB40030 */  lw        $s4, 0x30($sp)
/* 8154C 800E809C 8FB3002C */  lw        $s3, 0x2C($sp)
/* 81550 800E80A0 8FB20028 */  lw        $s2, 0x28($sp)
/* 81554 800E80A4 8FB10024 */  lw        $s1, 0x24($sp)
/* 81558 800E80A8 8FB00020 */  lw        $s0, 0x20($sp)
/* 8155C 800E80AC 03E00008 */  jr        $ra
/* 81560 800E80B0 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void status_bar_draw_stat(s32 id, s32 x, s32 y, s32 currentValue, s32 maxValue) {
    s8 digits[4];
    s32 cond;
    s32 digit;
    s32 numDigits = 2;
    s32 localX;
    s32 localY;
    s32 i = 0;
    s32 baseX = x + 8;
    s32 baseY = y + 8;

    hud_element_set_script(id, SlashHudScript);
    hud_element_set_render_pos(id, baseX + 14, baseY + 1);
    hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED);
    hud_element_draw_next(id);

    for (i = 0; i < numDigits; i++) {
        s32 num = currentValue % 10;
        digits[numDigits - i - 1] = num;
        currentValue /= 10;
    }

    localX = baseX;
    localY = baseY;
    cond = FALSE;
    for (i = 0; i < numDigits; i++, localX += 8) {
        digit = digits[i];
        if (digit != 0 || cond || i == numDigits - 1) {
            cond = TRUE;
            hud_element_set_script(id, DigitHudScripts[digit]);
            hud_element_set_render_pos(id, localX, localY);
            hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED);
            hud_element_draw_next(id);
        }
    }

    for (i = 0; i < numDigits; i++) {
        digits[numDigits - i - 1] = maxValue % 10;
        maxValue /= 10;
    }

    localX = baseX + 26;
    localY = baseY;
    cond = FALSE;
    for (i = 0; i < numDigits; i++, localX += 8) {
        digit = digits[i];
        if (digit != 0 || cond || i == numDigits - 1) {
            cond = TRUE;
            hud_element_set_script(id, DigitHudScripts[digit]);
            hud_element_set_render_pos(id, localX, localY);
            hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED);
            hud_element_draw_next(id);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel radial_shimmer_update
/* 3664C8 E0066498 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 3664CC E006649C AFB1003C */  sw        $s1, 0x3C($sp)
/* 3664D0 E00664A0 0080882D */  daddu     $s1, $a0, $zero
/* 3664D4 E00664A4 AFBF0040 */  sw        $ra, 0x40($sp)
/* 3664D8 E00664A8 AFB00038 */  sw        $s0, 0x38($sp)
/* 3664DC E00664AC F7B40048 */  sdc1      $f20, 0x48($sp)
/* 3664E0 E00664B0 8E30000C */  lw        $s0, 0xC($s1)
/* 3664E4 E00664B4 8E020028 */  lw        $v0, 0x28($s0)
/* 3664E8 E00664B8 8E03002C */  lw        $v1, 0x2C($s0)
/* 3664EC E00664BC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3664F0 E00664C0 24630001 */  addiu     $v1, $v1, 0x1
/* 3664F4 E00664C4 AE020028 */  sw        $v0, 0x28($s0)
/* 3664F8 E00664C8 AE03002C */  sw        $v1, 0x2C($s0)
/* 3664FC E00664CC 8E230000 */  lw        $v1, 0x0($s1)
/* 366500 E00664D0 30620010 */  andi      $v0, $v1, 0x10
/* 366504 E00664D4 10400005 */  beqz      $v0, .LE00664EC
/* 366508 E00664D8 2402FFEF */   addiu    $v0, $zero, -0x11
/* 36650C E00664DC 00621024 */  and       $v0, $v1, $v0
/* 366510 E00664E0 AE220000 */  sw        $v0, 0x0($s1)
/* 366514 E00664E4 24020010 */  addiu     $v0, $zero, 0x10
/* 366518 E00664E8 AE020028 */  sw        $v0, 0x28($s0)
.LE00664EC:
/* 36651C E00664EC 8E050028 */  lw        $a1, 0x28($s0)
/* 366520 E00664F0 04A10005 */  bgez      $a1, .LE0066508
/* 366524 E00664F4 00000000 */   nop
/* 366528 E00664F8 0C080128 */  jal       shim_remove_effect
/* 36652C E00664FC 0220202D */   daddu    $a0, $s1, $zero
/* 366530 E0066500 080199C5 */  j         .LE0066714
/* 366534 E0066504 00000000 */   nop
.LE0066508:
/* 366538 E0066508 8E04002C */  lw        $a0, 0x2C($s0)
/* 36653C E006650C 2882000B */  slti      $v0, $a0, 0xB
/* 366540 E0066510 1040000A */  beqz      $v0, .LE006653C
/* 366544 E0066514 3C036666 */   lui      $v1, (0x66666667 >> 16)
/* 366548 E0066518 34636667 */  ori       $v1, $v1, (0x66666667 & 0xFFFF)
/* 36654C E006651C 00041200 */  sll       $v0, $a0, 8
/* 366550 E0066520 00441023 */  subu      $v0, $v0, $a0
/* 366554 E0066524 00430018 */  mult      $v0, $v1
/* 366558 E0066528 000217C3 */  sra       $v0, $v0, 31
/* 36655C E006652C 00004010 */  mfhi      $t0
/* 366560 E0066530 00081883 */  sra       $v1, $t0, 2
/* 366564 E0066534 00621823 */  subu      $v1, $v1, $v0
/* 366568 E0066538 AE030024 */  sw        $v1, 0x24($s0)
.LE006653C:
/* 36656C E006653C 28A20006 */  slti      $v0, $a1, 0x6
/* 366570 E0066540 10400009 */  beqz      $v0, .LE0066568
/* 366574 E0066544 3C032AAA */   lui      $v1, (0x2AAAAAAB >> 16)
/* 366578 E0066548 3463AAAB */  ori       $v1, $v1, (0x2AAAAAAB & 0xFFFF)
/* 36657C E006654C 00051200 */  sll       $v0, $a1, 8
/* 366580 E0066550 00451023 */  subu      $v0, $v0, $a1
/* 366584 E0066554 00430018 */  mult      $v0, $v1
/* 366588 E0066558 000217C3 */  sra       $v0, $v0, 31
/* 36658C E006655C 00004010 */  mfhi      $t0
/* 366590 E0066560 01021023 */  subu      $v0, $t0, $v0
/* 366594 E0066564 AE020024 */  sw        $v0, 0x24($s0)
.LE0066568:
/* 366598 E0066568 28A2000A */  slti      $v0, $a1, 0xA
/* 36659C E006656C 1040000C */  beqz      $v0, .LE00665A0
/* 3665A0 E0066570 24020004 */   addiu    $v0, $zero, 0x4
/* 3665A4 E0066574 8E030000 */  lw        $v1, 0x0($s0)
/* 3665A8 E0066578 14620009 */  bne       $v1, $v0, .LE00665A0
/* 3665AC E006657C 00000000 */   nop
/* 3665B0 E0066580 C600001C */  lwc1      $f0, 0x1C($s0)
/* 3665B4 E0066584 3C01E006 */  lui       $at, (0xE0066D20 >> 16)
/* 3665B8 E0066588 D4226D20 */  ldc1      $f2, (0xE0066D20 & 0xFFFF)($at)
/* 3665BC E006658C 46000021 */  cvt.d.s   $f0, $f0
/* 3665C0 E0066590 46220002 */  mul.d     $f0, $f0, $f2
/* 3665C4 E0066594 00000000 */  nop
/* 3665C8 E0066598 46200020 */  cvt.s.d   $f0, $f0
/* 3665CC E006659C E600001C */  swc1      $f0, 0x1C($s0)
.LE00665A0:
/* 3665D0 E00665A0 C6000020 */  lwc1      $f0, 0x20($s0)
/* 3665D4 E00665A4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3665D8 E00665A8 4481A000 */  mtc1      $at, $f20
/* 3665DC E00665AC 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3665E0 E00665B0 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3665E4 E00665B4 27A20028 */  addiu     $v0, $sp, 0x28
/* 3665E8 E00665B8 E600001C */  swc1      $f0, 0x1C($s0)
/* 3665EC E00665BC AFA20014 */  sw        $v0, 0x14($sp)
/* 3665F0 E00665C0 27A2002C */  addiu     $v0, $sp, 0x2C
/* 3665F4 E00665C4 AFA20018 */  sw        $v0, 0x18($sp)
/* 3665F8 E00665C8 27A20030 */  addiu     $v0, $sp, 0x30
/* 3665FC E00665CC AFA2001C */  sw        $v0, 0x1C($sp)
/* 366600 E00665D0 27A20034 */  addiu     $v0, $sp, 0x34
/* 366604 E00665D4 00032080 */  sll       $a0, $v1, 2
/* 366608 E00665D8 00832021 */  addu      $a0, $a0, $v1
/* 36660C E00665DC 00042080 */  sll       $a0, $a0, 2
/* 366610 E00665E0 00832023 */  subu      $a0, $a0, $v1
/* 366614 E00665E4 AFA20020 */  sw        $v0, 0x20($sp)
/* 366618 E00665E8 000410C0 */  sll       $v0, $a0, 3
/* 36661C E00665EC 00822021 */  addu      $a0, $a0, $v0
/* 366620 E00665F0 000420C0 */  sll       $a0, $a0, 3
/* 366624 E00665F4 3C02800B */  lui       $v0, %hi(gCameras + 0xD4)
/* 366628 E00665F8 24421E54 */  addiu     $v0, $v0, %lo(gCameras + 0xD4)
/* 36662C E00665FC E7B40010 */  swc1      $f20, 0x10($sp)
/* 366630 E0066600 8E050004 */  lw        $a1, 0x4($s0)
/* 366634 E0066604 8E060008 */  lw        $a2, 0x8($s0)
/* 366638 E0066608 8E07000C */  lw        $a3, 0xC($s0)
/* 36663C E006660C 0C080168 */  jal       shim_transform_point
/* 366640 E0066610 00822021 */   addu     $a0, $a0, $v0
/* 366644 E0066614 C7A00034 */  lwc1      $f0, 0x34($sp)
/* 366648 E0066618 C7A40028 */  lwc1      $f4, 0x28($sp)
/* 36664C E006661C 4600A503 */  div.s     $f20, $f20, $f0
/* 366650 E0066620 46142102 */  mul.s     $f4, $f4, $f20
/* 366654 E0066624 00000000 */  nop
/* 366658 E0066628 C7A0002C */  lwc1      $f0, 0x2C($sp)
/* 36665C E006662C 46140002 */  mul.s     $f0, $f0, $f20
/* 366660 E0066630 00000000 */  nop
/* 366664 E0066634 C7A20030 */  lwc1      $f2, 0x30($sp)
/* 366668 E0066638 46141082 */  mul.s     $f2, $f2, $f20
/* 36666C E006663C 00000000 */  nop
/* 366670 E0066640 AE000018 */  sw        $zero, 0x18($s0)
/* 366674 E0066644 E6040010 */  swc1      $f4, 0x10($s0)
/* 366678 E0066648 E6000014 */  swc1      $f0, 0x14($s0)
/* 36667C E006664C 8E220008 */  lw        $v0, 0x8($s1)
/* 366680 E0066650 0000202D */  daddu     $a0, $zero, $zero
/* 366684 E0066654 E7B40034 */  swc1      $f20, 0x34($sp)
/* 366688 E0066658 E7A40028 */  swc1      $f4, 0x28($sp)
/* 36668C E006665C E7A0002C */  swc1      $f0, 0x2C($sp)
/* 366690 E0066660 1840002C */  blez      $v0, .LE0066714
/* 366694 E0066664 E7A20030 */   swc1     $f2, 0x30($sp)
/* 366698 E0066668 26030048 */  addiu     $v1, $s0, 0x48
/* 36669C E006666C C60E0018 */  lwc1      $f14, 0x18($s0)
/* 3666A0 E0066670 3C014400 */  lui       $at, (0x44000000 >> 16)
/* 3666A4 E0066674 44816000 */  mtc1      $at, $f12
.LE0066678:
/* 3666A8 E0066678 C4620010 */  lwc1      $f2, 0x10($v1)
/* 3666AC E006667C C4600014 */  lwc1      $f0, 0x14($v1)
/* 3666B0 E0066680 C4680008 */  lwc1      $f8, 0x8($v1)
/* 3666B4 E0066684 C464FFF8 */  lwc1      $f4, -0x8($v1)
/* 3666B8 E0066688 46001080 */  add.s     $f2, $f2, $f0
/* 3666BC E006668C C460000C */  lwc1      $f0, 0xC($v1)
/* 3666C0 E0066690 C46AFFE8 */  lwc1      $f10, -0x18($v1)
/* 3666C4 E0066694 46004200 */  add.s     $f8, $f8, $f0
/* 3666C8 E0066698 C460FFFC */  lwc1      $f0, -0x4($v1)
/* 3666CC E006669C C466FFF0 */  lwc1      $f6, -0x10($v1)
/* 3666D0 E00666A0 46002100 */  add.s     $f4, $f4, $f0
/* 3666D4 E00666A4 C460FFEC */  lwc1      $f0, -0x14($v1)
/* 3666D8 E00666A8 E4620010 */  swc1      $f2, 0x10($v1)
/* 3666DC E00666AC 46005280 */  add.s     $f10, $f10, $f0
/* 3666E0 E00666B0 C462FFF4 */  lwc1      $f2, -0xC($v1)
/* 3666E4 E00666B4 46023180 */  add.s     $f6, $f6, $f2
/* 3666E8 E00666B8 C4600000 */  lwc1      $f0, 0x0($v1)
/* 3666EC E00666BC C4620004 */  lwc1      $f2, 0x4($v1)
/* 3666F0 E00666C0 46020000 */  add.s     $f0, $f0, $f2
/* 3666F4 E00666C4 E4680008 */  swc1      $f8, 0x8($v1)
/* 3666F8 E00666C8 460E203C */  c.lt.s    $f4, $f14
/* 3666FC E00666CC E464FFF8 */  swc1      $f4, -0x8($v1)
/* 366700 E00666D0 E46AFFE8 */  swc1      $f10, -0x18($v1)
/* 366704 E00666D4 E466FFF0 */  swc1      $f6, -0x10($v1)
/* 366708 E00666D8 45000003 */  bc1f      .LE00666E8
/* 36670C E00666DC E4600000 */   swc1     $f0, 0x0($v1)
/* 366710 E00666E0 460C2000 */  add.s     $f0, $f4, $f12
/* 366714 E00666E4 E460FFF8 */  swc1      $f0, -0x8($v1)
.LE00666E8:
/* 366718 E00666E8 C4600000 */  lwc1      $f0, 0x0($v1)
/* 36671C E00666EC 460E003C */  c.lt.s    $f0, $f14
/* 366720 E00666F0 00000000 */  nop
/* 366724 E00666F4 45000003 */  bc1f      .LE0066704
/* 366728 E00666F8 24840001 */   addiu    $a0, $a0, 0x1
/* 36672C E00666FC 460C0000 */  add.s     $f0, $f0, $f12
/* 366730 E0066700 E4600000 */  swc1      $f0, 0x0($v1)
.LE0066704:
/* 366734 E0066704 8E220008 */  lw        $v0, 0x8($s1)
/* 366738 E0066708 0082102A */  slt       $v0, $a0, $v0
/* 36673C E006670C 1440FFDA */  bnez      $v0, .LE0066678
/* 366740 E0066710 24630070 */   addiu    $v1, $v1, 0x70
.LE0066714:
/* 366744 E0066714 8FBF0040 */  lw        $ra, 0x40($sp)
/* 366748 E0066718 8FB1003C */  lw        $s1, 0x3C($sp)
/* 36674C E006671C 8FB00038 */  lw        $s0, 0x38($sp)
/* 366750 E0066720 D7B40048 */  ldc1      $f20, 0x48($sp)
/* 366754 E0066724 03E00008 */  jr        $ra
/* 366758 E0066728 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void radial_shimmer_update(EffectInstance* effect) {
    RadialShimmerFXData* part = effect->data.radialShimmer;
    s32 unk_28;
    f32 outX;
    f32 outY;
    f32 outZ;
    f32 outS;
    s32 i;

    part->timeLeft--;
    part->lifeTime++;

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

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

    unk_28 = part->timeLeft;

    if (part->lifeTime <= 10) {
        part->unk_24 = (part->lifeTime * 255) / 10;
    }

    if (unk_28 < 6) {
        part->unk_24 = (unk_28 * 255) / 6;
    }

    if (unk_28 < 10 && part->unk_00 == 4) {
        part->unk_1C *= 0.7;
    }

    part->unk_1C = part->unk_20;

    shim_transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], part->unk_04, part->unk_08, part->unk_0C,
                         1.0f, &outX, &outY, &outZ, &outS);

    outS = 1.0f / outS;
    outX *= outS;
    outY *= outS;
    outZ *= outS;

    part->unk_10 = outX;
    part->unk_14 = outY;
    part->unk_18 = 0.0f;

    for (i = 0; i < effect->numParts; i++, part++) {
        part->unk_58 += part->unk_5C;
        part->unk_50 += part->unk_54;
        part->unk_40 += part->unk_44;
        part->unk_30 += part->unk_34;
        part->unk_38 += part->unk_3C;
        part->unk_48 += part->unk_4C;

        if (part->unk_40 < 0.0f) {
            part->unk_40 += 512.0f;
        }

        if (part->unk_48 < 0.0f) {
            part->unk_48 += 512.0f;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel player_raycast_down
/* 779FC 800DE54C 27BDFF78 */  addiu     $sp, $sp, -0x88
/* 77A00 800DE550 AFB20060 */  sw        $s2, 0x60($sp)
/* 77A04 800DE554 0080902D */  daddu     $s2, $a0, $zero
/* 77A08 800DE558 AFB30064 */  sw        $s3, 0x64($sp)
/* 77A0C 800DE55C 00A0982D */  daddu     $s3, $a1, $zero
/* 77A10 800DE560 AFB40068 */  sw        $s4, 0x68($sp)
/* 77A14 800DE564 00C0A02D */  daddu     $s4, $a2, $zero
/* 77A18 800DE568 AFB5006C */  sw        $s5, 0x6C($sp)
/* 77A1C 800DE56C 00E0A82D */  daddu     $s5, $a3, $zero
/* 77A20 800DE570 AFBF0070 */  sw        $ra, 0x70($sp)
/* 77A24 800DE574 AFB1005C */  sw        $s1, 0x5C($sp)
/* 77A28 800DE578 AFB00058 */  sw        $s0, 0x58($sp)
/* 77A2C 800DE57C F7B60080 */  sdc1      $f22, 0x80($sp)
/* 77A30 800DE580 F7B40078 */  sdc1      $f20, 0x78($sp)
/* 77A34 800DE584 C6A20000 */  lwc1      $f2, 0x0($s5)
/* 77A38 800DE588 44802000 */  mtc1      $zero, $f4
/* 77A3C 800DE58C 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 77A40 800DE590 44810000 */  mtc1      $at, $f0
/* 77A44 800DE594 27A20038 */  addiu     $v0, $sp, 0x38
/* 77A48 800DE598 E7A20044 */  swc1      $f2, 0x44($sp)
/* 77A4C 800DE59C AFA20018 */  sw        $v0, 0x18($sp)
/* 77A50 800DE5A0 27A2003C */  addiu     $v0, $sp, 0x3C
/* 77A54 800DE5A4 AFA2001C */  sw        $v0, 0x1C($sp)
/* 77A58 800DE5A8 27A20040 */  addiu     $v0, $sp, 0x40
/* 77A5C 800DE5AC AFA20020 */  sw        $v0, 0x20($sp)
/* 77A60 800DE5B0 27A20044 */  addiu     $v0, $sp, 0x44
/* 77A64 800DE5B4 AFA20024 */  sw        $v0, 0x24($sp)
/* 77A68 800DE5B8 27A20048 */  addiu     $v0, $sp, 0x48
/* 77A6C 800DE5BC AFA20028 */  sw        $v0, 0x28($sp)
/* 77A70 800DE5C0 27A2004C */  addiu     $v0, $sp, 0x4C
/* 77A74 800DE5C4 AFA2002C */  sw        $v0, 0x2C($sp)
/* 77A78 800DE5C8 27A20050 */  addiu     $v0, $sp, 0x50
/* 77A7C 800DE5CC E7A00010 */  swc1      $f0, 0x10($sp)
/* 77A80 800DE5D0 E7A40014 */  swc1      $f4, 0x14($sp)
/* 77A84 800DE5D4 AFA20030 */  sw        $v0, 0x30($sp)
/* 77A88 800DE5D8 C64C0000 */  lwc1      $f12, 0x0($s2)
/* 77A8C 800DE5DC C66E0000 */  lwc1      $f14, 0x0($s3)
/* 77A90 800DE5E0 8E860000 */  lw        $a2, 0x0($s4)
/* 77A94 800DE5E4 44072000 */  mfc1      $a3, $f4
/* 77A98 800DE5E8 0C017512 */  jal       test_ray_entities
/* 77A9C 800DE5EC 2411FFFF */   addiu    $s1, $zero, -0x1
/* 77AA0 800DE5F0 0040802D */  daddu     $s0, $v0, $zero
/* 77AA4 800DE5F4 0600000E */  bltz      $s0, .L800DE630
/* 77AA8 800DE5F8 00000000 */   nop
/* 77AAC 800DE5FC 0C04417A */  jal       get_entity_by_index
/* 77AB0 800DE600 0200202D */   daddu    $a0, $s0, $zero
/* 77AB4 800DE604 0040202D */  daddu     $a0, $v0, $zero
/* 77AB8 800DE608 9082000B */  lbu       $v0, 0xB($a0)
/* 77ABC 800DE60C 2C4200FF */  sltiu     $v0, $v0, 0xFF
/* 77AC0 800DE610 10400006 */  beqz      $v0, .L800DE62C
/* 77AC4 800DE614 24030004 */   addiu    $v1, $zero, 0x4
/* 77AC8 800DE618 8C820000 */  lw        $v0, 0x0($a0)
/* 77ACC 800DE61C A0830007 */  sb        $v1, 0x7($a0)
/* 77AD0 800DE620 34420040 */  ori       $v0, $v0, 0x40
/* 77AD4 800DE624 0803798C */  j         .L800DE630
/* 77AD8 800DE628 AC820000 */   sw       $v0, 0x0($a0)
.L800DE62C:
/* 77ADC 800DE62C 36114000 */  ori       $s1, $s0, 0x4000
.L800DE630:
/* 77AE0 800DE630 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 77AE4 800DE634 44810000 */  mtc1      $at, $f0
/* 77AE8 800DE638 27A20038 */  addiu     $v0, $sp, 0x38
/* 77AEC 800DE63C AFA2001C */  sw        $v0, 0x1C($sp)
/* 77AF0 800DE640 27A2003C */  addiu     $v0, $sp, 0x3C
/* 77AF4 800DE644 AFA20020 */  sw        $v0, 0x20($sp)
/* 77AF8 800DE648 27A20040 */  addiu     $v0, $sp, 0x40
/* 77AFC 800DE64C AFA20024 */  sw        $v0, 0x24($sp)
/* 77B00 800DE650 27A20044 */  addiu     $v0, $sp, 0x44
/* 77B04 800DE654 AFA20028 */  sw        $v0, 0x28($sp)
/* 77B08 800DE658 27A20048 */  addiu     $v0, $sp, 0x48
/* 77B0C 800DE65C AFA2002C */  sw        $v0, 0x2C($sp)
/* 77B10 800DE660 27A2004C */  addiu     $v0, $sp, 0x4C
/* 77B14 800DE664 AFA20030 */  sw        $v0, 0x30($sp)
/* 77B18 800DE668 27A20050 */  addiu     $v0, $sp, 0x50
/* 77B1C 800DE66C AFA00010 */  sw        $zero, 0x10($sp)
/* 77B20 800DE670 AFA00018 */  sw        $zero, 0x18($sp)
/* 77B24 800DE674 AFA20034 */  sw        $v0, 0x34($sp)
/* 77B28 800DE678 E7A00014 */  swc1      $f0, 0x14($sp)
/* 77B2C 800DE67C 8E660000 */  lw        $a2, 0x0($s3)
/* 77B30 800DE680 8E870000 */  lw        $a3, 0x0($s4)
/* 77B34 800DE684 8E450000 */  lw        $a1, 0x0($s2)
/* 77B38 800DE688 0C017334 */  jal       test_ray_colliders
/* 77B3C 800DE68C 3C040001 */   lui      $a0, (0x10000 >> 16)
/* 77B40 800DE690 04430001 */  bgezl     $v0, .L800DE698
/* 77B44 800DE694 0040882D */   daddu    $s1, $v0, $zero
.L800DE698:
/* 77B48 800DE698 06200041 */  bltz      $s1, .L800DE7A0
/* 77B4C 800DE69C 00000000 */   nop
/* 77B50 800DE6A0 C7A00044 */  lwc1      $f0, 0x44($sp)
/* 77B54 800DE6A4 E6A00000 */  swc1      $f0, 0x0($s5)
/* 77B58 800DE6A8 C7A00038 */  lwc1      $f0, 0x38($sp)
/* 77B5C 800DE6AC E6400000 */  swc1      $f0, 0x0($s2)
/* 77B60 800DE6B0 C7A0003C */  lwc1      $f0, 0x3C($sp)
/* 77B64 800DE6B4 E6600000 */  swc1      $f0, 0x0($s3)
/* 77B68 800DE6B8 C7A00040 */  lwc1      $f0, 0x40($sp)
/* 77B6C 800DE6BC 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* 77B70 800DE6C0 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
/* 77B74 800DE6C4 E6800000 */  swc1      $f0, 0x0($s4)
/* 77B78 800DE6C8 8E020000 */  lw        $v0, 0x0($s0)
/* 77B7C 800DE6CC C7A00048 */  lwc1      $f0, 0x48($sp)
/* 77B80 800DE6D0 C7A2004C */  lwc1      $f2, 0x4C($sp)
/* 77B84 800DE6D4 C7A40050 */  lwc1      $f4, 0x50($sp)
/* 77B88 800DE6D8 E4400128 */  swc1      $f0, 0x128($v0)
/* 77B8C 800DE6DC E442012C */  swc1      $f2, 0x12C($v0)
/* 77B90 800DE6E0 0C00A788 */  jal       get_player_normal_yaw
/* 77B94 800DE6E4 E4440130 */   swc1     $f4, 0x130($v0)
/* 77B98 800DE6E8 3C018011 */  lui       $at, %hi(D_8010C938)
/* 77B9C 800DE6EC E420C938 */  swc1      $f0, %lo(D_8010C938)($at)
/* 77BA0 800DE6F0 0C00A794 */  jal       get_player_normal_pitch
/* 77BA4 800DE6F4 00000000 */   nop
/* 77BA8 800DE6F8 C7A40050 */  lwc1      $f4, 0x50($sp)
/* 77BAC 800DE6FC 3C014059 */  lui       $at, (0x40590000 >> 16)
/* 77BB0 800DE700 4481A800 */  mtc1      $at, $f21
/* 77BB4 800DE704 4480A000 */  mtc1      $zero, $f20
/* 77BB8 800DE708 46002121 */  cvt.d.s   $f4, $f4
/* 77BBC 800DE70C 46342102 */  mul.d     $f4, $f4, $f20
/* 77BC0 800DE710 00000000 */  nop
/* 77BC4 800DE714 C7A2004C */  lwc1      $f2, 0x4C($sp)
/* 77BC8 800DE718 460010A1 */  cvt.d.s   $f2, $f2
/* 77BCC 800DE71C 46341082 */  mul.d     $f2, $f2, $f20
/* 77BD0 800DE720 00000000 */  nop
/* 77BD4 800DE724 4480B000 */  mtc1      $zero, $f22
/* 77BD8 800DE728 3C018011 */  lui       $at, %hi(D_8010C990)
/* 77BDC 800DE72C E420C990 */  swc1      $f0, %lo(D_8010C990)($at)
/* 77BE0 800DE730 4600B306 */  mov.s     $f12, $f22
/* 77BE4 800DE734 46202120 */  cvt.s.d   $f4, $f4
/* 77BE8 800DE738 462010A0 */  cvt.s.d   $f2, $f2
/* 77BEC 800DE73C 44062000 */  mfc1      $a2, $f4
/* 77BF0 800DE740 44071000 */  mfc1      $a3, $f2
/* 77BF4 800DE744 0C00A720 */  jal       atan2
/* 77BF8 800DE748 4600B386 */   mov.s    $f14, $f22
/* 77BFC 800DE74C C7A40048 */  lwc1      $f4, 0x48($sp)
/* 77C00 800DE750 46002121 */  cvt.d.s   $f4, $f4
/* 77C04 800DE754 46342102 */  mul.d     $f4, $f4, $f20
/* 77C08 800DE758 00000000 */  nop
/* 77C0C 800DE75C C7A2004C */  lwc1      $f2, 0x4C($sp)
/* 77C10 800DE760 460010A1 */  cvt.d.s   $f2, $f2
/* 77C14 800DE764 46341082 */  mul.d     $f2, $f2, $f20
/* 77C18 800DE768 00000000 */  nop
/* 77C1C 800DE76C 4600B306 */  mov.s     $f12, $f22
/* 77C20 800DE770 8E020000 */  lw        $v0, 0x0($s0)
/* 77C24 800DE774 46202120 */  cvt.s.d   $f4, $f4
/* 77C28 800DE778 462010A0 */  cvt.s.d   $f2, $f2
/* 77C2C 800DE77C 44062000 */  mfc1      $a2, $f4
/* 77C30 800DE780 44071000 */  mfc1      $a3, $f2
/* 77C34 800DE784 46006386 */  mov.s     $f14, $f12
/* 77C38 800DE788 E440011C */  swc1      $f0, 0x11C($v0)
/* 77C3C 800DE78C 0C00A720 */  jal       atan2
/* 77C40 800DE790 E44C0120 */   swc1     $f12, 0x120($v0)
/* 77C44 800DE794 8E020000 */  lw        $v0, 0x0($s0)
/* 77C48 800DE798 080379ED */  j         .L800DE7B4
/* 77C4C 800DE79C E4400124 */   swc1     $f0, 0x124($v0)
.L800DE7A0:
/* 77C50 800DE7A0 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 77C54 800DE7A4 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 77C58 800DE7A8 AC40011C */  sw        $zero, 0x11C($v0)
/* 77C5C 800DE7AC AC400120 */  sw        $zero, 0x120($v0)
/* 77C60 800DE7B0 AC400124 */  sw        $zero, 0x124($v0)
.L800DE7B4:
/* 77C64 800DE7B4 0220102D */  daddu     $v0, $s1, $zero
/* 77C68 800DE7B8 8FBF0070 */  lw        $ra, 0x70($sp)
/* 77C6C 800DE7BC 8FB5006C */  lw        $s5, 0x6C($sp)
/* 77C70 800DE7C0 8FB40068 */  lw        $s4, 0x68($sp)
/* 77C74 800DE7C4 8FB30064 */  lw        $s3, 0x64($sp)
/* 77C78 800DE7C8 8FB20060 */  lw        $s2, 0x60($sp)
/* 77C7C 800DE7CC 8FB1005C */  lw        $s1, 0x5C($sp)
/* 77C80 800DE7D0 8FB00058 */  lw        $s0, 0x58($sp)
/* 77C84 800DE7D4 D7B60080 */  ldc1      $f22, 0x80($sp)
/* 77C88 800DE7D8 D7B40078 */  ldc1      $f20, 0x78($sp)
/* 77C8C 800DE7DC 03E00008 */  jr        $ra
/* 77C90 800DE7E0 27BD0088 */   addiu    $sp, $sp, 0x88

### DECOMPILED C INSTRUCTIONS:

s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) {
    f32 hitX;
    f32 hitY;
    f32 hitZ;
    f32 hitDepth;
    f32 hitNx;
    f32 hitNy;
    f32 hitNz;
    s32 entityID, colliderID;
    Entity* entity;
    s32 ret = NO_COLLIDER;

    hitDepth = *length;
    entityID = test_ray_entities(*x, *y, *z, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
    if (entityID >= 0) {
        entity = get_entity_by_index(entityID);
        if (entity->alpha < 255) {
            entity->collisionTimer = 4;
            entity->flags |= ENTITY_FLAG_CONTINUOUS_COLLISION;
        } else {
            ret = entityID | COLLISION_WITH_ENTITY_BIT;
        }
    }

    colliderID = test_ray_colliders(0x10000, *x, *y, *z, 0, -1.0f, 0, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
    if (colliderID >= 0) {
        ret = colliderID;
    }

    if (ret >= 0) {
        *length = hitDepth;
        *x = hitX;
        *y = hitY;
        *z = hitZ;
        gGameStatusPtr->playerGroundTraceNormal.x = hitNx;
        gGameStatusPtr->playerGroundTraceNormal.y = hitNy;
        gGameStatusPtr->playerGroundTraceNormal.z = hitNz;
        D_8010C938 = get_player_normal_yaw();
        D_8010C990 = get_player_normal_pitch();
        gGameStatusPtr->playerGroundTraceAngles.x = atan2(0.0f, 0.0f, hitNz * 100.0, hitNy * 100.0);
        gGameStatusPtr->playerGroundTraceAngles.y = 0.0f;
        gGameStatusPtr->playerGroundTraceAngles.z = atan2(0.0f, 0.0f, hitNx * 100.0, hitNy * 100.0);
    } else {
        gGameStatusPtr->playerGroundTraceAngles.x = 0.0f;
        gGameStatusPtr->playerGroundTraceAngles.y = 0.0f;
        gGameStatusPtr->playerGroundTraceAngles.z = 0.0f;
    }
    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel dust_main
/* 33E8C0 E002A000 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 33E8C4 E002A004 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 33E8C8 E002A008 4485A000 */  mtc1      $a1, $f20
/* 33E8CC E002A00C AFB40038 */  sw        $s4, 0x38($sp)
/* 33E8D0 E002A010 0080A02D */  daddu     $s4, $a0, $zero
/* 33E8D4 E002A014 AFB20030 */  sw        $s2, 0x30($sp)
/* 33E8D8 E002A018 24120004 */  addiu     $s2, $zero, 0x4
/* 33E8DC E002A01C F7B60048 */  sdc1      $f22, 0x48($sp)
/* 33E8E0 E002A020 4486B000 */  mtc1      $a2, $f22
/* 33E8E4 E002A024 27A40010 */  addiu     $a0, $sp, 0x10
/* 33E8E8 E002A028 F7B80050 */  sdc1      $f24, 0x50($sp)
/* 33E8EC E002A02C 4487C000 */  mtc1      $a3, $f24
/* 33E8F0 E002A030 2A820002 */  slti      $v0, $s4, 0x2
/* 33E8F4 E002A034 AFBF003C */  sw        $ra, 0x3C($sp)
/* 33E8F8 E002A038 AFB30034 */  sw        $s3, 0x34($sp)
/* 33E8FC E002A03C AFB1002C */  sw        $s1, 0x2C($sp)
/* 33E900 E002A040 10400002 */  beqz      $v0, .LE002A04C
/* 33E904 E002A044 AFB00028 */   sw       $s0, 0x28($sp)
/* 33E908 E002A048 24120005 */  addiu     $s2, $zero, 0x5
.LE002A04C:
/* 33E90C E002A04C 3C02E003 */  lui       $v0, %hi(dust_init)
/* 33E910 E002A050 2442A284 */  addiu     $v0, $v0, %lo(dust_init)
/* 33E914 E002A054 AFA20018 */  sw        $v0, 0x18($sp)
/* 33E918 E002A058 3C02E003 */  lui       $v0, %hi(dust_update)
/* 33E91C E002A05C 2442A28C */  addiu     $v0, $v0, %lo(dust_update)
/* 33E920 E002A060 AFA2001C */  sw        $v0, 0x1C($sp)
/* 33E924 E002A064 3C02E003 */  lui       $v0, %hi(dust_render)
/* 33E928 E002A068 2442A380 */  addiu     $v0, $v0, %lo(dust_render)
/* 33E92C E002A06C AFA20020 */  sw        $v0, 0x20($sp)
/* 33E930 E002A070 24020015 */  addiu     $v0, $zero, 0x15
/* 33E934 E002A074 AFA00010 */  sw        $zero, 0x10($sp)
/* 33E938 E002A078 AFA00024 */  sw        $zero, 0x24($sp)
/* 33E93C E002A07C 0C080124 */  jal       shim_create_effect_instance
/* 33E940 E002A080 AFA20014 */   sw       $v0, 0x14($sp)
/* 33E944 E002A084 001220C0 */  sll       $a0, $s2, 3
/* 33E948 E002A088 00922021 */  addu      $a0, $a0, $s2
/* 33E94C E002A08C 000420C0 */  sll       $a0, $a0, 3
/* 33E950 E002A090 0040982D */  daddu     $s3, $v0, $zero
/* 33E954 E002A094 0C08012C */  jal       shim_general_heap_malloc
/* 33E958 E002A098 AE720008 */   sw       $s2, 0x8($s3)
/* 33E95C E002A09C 0040202D */  daddu     $a0, $v0, $zero
/* 33E960 E002A0A0 14800003 */  bnez      $a0, .LE002A0B0
/* 33E964 E002A0A4 AE64000C */   sw       $a0, 0xC($s3)
.LE002A0A8:
/* 33E968 E002A0A8 0800A82A */  j         .LE002A0A8
/* 33E96C E002A0AC 00000000 */   nop
.LE002A0B0:
/* 33E970 E002A0B0 2403008C */  addiu     $v1, $zero, 0x8C
/* 33E974 E002A0B4 AC940000 */  sw        $s4, 0x0($a0)
/* 33E978 E002A0B8 E4940004 */  swc1      $f20, 0x4($a0)
/* 33E97C E002A0BC E4960008 */  swc1      $f22, 0x8($a0)
/* 33E980 E002A0C0 E498000C */  swc1      $f24, 0xC($a0)
/* 33E984 E002A0C4 8FA20068 */  lw        $v0, 0x68($sp)
/* 33E988 E002A0C8 24110001 */  addiu     $s1, $zero, 0x1
/* 33E98C E002A0CC AC830038 */  sw        $v1, 0x38($a0)
/* 33E990 E002A0D0 AC830044 */  sw        $v1, 0x44($a0)
/* 33E994 E002A0D4 AC82002C */  sw        $v0, 0x2C($a0)
/* 33E998 E002A0D8 240200FF */  addiu     $v0, $zero, 0xFF
/* 33E99C E002A0DC AC820018 */  sw        $v0, 0x18($a0)
/* 33E9A0 E002A0E0 240200A0 */  addiu     $v0, $zero, 0xA0
/* 33E9A4 E002A0E4 AC820030 */  sw        $v0, 0x30($a0)
/* 33E9A8 E002A0E8 AC820034 */  sw        $v0, 0x34($a0)
/* 33E9AC E002A0EC AC82003C */  sw        $v0, 0x3C($a0)
/* 33E9B0 E002A0F0 AC820040 */  sw        $v0, 0x40($a0)
/* 33E9B4 E002A0F4 0232102A */  slt       $v0, $s1, $s2
/* 33E9B8 E002A0F8 10400056 */  beqz      $v0, .LE002A254
/* 33E9BC E002A0FC 24840048 */   addiu    $a0, $a0, 0x48
/* 33E9C0 E002A100 24900008 */  addiu     $s0, $a0, 0x8
/* 33E9C4 E002A104 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 33E9C8 E002A108 4481C000 */  mtc1      $at, $f24
/* 33E9CC E002A10C 3C01E003 */  lui       $at, (0xE0030000 >> 16)
/* 33E9D0 E002A110 D434A720 */  ldc1      $f20, -0x58E0($at)
/* 33E9D4 E002A114 3C013ECC */  lui       $at, (0x3ECCCCCD >> 16)
/* 33E9D8 E002A118 3421CCCD */  ori       $at, $at, (0x3ECCCCCD & 0xFFFF)
/* 33E9DC E002A11C 4481B000 */  mtc1      $at, $f22
.LE002A120:
/* 33E9E0 E002A120 0C080138 */  jal       shim_rand_int
/* 33E9E4 E002A124 240400C8 */   addiu    $a0, $zero, 0xC8
/* 33E9E8 E002A128 24040032 */  addiu     $a0, $zero, 0x32
/* 33E9EC E002A12C 2442FF9C */  addiu     $v0, $v0, -0x64
/* 33E9F0 E002A130 44820000 */  mtc1      $v0, $f0
/* 33E9F4 E002A134 00000000 */  nop
/* 33E9F8 E002A138 46800020 */  cvt.s.w   $f0, $f0
/* 33E9FC E002A13C 0C080138 */  jal       shim_rand_int
/* 33EA00 E002A140 E600FFFC */   swc1     $f0, -0x4($s0)
/* 33EA04 E002A144 2404000A */  addiu     $a0, $zero, 0xA
/* 33EA08 E002A148 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 33EA0C E002A14C 44811000 */  mtc1      $at, $f2
/* 33EA10 E002A150 44820000 */  mtc1      $v0, $f0
/* 33EA14 E002A154 00000000 */  nop
/* 33EA18 E002A158 46800020 */  cvt.s.w   $f0, $f0
/* 33EA1C E002A15C E6000000 */  swc1      $f0, 0x0($s0)
/* 33EA20 E002A160 AE000004 */  sw        $zero, 0x4($s0)
/* 33EA24 E002A164 AE00000C */  sw        $zero, 0xC($s0)
/* 33EA28 E002A168 E6180014 */  swc1      $f24, 0x14($s0)
/* 33EA2C E002A16C E6180018 */  swc1      $f24, 0x18($s0)
/* 33EA30 E002A170 0C080138 */  jal       shim_rand_int
/* 33EA34 E002A174 E6020008 */   swc1     $f2, 0x8($s0)
/* 33EA38 E002A178 3C0351EB */  lui       $v1, (0x51EB851F >> 16)
/* 33EA3C E002A17C 3463851F */  ori       $v1, $v1, (0x51EB851F & 0xFFFF)
/* 33EA40 E002A180 00430018 */  mult      $v0, $v1
/* 33EA44 E002A184 000217C3 */  sra       $v0, $v0, 31
/* 33EA48 E002A188 00004010 */  mfhi      $t0
/* 33EA4C E002A18C 00081983 */  sra       $v1, $t0, 6
/* 33EA50 E002A190 00621823 */  subu      $v1, $v1, $v0
/* 33EA54 E002A194 44830000 */  mtc1      $v1, $f0
/* 33EA58 E002A198 00000000 */  nop
/* 33EA5C E002A19C 46800020 */  cvt.s.w   $f0, $f0
/* 33EA60 E002A1A0 12800006 */  beqz      $s4, .LE002A1BC
/* 33EA64 E002A1A4 E600001C */   swc1     $f0, 0x1C($s0)
/* 33EA68 E002A1A8 24020001 */  addiu     $v0, $zero, 0x1
/* 33EA6C E002A1AC 12820008 */  beq       $s4, $v0, .LE002A1D0
/* 33EA70 E002A1B0 24040028 */   addiu    $a0, $zero, 0x28
/* 33EA74 E002A1B4 0800A87C */  j         .LE002A1F0
/* 33EA78 E002A1B8 E616001C */   swc1     $f22, 0x1C($s0)
.LE002A1BC:
/* 33EA7C E002A1BC 46000021 */  cvt.d.s   $f0, $f0
/* 33EA80 E002A1C0 46340002 */  mul.d     $f0, $f0, $f20
/* 33EA84 E002A1C4 00000000 */  nop
/* 33EA88 E002A1C8 0800A87A */  j         .LE002A1E8
/* 33EA8C E002A1CC 46200020 */   cvt.s.d  $f0, $f0
.LE002A1D0:
/* 33EA90 E002A1D0 3C01E003 */  lui       $at, (0xE0030000 >> 16)
/* 33EA94 E002A1D4 D422A728 */  ldc1      $f2, -0x58D8($at)
/* 33EA98 E002A1D8 46000021 */  cvt.d.s   $f0, $f0
/* 33EA9C E002A1DC 46220002 */  mul.d     $f0, $f0, $f2
/* 33EAA0 E002A1E0 00000000 */  nop
/* 33EAA4 E002A1E4 46200020 */  cvt.s.d   $f0, $f0
.LE002A1E8:
/* 33EAA8 E002A1E8 0800A891 */  j         .LE002A244
/* 33EAAC E002A1EC E6000020 */   swc1     $f0, 0x20($s0)
.LE002A1F0:
/* 33EAB0 E002A1F0 E6160020 */  swc1      $f22, 0x20($s0)
/* 33EAB4 E002A1F4 0C080138 */  jal       shim_rand_int
/* 33EAB8 E002A1F8 AE000008 */   sw       $zero, 0x8($s0)
/* 33EABC E002A1FC 2442FFEC */  addiu     $v0, $v0, -0x14
/* 33EAC0 E002A200 44820000 */  mtc1      $v0, $f0
/* 33EAC4 E002A204 00000000 */  nop
/* 33EAC8 E002A208 46800021 */  cvt.d.w   $f0, $f0
/* 33EACC E002A20C 46340002 */  mul.d     $f0, $f0, $f20
/* 33EAD0 E002A210 00000000 */  nop
/* 33EAD4 E002A214 24040028 */  addiu     $a0, $zero, 0x28
/* 33EAD8 E002A218 46200020 */  cvt.s.d   $f0, $f0
/* 33EADC E002A21C 0C080138 */  jal       shim_rand_int
/* 33EAE0 E002A220 E600FFFC */   swc1     $f0, -0x4($s0)
/* 33EAE4 E002A224 2442FFEC */  addiu     $v0, $v0, -0x14
/* 33EAE8 E002A228 44820000 */  mtc1      $v0, $f0
/* 33EAEC E002A22C 00000000 */  nop
/* 33EAF0 E002A230 46800021 */  cvt.d.w   $f0, $f0
/* 33EAF4 E002A234 46340002 */  mul.d     $f0, $f0, $f20
/* 33EAF8 E002A238 00000000 */  nop
/* 33EAFC E002A23C 46200020 */  cvt.s.d   $f0, $f0
/* 33EB00 E002A240 E6000000 */  swc1      $f0, 0x0($s0)
.LE002A244:
/* 33EB04 E002A244 26310001 */  addiu     $s1, $s1, 0x1
/* 33EB08 E002A248 0232102A */  slt       $v0, $s1, $s2
/* 33EB0C E002A24C 1440FFB4 */  bnez      $v0, .LE002A120
/* 33EB10 E002A250 26100048 */   addiu    $s0, $s0, 0x48
.LE002A254:
/* 33EB14 E002A254 0260102D */  daddu     $v0, $s3, $zero
/* 33EB18 E002A258 8FBF003C */  lw        $ra, 0x3C($sp)
/* 33EB1C E002A25C 8FB40038 */  lw        $s4, 0x38($sp)
/* 33EB20 E002A260 8FB30034 */  lw        $s3, 0x34($sp)
/* 33EB24 E002A264 8FB20030 */  lw        $s2, 0x30($sp)
/* 33EB28 E002A268 8FB1002C */  lw        $s1, 0x2C($sp)
/* 33EB2C E002A26C 8FB00028 */  lw        $s0, 0x28($sp)
/* 33EB30 E002A270 D7B80050 */  ldc1      $f24, 0x50($sp)
/* 33EB34 E002A274 D7B60048 */  ldc1      $f22, 0x48($sp)
/* 33EB38 E002A278 D7B40040 */  ldc1      $f20, 0x40($sp)
/* 33EB3C E002A27C 03E00008 */  jr        $ra
/* 33EB40 E002A280 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    DustFXData* part;
    s32 numParts;
    s32 i;

    if (arg0 < 2) {
        numParts = 5;
    } else {
        numParts = 4;
    }

    bp.init = dust_init;
    bp.update = dust_update;
    bp.renderWorld = dust_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_DUST;

    effect = shim_create_effect_instance(bpPtr);
    effect->numParts = numParts;
    part = effect->data.dust = shim_general_heap_malloc(numParts * sizeof(*part));
    ASSERT(effect->data.dust != NULL);

    part->unk_00 = arg0;
    part->unk_04 = arg1;
    part->unk_08 = arg2;
    part->unk_0C = arg3;
    part->unk_2C = arg4;
    part->unk_18 = 255;
    part->unk_30 = 160;
    part->unk_34 = 160;
    part->unk_38 = 140;
    part->unk_3C = 160;
    part->unk_40 = 160;
    part->unk_44 = 140;

    part++;
    for (i = 1; i < numParts; i++, part++) {
        part->unk_04 = shim_rand_int(200) - 100;
        part->unk_08 = shim_rand_int(50);
        part->unk_0C = 0;
        part->unk_14 = 0;
        part->unk_1C = 1.0f;
        part->unk_20 = 1.0f;
        part->unk_10 = -1.0f;
        part->unk_24 = shim_rand_int(10) / 200;
        switch (arg0) {
            case 0:
                part->unk_28 = part->unk_24 * 0.1;
                break;
            case 1:
                part->unk_28 = part->unk_24 * 0.2;
                break;
            default:
                part->unk_24 = 0.4f;
                part->unk_28 = 0.4f;
                part->unk_10 = 0;
                part->unk_04 = (shim_rand_int(40) - 20) * 0.1;
                part->unk_08 = (shim_rand_int(40) - 20) * 0.1;
                break;
        }
    }

    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8025A2C4
/* 188BA4 8025A2C4 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 188BA8 8025A2C8 AFB20018 */  sw        $s2, 0x18($sp)
/* 188BAC 8025A2CC 0080902D */  daddu     $s2, $a0, $zero
/* 188BB0 8025A2D0 AFB10014 */  sw        $s1, 0x14($sp)
/* 188BB4 8025A2D4 00A0882D */  daddu     $s1, $a1, $zero
/* 188BB8 8025A2D8 AFB3001C */  sw        $s3, 0x1C($sp)
/* 188BBC 8025A2DC 00C0982D */  daddu     $s3, $a2, $zero
/* 188BC0 8025A2E0 AFBF0028 */  sw        $ra, 0x28($sp)
/* 188BC4 8025A2E4 AFB50024 */  sw        $s5, 0x24($sp)
/* 188BC8 8025A2E8 AFB40020 */  sw        $s4, 0x20($sp)
/* 188BCC 8025A2EC AFB00010 */  sw        $s0, 0x10($sp)
/* 188BD0 8025A2F0 8E3000C0 */  lw        $s0, 0xC0($s1)
/* 188BD4 8025A2F4 820206C1 */  lb        $v0, 0x6C1($s0)
/* 188BD8 8025A2F8 8FB50040 */  lw        $s5, 0x40($sp)
/* 188BDC 8025A2FC 10400033 */  beqz      $v0, .L8025A3CC
/* 188BE0 8025A300 00E0A02D */   daddu    $s4, $a3, $zero
/* 188BE4 8025A304 16400018 */  bnez      $s2, .L8025A368
/* 188BE8 8025A308 00000000 */   nop
/* 188BEC 8025A30C 0C0B7830 */  jal       spr_get_player_palettes
/* 188BF0 8025A310 96240088 */   lhu      $a0, 0x88($s1)
/* 188BF4 8025A314 AE0206D0 */  sw        $v0, 0x6D0($s0)
/* 188BF8 8025A318 0040202D */  daddu     $a0, $v0, $zero
/* 188BFC 8025A31C 24020002 */  addiu     $v0, $zero, 0x2
/* 188C00 8025A320 A20206CD */  sb        $v0, 0x6CD($s0)
/* 188C04 8025A324 8C830008 */  lw        $v1, 0x8($a0)
/* 188C08 8025A328 2402FFFF */  addiu     $v0, $zero, -0x1
/* 188C0C 8025A32C 50620024 */  beql      $v1, $v0, .L8025A3C0
/* 188C10 8025A330 A20006C2 */   sb       $zero, 0x6C2($s0)
/* 188C14 8025A334 0080182D */  daddu     $v1, $a0, $zero
/* 188C18 8025A338 0040202D */  daddu     $a0, $v0, $zero
.L8025A33C:
/* 188C1C 8025A33C 920206CD */  lbu       $v0, 0x6CD($s0)
/* 188C20 8025A340 24420001 */  addiu     $v0, $v0, 0x1
/* 188C24 8025A344 A20206CD */  sb        $v0, 0x6CD($s0)
/* 188C28 8025A348 00021600 */  sll       $v0, $v0, 24
/* 188C2C 8025A34C 00021583 */  sra       $v0, $v0, 22
/* 188C30 8025A350 00431021 */  addu      $v0, $v0, $v1
/* 188C34 8025A354 8C420000 */  lw        $v0, 0x0($v0)
/* 188C38 8025A358 1444FFF8 */  bne       $v0, $a0, .L8025A33C
/* 188C3C 8025A35C 00000000 */   nop
/* 188C40 8025A360 080968F0 */  j         .L8025A3C0
/* 188C44 8025A364 A20006C2 */   sb       $zero, 0x6C2($s0)
.L8025A368:
/* 188C48 8025A368 96240088 */  lhu       $a0, 0x88($s1)
/* 188C4C 8025A36C 0C0B7A90 */  jal       spr_get_npc_palettes
/* 188C50 8025A370 00000000 */   nop
/* 188C54 8025A374 AE0206D0 */  sw        $v0, 0x6D0($s0)
/* 188C58 8025A378 0040202D */  daddu     $a0, $v0, $zero
/* 188C5C 8025A37C A20006CD */  sb        $zero, 0x6CD($s0)
/* 188C60 8025A380 8C830000 */  lw        $v1, 0x0($a0)
/* 188C64 8025A384 2402FFFF */  addiu     $v0, $zero, -0x1
/* 188C68 8025A388 5062000D */  beql      $v1, $v0, .L8025A3C0
/* 188C6C 8025A38C A20006C2 */   sb       $zero, 0x6C2($s0)
/* 188C70 8025A390 0080182D */  daddu     $v1, $a0, $zero
/* 188C74 8025A394 0040202D */  daddu     $a0, $v0, $zero
.L8025A398:
/* 188C78 8025A398 920206CD */  lbu       $v0, 0x6CD($s0)
/* 188C7C 8025A39C 24420001 */  addiu     $v0, $v0, 0x1
/* 188C80 8025A3A0 A20206CD */  sb        $v0, 0x6CD($s0)
/* 188C84 8025A3A4 00021600 */  sll       $v0, $v0, 24
/* 188C88 8025A3A8 00021583 */  sra       $v0, $v0, 22
/* 188C8C 8025A3AC 00431021 */  addu      $v0, $v0, $v1
/* 188C90 8025A3B0 8C420000 */  lw        $v0, 0x0($v0)
/* 188C94 8025A3B4 1444FFF8 */  bne       $v0, $a0, .L8025A398
/* 188C98 8025A3B8 00000000 */   nop
/* 188C9C 8025A3BC A20006C2 */  sb        $zero, 0x6C2($s0)
.L8025A3C0:
/* 188CA0 8025A3C0 A60006CA */  sh        $zero, 0x6CA($s0)
/* 188CA4 8025A3C4 A60006C8 */  sh        $zero, 0x6C8($s0)
/* 188CA8 8025A3C8 A20006C1 */  sb        $zero, 0x6C1($s0)
.L8025A3CC:
/* 188CAC 8025A3CC 820206CD */  lb        $v0, 0x6CD($s0)
/* 188CB0 8025A3D0 18400024 */  blez      $v0, .L8025A464
/* 188CB4 8025A3D4 0000482D */   daddu    $t1, $zero, $zero
/* 188CB8 8025A3D8 0200502D */  daddu     $t2, $s0, $zero
.L8025A3DC:
/* 188CBC 8025A3DC 8E0206D0 */  lw        $v0, 0x6D0($s0)
/* 188CC0 8025A3E0 00091880 */  sll       $v1, $t1, 2
/* 188CC4 8025A3E4 00621821 */  addu      $v1, $v1, $v0
/* 188CC8 8025A3E8 00091140 */  sll       $v0, $t1, 5
/* 188CCC 8025A3EC 8C660000 */  lw        $a2, 0x0($v1)
/* 188CD0 8025A3F0 02023821 */  addu      $a3, $s0, $v0
/* 188CD4 8025A3F4 10C00016 */  beqz      $a2, .L8025A450
/* 188CD8 8025A3F8 AD4706D4 */   sw       $a3, 0x6D4($t2)
/* 188CDC 8025A3FC 0000402D */  daddu     $t0, $zero, $zero
.L8025A400:
/* 188CE0 8025A400 94C20000 */  lhu       $v0, 0x0($a2)
/* 188CE4 8025A404 90C50001 */  lbu       $a1, 0x1($a2)
/* 188CE8 8025A408 24C60002 */  addiu     $a2, $a2, 0x2
/* 188CEC 8025A40C 25080001 */  addiu     $t0, $t0, 0x1
/* 188CF0 8025A410 000219C2 */  srl       $v1, $v0, 7
/* 188CF4 8025A414 3063000F */  andi      $v1, $v1, 0xF
/* 188CF8 8025A418 00022082 */  srl       $a0, $v0, 2
/* 188CFC 8025A41C 3084000F */  andi      $a0, $a0, 0xF
/* 188D00 8025A420 00021302 */  srl       $v0, $v0, 12
/* 188D04 8025A424 30A50001 */  andi      $a1, $a1, 0x1
/* 188D08 8025A428 000212C0 */  sll       $v0, $v0, 11
/* 188D0C 8025A42C 00031980 */  sll       $v1, $v1, 6
/* 188D10 8025A430 00431025 */  or        $v0, $v0, $v1
/* 188D14 8025A434 00042040 */  sll       $a0, $a0, 1
/* 188D18 8025A438 00441025 */  or        $v0, $v0, $a0
/* 188D1C 8025A43C 00A22825 */  or        $a1, $a1, $v0
/* 188D20 8025A440 A4E50000 */  sh        $a1, 0x0($a3)
/* 188D24 8025A444 29020010 */  slti      $v0, $t0, 0x10
/* 188D28 8025A448 1440FFED */  bnez      $v0, .L8025A400
/* 188D2C 8025A44C 24E70002 */   addiu    $a3, $a3, 0x2
.L8025A450:
/* 188D30 8025A450 820206CD */  lb        $v0, 0x6CD($s0)
/* 188D34 8025A454 25290001 */  addiu     $t1, $t1, 0x1
/* 188D38 8025A458 0122102A */  slt       $v0, $t1, $v0
/* 188D3C 8025A45C 1440FFDF */  bnez      $v0, .L8025A3DC
/* 188D40 8025A460 254A0004 */   addiu    $t2, $t2, 0x4
.L8025A464:
/* 188D44 8025A464 860206C8 */  lh        $v0, 0x6C8($s0)
/* 188D48 8025A468 1C400010 */  bgtz      $v0, .L8025A4AC
/* 188D4C 8025A46C 240300FF */   addiu    $v1, $zero, 0xFF
/* 188D50 8025A470 04420001 */  bltzl     $v0, .L8025A478
/* 188D54 8025A474 00021023 */   negu     $v0, $v0
.L8025A478:
/* 188D58 8025A478 00021040 */  sll       $v0, $v0, 1
/* 188D5C 8025A47C 3C018028 */  lui       $at, %hi(D_802840B4)
/* 188D60 8025A480 00220821 */  addu      $at, $at, $v0
/* 188D64 8025A484 942240B4 */  lhu       $v0, %lo(D_802840B4)($at)
/* 188D68 8025A488 A6220068 */  sh        $v0, 0x68($s1)
/* 188D6C 8025A48C 00021400 */  sll       $v0, $v0, 16
/* 188D70 8025A490 00021403 */  sra       $v0, $v0, 16
/* 188D74 8025A494 14430005 */  bne       $v0, $v1, .L8025A4AC
/* 188D78 8025A498 2404003C */   addiu    $a0, $zero, 0x3C
D_8025A49C:
/* 188D7C 8025A49C 0C00A67F */  jal       rand_int
/* 188D80 8025A4A0 A6200068 */   sh       $zero, 0x68($s1)
/* 188D84 8025A4A4 2442001E */  addiu     $v0, $v0, 0x1E
/* 188D88 8025A4A8 A60206C8 */  sh        $v0, 0x6C8($s0)
.L8025A4AC:
/* 188D8C 8025A4AC 16A00004 */  bnez      $s5, .L8025A4C0
/* 188D90 8025A4B0 00000000 */   nop
/* 188D94 8025A4B4 960206C8 */  lhu       $v0, 0x6C8($s0)
/* 188D98 8025A4B8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 188D9C 8025A4BC A60206C8 */  sh        $v0, 0x6C8($s0)
.L8025A4C0:
/* 188DA0 8025A4C0 16400006 */  bnez      $s2, .L8025A4DC
/* 188DA4 8025A4C4 0220202D */   daddu    $a0, $s1, $zero
/* 188DA8 8025A4C8 0260282D */  daddu     $a1, $s3, $zero
/* 188DAC 8025A4CC 0C096657 */  jal       func_8025995C
/* 188DB0 8025A4D0 0280302D */   daddu    $a2, $s4, $zero
/* 188DB4 8025A4D4 0809693A */  j         .L8025A4E8
/* 188DB8 8025A4D8 00000000 */   nop
.L8025A4DC:
/* 188DBC 8025A4DC 0260282D */  daddu     $a1, $s3, $zero
/* 188DC0 8025A4E0 0C0965B0 */  jal       func_802596C0
/* 188DC4 8025A4E4 0280302D */   daddu    $a2, $s4, $zero
.L8025A4E8:
/* 188DC8 8025A4E8 8FBF0028 */  lw        $ra, 0x28($sp)
/* 188DCC 8025A4EC 8FB50024 */  lw        $s5, 0x24($sp)
/* 188DD0 8025A4F0 8FB40020 */  lw        $s4, 0x20($sp)
/* 188DD4 8025A4F4 8FB3001C */  lw        $s3, 0x1C($sp)
/* 188DD8 8025A4F8 8FB20018 */  lw        $s2, 0x18($sp)
/* 188DDC 8025A4FC 8FB10014 */  lw        $s1, 0x14($sp)
/* 188DE0 8025A500 8FB00010 */  lw        $s0, 0x10($sp)
/* 188DE4 8025A504 03E00008 */  jr        $ra
/* 188DE8 8025A508 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void render_with_fear_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
    DecorationTable* decorationTable = part->decorationTable;
    PAL_PTR palIn;
    PAL_PTR palOut;
    s32 i, j;
    s32 temp;

    if (decorationTable->resetPalAdjust) {
        if (isNpcSprite == SPRITE_MODE_PLAYER) {
            decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16);
            decorationTable->originalPalettesCount = 2;
            while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
                decorationTable->originalPalettesCount++;
            }
        } else {
            decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16);
            decorationTable->originalPalettesCount = 0;
            while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
                decorationTable->originalPalettesCount++;
            }
        }

        decorationTable->palAnimState = 0;
        decorationTable->palBlendAlpha = 0;
        decorationTable->nextPalTime = 0;
        decorationTable->resetPalAdjust = FALSE;
    }

    for (i = 0; i < decorationTable->originalPalettesCount; i++) {
        palIn = decorationTable->originalPalettesList[i];
        palOut = decorationTable->copiedPalettes[0][i];
        decorationTable->adjustedPalettes[i] = palOut;
        if (palIn != NULL) {
            for (j = 0; j < SPR_PAL_SIZE; j++) {
                u8 r = UNPACK_PAL_R(*palIn);
                u8 g = UNPACK_PAL_G(*palIn);
                u8 b = UNPACK_PAL_B(*palIn);
                u8 a = UNPACK_PAL_A(*palIn);
                palIn++;

                // darken the color
                r /= 2;
                g /= 2;
                b /= 2;

                *palOut++ = PACK_PAL_RGBA(r, g, b, a);
            }
        }
    }

    if (decorationTable->nextPalTime <= 0) {
        part->palAnimPosOffset[0] = FearPaletteAnimXOffsets[abs(decorationTable->nextPalTime)];
        if (part->palAnimPosOffset[0] == PAL_ANIM_END) {
            part->palAnimPosOffset[0] = 0;
            decorationTable->nextPalTime = rand_int(60) + 30;
        }
    }

    if (!skipAnimation) {
        decorationTable->nextPalTime--;
    }

    if (isNpcSprite == SPRITE_MODE_PLAYER) {
        func_8025995C(part, yaw, mtx);
    } else {
        func_802596C0(part, yaw, mtx);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel player_test_move_without_slipping
/* 7860C 800DF15C 27BDFF60 */  addiu     $sp, $sp, -0xA0
/* 78610 800DF160 AFB1006C */  sw        $s1, 0x6C($sp)
/* 78614 800DF164 00A0882D */  daddu     $s1, $a1, $zero
/* 78618 800DF168 AFB00068 */  sw        $s0, 0x68($sp)
/* 7861C 800DF16C 00C0802D */  daddu     $s0, $a2, $zero
/* 78620 800DF170 AFBF0078 */  sw        $ra, 0x78($sp)
/* 78624 800DF174 AFB30074 */  sw        $s3, 0x74($sp)
/* 78628 800DF178 AFB20070 */  sw        $s2, 0x70($sp)
/* 7862C 800DF17C F7BA0098 */  sdc1      $f26, 0x98($sp)
/* 78630 800DF180 F7B80090 */  sdc1      $f24, 0x90($sp)
/* 78634 800DF184 F7B60088 */  sdc1      $f22, 0x88($sp)
/* 78638 800DF188 F7B40080 */  sdc1      $f20, 0x80($sp)
/* 7863C 800DF18C 848200B2 */  lh        $v0, 0xB2($a0)
/* 78640 800DF190 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 78644 800DF194 44811000 */  mtc1      $at, $f2
/* 78648 800DF198 44820000 */  mtc1      $v0, $f0
/* 7864C 800DF19C 00000000 */  nop
/* 78650 800DF1A0 46800020 */  cvt.s.w   $f0, $f0
/* 78654 800DF1A4 46020582 */  mul.s     $f22, $f0, $f2
/* 78658 800DF1A8 00000000 */  nop
/* 7865C 800DF1AC 00E0902D */  daddu     $s2, $a3, $zero
/* 78660 800DF1B0 C7A200B4 */  lwc1      $f2, 0xB4($sp)
/* 78664 800DF1B4 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 78668 800DF1B8 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 7866C 800DF1BC 44810000 */  mtc1      $at, $f0
/* 78670 800DF1C0 27A50038 */  addiu     $a1, $sp, 0x38
/* 78674 800DF1C4 46001082 */  mul.s     $f2, $f2, $f0
/* 78678 800DF1C8 00000000 */  nop
/* 7867C 800DF1CC 27A6003C */  addiu     $a2, $sp, 0x3C
/* 78680 800DF1D0 848200B0 */  lh        $v0, 0xB0($a0)
/* 78684 800DF1D4 3C013E92 */  lui       $at, (0x3E926E98 >> 16)
/* 78688 800DF1D8 34216E98 */  ori       $at, $at, (0x3E926E98 & 0xFFFF)
/* 7868C 800DF1DC 44810000 */  mtc1      $at, $f0
/* 78690 800DF1E0 44822000 */  mtc1      $v0, $f4
/* 78694 800DF1E4 00000000 */  nop
/* 78698 800DF1E8 46802120 */  cvt.s.w   $f4, $f4
/* 7869C 800DF1EC 46002682 */  mul.s     $f26, $f4, $f0
/* 786A0 800DF1F0 00000000 */  nop
/* 786A4 800DF1F4 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 786A8 800DF1F8 44816000 */  mtc1      $at, $f12
/* 786AC 800DF1FC C7B800B0 */  lwc1      $f24, 0xB0($sp)
/* 786B0 800DF200 0C00A82D */  jal       sin_cos_rad
/* 786B4 800DF204 460C1303 */   div.s    $f12, $f2, $f12
/* 786B8 800DF208 4616C500 */  add.s     $f20, $f24, $f22
/* 786BC 800DF20C C7A0003C */  lwc1      $f0, 0x3C($sp)
/* 786C0 800DF210 C7A40038 */  lwc1      $f4, 0x38($sp)
/* 786C4 800DF214 46000007 */  neg.s     $f0, $f0
/* 786C8 800DF218 E7A0003C */  swc1      $f0, 0x3C($sp)
/* 786CC 800DF21C E7B4004C */  swc1      $f20, 0x4C($sp)
/* 786D0 800DF220 C6020000 */  lwc1      $f2, 0x0($s0)
/* 786D4 800DF224 2413FFFF */  addiu     $s3, $zero, -0x1
/* 786D8 800DF228 E7A00018 */  swc1      $f0, 0x18($sp)
/* 786DC 800DF22C 3C018011 */  lui       $at, %hi(D_8010BC50)
/* 786E0 800DF230 D420BC50 */  ldc1      $f0, %lo(D_8010BC50)($at)
/* 786E4 800DF234 27A20040 */  addiu     $v0, $sp, 0x40
/* 786E8 800DF238 AFA2001C */  sw        $v0, 0x1C($sp)
/* 786EC 800DF23C 27A20044 */  addiu     $v0, $sp, 0x44
/* 786F0 800DF240 AFA20020 */  sw        $v0, 0x20($sp)
/* 786F4 800DF244 27A20048 */  addiu     $v0, $sp, 0x48
/* 786F8 800DF248 AFA20024 */  sw        $v0, 0x24($sp)
/* 786FC 800DF24C 27A2004C */  addiu     $v0, $sp, 0x4C
/* 78700 800DF250 AFA20028 */  sw        $v0, 0x28($sp)
/* 78704 800DF254 27A20050 */  addiu     $v0, $sp, 0x50
/* 78708 800DF258 AFA2002C */  sw        $v0, 0x2C($sp)
/* 7870C 800DF25C 27A20054 */  addiu     $v0, $sp, 0x54
/* 78710 800DF260 AFA20030 */  sw        $v0, 0x30($sp)
/* 78714 800DF264 27A20058 */  addiu     $v0, $sp, 0x58
/* 78718 800DF268 E7A40010 */  swc1      $f4, 0x10($sp)
/* 7871C 800DF26C AFA00014 */  sw        $zero, 0x14($sp)
/* 78720 800DF270 AFA20034 */  sw        $v0, 0x34($sp)
/* 78724 800DF274 460010A1 */  cvt.d.s   $f2, $f2
/* 78728 800DF278 46201080 */  add.d     $f2, $f2, $f0
/* 7872C 800DF27C 8E250000 */  lw        $a1, 0x0($s1)
/* 78730 800DF280 8E470000 */  lw        $a3, 0x0($s2)
/* 78734 800DF284 462010A0 */  cvt.s.d   $f2, $f2
/* 78738 800DF288 44061000 */  mfc1      $a2, $f2
/* 7873C 800DF28C 0C037B97 */  jal       player_raycast_general
/* 78740 800DF290 0000202D */   daddu    $a0, $zero, $zero
/* 78744 800DF294 04420009 */  bltzl     $v0, .L800DF2BC
/* 78748 800DF298 4616C500 */   add.s    $f20, $f24, $f22
/* 7874C 800DF29C C7A0004C */  lwc1      $f0, 0x4C($sp)
/* 78750 800DF2A0 4614003E */  c.le.s    $f0, $f20
/* 78754 800DF2A4 00000000 */  nop
/* 78758 800DF2A8 45000003 */  bc1f      .L800DF2B8
/* 7875C 800DF2AC 24030001 */   addiu    $v1, $zero, 0x1
/* 78760 800DF2B0 8FA200B8 */  lw        $v0, 0xB8($sp)
/* 78764 800DF2B4 AC430000 */  sw        $v1, 0x0($v0)
.L800DF2B8:
/* 78768 800DF2B8 4616C500 */  add.s     $f20, $f24, $f22
.L800DF2BC:
/* 7876C 800DF2BC C7A00038 */  lwc1      $f0, 0x38($sp)
/* 78770 800DF2C0 C7A2003C */  lwc1      $f2, 0x3C($sp)
/* 78774 800DF2C4 E7B4004C */  swc1      $f20, 0x4C($sp)
/* 78778 800DF2C8 C6040000 */  lwc1      $f4, 0x0($s0)
/* 7877C 800DF2CC 27A20040 */  addiu     $v0, $sp, 0x40
/* 78780 800DF2D0 AFA2001C */  sw        $v0, 0x1C($sp)
/* 78784 800DF2D4 27A20044 */  addiu     $v0, $sp, 0x44
/* 78788 800DF2D8 AFA20020 */  sw        $v0, 0x20($sp)
/* 7878C 800DF2DC 27A20048 */  addiu     $v0, $sp, 0x48
/* 78790 800DF2E0 AFA20024 */  sw        $v0, 0x24($sp)
/* 78794 800DF2E4 27A2004C */  addiu     $v0, $sp, 0x4C
/* 78798 800DF2E8 AFA20028 */  sw        $v0, 0x28($sp)
/* 7879C 800DF2EC 27A20050 */  addiu     $v0, $sp, 0x50
/* 787A0 800DF2F0 AFA2002C */  sw        $v0, 0x2C($sp)
/* 787A4 800DF2F4 27A20054 */  addiu     $v0, $sp, 0x54
/* 787A8 800DF2F8 AFA20030 */  sw        $v0, 0x30($sp)
/* 787AC 800DF2FC 27A20058 */  addiu     $v0, $sp, 0x58
/* 787B0 800DF300 E7A00010 */  swc1      $f0, 0x10($sp)
/* 787B4 800DF304 AFA00014 */  sw        $zero, 0x14($sp)
/* 787B8 800DF308 E7A20018 */  swc1      $f2, 0x18($sp)
/* 787BC 800DF30C AFA20034 */  sw        $v0, 0x34($sp)
/* 787C0 800DF310 461A2100 */  add.s     $f4, $f4, $f26
/* 787C4 800DF314 8E250000 */  lw        $a1, 0x0($s1)
/* 787C8 800DF318 8E470000 */  lw        $a3, 0x0($s2)
/* 787CC 800DF31C 44062000 */  mfc1      $a2, $f4
/* 787D0 800DF320 0C037B97 */  jal       player_raycast_general
/* 787D4 800DF324 0000202D */   daddu    $a0, $zero, $zero
/* 787D8 800DF328 4480C000 */  mtc1      $zero, $f24
/* 787DC 800DF32C 0040802D */  daddu     $s0, $v0, $zero
/* 787E0 800DF330 06000020 */  bltz      $s0, .L800DF3B4
/* 787E4 800DF334 4600C686 */   mov.s    $f26, $f24
/* 787E8 800DF338 C7B6004C */  lwc1      $f22, 0x4C($sp)
/* 787EC 800DF33C 4614B03E */  c.le.s    $f22, $f20
/* 787F0 800DF340 00000000 */  nop
/* 787F4 800DF344 4500001B */  bc1f      .L800DF3B4
/* 787F8 800DF348 27A4005C */   addiu    $a0, $sp, 0x5C
/* 787FC 800DF34C 4614B581 */  sub.s     $f22, $f22, $f20
/* 78800 800DF350 4406C000 */  mfc1      $a2, $f24
/* 78804 800DF354 C7B40038 */  lwc1      $f20, 0x38($sp)
/* 78808 800DF358 4407C000 */  mfc1      $a3, $f24
/* 7880C 800DF35C C7A2003C */  lwc1      $f2, 0x3C($sp)
/* 78810 800DF360 4614B502 */  mul.s     $f20, $f22, $f20
/* 78814 800DF364 00000000 */  nop
/* 78818 800DF368 C7A00050 */  lwc1      $f0, 0x50($sp)
/* 7881C 800DF36C 27A50060 */  addiu     $a1, $sp, 0x60
/* 78820 800DF370 E7A00010 */  swc1      $f0, 0x10($sp)
/* 78824 800DF374 C7A00058 */  lwc1      $f0, 0x58($sp)
/* 78828 800DF378 4602B582 */  mul.s     $f22, $f22, $f2
/* 7882C 800DF37C 00000000 */  nop
/* 78830 800DF380 0C037CFF */  jal       player_get_slip_vector
/* 78834 800DF384 E7A00014 */   swc1     $f0, 0x14($sp)
/* 78838 800DF388 C7A0005C */  lwc1      $f0, 0x5C($sp)
/* 7883C 800DF38C 4600A500 */  add.s     $f20, $f20, $f0
/* 78840 800DF390 C6200000 */  lwc1      $f0, 0x0($s1)
/* 78844 800DF394 46140000 */  add.s     $f0, $f0, $f20
/* 78848 800DF398 E6200000 */  swc1      $f0, 0x0($s1)
/* 7884C 800DF39C C7A00060 */  lwc1      $f0, 0x60($sp)
/* 78850 800DF3A0 4600B580 */  add.s     $f22, $f22, $f0
/* 78854 800DF3A4 C6400000 */  lwc1      $f0, 0x0($s2)
/* 78858 800DF3A8 46160000 */  add.s     $f0, $f0, $f22
/* 7885C 800DF3AC 0200982D */  daddu     $s3, $s0, $zero
/* 78860 800DF3B0 E6400000 */  swc1      $f0, 0x0($s2)
.L800DF3B4:
/* 78864 800DF3B4 C6200000 */  lwc1      $f0, 0x0($s1)
/* 78868 800DF3B8 461A0000 */  add.s     $f0, $f0, $f26
/* 7886C 800DF3BC E6200000 */  swc1      $f0, 0x0($s1)
/* 78870 800DF3C0 C6400000 */  lwc1      $f0, 0x0($s2)
/* 78874 800DF3C4 46180000 */  add.s     $f0, $f0, $f24
/* 78878 800DF3C8 0260102D */  daddu     $v0, $s3, $zero
/* 7887C 800DF3CC E6400000 */  swc1      $f0, 0x0($s2)
/* 78880 800DF3D0 8FBF0078 */  lw        $ra, 0x78($sp)
/* 78884 800DF3D4 8FB30074 */  lw        $s3, 0x74($sp)
/* 78888 800DF3D8 8FB20070 */  lw        $s2, 0x70($sp)
/* 7888C 800DF3DC 8FB1006C */  lw        $s1, 0x6C($sp)
/* 78890 800DF3E0 8FB00068 */  lw        $s0, 0x68($sp)
/* 78894 800DF3E4 D7BA0098 */  ldc1      $f26, 0x98($sp)
/* 78898 800DF3E8 D7B80090 */  ldc1      $f24, 0x90($sp)
/* 7889C 800DF3EC D7B60088 */  ldc1      $f22, 0x88($sp)
/* 788A0 800DF3F0 D7B40080 */  ldc1      $f20, 0x80($sp)
/* 788A4 800DF3F4 03E00008 */  jr        $ra
/* 788A8 800DF3F8 27BD00A0 */   addiu    $sp, $sp, 0xA0

### DECOMPILED C INSTRUCTIONS:

s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw, s32* hasClimbableStep) {
    f32 sinTheta;
    f32 cosTheta;
    f32 hitX;
    f32 hitY;
    f32 hitZ;
    f32 hitDepth;
    f32 hitNx;
    f32 hitNy;
    f32 hitNz;
    f32 slipDx;
    f32 slipDz;
    f32 depth;
    f32 radius;
    f32 depthDiff;
    f32 height;
    s32 ret;
    s32 raycastID;
    f32 targetDx;
    f32 targetDz;
    f32 dx, dz;

    radius = playerStatus->colliderDiameter * 0.5f;
    height = playerStatus->colliderHeight * 0.286f;
    sin_cos_rad(DEG_TO_RAD(yaw), &sinTheta, &cosTheta);

    depth = length + radius;
    cosTheta = -cosTheta;
    hitDepth = depth;
    dx = radius * sinTheta;
    ret = NO_COLLIDER;

    raycastID = player_raycast_general(0, *x, *y + 0.1, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
    if (raycastID >= 0 && hitDepth <= depth) {
        *hasClimbableStep = TRUE;
    }

    depth = length + radius;
    hitDepth = depth;
    dz = radius * cosTheta;

    raycastID = player_raycast_general(0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);

    targetDx = 0.0f;
    targetDz = 0.0f;

    if ((raycastID >= 0) && (hitDepth <= depth)) {
        depthDiff = hitDepth - depth;
        dx = depthDiff * sinTheta;
        dz = depthDiff * cosTheta;
        player_get_slip_vector(&slipDx, &slipDz, 0.0f, 0.0f, hitNx, hitNz);
        *x += dx + slipDx;
        *z += dz + slipDz;
        ret = raycastID;
    }
    *x += targetDx;
    *z += targetDz;
    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_802448E0
/* 165140 802448E0 27BDFFD0 */  addiu     $sp, $sp, -0x30
.L802448E4:
/* 165144 802448E4 AFB40020 */  sw        $s4, 0x20($sp)
/* 165148 802448E8 0080A02D */  daddu     $s4, $a0, $zero
/* 16514C 802448EC 3C040013 */  lui       $a0, %hi(D_131340)
/* 165150 802448F0 24841340 */  addiu     $a0, $a0, %lo(D_131340)
D_802448F4:
/* 165154 802448F4 3C050013 */  lui       $a1, %hi(D_135EE0)
/* 165158 802448F8 24A55EE0 */  addiu     $a1, $a1, %lo(D_135EE0)
D_802448FC:
/* 16515C 802448FC 3C068024 */  lui       $a2, %hi(get_dpad_input_radial)
D_80244900:
/* 165160 80244900 24C6E000 */  addiu     $a2, $a2, %lo(get_dpad_input_radial)
/* 165164 80244904 AFBF0028 */  sw        $ra, 0x28($sp)
/* 165168 80244908 AFB50024 */  sw        $s5, 0x24($sp)
D_8024490C:
/* 16516C 8024490C AFB3001C */  sw        $s3, 0x1C($sp)
jtbl_80244910:
/* 165170 80244910 AFB20018 */  sw        $s2, 0x18($sp)
/* 165174 80244914 AFB10014 */  sw        $s1, 0x14($sp)
.L80244918:
/* 165178 80244918 0C00A5CF */  jal       dma_copy
.L8024491C:
/* 16517C 8024491C AFB00010 */   sw       $s0, 0x10($sp)
D_80244920:
/* 165180 80244920 0000802D */  daddu     $s0, $zero, $zero
.L80244924:
/* 165184 80244924 3C128025 */  lui       $s2, %hi(D_8024C0A0)
/* 165188 80244928 2652C0A0 */  addiu     $s2, $s2, %lo(D_8024C0A0)
/* 16518C 8024492C 3C118025 */  lui       $s1, %hi(D_80249B80)
/* 165190 80244930 26319B80 */  addiu     $s1, $s1, %lo(D_80249B80)
glabel func_80244934
/* 165194 80244934 8E240000 */  lw        $a0, 0x0($s1)
/* 165198 80244938 26310004 */  addiu     $s1, $s1, 0x4
/* 16519C 8024493C 0C050529 */  jal       hud_element_create
.L80244940:
/* 1651A0 80244940 26100001 */   addiu    $s0, $s0, 0x1
/* 1651A4 80244944 0040202D */  daddu     $a0, $v0, $zero
.L80244948:
/* 1651A8 80244948 3C052000 */  lui       $a1, (0x20000080 >> 16)
/* 1651AC 8024494C 34A50080 */  ori       $a1, $a1, (0x20000080 & 0xFFFF)
/* 1651B0 80244950 0C051280 */  jal       hud_element_set_flags
.L80244954:
/* 1651B4 80244954 AE440000 */   sw       $a0, 0x0($s2)
/* 1651B8 80244958 1A00FFF6 */  blez      $s0, func_80244934
/* 1651BC 8024495C 26520004 */   addiu    $s2, $s2, 0x4
D_80244960:
/* 1651C0 80244960 3C028025 */  lui       $v0, %hi(D_8024C0A0)
.L80244964:
/* 1651C4 80244964 8C42C0A0 */  lw        $v0, %lo(D_8024C0A0)($v0)
D_80244968:
/* 1651C8 80244968 3C018025 */  lui       $at, %hi(D_8024C088)
/* 1651CC 8024496C AC22C088 */  sw        $v0, %lo(D_8024C088)($at)
/* 1651D0 80244970 16800004 */  bnez      $s4, func_80244984
.L80244974:
/* 1651D4 80244974 00000000 */   nop
/* 1651D8 80244978 3C028025 */  lui       $v0, %hi(D_80249DCC)
/* 1651DC 8024497C 8C429DCC */  lw        $v0, %lo(D_80249DCC)($v0)
/* 1651E0 80244980 AC400000 */  sw        $zero, 0x0($v0)
glabel func_80244984
/* 1651E4 80244984 3C048025 */  lui       $a0, %hi(D_80249DAC)
D_80244988:
/* 1651E8 80244988 24849DAC */  addiu     $a0, $a0, %lo(D_80249DAC)
.L8024498C:
/* 1651EC 8024498C 0C051FCC */  jal       setup_pause_menu_tab
.L80244990:
/* 1651F0 80244990 24050003 */   addiu    $a1, $zero, 0x3
/* 1651F4 80244994 3C138025 */  lui       $s3, %hi(D_80249B84)
D_80244998:
/* 1651F8 80244998 8E739B84 */  lw        $s3, %lo(D_80249B84)($s3)
/* 1651FC 8024499C 3C018025 */  lui       $at, %hi(D_8024C098_C09918)
.L802449A0:
/* 165200 802449A0 A020C098 */  sb        $zero, %lo(D_8024C098_C09918)($at)
.L802449A4:
/* 165204 802449A4 16800003 */  bnez      $s4, .L802449B4
/* 165208 802449A8 24020002 */   addiu    $v0, $zero, 0x2
.L802449AC:
/* 16520C 802449AC 0809126E */  j         .L802449B8
D_802449B0:
/* 165210 802449B0 A2600004 */   sb       $zero, 0x4($s3)
.L802449B4:
/* 165214 802449B4 A2620004 */  sb        $v0, 0x4($s3)
.L802449B8:
/* 165218 802449B8 82620004 */  lb        $v0, 0x4($s3)
/* 16521C 802449BC 14400031 */  bnez      $v0, .L80244A84
/* 165220 802449C0 0260202D */   daddu    $a0, $s3, $zero
D_802449C4:
/* 165224 802449C4 0000802D */  daddu     $s0, $zero, $zero
.L802449C8:
/* 165228 802449C8 3C15800E */  lui       $s5, %hi(gCurrentSaveFile)
D_802449CC:
/* 16522C 802449CC 26B5ACC0 */  addiu     $s5, $s5, %lo(gCurrentSaveFile)
D_802449D0:
/* 165230 802449D0 24140001 */  addiu     $s4, $zero, 0x1
/* 165234 802449D4 3C118007 */  lui       $s1, %hi(gSaveSlotHasData)
D_802449D8:
/* 165238 802449D8 26317A24 */  addiu     $s1, $s1, %lo(gSaveSlotHasData)
.L802449DC:
/* 16523C 802449DC 3C128007 */  lui       $s2, %hi(gSaveSlotMetadata)
.L802449E0:
/* 165240 802449E0 265279C4 */  addiu     $s2, $s2, %lo(gSaveSlotMetadata)
glabel func_802449E4
/* 165244 802449E4 0C00ACB4 */  jal       fio_load_game
/* 165248 802449E8 0200202D */   daddu    $a0, $s0, $zero
D_802449EC:
/* 16524C 802449EC 14400003 */  bnez      $v0, D_802449FC
D_802449F0:
/* 165250 802449F0 00000000 */   nop
D_802449F4:
/* 165254 802449F4 0809128C */  j         .L80244A30
glabel func_802449F8
/* 165258 802449F8 A2200000 */   sb       $zero, 0x0($s1)
D_802449FC:
/* 16525C 802449FC 8EA712EC */  lw        $a3, 0x12EC($s5)
jtbl_80244A00:
/* 165260 80244A00 8EA812F0 */  lw        $t0, 0x12F0($s5)
D_80244A04:
/* 165264 80244A04 8EA912F4 */  lw        $t1, 0x12F4($s5)
/* 165268 80244A08 8EAA12F8 */  lw        $t2, 0x12F8($s5)
D_80244A0C:
/* 16526C 80244A0C AE470000 */  sw        $a3, 0x0($s2)
D_80244A10:
/* 165270 80244A10 AE480004 */  sw        $t0, 0x4($s2)
/* 165274 80244A14 AE490008 */  sw        $t1, 0x8($s2)
/* 165278 80244A18 AE4A000C */  sw        $t2, 0xC($s2)
.L80244A1C:
/* 16527C 80244A1C 8EA712FC */  lw        $a3, 0x12FC($s5)
D_80244A20:
/* 165280 80244A20 8EA81300 */  lw        $t0, 0x1300($s5)
.L80244A24:
/* 165284 80244A24 AE470010 */  sw        $a3, 0x10($s2)
D_80244A28:
/* 165288 80244A28 AE480014 */  sw        $t0, 0x14($s2)
D_80244A2C:
/* 16528C 80244A2C A2340000 */  sb        $s4, 0x0($s1)
.L80244A30:
/* 165290 80244A30 26310001 */  addiu     $s1, $s1, 0x1
/* 165294 80244A34 26100001 */  addiu     $s0, $s0, 0x1
/* 165298 80244A38 2A020004 */  slti      $v0, $s0, 0x4
/* 16529C 80244A3C 1440FFE9 */  bnez      $v0, func_802449E4
D_80244A40:
/* 1652A0 80244A40 26520018 */   addiu    $s2, $s2, 0x18
.L80244A44:
/* 1652A4 80244A44 82620004 */  lb        $v0, 0x4($s3)
glabel func_80244A48
/* 1652A8 80244A48 1440000E */  bnez      $v0, .L80244A84
glabel func_80244A4C
/* 1652AC 80244A4C 0260202D */   daddu    $a0, $s3, $zero
D_80244A50:
/* 1652B0 80244A50 0C00ABF6 */  jal       fio_has_valid_backup
D_80244A54:
/* 1652B4 80244A54 00000000 */   nop
glabel .L80244A58
/* 1652B8 80244A58 3C04800E */  lui       $a0, %hi(D_800D95E8)
/* 1652BC 80244A5C 248495E8 */  addiu     $a0, $a0, %lo(D_800D95E8)
D_80244A60:
/* 1652C0 80244A60 8C82003C */  lw        $v0, 0x3C($a0)
/* 1652C4 80244A64 2C420004 */  sltiu     $v0, $v0, 0x4
D_80244A68:
/* 1652C8 80244A68 50400001 */  beql      $v0, $zero, D_80244A70
D_80244A6C:
/* 1652CC 80244A6C AC80003C */   sw       $zero, 0x3C($a0)
D_80244A70:
/* 1652D0 80244A70 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
D_80244A74:
/* 1652D4 80244A74 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
D_80244A78:
/* 1652D8 80244A78 9082003F */  lbu       $v0, 0x3F($a0)
.L80244A7C:
/* 1652DC 80244A7C A0620166 */  sb        $v0, 0x166($v1)
/* 1652E0 80244A80 0260202D */  daddu     $a0, $s3, $zero
.L80244A84:
/* 1652E4 80244A84 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 1652E8 80244A88 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 1652EC 80244A8C 3C118025 */  lui       $s1, %hi(D_80249B84)
/* 1652F0 80244A90 26319B84 */  addiu     $s1, $s1, %lo(D_80249B84)
/* 1652F4 80244A94 90460166 */  lbu       $a2, 0x166($v0)
/* 1652F8 80244A98 0000802D */  daddu     $s0, $zero, $zero
/* 1652FC 80244A9C 30C50001 */  andi      $a1, $a2, 0x1
/* 165300 80244AA0 00052840 */  sll       $a1, $a1, 1
/* 165304 80244AA4 0C090B65 */  jal       func_80242D94
glabel .L80244AA8
/* 165308 80244AA8 00063042 */   srl      $a2, $a2, 1
.L80244AAC:
/* 16530C 80244AAC 8E240000 */  lw        $a0, 0x0($s1)
/* 165310 80244AB0 8C82000C */  lw        $v0, 0xC($a0)
.L80244AB4:
/* 165314 80244AB4 10400003 */  beqz      $v0, .L80244AC4
D_80244AB8:
/* 165318 80244AB8 26100001 */   addiu    $s0, $s0, 0x1
D_80244ABC:
/* 16531C 80244ABC 0040F809 */  jalr      $v0
/* 165320 80244AC0 00000000 */   nop
glabel .L80244AC4
/* 165324 80244AC4 2A020004 */  slti      $v0, $s0, 0x4
/* 165328 80244AC8 1440FFF8 */  bnez      $v0, .L80244AAC
/* 16532C 80244ACC 26310004 */   addiu    $s1, $s1, 0x4
D_80244AD0:
/* 165330 80244AD0 24040017 */  addiu     $a0, $zero, 0x17
/* 165334 80244AD4 0C051F5C */  jal       update_window_hierarchy
.L80244AD8:
/* 165338 80244AD8 24050040 */   addiu    $a1, $zero, 0x40
D_80244ADC:
/* 16533C 80244ADC 8FBF0028 */  lw        $ra, 0x28($sp)
/* 165340 80244AE0 8FB50024 */  lw        $s5, 0x24($sp)
.L80244AE4:
/* 165344 80244AE4 8FB40020 */  lw        $s4, 0x20($sp)
/* 165348 80244AE8 8FB3001C */  lw        $s3, 0x1C($sp)
glabel .L80244AEC
/* 16534C 80244AEC 8FB20018 */  lw        $s2, 0x18($sp)
/* 165350 80244AF0 8FB10014 */  lw        $s1, 0x14($sp)
D_80244AF4:
/* 165354 80244AF4 8FB00010 */  lw        $s0, 0x10($sp)
/* 165358 80244AF8 03E00008 */  jr        $ra
/* 16535C 80244AFC 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void filemenu_init(s32 arg0) {
    MenuPanel** panelIt;
    MenuPanel* menu;
    s32 i;

    dma_copy(ui_images_ROM_START, ui_images_ROM_END, ui_images_VRAM);
    for (i = 0; i < ARRAY_COUNT(filemenu_cursorHudElemID); i++) {
        filemenu_cursorHudElemID[i] = hud_element_create(filemenu_cursor_hudElemScripts[i]);
        hud_element_set_flags(filemenu_cursorHudElemID[i], HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80);
    }

    filemenu_cursorHudElem = filemenu_cursorHudElemID[0];
    if (!arg0) {
        filemenu_common_windowBPs[0].style.customStyle->background.imgData = NULL; // ???
    }
    setup_pause_menu_tab(filemenu_common_windowBPs, ARRAY_COUNT(filemenu_common_windowBPs));
    menu = filemenu_menus[0];
    filemenu_currentMenu = 0;

    if (!arg0) {
        menu->page = 0;
    } else {
        menu->page = 2;
    }

    if (menu->page == 0) {
        for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) {
            if (!fio_load_game(i)) {
                gSaveSlotHasData[i] = FALSE;
            } else {
                gSaveSlotMetadata[i] = gCurrentSaveFile.unk_12EC;
                gSaveSlotHasData[i] = TRUE;
            }
        }

        if (menu->page == 0) {
            fio_has_valid_backup();
            if (D_800D95E8.saveCount >= 4) {
                D_800D95E8.saveCount = 0;
            }
            gGameStatusPtr->saveSlot = D_800D95E8.saveCount;
        }
    }

    filemenu_set_selected(menu, (gGameStatusPtr->saveSlot & 1) * 2, gGameStatusPtr->saveSlot >> 1);

    panelIt = filemenu_menus;
    for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++, panelIt++) {
        if ((*panelIt)->fpInit != NULL) {
            (*panelIt)->fpInit((*panelIt));
        }
    }
    update_window_hierarchy(23, 64);
}