### RAW ASSEMBLY INSTRUCTIONS:

glabel au_syn_set_pan_fxmix
/* 32948 80057548 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 3294C 8005754C AFB20018 */  sw        $s2, 0x18($sp)
/* 32950 80057550 00A0902D */  daddu     $s2, $a1, $zero
/* 32954 80057554 AFB3001C */  sw        $s3, 0x1C($sp)
/* 32958 80057558 00C0982D */  daddu     $s3, $a2, $zero
/* 3295C 8005755C 308400FF */  andi      $a0, $a0, 0xFF
/* 32960 80057560 00041140 */  sll       $v0, $a0, 5
/* 32964 80057564 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 32968 80057568 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 3296C 8005756C 00441023 */  subu      $v0, $v0, $a0
/* 32970 80057570 AFBF0020 */  sw        $ra, 0x20($sp)
/* 32974 80057574 AFB10014 */  sw        $s1, 0x14($sp)
/* 32978 80057578 AFB00010 */  sw        $s0, 0x10($sp)
/* 3297C 8005757C 8C63001C */  lw        $v1, 0x1C($v1)
/* 32980 80057580 00021080 */  sll       $v0, $v0, 2
/* 32984 80057584 00628021 */  addu      $s0, $v1, $v0
/* 32988 80057588 8E050064 */  lw        $a1, 0x64($s0)
/* 3298C 8005758C 8E030068 */  lw        $v1, 0x68($s0)
/* 32990 80057590 00A3102A */  slt       $v0, $a1, $v1
/* 32994 80057594 14400029 */  bnez      $v0, .L8005763C
/* 32998 80057598 26110048 */   addiu    $s1, $s0, 0x48
/* 3299C 8005759C 3C028008 */  lui       $v0, %hi(AuSynUseStereo)
/* 329A0 800575A0 24428181 */  addiu     $v0, $v0, %lo(AuSynUseStereo)
/* 329A4 800575A4 90420000 */  lbu       $v0, 0x0($v0)
/* 329A8 800575A8 1440000E */  bnez      $v0, .L800575E4
/* 329AC 800575AC AE030064 */   sw       $v1, 0x64($s0)
/* 329B0 800575B0 3C048008 */  lui       $a0, %hi(AlCosineBlend)
/* 329B4 800575B4 24848E60 */  addiu     $a0, $a0, %lo(AlCosineBlend)
/* 329B8 800575B8 8603004E */  lh        $v1, 0x4E($s0)
/* 329BC 800575BC 84820080 */  lh        $v0, 0x80($a0)
/* 329C0 800575C0 00620018 */  mult      $v1, $v0
/* 329C4 800575C4 00004012 */  mflo      $t0
/* 329C8 800575C8 000813C3 */  sra       $v0, $t0, 15
/* 329CC 800575CC A6020050 */  sh        $v0, 0x50($s0)
/* 329D0 800575D0 84820080 */  lh        $v0, 0x80($a0)
/* 329D4 800575D4 00620018 */  mult      $v1, $v0
/* 329D8 800575D8 00004012 */  mflo      $t0
/* 329DC 800575DC 08015D99 */  j         .L80057664
/* 329E0 800575E0 000813C3 */   sra      $v0, $t0, 15
.L800575E4:
/* 329E4 800575E4 8602004C */  lh        $v0, 0x4C($s0)
/* 329E8 800575E8 8603004E */  lh        $v1, 0x4E($s0)
/* 329EC 800575EC 00021040 */  sll       $v0, $v0, 1
/* 329F0 800575F0 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 329F4 800575F4 00220821 */  addu      $at, $at, $v0
/* 329F8 800575F8 84228E60 */  lh        $v0, %lo(AlCosineBlend)($at)
/* 329FC 800575FC 00620018 */  mult      $v1, $v0
/* 32A00 80057600 8603004C */  lh        $v1, 0x4C($s0)
/* 32A04 80057604 00004012 */  mflo      $t0
/* 32A08 80057608 000813C3 */  sra       $v0, $t0, 15
/* 32A0C 8005760C A6020050 */  sh        $v0, 0x50($s0)
/* 32A10 80057610 2402007F */  addiu     $v0, $zero, 0x7F
/* 32A14 80057614 00431023 */  subu      $v0, $v0, $v1
/* 32A18 80057618 00021040 */  sll       $v0, $v0, 1
/* 32A1C 8005761C 8603004E */  lh        $v1, 0x4E($s0)
/* 32A20 80057620 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32A24 80057624 00220821 */  addu      $at, $at, $v0
/* 32A28 80057628 84228E60 */  lh        $v0, %lo(AlCosineBlend)($at)
/* 32A2C 8005762C 00620018 */  mult      $v1, $v0
/* 32A30 80057630 00004012 */  mflo      $t0
/* 32A34 80057634 08015D99 */  j         .L80057664
/* 32A38 80057638 000813C3 */   sra      $v0, $t0, 15
.L8005763C:
/* 32A3C 8005763C 86040050 */  lh        $a0, 0x50($s0)
/* 32A40 80057640 8606005A */  lh        $a2, 0x5A($s0)
/* 32A44 80057644 0C016001 */  jal       func_80058004
/* 32A48 80057648 96070058 */   lhu      $a3, 0x58($s0)
/* 32A4C 8005764C 86040052 */  lh        $a0, 0x52($s0)
/* 32A50 80057650 8E050064 */  lw        $a1, 0x64($s0)
/* 32A54 80057654 86060060 */  lh        $a2, 0x60($s0)
/* 32A58 80057658 9607005E */  lhu       $a3, 0x5E($s0)
/* 32A5C 8005765C 0C016001 */  jal       func_80058004
/* 32A60 80057660 A6020050 */   sh       $v0, 0x50($s0)
.L80057664:
/* 32A64 80057664 A6020052 */  sh        $v0, 0x52($s0)
/* 32A68 80057668 86220008 */  lh        $v0, 0x8($s1)
/* 32A6C 8005766C 14400002 */  bnez      $v0, .L80057678
/* 32A70 80057670 24020001 */   addiu    $v0, $zero, 0x1
/* 32A74 80057674 A6220008 */  sh        $v0, 0x8($s1)
.L80057678:
/* 32A78 80057678 8622000A */  lh        $v0, 0xA($s1)
/* 32A7C 8005767C 14400004 */  bnez      $v0, .L80057690
/* 32A80 80057680 324200FF */   andi     $v0, $s2, 0xFF
/* 32A84 80057684 24020001 */  addiu     $v0, $zero, 0x1
/* 32A88 80057688 A622000A */  sh        $v0, 0xA($s1)
/* 32A8C 8005768C 324200FF */  andi      $v0, $s2, 0xFF
.L80057690:
/* 32A90 80057690 326300FF */  andi      $v1, $s3, 0xFF
/* 32A94 80057694 A6220004 */  sh        $v0, 0x4($s1)
/* 32A98 80057698 00031040 */  sll       $v0, $v1, 1
/* 32A9C 8005769C 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32AA0 800576A0 00220821 */  addu      $at, $at, $v0
/* 32AA4 800576A4 94228E60 */  lhu       $v0, %lo(AlCosineBlend)($at)
/* 32AA8 800576A8 A622000C */  sh        $v0, 0xC($s1)
/* 32AAC 800576AC 2402007F */  addiu     $v0, $zero, 0x7F
/* 32AB0 800576B0 00431023 */  subu      $v0, $v0, $v1
/* 32AB4 800576B4 00021040 */  sll       $v0, $v0, 1
/* 32AB8 800576B8 3C038008 */  lui       $v1, %hi(AlCosineBlend)
/* 32ABC 800576BC 00621821 */  addu      $v1, $v1, $v0
/* 32AC0 800576C0 94638E60 */  lhu       $v1, %lo(AlCosineBlend)($v1)
/* 32AC4 800576C4 24020001 */  addiu     $v0, $zero, 0x1
/* 32AC8 800576C8 AE220024 */  sw        $v0, 0x24($s1)
/* 32ACC 800576CC A623000E */  sh        $v1, 0xE($s1)
/* 32AD0 800576D0 8FBF0020 */  lw        $ra, 0x20($sp)
/* 32AD4 800576D4 8FB3001C */  lw        $s3, 0x1C($sp)
/* 32AD8 800576D8 8FB20018 */  lw        $s2, 0x18($sp)
/* 32ADC 800576DC 8FB10014 */  lw        $s1, 0x14($sp)
/* 32AE0 800576E0 8FB00010 */  lw        $s0, 0x10($sp)
/* 32AE4 800576E4 03E00008 */  jr        $ra
/* 32AE8 800576E8 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void au_syn_set_pan_fxmix(u8 voiceIdx, u8 pan, u8 fxMix) {
    AuPVoice* pvoice = &gSynDriverPtr->pvoices[voiceIdx];
    AuEnvMixer* envMixer = &pvoice->envMixer;

    if (envMixer->delta >= envMixer->segEnd) {
        envMixer->delta = envMixer->segEnd;
        if (!AuSynUseStereo) {
            envMixer->cvolL = (envMixer->volume * AuEqPower[AU_EQPOW_MID_IDX]) >> 0xF;
            envMixer->cvolR = (envMixer->volume * AuEqPower[AU_EQPOW_MID_IDX]) >> 0xF;
        } else {
            envMixer->cvolL = (envMixer->volume * AuEqPower[envMixer->pan]) >> 0xF;
            envMixer->cvolR = (envMixer->volume * AuEqPower[AU_EQPOW_MAX_IDX - envMixer->pan]) >> 0xF;
        }
    } else {
        envMixer->cvolL = _getVol(envMixer->cvolL, envMixer->delta, envMixer->lratm, envMixer->lratl);
        envMixer->cvolR = _getVol(envMixer->cvolR, envMixer->delta, envMixer->rratm, envMixer->rratl);
    }
    if (envMixer->cvolL == 0) {
        envMixer->cvolL = 1;
    }
    if (envMixer->cvolR == 0) {
        envMixer->cvolR = 1;
    }

    envMixer->pan = pan;
    envMixer->dryamt = AuEqPower[fxMix];
    envMixer->wetamt = AuEqPower[AU_EQPOW_MAX_IDX - fxMix];
    envMixer->first = 1;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel red_impact_main
/* 3D3E20 E00D0000 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* 3D3E24 E00D0004 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 3D3E28 E00D0008 4485B000 */  mtc1      $a1, $f22
/* 3D3E2C E00D000C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3D3E30 E00D0010 4486C000 */  mtc1      $a2, $f24
/* 3D3E34 E00D0014 F7BA0050 */  sdc1      $f26, 0x50($sp)
/* 3D3E38 E00D0018 4487D000 */  mtc1      $a3, $f26
/* 3D3E3C E00D001C F7B40038 */  sdc1      $f20, 0x38($sp)
/* 3D3E40 E00D0020 C7B40070 */  lwc1      $f20, 0x70($sp)
/* 3D3E44 E00D0024 AFB20030 */  sw        $s2, 0x30($sp)
/* 3D3E48 E00D0028 0080902D */  daddu     $s2, $a0, $zero
/* 3D3E4C E00D002C AFB00028 */  sw        $s0, 0x28($sp)
/* 3D3E50 E00D0030 24100003 */  addiu     $s0, $zero, 0x3
/* 3D3E54 E00D0034 F7BC0058 */  sdc1      $f28, 0x58($sp)
/* 3D3E58 E00D0038 4480E000 */  mtc1      $zero, $f28
/* 3D3E5C E00D003C 27A40010 */  addiu     $a0, $sp, 0x10
/* 3D3E60 E00D0040 AFBF0034 */  sw        $ra, 0x34($sp)
/* 3D3E64 E00D0044 16400002 */  bnez      $s2, .LE00D0050
/* 3D3E68 E00D0048 AFB1002C */   sw       $s1, 0x2C($sp)
/* 3D3E6C E00D004C 24100007 */  addiu     $s0, $zero, 0x7
.LE00D0050:
/* 3D3E70 E00D0050 26100001 */  addiu     $s0, $s0, 0x1
/* 3D3E74 E00D0054 3C02E00D */  lui       $v0, %hi(red_impact_init)
/* 3D3E78 E00D0058 2442018C */  addiu     $v0, $v0, %lo(red_impact_init)
/* 3D3E7C E00D005C AFA00010 */  sw        $zero, 0x10($sp)
/* 3D3E80 E00D0060 AC820008 */  sw        $v0, 0x8($a0)
/* 3D3E84 E00D0064 3C02E00D */  lui       $v0, %hi(red_impact_update)
/* 3D3E88 E00D0068 24420194 */  addiu     $v0, $v0, %lo(red_impact_update)
/* 3D3E8C E00D006C AC82000C */  sw        $v0, 0xC($a0)
/* 3D3E90 E00D0070 3C02E00D */  lui       $v0, %hi(red_impact_render)
/* 3D3E94 E00D0074 24420448 */  addiu     $v0, $v0, %lo(red_impact_render)
/* 3D3E98 E00D0078 AC820010 */  sw        $v0, 0x10($a0)
/* 3D3E9C E00D007C 24020068 */  addiu     $v0, $zero, 0x68
/* 3D3EA0 E00D0080 AC800014 */  sw        $zero, 0x14($a0)
/* 3D3EA4 E00D0084 0C080124 */  jal       shim_create_effect_instance
/* 3D3EA8 E00D0088 AC820004 */   sw       $v0, 0x4($a0)
/* 3D3EAC E00D008C 00102040 */  sll       $a0, $s0, 1
/* 3D3EB0 E00D0090 00902021 */  addu      $a0, $a0, $s0
/* 3D3EB4 E00D0094 00042080 */  sll       $a0, $a0, 2
/* 3D3EB8 E00D0098 00902023 */  subu      $a0, $a0, $s0
/* 3D3EBC E00D009C 000420C0 */  sll       $a0, $a0, 3
/* 3D3EC0 E00D00A0 0040882D */  daddu     $s1, $v0, $zero
/* 3D3EC4 E00D00A4 0C08012C */  jal       shim_general_heap_malloc
/* 3D3EC8 E00D00A8 AE300008 */   sw       $s0, 0x8($s1)
/* 3D3ECC E00D00AC 0040182D */  daddu     $v1, $v0, $zero
/* 3D3ED0 E00D00B0 14600003 */  bnez      $v1, .LE00D00C0
/* 3D3ED4 E00D00B4 AE23000C */   sw       $v1, 0xC($s1)
.LE00D00B8:
/* 3D3ED8 E00D00B8 0803402E */  j         .LE00D00B8
/* 3D3EDC E00D00BC 00000000 */   nop
.LE00D00C0:
/* 3D3EE0 E00D00C0 2402003C */  addiu     $v0, $zero, 0x3C
/* 3D3EE4 E00D00C4 AC620028 */  sw        $v0, 0x28($v1)
/* 3D3EE8 E00D00C8 240200FF */  addiu     $v0, $zero, 0xFF
/* 3D3EEC E00D00CC AC620038 */  sw        $v0, 0x38($v1)
/* 3D3EF0 E00D00D0 A0620050 */  sb        $v0, 0x50($v1)
/* 3D3EF4 E00D00D4 A0620053 */  sb        $v0, 0x53($v1)
/* 3D3EF8 E00D00D8 240200C8 */  addiu     $v0, $zero, 0xC8
/* 3D3EFC E00D00DC A0620054 */  sb        $v0, 0x54($v1)
/* 3D3F00 E00D00E0 24020064 */  addiu     $v0, $zero, 0x64
/* 3D3F04 E00D00E4 AC60002C */  sw        $zero, 0x2C($v1)
/* 3D3F08 E00D00E8 A4720000 */  sh        $s2, 0x0($v1)
/* 3D3F0C E00D00EC E4760004 */  swc1      $f22, 0x4($v1)
/* 3D3F10 E00D00F0 E4780008 */  swc1      $f24, 0x8($v1)
/* 3D3F14 E00D00F4 E47A000C */  swc1      $f26, 0xC($v1)
/* 3D3F18 E00D00F8 E4740024 */  swc1      $f20, 0x24($v1)
/* 3D3F1C E00D00FC E4740020 */  swc1      $f20, 0x20($v1)
/* 3D3F20 E00D0100 E474001C */  swc1      $f20, 0x1C($v1)
/* 3D3F24 E00D0104 A0600051 */  sb        $zero, 0x51($v1)
/* 3D3F28 E00D0108 A0600052 */  sb        $zero, 0x52($v1)
/* 3D3F2C E00D010C A0620055 */  sb        $v0, 0x55($v1)
/* 3D3F30 E00D0110 24040001 */  addiu     $a0, $zero, 0x1
/* 3D3F34 E00D0114 0090102A */  slt       $v0, $a0, $s0
/* 3D3F38 E00D0118 10400010 */  beqz      $v0, .LE00D015C
/* 3D3F3C E00D011C 24630058 */   addiu    $v1, $v1, 0x58
/* 3D3F40 E00D0120 24630030 */  addiu     $v1, $v1, 0x30
/* 3D3F44 E00D0124 2406001E */  addiu     $a2, $zero, 0x1E
/* 3D3F48 E00D0128 2405FFFF */  addiu     $a1, $zero, -0x1
.LE00D012C:
/* 3D3F4C E00D012C 44860000 */  mtc1      $a2, $f0
/* 3D3F50 E00D0130 00000000 */  nop
/* 3D3F54 E00D0134 46800020 */  cvt.s.w   $f0, $f0
/* 3D3F58 E00D0138 24C6001E */  addiu     $a2, $a2, 0x1E
/* 3D3F5C E00D013C AC65001C */  sw        $a1, 0x1C($v1)
/* 3D3F60 E00D0140 24A5FFFE */  addiu     $a1, $a1, -0x2
/* 3D3F64 E00D0144 24840001 */  addiu     $a0, $a0, 0x1
/* 3D3F68 E00D0148 E47C0004 */  swc1      $f28, 0x4($v1)
/* 3D3F6C E00D014C E4600000 */  swc1      $f0, 0x0($v1)
/* 3D3F70 E00D0150 0090102A */  slt       $v0, $a0, $s0
/* 3D3F74 E00D0154 1440FFF5 */  bnez      $v0, .LE00D012C
/* 3D3F78 E00D0158 24630058 */   addiu    $v1, $v1, 0x58
.LE00D015C:
/* 3D3F7C E00D015C 0220102D */  daddu     $v0, $s1, $zero
/* 3D3F80 E00D0160 8FBF0034 */  lw        $ra, 0x34($sp)
/* 3D3F84 E00D0164 8FB20030 */  lw        $s2, 0x30($sp)
/* 3D3F88 E00D0168 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3D3F8C E00D016C 8FB00028 */  lw        $s0, 0x28($sp)
/* 3D3F90 E00D0170 D7BC0058 */  ldc1      $f28, 0x58($sp)
/* 3D3F94 E00D0174 D7BA0050 */  ldc1      $f26, 0x50($sp)
/* 3D3F98 E00D0178 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 3D3F9C E00D017C D7B60040 */  ldc1      $f22, 0x40($sp)
/* 3D3FA0 E00D0180 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 3D3FA4 E00D0184 03E00008 */  jr        $ra
/* 3D3FA8 E00D0188 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

EffectInstance* red_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    RedImpactFXData* part;
    f32 zero = 0.0f;
    s32 numParts;
    s32 temp;
    s32 i;

    if (arg0 == 0) {
        numParts = 7;
    } else {
        temp = 3; // Required to match
        numParts = temp;
    }
    numParts++;

    bpPtr->unk_00 = 0;
    bpPtr->init = red_impact_init;
    bpPtr->update = red_impact_update;
    bpPtr->renderWorld = red_impact_render;
    bpPtr->renderUI = NULL;
    bpPtr->effectID = EFFECT_RED_IMPACT;

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

    part->unk_2C = 0;
    part->unk_00 = arg0;
    part->unk_04 = arg1;
    part->unk_08 = arg2;
    part->unk_0C = arg3;
    part->unk_24 = arg4;
    part->unk_20 = arg4;
    part->unk_1C = arg4;
    part->unk_28 = 60;
    part->unk_38 = 255;
    part->unk_50.r = 255;
    part->unk_50.g = 0;
    part->unk_50.b = 0;
    part->unk_53.r = 255;
    part->unk_53.g = 200;
    part->unk_53.b = 100;

    part++;
    for (i = 1; i < numParts; i++, part++) {
        part->unk_4C = -1 + (i - 1) * (-2);
        part->unk_34 = zero;
        part->unk_30 = i * 30;
    }

    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel guPositionF
/* 3F310 80063F10 3C018009 */  lui       $at, %hi(dtor)
/* 3F314 80063F14 C4203DC0 */  lwc1      $f0, %lo(dtor)($at)
/* 3F318 80063F18 44859000 */  mtc1      $a1, $f18
/* 3F31C 80063F1C 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 3F320 80063F20 F7BC0040 */  sdc1      $f28, 0x40($sp)
/* 3F324 80063F24 F7B40020 */  sdc1      $f20, 0x20($sp)
/* 3F328 80063F28 46009502 */  mul.s     $f20, $f18, $f0
/* 3F32C 80063F2C C7BC0060 */  lwc1      $f28, 0x60($sp)
/* 3F330 80063F30 44869000 */  mtc1      $a2, $f18
/* 3F334 80063F34 AFB00010 */  sw        $s0, 0x10($sp)
/* 3F338 80063F38 F7B60028 */  sdc1      $f22, 0x28($sp)
/* 3F33C 80063F3C 46009582 */  mul.s     $f22, $f18, $f0
/* 3F340 80063F40 44879000 */  mtc1      $a3, $f18
/* 3F344 80063F44 00808021 */  addu      $s0, $a0, $zero
/* 3F348 80063F48 AFBF0018 */  sw        $ra, 0x18($sp)
/* 3F34C 80063F4C AFB10014 */  sw        $s1, 0x14($sp)
/* 3F350 80063F50 F7BE0048 */  sdc1      $f30, 0x48($sp)
/* 3F354 80063F54 F7BA0038 */  sdc1      $f26, 0x38($sp)
/* 3F358 80063F58 F7B80030 */  sdc1      $f24, 0x30($sp)
/* 3F35C 80063F5C 46009602 */  mul.s     $f24, $f18, $f0
/* 3F360 80063F60 0C00A85B */  jal       sin_rad
/* 3F364 80063F64 4600A306 */   mov.s    $f12, $f20
/* 3F368 80063F68 44110000 */  mfc1      $s1, $f0
/* 3F36C 80063F6C 00000000 */  nop
/* 3F370 80063F70 0C00A874 */  jal       cos_rad
/* 3F374 80063F74 4600A306 */   mov.s    $f12, $f20
/* 3F378 80063F78 46000686 */  mov.s     $f26, $f0
/* 3F37C 80063F7C 0C00A85B */  jal       sin_rad
/* 3F380 80063F80 4600B306 */   mov.s    $f12, $f22
/* 3F384 80063F84 4600B306 */  mov.s     $f12, $f22
/* 3F388 80063F88 0C00A874 */  jal       cos_rad
/* 3F38C 80063F8C 46000506 */   mov.s    $f20, $f0
/* 3F390 80063F90 46000786 */  mov.s     $f30, $f0
/* 3F394 80063F94 0C00A85B */  jal       sin_rad
/* 3F398 80063F98 4600C306 */   mov.s    $f12, $f24
/* 3F39C 80063F9C 4600C306 */  mov.s     $f12, $f24
/* 3F3A0 80063FA0 0C00A874 */  jal       cos_rad
/* 3F3A4 80063FA4 46000586 */   mov.s    $f22, $f0
/* 3F3A8 80063FA8 00000000 */  nop
/* 3F3AC 80063FAC 4600F382 */  mul.s     $f14, $f30, $f0
/* 3F3B0 80063FB0 00000000 */  nop
/* 3F3B4 80063FB4 4616F402 */  mul.s     $f16, $f30, $f22
/* 3F3B8 80063FB8 00000000 */  nop
/* 3F3BC 80063FBC 4616D082 */  mul.s     $f2, $f26, $f22
/* 3F3C0 80063FC0 00000000 */  nop
/* 3F3C4 80063FC4 4600D182 */  mul.s     $f6, $f26, $f0
/* 3F3C8 80063FC8 44919000 */  mtc1      $s1, $f18
/* 3F3CC 80063FCC 00000000 */  nop
/* 3F3D0 80063FD0 46149102 */  mul.s     $f4, $f18, $f20
/* 3F3D4 80063FD4 4600A307 */  neg.s     $f12, $f20
/* 3F3D8 80063FD8 461C6302 */  mul.s     $f12, $f12, $f28
/* 3F3DC 80063FDC 00000000 */  nop
/* 3F3E0 80063FE0 4614D502 */  mul.s     $f20, $f26, $f20
/* 3F3E4 80063FE4 00000000 */  nop
/* 3F3E8 80063FE8 461E9282 */  mul.s     $f10, $f18, $f30
/* 3F3EC 80063FEC 00000000 */  nop
/* 3F3F0 80063FF0 461ED682 */  mul.s     $f26, $f26, $f30
/* 3F3F4 80063FF4 00000000 */  nop
/* 3F3F8 80063FF8 461C7382 */  mul.s     $f14, $f14, $f28
/* 3F3FC 80063FFC 00000000 */  nop
/* 3F400 80064000 461C8402 */  mul.s     $f16, $f16, $f28
/* 3F404 80064004 00000000 */  nop
/* 3F408 80064008 46002202 */  mul.s     $f8, $f4, $f0
/* 3F40C 8006400C 00000000 */  nop
/* 3F410 80064010 46162102 */  mul.s     $f4, $f4, $f22
/* 3F414 80064014 00000000 */  nop
/* 3F418 80064018 461C5282 */  mul.s     $f10, $f10, $f28
/* 3F41C 8006401C 00000000 */  nop
/* 3F420 80064020 461CD682 */  mul.s     $f26, $f26, $f28
/* 3F424 80064024 46062100 */  add.s     $f4, $f4, $f6
/* 3F428 80064028 4600A182 */  mul.s     $f6, $f20, $f0
/* 3F42C 8006402C 46024201 */  sub.s     $f8, $f8, $f2
/* 3F430 80064030 46169082 */  mul.s     $f2, $f18, $f22
/* 3F434 80064034 00000000 */  nop
/* 3F438 80064038 4616A502 */  mul.s     $f20, $f20, $f22
/* 3F43C 8006403C 00000000 */  nop
/* 3F440 80064040 46009482 */  mul.s     $f18, $f18, $f0
/* 3F444 80064044 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3F448 80064048 44810000 */  mtc1      $at, $f0
/* 3F44C 8006404C 461C4202 */  mul.s     $f8, $f8, $f28
/* 3F450 80064050 AE00000C */  sw        $zero, 0xC($s0)
/* 3F454 80064054 AE00001C */  sw        $zero, 0x1C($s0)
/* 3F458 80064058 AE00002C */  sw        $zero, 0x2C($s0)
/* 3F45C 8006405C 44119000 */  mfc1      $s1, $f18
/* 3F460 80064060 C7B20064 */  lwc1      $f18, 0x64($sp)
/* 3F464 80064064 461C2102 */  mul.s     $f4, $f4, $f28
/* 3F468 80064068 E6120030 */  swc1      $f18, 0x30($s0)
/* 3F46C 8006406C C7B20068 */  lwc1      $f18, 0x68($sp)
/* 3F470 80064070 46023180 */  add.s     $f6, $f6, $f2
/* 3F474 80064074 E6120034 */  swc1      $f18, 0x34($s0)
/* 3F478 80064078 C7B2006C */  lwc1      $f18, 0x6C($sp)
/* 3F47C 8006407C 461C3182 */  mul.s     $f6, $f6, $f28
/* 3F480 80064080 E6120038 */  swc1      $f18, 0x38($s0)
/* 3F484 80064084 44919000 */  mtc1      $s1, $f18
/* 3F488 80064088 00000000 */  nop
/* 3F48C 8006408C 4612A501 */  sub.s     $f20, $f20, $f18
/* 3F490 80064090 E600003C */  swc1      $f0, 0x3C($s0)
/* 3F494 80064094 E60C0008 */  swc1      $f12, 0x8($s0)
/* 3F498 80064098 E60E0000 */  swc1      $f14, 0x0($s0)
/* 3F49C 8006409C 461CA502 */  mul.s     $f20, $f20, $f28
/* 3F4A0 800640A0 E6100004 */  swc1      $f16, 0x4($s0)
/* 3F4A4 800640A4 E60A0018 */  swc1      $f10, 0x18($s0)
/* 3F4A8 800640A8 E61A0028 */  swc1      $f26, 0x28($s0)
/* 3F4AC 800640AC E6080010 */  swc1      $f8, 0x10($s0)
/* 3F4B0 800640B0 E6040014 */  swc1      $f4, 0x14($s0)
/* 3F4B4 800640B4 E6060020 */  swc1      $f6, 0x20($s0)
/* 3F4B8 800640B8 E6140024 */  swc1      $f20, 0x24($s0)
/* 3F4BC 800640BC 8FBF0018 */  lw        $ra, 0x18($sp)
/* 3F4C0 800640C0 8FB10014 */  lw        $s1, 0x14($sp)
/* 3F4C4 800640C4 8FB00010 */  lw        $s0, 0x10($sp)
/* 3F4C8 800640C8 D7BE0048 */  ldc1      $f30, 0x48($sp)
/* 3F4CC 800640CC D7BC0040 */  ldc1      $f28, 0x40($sp)
/* 3F4D0 800640D0 D7BA0038 */  ldc1      $f26, 0x38($sp)
/* 3F4D4 800640D4 D7B80030 */  ldc1      $f24, 0x30($sp)
/* 3F4D8 800640D8 D7B60028 */  ldc1      $f22, 0x28($sp)
/* 3F4DC 800640DC D7B40020 */  ldc1      $f20, 0x20($sp)
/* 3F4E0 800640E0 03E00008 */  jr        $ra
/* 3F4E4 800640E4 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void guPositionF(f32 mf[4][4], f32 r, f32 p, f32 h, f32 s, f32 x, f32 y, f32 z) {
        static f32 dtor = 3.1415926 / 180.0;
        f32   sinr, sinp, sinh;
        f32   cosr, cosp, cosh;

        r *= dtor;
        p *= dtor;
        h *= dtor;
        sinr = sin_rad(r);
        cosr = cos_rad(r);
        sinp = sin_rad(p);
        cosp = cos_rad(p);
        sinh = sin_rad(h);
        cosh = cos_rad(h);

        mf[0][0] = (cosp * cosh) * s;
        mf[0][1] = (cosp * sinh) * s;
        mf[0][2] = (-sinp) * s;
        mf[0][3] = 0.0;

        mf[1][0] = (sinr * sinp * cosh - cosr * sinh) * s;
        mf[1][1] = (sinr * sinp * sinh + cosr * cosh) * s;
        mf[1][2] = (sinr * cosp) * s;
        mf[1][3] = 0.0;

        mf[2][0] = (cosr * sinp * cosh + sinr * sinh) * s;
        mf[2][1] = (cosr * sinp * sinh - sinr * cosh) * s;
        mf[2][2] = (cosr * cosp) * s;
        mf[2][3] = 0.0;

        mf[3][0] = x;
        mf[3][1] = y;
        mf[3][2] = z;
        mf[3][3] = 1.0;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_GiantChest_give_equipment
/* 109364 802E7AE4 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 109368 802E7AE8 AFB1001C */  sw        $s1, 0x1C($sp)
/* 10936C 802E7AEC 0080882D */  daddu     $s1, $a0, $zero
/* 109370 802E7AF0 AFBF0020 */  sw        $ra, 0x20($sp)
/* 109374 802E7AF4 AFB00018 */  sw        $s0, 0x18($sp)
/* 109378 802E7AF8 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 10937C 802E7AFC F7B40028 */  sdc1      $f20, 0x28($sp)
/* 109380 802E7B00 8E300040 */  lw        $s0, 0x40($s1)
/* 109384 802E7B04 8E020010 */  lw        $v0, 0x10($s0)
/* 109388 802E7B08 2443FFFF */  addiu     $v1, $v0, -0x1
/* 10938C 802E7B0C 2C620006 */  sltiu     $v0, $v1, 0x6
/* 109390 802E7B10 1040001D */  beqz      $v0, .L802E7B88
/* 109394 802E7B14 00031080 */   sll      $v0, $v1, 2
/* 109398 802E7B18 3C01802F */  lui       $at, %hi(jtbl_802EB330)
/* 10939C 802E7B1C 00220821 */  addu      $at, $at, $v0
/* 1093A0 802E7B20 8C22B330 */  lw        $v0, %lo(jtbl_802EB330)($at)
/* 1093A4 802E7B24 00400008 */  jr        $v0
/* 1093A8 802E7B28 00000000 */   nop
glabel .L802E7B2C
/* 1093AC 802E7B2C 3C018011 */  lui       $at, %hi(gPlayerData)
/* 1093B0 802E7B30 A020F290 */  sb        $zero, %lo(gPlayerData)($at)
/* 1093B4 802E7B34 080B9EE2 */  j         .L802E7B88
/* 1093B8 802E7B38 00000000 */   nop
glabel .L802E7B3C
/* 1093BC 802E7B3C 24020001 */  addiu     $v0, $zero, 0x1
/* 1093C0 802E7B40 3C018011 */  lui       $at, %hi(gPlayerData)
/* 1093C4 802E7B44 A022F290 */  sb        $v0, %lo(gPlayerData)($at)
/* 1093C8 802E7B48 080B9EE2 */  j         .L802E7B88
/* 1093CC 802E7B4C 00000000 */   nop
glabel .L802E7B50
/* 1093D0 802E7B50 24020002 */  addiu     $v0, $zero, 0x2
/* 1093D4 802E7B54 3C018011 */  lui       $at, %hi(gPlayerData)
/* 1093D8 802E7B58 A022F290 */  sb        $v0, %lo(gPlayerData)($at)
/* 1093DC 802E7B5C 080B9EE2 */  j         .L802E7B88
/* 1093E0 802E7B60 00000000 */   nop
glabel .L802E7B64
/* 1093E4 802E7B64 3C018011 */  lui       $at, %hi(gPlayerData + 0x1)
/* 1093E8 802E7B68 A020F291 */  sb        $zero, %lo(gPlayerData + 0x1)($at)
/* 1093EC 802E7B6C 080B9EE2 */  j         .L802E7B88
/* 1093F0 802E7B70 00000000 */   nop
glabel .L802E7B74
/* 1093F4 802E7B74 080B9EE0 */  j         .L802E7B80
/* 1093F8 802E7B78 24020001 */   addiu    $v0, $zero, 0x1
glabel .L802E7B7C
/* 1093FC 802E7B7C 24020002 */  addiu     $v0, $zero, 0x2
.L802E7B80:
/* 109400 802E7B80 3C018011 */  lui       $at, %hi(gPlayerData + 0x1)
/* 109404 802E7B84 A022F291 */  sb        $v0, %lo(gPlayerData + 0x1)($at)
.L802E7B88:
/* 109408 802E7B88 8E020010 */  lw        $v0, 0x10($s0)
/* 10940C 802E7B8C 10400027 */  beqz      $v0, .L802E7C2C
/* 109410 802E7B90 00000000 */   nop
/* 109414 802E7B94 C6340064 */  lwc1      $f20, 0x64($s1)
/* 109418 802E7B98 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 10941C 802E7B9C 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 109420 802E7BA0 44810000 */  mtc1      $at, $f0
/* 109424 802E7BA4 00000000 */  nop
/* 109428 802E7BA8 4600A502 */  mul.s     $f20, $f20, $f0
/* 10942C 802E7BAC 00000000 */  nop
/* 109430 802E7BB0 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 109434 802E7BB4 44810000 */  mtc1      $at, $f0
/* 109438 802E7BB8 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 10943C 802E7BBC 4481B000 */  mtc1      $at, $f22
/* 109440 802E7BC0 4600A503 */  div.s     $f20, $f20, $f0
/* 109444 802E7BC4 0C00A85B */  jal       sin_rad
/* 109448 802E7BC8 4600A306 */   mov.s    $f12, $f20
/* 10944C 802E7BCC 46160002 */  mul.s     $f0, $f0, $f22
/* 109450 802E7BD0 00000000 */  nop
/* 109454 802E7BD4 C6220048 */  lwc1      $f2, 0x48($s1)
/* 109458 802E7BD8 46001080 */  add.s     $f2, $f2, $f0
/* 10945C 802E7BDC E6020018 */  swc1      $f2, 0x18($s0)
/* 109460 802E7BE0 C620004C */  lwc1      $f0, 0x4C($s1)
/* 109464 802E7BE4 4600A306 */  mov.s     $f12, $f20
/* 109468 802E7BE8 0C00A874 */  jal       cos_rad
/* 10946C 802E7BEC E600001C */   swc1     $f0, 0x1C($s0)
/* 109470 802E7BF0 46160002 */  mul.s     $f0, $f0, $f22
/* 109474 802E7BF4 00000000 */  nop
/* 109478 802E7BF8 C6220050 */  lwc1      $f2, 0x50($s1)
/* 10947C 802E7BFC 46001080 */  add.s     $f2, $f2, $f0
/* 109480 802E7C00 24020001 */  addiu     $v0, $zero, 0x1
/* 109484 802E7C04 E6020020 */  swc1      $f2, 0x20($s0)
/* 109488 802E7C08 AFA20010 */  sw        $v0, 0x10($sp)
/* 10948C 802E7C0C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 109490 802E7C10 AFA20014 */  sw        $v0, 0x14($sp)
/* 109494 802E7C14 8E040010 */  lw        $a0, 0x10($s0)
/* 109498 802E7C18 8E050018 */  lw        $a1, 0x18($s0)
/* 10949C 802E7C1C 8E06001C */  lw        $a2, 0x1C($s0)
/* 1094A0 802E7C20 0C04C6A5 */  jal       make_item_entity_nodelay
/* 1094A4 802E7C24 8E070020 */   lw       $a3, 0x20($s0)
/* 1094A8 802E7C28 AE020014 */  sw        $v0, 0x14($s0)
.L802E7C2C:
/* 1094AC 802E7C2C 96040000 */  lhu       $a0, 0x0($s0)
/* 1094B0 802E7C30 3C02F8D8 */  lui       $v0, (0xF8D8F200 >> 16)
/* 1094B4 802E7C34 3442F200 */  ori       $v0, $v0, (0xF8D8F200 & 0xFFFF)
/* 1094B8 802E7C38 0044102A */  slt       $v0, $v0, $a0
/* 1094BC 802E7C3C 14400003 */  bnez      $v0, .L802E7C4C
/* 1094C0 802E7C40 3C0207BF */   lui      $v0, (0x7BFA480 >> 16)
/* 1094C4 802E7C44 3442A480 */  ori       $v0, $v0, (0x7BFA480 & 0xFFFF)
/* 1094C8 802E7C48 00822021 */  addu      $a0, $a0, $v0
.L802E7C4C:
/* 1094CC 802E7C4C 0C051514 */  jal       set_global_flag
/* 1094D0 802E7C50 00000000 */   nop
/* 1094D4 802E7C54 8FBF0020 */  lw        $ra, 0x20($sp)
/* 1094D8 802E7C58 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1094DC 802E7C5C 8FB00018 */  lw        $s0, 0x18($sp)
/* 1094E0 802E7C60 D7B60030 */  ldc1      $f22, 0x30($sp)
/* 1094E4 802E7C64 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 1094E8 802E7C68 03E00008 */  jr        $ra
/* 1094EC 802E7C6C 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void entity_GiantChest_give_equipment(Entity* entity) {
    ChestData* data = entity->dataBuf.chest;
    f32 angle;
    s32 flagIndex;

    switch (data->itemID) {
        case ITEM_BOOTS:
            gPlayerData.bootsLevel = 0;
            break;
        case ITEM_SUPER_BOOTS:
            gPlayerData.bootsLevel = 1;
            break;
        case ITEM_ULTRA_BOOTS:
            gPlayerData.bootsLevel = 2;
            break;
        case ITEM_HAMMER:
            gPlayerData.hammerLevel = 0;
            break;
        case ITEM_SUPER_HAMMER:
            gPlayerData.hammerLevel = 1;
            break;
        case ITEM_ULTRA_HAMMER:
            gPlayerData.hammerLevel = 2;
            break;
    }

    if (data->itemID != 0) {
        angle = DEG_TO_RAD(entity->rotation.y);
        data->itemEntityPos.x = entity->position.x + (sin_rad(angle) * 10.0f);
        data->itemEntityPos.y = entity->position.y;
        data->itemEntityPos.z = entity->position.z + (cos_rad(angle) * 10.0f);
        data->itemEntityIndex = make_item_entity_nodelay(data->itemID,
            data->itemEntityPos.x, data->itemEntityPos.y, data->itemEntityPos.z,
            ITEM_SPAWN_MODE_DECORATION, -1);
    }

    flagIndex = data->gameFlagIndex;
    if (flagIndex <= EVT_GAME_FLAG_CUTOFF) {
        flagIndex = EVT_INDEX_OF_GAME_FLAG(flagIndex);
    }
    set_global_flag(flagIndex);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel star_spirits_energy_main
/* 40C5A0 E0122000 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 40C5A4 E0122004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 40C5A8 E0122008 4485A000 */  mtc1      $a1, $f20
/* 40C5AC E012200C F7B60040 */  sdc1      $f22, 0x40($sp)
/* 40C5B0 E0122010 4486B000 */  mtc1      $a2, $f22
/* 40C5B4 E0122014 AFB00028 */  sw        $s0, 0x28($sp)
/* 40C5B8 E0122018 0080802D */  daddu     $s0, $a0, $zero
/* 40C5BC E012201C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 40C5C0 E0122020 4487C000 */  mtc1      $a3, $f24
/* 40C5C4 E0122024 27A40010 */  addiu     $a0, $sp, 0x10
/* 40C5C8 E0122028 AFB20030 */  sw        $s2, 0x30($sp)
/* 40C5CC E012202C 8FB20064 */  lw        $s2, 0x64($sp)
/* 40C5D0 E0122030 3C02E012 */  lui       $v0, %hi(star_spirits_energy_init)
/* 40C5D4 E0122034 24422174 */  addiu     $v0, $v0, %lo(star_spirits_energy_init)
/* 40C5D8 E0122038 AFA20018 */  sw        $v0, 0x18($sp)
/* 40C5DC E012203C 3C02E012 */  lui       $v0, %hi(star_spirits_energy_update)
/* 40C5E0 E0122040 2442217C */  addiu     $v0, $v0, %lo(star_spirits_energy_update)
/* 40C5E4 E0122044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 40C5E8 E0122048 3C02E012 */  lui       $v0, %hi(star_spirits_energy_render)
/* 40C5EC E012204C 244226C4 */  addiu     $v0, $v0, %lo(star_spirits_energy_render)
/* 40C5F0 E0122050 AFA20020 */  sw        $v0, 0x20($sp)
/* 40C5F4 E0122054 24020083 */  addiu     $v0, $zero, 0x83
/* 40C5F8 E0122058 AFBF0034 */  sw        $ra, 0x34($sp)
/* 40C5FC E012205C AFB1002C */  sw        $s1, 0x2C($sp)
/* 40C600 E0122060 AFA00010 */  sw        $zero, 0x10($sp)
/* 40C604 E0122064 AFA00024 */  sw        $zero, 0x24($sp)
/* 40C608 E0122068 0C080124 */  jal       shim_create_effect_instance
/* 40C60C E012206C AFA20014 */   sw       $v0, 0x14($sp)
/* 40C610 E0122070 24040078 */  addiu     $a0, $zero, 0x78
/* 40C614 E0122074 24030001 */  addiu     $v1, $zero, 0x1
/* 40C618 E0122078 0040882D */  daddu     $s1, $v0, $zero
/* 40C61C E012207C 0C08012C */  jal       shim_general_heap_malloc
/* 40C620 E0122080 AE230008 */   sw       $v1, 0x8($s1)
/* 40C624 E0122084 0040182D */  daddu     $v1, $v0, $zero
/* 40C628 E0122088 14600003 */  bnez      $v1, .LE0122098
/* 40C62C E012208C AE22000C */   sw       $v0, 0xC($s1)
.LE0122090:
/* 40C630 E0122090 08048824 */  j         .LE0122090
/* 40C634 E0122094 00000000 */   nop
.LE0122098:
/* 40C638 E0122098 3202FF00 */  andi      $v0, $s0, 0xFF00
/* 40C63C E012209C 321000FF */  andi      $s0, $s0, 0xFF
/* 40C640 E01220A0 AC620000 */  sw        $v0, 0x0($v1)
/* 40C644 E01220A4 AC700004 */  sw        $s0, 0x4($v1)
/* 40C648 E01220A8 1E400004 */  bgtz      $s2, .LE01220BC
/* 40C64C E01220AC AC600018 */   sw       $zero, 0x18($v1)
/* 40C650 E01220B0 240203E8 */  addiu     $v0, $zero, 0x3E8
/* 40C654 E01220B4 08048830 */  j         .LE01220C0
/* 40C658 E01220B8 AC620014 */   sw       $v0, 0x14($v1)
.LE01220BC:
/* 40C65C E01220BC AC720014 */  sw        $s2, 0x14($v1)
.LE01220C0:
/* 40C660 E01220C0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 40C664 E01220C4 44811000 */  mtc1      $at, $f2
/* 40C668 E01220C8 240200FF */  addiu     $v0, $zero, 0xFF
/* 40C66C E01220CC AC620028 */  sw        $v0, 0x28($v1)
/* 40C670 E01220D0 E4740008 */  swc1      $f20, 0x8($v1)
/* 40C674 E01220D4 E476000C */  swc1      $f22, 0xC($v1)
/* 40C678 E01220D8 E4780010 */  swc1      $f24, 0x10($v1)
/* 40C67C E01220DC C7A00060 */  lwc1      $f0, 0x60($sp)
/* 40C680 E01220E0 AC62001C */  sw        $v0, 0x1C($v1)
/* 40C684 E01220E4 AC620020 */  sw        $v0, 0x20($v1)
/* 40C688 E01220E8 AC620024 */  sw        $v0, 0x24($v1)
/* 40C68C E01220EC AC62002C */  sw        $v0, 0x2C($v1)
/* 40C690 E01220F0 AC620030 */  sw        $v0, 0x30($v1)
/* 40C694 E01220F4 AC620034 */  sw        $v0, 0x34($v1)
/* 40C698 E01220F8 AC620038 */  sw        $v0, 0x38($v1)
/* 40C69C E01220FC AC620050 */  sw        $v0, 0x50($v1)
/* 40C6A0 E0122100 24020003 */  addiu     $v0, $zero, 0x3
/* 40C6A4 E0122104 AC600060 */  sw        $zero, 0x60($v1)
/* 40C6A8 E0122108 AC600064 */  sw        $zero, 0x64($v1)
/* 40C6AC E012210C AC600068 */  sw        $zero, 0x68($v1)
/* 40C6B0 E0122110 AC60006C */  sw        $zero, 0x6C($v1)
/* 40C6B4 E0122114 AC600044 */  sw        $zero, 0x44($v1)
/* 40C6B8 E0122118 AC600048 */  sw        $zero, 0x48($v1)
/* 40C6BC E012211C AC60004C */  sw        $zero, 0x4C($v1)
/* 40C6C0 E0122120 AC600054 */  sw        $zero, 0x54($v1)
/* 40C6C4 E0122124 AC600058 */  sw        $zero, 0x58($v1)
/* 40C6C8 E0122128 AC60005C */  sw        $zero, 0x5C($v1)
/* 40C6CC E012212C E460003C */  swc1      $f0, 0x3C($v1)
/* 40C6D0 E0122130 16020004 */  bne       $s0, $v0, .LE0122144
/* 40C6D4 E0122134 E4620040 */   swc1     $f2, 0x40($v1)
/* 40C6D8 E0122138 24020001 */  addiu     $v0, $zero, 0x1
/* 40C6DC E012213C 08048852 */  j         .LE0122148
/* 40C6E0 E0122140 AC620070 */   sw       $v0, 0x70($v1)
.LE0122144:
/* 40C6E4 E0122144 AC600070 */  sw        $zero, 0x70($v1)
.LE0122148:
/* 40C6E8 E0122148 0220102D */  daddu     $v0, $s1, $zero
/* 40C6EC E012214C AC600074 */  sw        $zero, 0x74($v1)
/* 40C6F0 E0122150 8FBF0034 */  lw        $ra, 0x34($sp)
/* 40C6F4 E0122154 8FB20030 */  lw        $s2, 0x30($sp)
/* 40C6F8 E0122158 8FB1002C */  lw        $s1, 0x2C($sp)
/* 40C6FC E012215C 8FB00028 */  lw        $s0, 0x28($sp)
/* 40C700 E0122160 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 40C704 E0122164 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 40C708 E0122168 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 40C70C E012216C 03E00008 */  jr        $ra
/* 40C710 E0122170 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

EffectInstance* star_spirits_energy_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
    EffectBlueprint bp;
    EffectInstance* effect;
    StarSpiritsEnergyFXData* data;
    s32 numParts = 1;

    bp.init = star_spirits_energy_init;
    bp.update = star_spirits_energy_update;
    bp.renderWorld = star_spirits_energy_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_STAR_SPIRITS_ENERGY;

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

    data->unk_00 = arg0 & 0xFF00;
    arg0 &= 0xFF;
    data->unk_04 = arg0;
    data->unk_18 = 0;
    if (arg5 <= 0) {
        data->unk_14 = 1000;
    } else {
        data->unk_14 = arg5;
    }
    data->unk_28 = 255;
    data->unk_08 = arg1;
    data->unk_0C = arg2;
    data->unk_10 = arg3;
    data->unk_3C = arg4;
    data->unk_1C = 255;
    data->unk_20 = 255;
    data->unk_24 = 255;
    data->unk_2C = 255;
    data->unk_30 = 255;
    data->unk_34 = 255;
    data->unk_38 = 255;
    data->unk_60 = 0;
    data->unk_64 = 0;
    data->unk_68 = 0;
    data->unk_6C = 0;
    data->unk_40[0] = 1.0f;
    data->unk_40[1] = 0;
    data->unk_40[2] = 0;
    data->unk_40[3] = 0;
    data->unk_50[0] = 255;
    data->unk_50[1] = 0;
    data->unk_50[2] = 0;
    data->unk_50[3] = 0;
    if (arg0 == 3) {
        data->unk_70 = 1;
    } else {
        data->unk_70 = 0;
    }
    data->unk_74 = 0;

    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80248A80
/* 1692E0 80248A80 27BDFFD8 */  addiu     $sp, $sp, -0x28
.L80248A84:
/* 1692E4 80248A84 AFB3001C */  sw        $s3, 0x1C($sp)
.L80248A88:
/* 1692E8 80248A88 0080982D */  daddu     $s3, $a0, $zero
/* 1692EC 80248A8C AFB00010 */  sw        $s0, 0x10($sp)
/* 1692F0 80248A90 0000802D */  daddu     $s0, $zero, $zero
/* 1692F4 80248A94 AFB20018 */  sw        $s2, 0x18($sp)
D_80248A98:
/* 1692F8 80248A98 3C128025 */  lui       $s2, %hi(D_8024C100_C09980)
.L80248A9C:
/* 1692FC 80248A9C 2652C100 */  addiu     $s2, $s2, %lo(D_8024C100_C09980)
D_80248AA0:
/* 169300 80248AA0 AFB10014 */  sw        $s1, 0x14($sp)
glabel func_80248AA4
/* 169304 80248AA4 3C118025 */  lui       $s1, %hi(D_8024A180)
/* 169308 80248AA8 2631A180 */  addiu     $s1, $s1, %lo(D_8024A180)
/* 16930C 80248AAC AFBF0020 */  sw        $ra, 0x20($sp)
.L80248AB0:
/* 169310 80248AB0 8E240000 */  lw        $a0, 0x0($s1)
/* 169314 80248AB4 26310004 */  addiu     $s1, $s1, 0x4
/* 169318 80248AB8 0C050529 */  jal       hud_element_create
/* 16931C 80248ABC 26100001 */   addiu    $s0, $s0, 0x1
D_80248AC0:
/* 169320 80248AC0 0040202D */  daddu     $a0, $v0, $zero
/* 169324 80248AC4 24050080 */  addiu     $a1, $zero, 0x80
/* 169328 80248AC8 0C051280 */  jal       hud_element_set_flags
D_80248ACC:
/* 16932C 80248ACC AE440000 */   sw       $a0, 0x0($s2)
/* 169330 80248AD0 2A020003 */  slti      $v0, $s0, 0x3
D_80248AD4:
/* 169334 80248AD4 1440FFF6 */  bnez      $v0, .L80248AB0
.L80248AD8:
/* 169338 80248AD8 26520004 */   addiu    $s2, $s2, 0x4
/* 16933C 80248ADC 24100001 */  addiu     $s0, $zero, 0x1
/* 169340 80248AE0 3C028025 */  lui       $v0, %hi(D_8024A1B4)
D_80248AE4:
/* 169344 80248AE4 2442A1B4 */  addiu     $v0, $v0, %lo(D_8024A1B4)
.L80248AE8:
/* 169348 80248AE8 AC530010 */  sw        $s3, 0x10($v0)
/* 16934C 80248AEC 2610FFFF */  addiu     $s0, $s0, -0x1
.L80248AF0:
/* 169350 80248AF0 0601FFFD */  bgez      $s0, .L80248AE8
.L80248AF4:
/* 169354 80248AF4 2442FFDC */   addiu    $v0, $v0, -0x24
D_80248AF8:
/* 169358 80248AF8 3C048025 */  lui       $a0, %hi(D_8024A190)
.L80248AFC:
/* 16935C 80248AFC 2484A190 */  addiu     $a0, $a0, %lo(D_8024A190)
/* 169360 80248B00 0C051FCC */  jal       setup_pause_menu_tab
/* 169364 80248B04 24050002 */   addiu    $a1, $zero, 0x2
glabel func_80248B08
/* 169368 80248B08 3C048016 */  lui       $a0, %hi(gWindows)
/* 16936C 80248B0C 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
D_80248B10:
/* 169370 80248B10 94820610 */  lhu       $v0, 0x610($a0)
/* 169374 80248B14 00021400 */  sll       $v0, $v0, 16
D_80248B18:
/* 169378 80248B18 00021C03 */  sra       $v1, $v0, 16
/* 16937C 80248B1C 000217C2 */  srl       $v0, $v0, 31
/* 169380 80248B20 00621821 */  addu      $v1, $v1, $v0
D_80248B24:
/* 169384 80248B24 00032843 */  sra       $a1, $v1, 1
/* 169388 80248B28 80830603 */  lb        $v1, 0x603($a0)
/* 16938C 80248B2C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 169390 80248B30 1062000B */  beq       $v1, $v0, .L80248B60
/* 169394 80248B34 2486060C */   addiu    $a2, $a0, 0x60C
/* 169398 80248B38 00031140 */  sll       $v0, $v1, 5
/* 16939C 80248B3C 00441021 */  addu      $v0, $v0, $a0
/* 1693A0 80248B40 94420010 */  lhu       $v0, 0x10($v0)
D_80248B44:
/* 1693A4 80248B44 00021400 */  sll       $v0, $v0, 16
/* 1693A8 80248B48 00021C03 */  sra       $v1, $v0, 16
/* 1693AC 80248B4C 000217C2 */  srl       $v0, $v0, 31
D_80248B50:
/* 1693B0 80248B50 00621821 */  addu      $v1, $v1, $v0
glabel .L80248B54
/* 1693B4 80248B54 00031843 */  sra       $v1, $v1, 1
/* 1693B8 80248B58 080922DC */  j         .L80248B70
/* 1693BC 80248B5C 00651023 */   subu     $v0, $v1, $a1
.L80248B60:
/* 1693C0 80248B60 240200A0 */  addiu     $v0, $zero, 0xA0
/* 1693C4 80248B64 00451023 */  subu      $v0, $v0, $a1
/* 1693C8 80248B68 3C048016 */  lui       $a0, %hi(gWindows)
/* 1693CC 80248B6C 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
.L80248B70:
/* 1693D0 80248B70 A4C20000 */  sh        $v0, 0x0($a2)
/* 1693D4 80248B74 94820630 */  lhu       $v0, 0x630($a0)
/* 1693D8 80248B78 00021400 */  sll       $v0, $v0, 16
D_80248B7C:
/* 1693DC 80248B7C 00021C03 */  sra       $v1, $v0, 16
/* 1693E0 80248B80 000217C2 */  srl       $v0, $v0, 31
/* 1693E4 80248B84 00621821 */  addu      $v1, $v1, $v0
/* 1693E8 80248B88 00032843 */  sra       $a1, $v1, 1
/* 1693EC 80248B8C 80830623 */  lb        $v1, 0x623($a0)
.L80248B90:
/* 1693F0 80248B90 2402FFFF */  addiu     $v0, $zero, -0x1
.L80248B94:
/* 1693F4 80248B94 1062000B */  beq       $v1, $v0, .L80248BC4
.L80248B98:
/* 1693F8 80248B98 2486062C */   addiu    $a2, $a0, 0x62C
D_80248B9C:
/* 1693FC 80248B9C 00031140 */  sll       $v0, $v1, 5
D_80248BA0:
/* 169400 80248BA0 00441021 */  addu      $v0, $v0, $a0
glabel .L80248BA4
/* 169404 80248BA4 94420010 */  lhu       $v0, 0x10($v0)
D_80248BA8:
/* 169408 80248BA8 00021400 */  sll       $v0, $v0, 16
/* 16940C 80248BAC 00021C03 */  sra       $v1, $v0, 16
/* 169410 80248BB0 000217C2 */  srl       $v0, $v0, 31
/* 169414 80248BB4 00621821 */  addu      $v1, $v1, $v0
/* 169418 80248BB8 00031843 */  sra       $v1, $v1, 1
/* 16941C 80248BBC 080922F3 */  j         .L80248BCC
/* 169420 80248BC0 00651023 */   subu     $v0, $v1, $a1
.L80248BC4:
/* 169424 80248BC4 240200A0 */  addiu     $v0, $zero, 0xA0
.L80248BC8:
/* 169428 80248BC8 00451023 */  subu      $v0, $v0, $a1
.L80248BCC:
/* 16942C 80248BCC A4C20000 */  sh        $v0, 0x0($a2)
/* 169430 80248BD0 24020001 */  addiu     $v0, $zero, 0x1
D_80248BD4:
/* 169434 80248BD4 A2620000 */  sb        $v0, 0x0($s3)
D_80248BD8:
/* 169438 80248BD8 8FBF0020 */  lw        $ra, 0x20($sp)
.L80248BDC:
/* 16943C 80248BDC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 169440 80248BE0 8FB20018 */  lw        $s2, 0x18($sp)
.L80248BE4:
/* 169444 80248BE4 8FB10014 */  lw        $s1, 0x14($sp)
/* 169448 80248BE8 8FB00010 */  lw        $s0, 0x10($sp)
/* 16944C 80248BEC 03E00008 */  jr        $ra
/* 169450 80248BF0 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void filemenu_choose_name_init(MenuPanel* menu) {
    s32 i;

    for (i = 0; i < ARRAY_COUNT(filemenu_createfile_hudElemScripts); i++) {
        filemenu_createfile_hudElems[i] = hud_element_create(filemenu_createfile_hudElemScripts[i]);
        hud_element_set_flags(filemenu_createfile_hudElems[i], HUD_ELEMENT_FLAG_80);
    }

    for (i = 0; i < ARRAY_COUNT(filemenu_createfile_windowBPs); i++) {
        filemenu_createfile_windowBPs[i].tab = menu;
    }

    setup_pause_menu_tab(filemenu_createfile_windowBPs, ARRAY_COUNT(filemenu_createfile_windowBPs));

    gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].pos.x = ((gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].parent != -1)
                        ? (gWindows[gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].parent].width / 2)
                        : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].width / 2;

    gWindows[WINDOW_ID_FILEMENU_KEYBOARD].pos.x = ((gWindows[WINDOW_ID_FILEMENU_KEYBOARD].parent != -1)
                        ? (gWindows[gWindows[WINDOW_ID_FILEMENU_KEYBOARD].parent].width / 2)
                        : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_KEYBOARD].width / 2;

    menu->initialized = TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8025CEC8
/* 18B7A8 8025CEC8 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 18B7AC 8025CECC AFB10014 */  sw        $s1, 0x14($sp)
/* 18B7B0 8025CED0 0080882D */  daddu     $s1, $a0, $zero
/* 18B7B4 8025CED4 AFBF0020 */  sw        $ra, 0x20($sp)
/* 18B7B8 8025CED8 AFB3001C */  sw        $s3, 0x1C($sp)
/* 18B7BC 8025CEDC AFB20018 */  sw        $s2, 0x18($sp)
/* 18B7C0 8025CEE0 AFB00010 */  sw        $s0, 0x10($sp)
/* 18B7C4 8025CEE4 8E220000 */  lw        $v0, 0x0($s1)
/* 18B7C8 8025CEE8 30420002 */  andi      $v0, $v0, 0x2
/* 18B7CC 8025CEEC 1440004C */  bnez      $v0, .L8025D020
/* 18B7D0 8025CEF0 0000802D */   daddu    $s0, $zero, $zero
/* 18B7D4 8025CEF4 8E3200C0 */  lw        $s2, 0xC0($s1)
/* 18B7D8 8025CEF8 3C13802A */  lui       $s3, %hi(D_8029D488)
/* 18B7DC 8025CEFC 2673D488 */  addiu     $s3, $s3, %lo(D_8029D488)
/* 18B7E0 8025CF00 02501021 */  addu      $v0, $s2, $s0
.L8025CF04:
/* 18B7E4 8025CF04 804308B8 */  lb        $v1, 0x8B8($v0)
/* 18B7E8 8025CF08 2C62000C */  sltiu     $v0, $v1, 0xC
/* 18B7EC 8025CF0C 50400041 */  beql      $v0, $zero, .L8025D014
/* 18B7F0 8025CF10 26100001 */   addiu    $s0, $s0, 0x1
/* 18B7F4 8025CF14 00031080 */  sll       $v0, $v1, 2
/* 18B7F8 8025CF18 00531021 */  addu      $v0, $v0, $s3
/* 18B7FC 8025CF1C 8C420000 */  lw        $v0, 0x0($v0)
/* 18B800 8025CF20 00400008 */  jr        $v0
/* 18B804 8025CF24 00000000 */   nop
/* 18B808 8025CF28 0220202D */  daddu     $a0, $s1, $zero
/* 18B80C 8025CF2C 0C097454 */  jal       func_8025D150
/* 18B810 8025CF30 0200282D */   daddu    $a1, $s0, $zero
/* 18B814 8025CF34 08097405 */  j         .L8025D014
/* 18B818 8025CF38 26100001 */   addiu    $s0, $s0, 0x1
/* 18B81C 8025CF3C 0220202D */  daddu     $a0, $s1, $zero
/* 18B820 8025CF40 0C097458 */  jal       func_8025D160
/* 18B824 8025CF44 0200282D */   daddu    $a1, $s0, $zero
/* 18B828 8025CF48 08097405 */  j         .L8025D014
/* 18B82C 8025CF4C 26100001 */   addiu    $s0, $s0, 0x1
/* 18B830 8025CF50 0220202D */  daddu     $a0, $s1, $zero
/* 18B834 8025CF54 0C0974AC */  jal       func_8025D2B0
/* 18B838 8025CF58 0200282D */   daddu    $a1, $s0, $zero
/* 18B83C 8025CF5C 08097405 */  j         .L8025D014
/* 18B840 8025CF60 26100001 */   addiu    $s0, $s0, 0x1
/* 18B844 8025CF64 0220202D */  daddu     $a0, $s1, $zero
/* 18B848 8025CF68 0C0974F3 */  jal       func_8025D3CC
/* 18B84C 8025CF6C 0200282D */   daddu    $a1, $s0, $zero
/* 18B850 8025CF70 08097405 */  j         .L8025D014
/* 18B854 8025CF74 26100001 */   addiu    $s0, $s0, 0x1
/* 18B858 8025CF78 0220202D */  daddu     $a0, $s1, $zero
/* 18B85C 8025CF7C 0C097532 */  jal       func_8025D4C8
/* 18B860 8025CF80 0200282D */   daddu    $a1, $s0, $zero
/* 18B864 8025CF84 08097405 */  j         .L8025D014
/* 18B868 8025CF88 26100001 */   addiu    $s0, $s0, 0x1
/* 18B86C 8025CF8C 0220202D */  daddu     $a0, $s1, $zero
/* 18B870 8025CF90 0C097590 */  jal       func_8025D640
/* 18B874 8025CF94 0200282D */   daddu    $a1, $s0, $zero
/* 18B878 8025CF98 08097405 */  j         .L8025D014
/* 18B87C 8025CF9C 26100001 */   addiu    $s0, $s0, 0x1
/* 18B880 8025CFA0 0220202D */  daddu     $a0, $s1, $zero
/* 18B884 8025CFA4 0C0975C7 */  jal       func_8025D71C
/* 18B888 8025CFA8 0200282D */   daddu    $a1, $s0, $zero
/* 18B88C 8025CFAC 08097405 */  j         .L8025D014
/* 18B890 8025CFB0 26100001 */   addiu    $s0, $s0, 0x1
/* 18B894 8025CFB4 0220202D */  daddu     $a0, $s1, $zero
/* 18B898 8025CFB8 0C09760C */  jal       func_8025D830
/* 18B89C 8025CFBC 0200282D */   daddu    $a1, $s0, $zero
/* 18B8A0 8025CFC0 08097405 */  j         .L8025D014
/* 18B8A4 8025CFC4 26100001 */   addiu    $s0, $s0, 0x1
/* 18B8A8 8025CFC8 0220202D */  daddu     $a0, $s1, $zero
/* 18B8AC 8025CFCC 0C097643 */  jal       func_8025D90C
/* 18B8B0 8025CFD0 0200282D */   daddu    $a1, $s0, $zero
/* 18B8B4 8025CFD4 08097405 */  j         .L8025D014
/* 18B8B8 8025CFD8 26100001 */   addiu    $s0, $s0, 0x1
/* 18B8BC 8025CFDC 0220202D */  daddu     $a0, $s1, $zero
/* 18B8C0 8025CFE0 0C09769A */  jal       func_8025DA68
/* 18B8C4 8025CFE4 0200282D */   daddu    $a1, $s0, $zero
/* 18B8C8 8025CFE8 08097405 */  j         .L8025D014
/* 18B8CC 8025CFEC 26100001 */   addiu    $s0, $s0, 0x1
/* 18B8D0 8025CFF0 0220202D */  daddu     $a0, $s1, $zero
/* 18B8D4 8025CFF4 0C0976F4 */  jal       func_8025DBD0
/* 18B8D8 8025CFF8 0200282D */   daddu    $a1, $s0, $zero
/* 18B8DC 8025CFFC 08097405 */  j         .L8025D014
/* 18B8E0 8025D000 26100001 */   addiu    $s0, $s0, 0x1
/* 18B8E4 8025D004 0220202D */  daddu     $a0, $s1, $zero
/* 18B8E8 8025D008 0C097758 */  jal       func_8025DD60
/* 18B8EC 8025D00C 0200282D */   daddu    $a1, $s0, $zero
/* 18B8F0 8025D010 26100001 */  addiu     $s0, $s0, 0x1
.L8025D014:
/* 18B8F4 8025D014 2A020002 */  slti      $v0, $s0, 0x2
/* 18B8F8 8025D018 1440FFBA */  bnez      $v0, .L8025CF04
/* 18B8FC 8025D01C 02501021 */   addu     $v0, $s2, $s0
.L8025D020:
/* 18B900 8025D020 8FBF0020 */  lw        $ra, 0x20($sp)
/* 18B904 8025D024 8FB3001C */  lw        $s3, 0x1C($sp)
/* 18B908 8025D028 8FB20018 */  lw        $s2, 0x18($sp)
/* 18B90C 8025D02C 8FB10014 */  lw        $s1, 0x14($sp)
/* 18B910 8025D030 8FB00010 */  lw        $s0, 0x10($sp)
/* 18B914 8025D034 03E00008 */  jr        $ra
/* 18B918 8025D038 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void _add_part_decoration(ActorPart* actorPart) {
    DecorationTable* decorationTable;
    s32 i;

    if (!(actorPart->flags & 2)) {
        decorationTable = actorPart->decorationTable;
        for (i = 0; i < ARRAY_COUNT(decorationTable->type); i++) {
            switch (decorationTable->type[i]) {
                case ACTOR_DECORATION_NONE:
                    func_8025D150(actorPart, i);
                    break;
                case ACTOR_DECORATION_GOLDEN_FLAMES:
                    func_8025D160(actorPart, i);
                    break;
                case ACTOR_DECORATION_SWEAT:
                    func_8025D2B0(actorPart, i);
                    break;
                case ACTOR_DECORATION_SEEING_STARS:
                    func_8025D3CC(actorPart, i);
                    break;
                case ACTOR_DECORATION_RED_FLAMES:
                    func_8025D4C8(actorPart, i);
                    break;
                case ACTOR_DECORATION_GREY_SMOKE_TRAIL:
                    func_8025D640(actorPart, i);
                    break;
                case ACTOR_DECORATION_FIRE_SMOKE_TRAIL:
                    func_8025D71C(actorPart, i);
                    break;
                case ACTOR_DECORATION_WHIRLWIND:
                    func_8025D830(actorPart, i);
                    break;
                case ACTOR_DECORATION_STEAM_EMITTER:
                    func_8025D90C(actorPart, i);
                    break;
                case ACTOR_DECORATION_9:
                    func_8025DA68(actorPart, i);
                    break;
                case ACTOR_DECORATION_A:
                    func_8025DBD0(actorPart, i);
                    break;
                case ACTOR_DECORATION_RADIAL_STAR_EMITTER:
                    func_8025DD60(actorPart, i);
                    break;
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel spr_init_sprites
/* 1009E8 802DD8F8 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 1009EC 802DD8FC AFB10014 */  sw        $s1, 0x14($sp)
/* 1009F0 802DD900 0080882D */  daddu     $s1, $a0, $zero
/* 1009F4 802DD904 3C048035 */  lui       $a0, %hi(heap_spriteHead)
/* 1009F8 802DD908 2484F800 */  addiu     $a0, $a0, %lo(heap_spriteHead)
/* 1009FC 802DD90C AFBF0018 */  sw        $ra, 0x18($sp)
/* 100A00 802DD910 AFB00010 */  sw        $s0, 0x10($sp)
/* 100A04 802DD914 3C01802E */  lui       $at, %hi(spr_allocateBtlComponentsOnWorldHeap)
/* 100A08 802DD918 AC20F524 */  sw        $zero, %lo(spr_allocateBtlComponentsOnWorldHeap)($at)
/* 100A0C 802DD91C 0C00A40C */  jal       _heap_create
/* 100A10 802DD920 3C050004 */   lui      $a1, (0x40000 >> 16)
/* 100A14 802DD924 0C04E8DF */  jal       imgfx_init
/* 100A18 802DD928 2410000C */   addiu    $s0, $zero, 0xC
/* 100A1C 802DD92C 3C02802E */  lui       $v0, %hi(D_802DF578)
/* 100A20 802DD930 2442F578 */  addiu     $v0, $v0, %lo(D_802DF578)
.L802DD934:
/* 100A24 802DD934 AC400000 */  sw        $zero, 0x0($v0)
/* 100A28 802DD938 2610FFFF */  addiu     $s0, $s0, -0x1
/* 100A2C 802DD93C 0601FFFD */  bgez      $s0, .L802DD934
/* 100A30 802DD940 2442FFFC */   addiu    $v0, $v0, -0x4
/* 100A34 802DD944 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 100A38 802DD948 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 100A3C 802DD94C 3C01802E */  lui       $at, %hi(spr_playerMaxComponents)
/* 100A40 802DD950 AC20F580 */  sw        $zero, %lo(spr_playerMaxComponents)($at)
/* 100A44 802DD954 9042007E */  lbu       $v0, 0x7E($v0)
/* 100A48 802DD958 30420001 */  andi      $v0, $v0, 0x1
/* 100A4C 802DD95C 54400001 */  bnel      $v0, $zero, .L802DD964
/* 100A50 802DD960 24110004 */   addiu    $s1, $zero, 0x4
.L802DD964:
/* 100A54 802DD964 24100001 */  addiu     $s0, $zero, 0x1
/* 100A58 802DD968 3C03802E */  lui       $v1, %hi(spr_playerSpriteSets)
/* 100A5C 802DD96C 2463F4C4 */  addiu     $v1, $v1, %lo(spr_playerSpriteSets)
/* 100A60 802DD970 02111004 */  sllv      $v0, $s1, $s0
/* 100A64 802DD974 00511021 */  addu      $v0, $v0, $s1
/* 100A68 802DD978 00021080 */  sll       $v0, $v0, 2
/* 100A6C 802DD97C 00431021 */  addu      $v0, $v0, $v1
/* 100A70 802DD980 8C440000 */  lw        $a0, 0x0($v0)
/* 100A74 802DD984 8C450004 */  lw        $a1, 0x4($v0)
/* 100A78 802DD988 0C0B7B58 */  jal       spr_init_player_raster_cache
/* 100A7C 802DD98C 8C510008 */   lw       $s1, 0x8($v0)
/* 100A80 802DD990 02111007 */  srav      $v0, $s1, $s0
.L802DD994:
/* 100A84 802DD994 30420001 */  andi      $v0, $v0, 0x1
/* 100A88 802DD998 50400004 */  beql      $v0, $zero, .L802DD9AC
/* 100A8C 802DD99C 26100001 */   addiu    $s0, $s0, 0x1
/* 100A90 802DD9A0 0C0B7627 */  jal       spr_load_player_sprite
/* 100A94 802DD9A4 0200202D */   daddu    $a0, $s0, $zero
/* 100A98 802DD9A8 26100001 */  addiu     $s0, $s0, 0x1
.L802DD9AC:
/* 100A9C 802DD9AC 2A02000E */  slti      $v0, $s0, 0xE
/* 100AA0 802DD9B0 1440FFF8 */  bnez      $v0, .L802DD994
/* 100AA4 802DD9B4 02111007 */   srav     $v0, $s1, $s0
/* 100AA8 802DD9B8 0000802D */  daddu     $s0, $zero, $zero
/* 100AAC 802DD9BC 2404FFFF */  addiu     $a0, $zero, -0x1
/* 100AB0 802DD9C0 3C03802E */  lui       $v1, %hi(spr_playerCurrentAnimInfo)
/* 100AB4 802DD9C4 2463F588 */  addiu     $v1, $v1, %lo(spr_playerCurrentAnimInfo)
.L802DD9C8:
/* 100AB8 802DD9C8 AC600000 */  sw        $zero, 0x0($v1)
/* 100ABC 802DD9CC AC640004 */  sw        $a0, 0x4($v1)
/* 100AC0 802DD9D0 26100001 */  addiu     $s0, $s0, 0x1
/* 100AC4 802DD9D4 2A020003 */  slti      $v0, $s0, 0x3
/* 100AC8 802DD9D8 1440FFFB */  bnez      $v0, .L802DD9C8
/* 100ACC 802DD9DC 2463000C */   addiu    $v1, $v1, 0xC
/* 100AD0 802DD9E0 0000802D */  daddu     $s0, $zero, $zero
/* 100AD4 802DD9E4 3C04802E */  lui       $a0, %hi(NpcSpriteInstanceCount)
/* 100AD8 802DD9E8 2484F958 */  addiu     $a0, $a0, %lo(NpcSpriteInstanceCount)
/* 100ADC 802DD9EC 3C03802E */  lui       $v1, %hi(NpcSpriteData)
/* 100AE0 802DD9F0 2463F5B0 */  addiu     $v1, $v1, %lo(NpcSpriteData)
.L802DD9F4:
/* 100AE4 802DD9F4 AC600000 */  sw        $zero, 0x0($v1)
/* 100AE8 802DD9F8 02041021 */  addu      $v0, $s0, $a0
/* 100AEC 802DD9FC 26100001 */  addiu     $s0, $s0, 0x1
/* 100AF0 802DDA00 A0400000 */  sb        $zero, 0x0($v0)
/* 100AF4 802DDA04 2A0200EA */  slti      $v0, $s0, 0xEA
/* 100AF8 802DDA08 1440FFFA */  bnez      $v0, .L802DD9F4
/* 100AFC 802DDA0C 24630004 */   addiu    $v1, $v1, 0x4
/* 100B00 802DDA10 0000802D */  daddu     $s0, $zero, $zero
/* 100B04 802DDA14 2404FFFF */  addiu     $a0, $zero, -0x1
/* 100B08 802DDA18 3C03802E */  lui       $v1, %hi(SpriteInstances)
/* 100B0C 802DDA1C 2463FA48 */  addiu     $v1, $v1, %lo(SpriteInstances)
.L802DDA20:
/* 100B10 802DDA20 AC600000 */  sw        $zero, 0x0($v1)
/* 100B14 802DDA24 AC600004 */  sw        $zero, 0x4($v1)
/* 100B18 802DDA28 AC600008 */  sw        $zero, 0x8($v1)
/* 100B1C 802DDA2C AC64000C */  sw        $a0, 0xC($v1)
/* 100B20 802DDA30 AC600010 */  sw        $zero, 0x10($v1)
/* 100B24 802DDA34 26100001 */  addiu     $s0, $s0, 0x1
/* 100B28 802DDA38 2A020033 */  slti      $v0, $s0, 0x33
/* 100B2C 802DDA3C 1440FFF8 */  bnez      $v0, .L802DDA20
/* 100B30 802DDA40 24630014 */   addiu    $v1, $v1, 0x14
/* 100B34 802DDA44 0C0B6F50 */  jal       spr_init_quad_cache
/* 100B38 802DDA48 00000000 */   nop
/* 100B3C 802DDA4C 8FBF0018 */  lw        $ra, 0x18($sp)
/* 100B40 802DDA50 8FB10014 */  lw        $s1, 0x14($sp)
/* 100B44 802DDA54 8FB00010 */  lw        $s0, 0x10($sp)
/* 100B48 802DDA58 03E00008 */  jr        $ra
/* 100B4C 802DDA5C 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void spr_init_sprites(s32 playerSpriteSet) {
    s32 loadedFlags;
    s32 i;

    spr_allocateBtlComponentsOnWorldHeap = FALSE;
    _heap_create(&heap_spriteHead, 0x40000);
    imgfx_init();

    for (i = 0; i < ARRAY_COUNT(spr_playerSprites); i++) {
        SpriteAnimData** playerSprites = spr_playerSprites;
        playerSprites[i] = 0;
    }

    spr_playerMaxComponents = 0;

    if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) {
        playerSpriteSet = PLAYER_SPRITES_PEACH_WORLD;
    }

    loadedFlags = (&spr_playerSpriteSets[playerSpriteSet])->initiallyLoaded;
    spr_init_player_raster_cache((&spr_playerSpriteSets[playerSpriteSet])->cacheSize,
                  (&spr_playerSpriteSets[playerSpriteSet])->rasterSize);

    for (i = 1; i <= SPR_Peach3; i++) {
        if ((loadedFlags >> i) & 1) {
            spr_load_player_sprite(i);
        }
    }

    for (i = 0; i < ARRAY_COUNT(spr_playerCurrentAnimInfo); i++) {
        spr_playerCurrentAnimInfo[i].componentList = NULL;
        spr_playerCurrentAnimInfo[i].animID = -1;
    }

    for (i = 0; i < ARRAY_COUNT(NpcSpriteData); i++) {
        NpcSpriteData[i] = NULL;
        NpcSpriteInstanceCount[i] = 0;
    }

    for (i = 0; i < ARRAY_COUNT(SpriteInstances); i++) {
        SpriteInstances[i].spriteIndex = 0;
        SpriteInstances[i].componentList = NULL;
        SpriteInstances[i].spriteData = NULL;
        SpriteInstances[i].currentAnimID = -1;
        SpriteInstances[i].notifyValue = 0;
    }

    spr_init_quad_cache();
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel gather_energy_pink_main
/* 33B180 E0026000 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 33B184 E0026004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 33B188 E0026008 4485A000 */  mtc1      $a1, $f20
/* 33B18C E002600C F7B60040 */  sdc1      $f22, 0x40($sp)
/* 33B190 E0026010 4486B000 */  mtc1      $a2, $f22
/* 33B194 E0026014 AFB1002C */  sw        $s1, 0x2C($sp)
/* 33B198 E0026018 0080882D */  daddu     $s1, $a0, $zero
/* 33B19C E002601C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 33B1A0 E0026020 4487C000 */  mtc1      $a3, $f24
/* 33B1A4 E0026024 27A40010 */  addiu     $a0, $sp, 0x10
/* 33B1A8 E0026028 F7BA0050 */  sdc1      $f26, 0x50($sp)
/* 33B1AC E002602C C7BA0068 */  lwc1      $f26, 0x68($sp)
/* 33B1B0 E0026030 3C02E002 */  lui       $v0, %hi(gather_energy_pink_init)
/* 33B1B4 E0026034 24426184 */  addiu     $v0, $v0, %lo(gather_energy_pink_init)
/* 33B1B8 E0026038 AFA20018 */  sw        $v0, 0x18($sp)
/* 33B1BC E002603C 3C02E002 */  lui       $v0, %hi(gather_energy_pink_update)
/* 33B1C0 E0026040 2442618C */  addiu     $v0, $v0, %lo(gather_energy_pink_update)
/* 33B1C4 E0026044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 33B1C8 E0026048 3C02E002 */  lui       $v0, %hi(gather_energy_pink_render)
/* 33B1CC E002604C 244264B0 */  addiu     $v0, $v0, %lo(gather_energy_pink_render)
/* 33B1D0 E0026050 AFA20020 */  sw        $v0, 0x20($sp)
/* 33B1D4 E0026054 24020013 */  addiu     $v0, $zero, 0x13
/* 33B1D8 E0026058 AFBF0030 */  sw        $ra, 0x30($sp)
/* 33B1DC E002605C AFB00028 */  sw        $s0, 0x28($sp)
/* 33B1E0 E0026060 AFA00010 */  sw        $zero, 0x10($sp)
/* 33B1E4 E0026064 AFA00024 */  sw        $zero, 0x24($sp)
/* 33B1E8 E0026068 0C080124 */  jal       shim_create_effect_instance
/* 33B1EC E002606C AFA20014 */   sw       $v0, 0x14($sp)
/* 33B1F0 E0026070 24040060 */  addiu     $a0, $zero, 0x60
/* 33B1F4 E0026074 24030001 */  addiu     $v1, $zero, 0x1
/* 33B1F8 E0026078 0040802D */  daddu     $s0, $v0, $zero
/* 33B1FC E002607C 0C08012C */  jal       shim_general_heap_malloc
/* 33B200 E0026080 AE030008 */   sw       $v1, 0x8($s0)
/* 33B204 E0026084 AE02000C */  sw        $v0, 0xC($s0)
/* 33B208 E0026088 0040802D */  daddu     $s0, $v0, $zero
/* 33B20C E002608C 56000003 */  bnel      $s0, $zero, .LE002609C
/* 33B210 E0026090 AE110000 */   sw       $s1, 0x0($s0)
.LE0026094:
/* 33B214 E0026094 08009825 */  j         .LE0026094
/* 33B218 E0026098 00000000 */   nop
.LE002609C:
/* 33B21C E002609C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 33B220 E00260A0 44810000 */  mtc1      $at, $f0
/* 33B224 E00260A4 8FA2006C */  lw        $v0, 0x6C($sp)
/* 33B228 E00260A8 24040168 */  addiu     $a0, $zero, 0x168
/* 33B22C E00260AC AE00002C */  sw        $zero, 0x2C($s0)
/* 33B230 E00260B0 AE000024 */  sw        $zero, 0x24($s0)
/* 33B234 E00260B4 E6140010 */  swc1      $f20, 0x10($s0)
/* 33B238 E00260B8 E6160014 */  swc1      $f22, 0x14($s0)
/* 33B23C E00260BC E6180018 */  swc1      $f24, 0x18($s0)
/* 33B240 E00260C0 AE000044 */  sw        $zero, 0x44($s0)
/* 33B244 E00260C4 AE000040 */  sw        $zero, 0x40($s0)
/* 33B248 E00260C8 AE00004C */  sw        $zero, 0x4C($s0)
/* 33B24C E00260CC AE000048 */  sw        $zero, 0x48($s0)
/* 33B250 E00260D0 AE000034 */  sw        $zero, 0x34($s0)
/* 33B254 E00260D4 AE000030 */  sw        $zero, 0x30($s0)
/* 33B258 E00260D8 AE00003C */  sw        $zero, 0x3C($s0)
/* 33B25C E00260DC AE000038 */  sw        $zero, 0x38($s0)
/* 33B260 E00260E0 E6140004 */  swc1      $f20, 0x4($s0)
/* 33B264 E00260E4 E6160008 */  swc1      $f22, 0x8($s0)
/* 33B268 E00260E8 E618000C */  swc1      $f24, 0xC($s0)
/* 33B26C E00260EC AE020028 */  sw        $v0, 0x28($s0)
/* 33B270 E00260F0 0C080000 */  jal       effect_rand_int
/* 33B274 E00260F4 E600001C */   swc1     $f0, 0x1C($s0)
/* 33B278 E00260F8 44820000 */  mtc1      $v0, $f0
/* 33B27C E00260FC 00000000 */  nop
/* 33B280 E0026100 46800020 */  cvt.s.w   $f0, $f0
/* 33B284 E0026104 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 33B288 E0026108 44811000 */  mtc1      $at, $f2
/* 33B28C E002610C 24020001 */  addiu     $v0, $zero, 0x1
/* 33B290 E0026110 E6000058 */  swc1      $f0, 0x58($s0)
/* 33B294 E0026114 AE000050 */  sw        $zero, 0x50($s0)
/* 33B298 E0026118 AE000054 */  sw        $zero, 0x54($s0)
/* 33B29C E002611C 16220005 */  bne       $s1, $v0, .LE0026134
/* 33B2A0 E0026120 E602005C */   swc1     $f2, 0x5C($s0)
/* 33B2A4 E0026124 24020060 */  addiu     $v0, $zero, 0x60
/* 33B2A8 E0026128 AE02003C */  sw        $v0, 0x3C($s0)
/* 33B2AC E002612C 08009858 */  j         .LE0026160
/* 33B2B0 E0026130 E61A0020 */   swc1     $f26, 0x20($s0)
.LE0026134:
/* 33B2B4 E0026134 3C01E002 */  lui       $at, (0xE0026A20 >> 16)
/* 33B2B8 E0026138 D4226A20 */  ldc1      $f2, (0xE0026A20 & 0xFFFF)($at)
/* 33B2BC E002613C 4600D021 */  cvt.d.s   $f0, $f26
/* 33B2C0 E0026140 46220002 */  mul.d     $f0, $f0, $f2
/* 33B2C4 E0026144 00000000 */  nop
/* 33B2C8 E0026148 2402FFFE */  addiu     $v0, $zero, -0x2
/* 33B2CC E002614C AE020044 */  sw        $v0, 0x44($s0)
/* 33B2D0 E0026150 2402FFFC */  addiu     $v0, $zero, -0x4
/* 33B2D4 E0026154 AE02004C */  sw        $v0, 0x4C($s0)
/* 33B2D8 E0026158 46200020 */  cvt.s.d   $f0, $f0
/* 33B2DC E002615C E6000020 */  swc1      $f0, 0x20($s0)
.LE0026160:
/* 33B2E0 E0026160 8FBF0030 */  lw        $ra, 0x30($sp)
/* 33B2E4 E0026164 8FB1002C */  lw        $s1, 0x2C($sp)
/* 33B2E8 E0026168 8FB00028 */  lw        $s0, 0x28($sp)
/* 33B2EC E002616C D7BA0050 */  ldc1      $f26, 0x50($sp)
/* 33B2F0 E0026170 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 33B2F4 E0026174 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 33B2F8 E0026178 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 33B2FC E002617C 03E00008 */  jr        $ra
/* 33B300 E0026180 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

void gather_energy_pink_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 scale, s32 duration) {
    EffectBlueprint bp;
    EffectInstance* effect;
    GatherEnergyPinkFXData* data;
    s32 numParts = 1;

    bp.unk_00 = 0;
    bp.init = gather_energy_pink_init;
    bp.update = gather_energy_pink_update;
    bp.renderWorld = gather_energy_pink_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_GATHER_ENERGY_PINK;

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

    data->unk_00 = type;
    data->unk_28 = duration;
    data->unk_2C = 0;
    data->unk_24 = 0;
    data->posB.x = posX;
    data->posB.y = posY;
    data->posB.z = posZ;
    data->unk_44 = 0;
    data->unk_40 = 0;
    data->unk_4C = 0;
    data->unk_48 = 0;
    data->unk_34 = 0;
    data->unk_30 = 0;
    data->unk_3C = 0;
    data->unk_38 = 0;
    data->posA.x = posX;
    data->posA.y = posY;
    data->posA.z = posZ;

    data->unk_1C = 10.0f;

    data->unk_58 = effect_rand_int(360);
    data->unk_5C = 4.0f;

    data->unk_50 = 0;
    data->unk_54 = 0;

    if (type == 1) {
        data->unk_3C = 96;
        data->unk_20 = scale;
    } else {
        data->unk_44 = -2;
        data->unk_4C = -4;
        data->unk_20 = scale * 0.2;
    }
    return;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel osContInit
/* 3CF80 80061B80 3C028009 */  lui       $v0, %hi(D_80093DB0)
/* 3CF84 80061B84 8C423DB0 */  lw        $v0, %lo(D_80093DB0)($v0)
/* 3CF88 80061B88 27BDFF80 */  addiu     $sp, $sp, -0x80
/* 3CF8C 80061B8C AFB40070 */  sw        $s4, 0x70($sp)
/* 3CF90 80061B90 0080A021 */  addu      $s4, $a0, $zero
/* 3CF94 80061B94 AFB50074 */  sw        $s5, 0x74($sp)
/* 3CF98 80061B98 00A0A821 */  addu      $s5, $a1, $zero
/* 3CF9C 80061B9C AFB60078 */  sw        $s6, 0x78($sp)
/* 3CFA0 80061BA0 00C0B021 */  addu      $s6, $a2, $zero
/* 3CFA4 80061BA4 AFBF007C */  sw        $ra, 0x7C($sp)
/* 3CFA8 80061BA8 AFB3006C */  sw        $s3, 0x6C($sp)
/* 3CFAC 80061BAC AFB20068 */  sw        $s2, 0x68($sp)
/* 3CFB0 80061BB0 AFB10064 */  sw        $s1, 0x64($sp)
/* 3CFB4 80061BB4 10400003 */  beqz      $v0, .L80061BC4
/* 3CFB8 80061BB8 AFB00060 */   sw       $s0, 0x60($sp)
/* 3CFBC 80061BBC 0801873D */  j         .L80061CF4
/* 3CFC0 80061BC0 00001021 */   addu     $v0, $zero, $zero
.L80061BC4:
/* 3CFC4 80061BC4 24020001 */  addiu     $v0, $zero, 0x1
/* 3CFC8 80061BC8 3C018009 */  lui       $at, %hi(D_80093DB0)
/* 3CFCC 80061BCC 0C0198A8 */  jal       osGetTime
/* 3CFD0 80061BD0 AC223DB0 */   sw       $v0, %lo(D_80093DB0)($at)
/* 3CFD4 80061BD4 00409021 */  addu      $s2, $v0, $zero
/* 3CFD8 80061BD8 00609821 */  addu      $s3, $v1, $zero
/* 3CFDC 80061BDC 56400022 */  bnel      $s2, $zero, .L80061C68
/* 3CFE0 80061BE0 24020004 */   addiu    $v0, $zero, 0x4
/* 3CFE4 80061BE4 16400007 */  bnez      $s2, .L80061C04
/* 3CFE8 80061BE8 27B10040 */   addiu    $s1, $sp, 0x40
/* 3CFEC 80061BEC 3C020165 */  lui       $v0, (0x165A0BB >> 16)
/* 3CFF0 80061BF0 3442A0BB */  ori       $v0, $v0, (0x165A0BB & 0xFFFF)
/* 3CFF4 80061BF4 0053102B */  sltu      $v0, $v0, $s3
/* 3CFF8 80061BF8 1440001B */  bnez      $v0, .L80061C68
/* 3CFFC 80061BFC 24020004 */   addiu    $v0, $zero, 0x4
/* 3D000 80061C00 27B10040 */  addiu     $s1, $sp, 0x40
.L80061C04:
/* 3D004 80061C04 02202021 */  addu      $a0, $s1, $zero
/* 3D008 80061C08 27B00058 */  addiu     $s0, $sp, 0x58
/* 3D00C 80061C0C 02002821 */  addu      $a1, $s0, $zero
/* 3D010 80061C10 0C019560 */  jal       osCreateMesgQueue
/* 3D014 80061C14 24060001 */   addiu    $a2, $zero, 0x1
/* 3D018 80061C18 00004021 */  addu      $t0, $zero, $zero
/* 3D01C 80061C1C 00004821 */  addu      $t1, $zero, $zero
/* 3D020 80061C20 27A40020 */  addiu     $a0, $sp, 0x20
/* 3D024 80061C24 24060000 */  addiu     $a2, $zero, 0x0
/* 3D028 80061C28 3C070165 */  lui       $a3, (0x165A0BC >> 16)
/* 3D02C 80061C2C 34E7A0BC */  ori       $a3, $a3, (0x165A0BC & 0xFFFF)
/* 3D030 80061C30 00F3102B */  sltu      $v0, $a3, $s3
/* 3D034 80061C34 00F33823 */  subu      $a3, $a3, $s3
/* 3D038 80061C38 00D23023 */  subu      $a2, $a2, $s2
/* 3D03C 80061C3C 00C23023 */  subu      $a2, $a2, $v0
/* 3D040 80061C40 AFA80010 */  sw        $t0, 0x10($sp)
/* 3D044 80061C44 AFA90014 */  sw        $t1, 0x14($sp)
/* 3D048 80061C48 AFB10018 */  sw        $s1, 0x18($sp)
/* 3D04C 80061C4C 0C0198D4 */  jal       osSetTimer
/* 3D050 80061C50 AFB0001C */   sw       $s0, 0x1C($sp)
/* 3D054 80061C54 02202021 */  addu      $a0, $s1, $zero
/* 3D058 80061C58 02002821 */  addu      $a1, $s0, $zero
/* 3D05C 80061C5C 0C0195BC */  jal       osRecvMesg
/* 3D060 80061C60 24060001 */   addiu    $a2, $zero, 0x1
/* 3D064 80061C64 24020004 */  addiu     $v0, $zero, 0x4
.L80061C68:
/* 3D068 80061C68 3C01800A */  lui       $at, %hi(__osMaxControllers)
/* 3D06C 80061C6C A022A606 */  sb        $v0, %lo(__osMaxControllers)($at)
/* 3D070 80061C70 0C018774 */  jal       osPackRequestData
/* 3D074 80061C74 00002021 */   addu     $a0, $zero, $zero
/* 3D078 80061C78 24040001 */  addiu     $a0, $zero, 0x1
/* 3D07C 80061C7C 3C11800B */  lui       $s1, %hi(__osContPifRam)
/* 3D080 80061C80 26310ED0 */  addiu     $s1, $s1, %lo(__osContPifRam)
/* 3D084 80061C84 0C019730 */  jal       __osSiRawStartDma
/* 3D088 80061C88 02202821 */   addu     $a1, $s1, $zero
/* 3D08C 80061C8C 02802021 */  addu      $a0, $s4, $zero
/* 3D090 80061C90 27B00058 */  addiu     $s0, $sp, 0x58
/* 3D094 80061C94 02002821 */  addu      $a1, $s0, $zero
/* 3D098 80061C98 0C0195BC */  jal       osRecvMesg
/* 3D09C 80061C9C 24060001 */   addiu    $a2, $zero, 0x1
/* 3D0A0 80061CA0 00002021 */  addu      $a0, $zero, $zero
/* 3D0A4 80061CA4 0C019730 */  jal       __osSiRawStartDma
/* 3D0A8 80061CA8 02202821 */   addu     $a1, $s1, $zero
/* 3D0AC 80061CAC 02802021 */  addu      $a0, $s4, $zero
/* 3D0B0 80061CB0 02002821 */  addu      $a1, $s0, $zero
/* 3D0B4 80061CB4 24060001 */  addiu     $a2, $zero, 0x1
/* 3D0B8 80061CB8 0C0195BC */  jal       osRecvMesg
/* 3D0BC 80061CBC 00408021 */   addu     $s0, $v0, $zero
/* 3D0C0 80061CC0 02A02021 */  addu      $a0, $s5, $zero
/* 3D0C4 80061CC4 0C018747 */  jal       osContGetInitData
/* 3D0C8 80061CC8 02C02821 */   addu     $a1, $s6, $zero
/* 3D0CC 80061CCC 3C01800A */  lui       $at, %hi(__osContLastCmd)
/* 3D0D0 80061CD0 0C01975C */  jal       __osSiCreateAccessQueue
/* 3D0D4 80061CD4 A020A61C */   sb       $zero, %lo(__osContLastCmd)($at)
/* 3D0D8 80061CD8 3C04800E */  lui       $a0, %hi(D_800DAAC0)
/* 3D0DC 80061CDC 2484AAC0 */  addiu     $a0, $a0, %lo(D_800DAAC0)
/* 3D0E0 80061CE0 3C05800A */  lui       $a1, %hi(D_8009A620)
/* 3D0E4 80061CE4 24A5A620 */  addiu     $a1, $a1, %lo(D_8009A620)
/* 3D0E8 80061CE8 0C019560 */  jal       osCreateMesgQueue
/* 3D0EC 80061CEC 24060001 */   addiu    $a2, $zero, 0x1
/* 3D0F0 80061CF0 02001021 */  addu      $v0, $s0, $zero
.L80061CF4:
/* 3D0F4 80061CF4 8FBF007C */  lw        $ra, 0x7C($sp)
/* 3D0F8 80061CF8 8FB60078 */  lw        $s6, 0x78($sp)
/* 3D0FC 80061CFC 8FB50074 */  lw        $s5, 0x74($sp)
/* 3D100 80061D00 8FB40070 */  lw        $s4, 0x70($sp)
/* 3D104 80061D04 8FB3006C */  lw        $s3, 0x6C($sp)
/* 3D108 80061D08 8FB20068 */  lw        $s2, 0x68($sp)
/* 3D10C 80061D0C 8FB10064 */  lw        $s1, 0x64($sp)
/* 3D110 80061D10 8FB00060 */  lw        $s0, 0x60($sp)
/* 3D114 80061D14 03E00008 */  jr        $ra
/* 3D118 80061D18 27BD0080 */   addiu    $sp, $sp, 0x80

### DECOMPILED C INSTRUCTIONS:

s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* data) {
    OSMesg dummy;
    s32 ret = 0;
    OSTime t;
    OSTimer mytimer;
    OSMesgQueue timerMesgQueue;

    if (__osContinitialized != 0) {
        return 0;
    }

    __osContinitialized = 1;

    t = osGetTime();
    if (t < OS_USEC_TO_CYCLES(500000)) {
        osCreateMesgQueue(&timerMesgQueue, &dummy, 1);
        osSetTimer(&mytimer, OS_USEC_TO_CYCLES(500000) - t, 0, &timerMesgQueue, &dummy);
        osRecvMesg(&timerMesgQueue, &dummy, OS_MESG_BLOCK);
    }

    __osMaxControllers = 4;

    __osPackRequestData(CONT_CMD_REQUEST_STATUS);

    ret = __osSiRawStartDma(OS_WRITE, __osContPifRam.ramarray);
    osRecvMesg(mq, &dummy, OS_MESG_BLOCK);

    ret = __osSiRawStartDma(OS_READ, __osContPifRam.ramarray);
    osRecvMesg(mq, &dummy, OS_MESG_BLOCK);

    __osContGetInitData(bitpattern, data);
    __osContLastCmd = CONT_CMD_REQUEST_STATUS;
    __osSiCreateAccessQueue();
    osCreateMesgQueue(&__osEepromTimerQ, &__osEepromTimerMsg, 1);

    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ice_pillar_main
/* 409990 E011E000 27BDFF88 */  addiu     $sp, $sp, -0x78
/* 409994 E011E004 F7B60060 */  sdc1      $f22, 0x60($sp)
/* 409998 E011E008 4485B000 */  mtc1      $a1, $f22
/* 40999C E011E00C F7BA0070 */  sdc1      $f26, 0x70($sp)
/* 4099A0 E011E010 4486D000 */  mtc1      $a2, $f26
/* 4099A4 E011E014 F7B80068 */  sdc1      $f24, 0x68($sp)
/* 4099A8 E011E018 4487C000 */  mtc1      $a3, $f24
/* 4099AC E011E01C AFB3004C */  sw        $s3, 0x4C($sp)
/* 4099B0 E011E020 0080982D */  daddu     $s3, $a0, $zero
/* 4099B4 E011E024 F7B40058 */  sdc1      $f20, 0x58($sp)
/* 4099B8 E011E028 C7B40088 */  lwc1      $f20, 0x88($sp)
/* 4099BC E011E02C 27A40028 */  addiu     $a0, $sp, 0x28
/* 4099C0 E011E030 AFB20048 */  sw        $s2, 0x48($sp)
/* 4099C4 E011E034 8FB2008C */  lw        $s2, 0x8C($sp)
/* 4099C8 E011E038 3C02E012 */  lui       $v0, %hi(ice_pillar_init)
/* 4099CC E011E03C 2442E18C */  addiu     $v0, $v0, %lo(ice_pillar_init)
/* 4099D0 E011E040 AFA20030 */  sw        $v0, 0x30($sp)
/* 4099D4 E011E044 3C02E012 */  lui       $v0, %hi(ice_pillar_update)
/* 4099D8 E011E048 2442E194 */  addiu     $v0, $v0, %lo(ice_pillar_update)
/* 4099DC E011E04C AFA20034 */  sw        $v0, 0x34($sp)
/* 4099E0 E011E050 3C02E012 */  lui       $v0, %hi(ice_pillar_render)
/* 4099E4 E011E054 2442E530 */  addiu     $v0, $v0, %lo(ice_pillar_render)
/* 4099E8 E011E058 AFA20038 */  sw        $v0, 0x38($sp)
/* 4099EC E011E05C 24020081 */  addiu     $v0, $zero, 0x81
/* 4099F0 E011E060 AFBF0050 */  sw        $ra, 0x50($sp)
/* 4099F4 E011E064 AFB10044 */  sw        $s1, 0x44($sp)
/* 4099F8 E011E068 AFB00040 */  sw        $s0, 0x40($sp)
/* 4099FC E011E06C AFA00028 */  sw        $zero, 0x28($sp)
/* 409A00 E011E070 AFA0003C */  sw        $zero, 0x3C($sp)
/* 409A04 E011E074 0C080124 */  jal       shim_create_effect_instance
/* 409A08 E011E078 AFA2002C */   sw       $v0, 0x2C($sp)
/* 409A0C E011E07C 2404002C */  addiu     $a0, $zero, 0x2C
/* 409A10 E011E080 24030001 */  addiu     $v1, $zero, 0x1
/* 409A14 E011E084 0040882D */  daddu     $s1, $v0, $zero
/* 409A18 E011E088 0C08012C */  jal       shim_general_heap_malloc
/* 409A1C E011E08C AE230008 */   sw       $v1, 0x8($s1)
/* 409A20 E011E090 0040802D */  daddu     $s0, $v0, $zero
/* 409A24 E011E094 16000003 */  bnez      $s0, .LE011E0A4
/* 409A28 E011E098 AE22000C */   sw       $v0, 0xC($s1)
.LE011E09C:
/* 409A2C E011E09C 08047827 */  j         .LE011E09C
/* 409A30 E011E0A0 00000000 */   nop
.LE011E0A4:
/* 409A34 E011E0A4 AE130000 */  sw        $s3, 0x0($s0)
/* 409A38 E011E0A8 1E400004 */  bgtz      $s2, .LE011E0BC
/* 409A3C E011E0AC AE000014 */   sw       $zero, 0x14($s0)
/* 409A40 E011E0B0 240203E8 */  addiu     $v0, $zero, 0x3E8
/* 409A44 E011E0B4 08047830 */  j         .LE011E0C0
/* 409A48 E011E0B8 AE020010 */   sw       $v0, 0x10($s0)
.LE011E0BC:
/* 409A4C E011E0BC AE120010 */  sw        $s2, 0x10($s0)
.LE011E0C0:
/* 409A50 E011E0C0 24040072 */  addiu     $a0, $zero, 0x72
/* 409A54 E011E0C4 240300FF */  addiu     $v1, $zero, 0xFF
/* 409A58 E011E0C8 240200F0 */  addiu     $v0, $zero, 0xF0
/* 409A5C E011E0CC A203001B */  sb        $v1, 0x1B($s0)
/* 409A60 E011E0D0 E6160004 */  swc1      $f22, 0x4($s0)
/* 409A64 E011E0D4 E61A0008 */  swc1      $f26, 0x8($s0)
/* 409A68 E011E0D8 E618000C */  swc1      $f24, 0xC($s0)
/* 409A6C E011E0DC E6140020 */  swc1      $f20, 0x20($s0)
/* 409A70 E011E0E0 A2030018 */  sb        $v1, 0x18($s0)
/* 409A74 E011E0E4 A2030019 */  sb        $v1, 0x19($s0)
/* 409A78 E011E0E8 A203001A */  sb        $v1, 0x1A($s0)
/* 409A7C E011E0EC A202001C */  sb        $v0, 0x1C($s0)
/* 409A80 E011E0F0 A203001D */  sb        $v1, 0x1D($s0)
/* 409A84 E011E0F4 A203001E */  sb        $v1, 0x1E($s0)
/* 409A88 E011E0F8 A203001F */  sb        $v1, 0x1F($s0)
/* 409A8C E011E0FC A2000025 */  sb        $zero, 0x25($s0)
/* 409A90 E011E100 0C080150 */  jal       shim_load_effect
/* 409A94 E011E104 A2000024 */   sb       $zero, 0x24($s0)
/* 409A98 E011E108 24040001 */  addiu     $a0, $zero, 0x1
/* 409A9C E011E10C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 409AA0 E011E110 44810000 */  mtc1      $at, $f0
/* 409AA4 E011E114 3C014200 */  lui       $at, (0x42000000 >> 16)
/* 409AA8 E011E118 44811000 */  mtc1      $at, $f2
/* 409AAC E011E11C 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 409AB0 E011E120 44812000 */  mtc1      $at, $f4
/* 409AB4 E011E124 4600D680 */  add.s     $f26, $f26, $f0
/* 409AB8 E011E128 4405B000 */  mfc1      $a1, $f22
/* 409ABC E011E12C 4407C000 */  mfc1      $a3, $f24
/* 409AC0 E011E130 4406D000 */  mfc1      $a2, $f26
/* 409AC4 E011E134 24020004 */  addiu     $v0, $zero, 0x4
/* 409AC8 E011E138 E7B40018 */  swc1      $f20, 0x18($sp)
/* 409ACC E011E13C AFA2001C */  sw        $v0, 0x1C($sp)
/* 409AD0 E011E140 AFA00020 */  sw        $zero, 0x20($sp)
/* 409AD4 E011E144 E7A20010 */  swc1      $f2, 0x10($sp)
/* 409AD8 E011E148 0C039000 */  jal       misc_particles_main
/* 409ADC E011E14C E7A40014 */   swc1     $f4, 0x14($sp)
/* 409AE0 E011E150 2404006F */  addiu     $a0, $zero, 0x6F
/* 409AE4 E011E154 0C080150 */  jal       shim_load_effect
/* 409AE8 E011E158 AE020028 */   sw       $v0, 0x28($s0)
/* 409AEC E011E15C 0220102D */  daddu     $v0, $s1, $zero
/* 409AF0 E011E160 8FBF0050 */  lw        $ra, 0x50($sp)
/* 409AF4 E011E164 8FB3004C */  lw        $s3, 0x4C($sp)
/* 409AF8 E011E168 8FB20048 */  lw        $s2, 0x48($sp)
/* 409AFC E011E16C 8FB10044 */  lw        $s1, 0x44($sp)
/* 409B00 E011E170 8FB00040 */  lw        $s0, 0x40($sp)
/* 409B04 E011E174 D7BA0070 */  ldc1      $f26, 0x70($sp)
/* 409B08 E011E178 D7B80068 */  ldc1      $f24, 0x68($sp)
/* 409B0C E011E17C D7B60060 */  ldc1      $f22, 0x60($sp)
/* 409B10 E011E180 D7B40058 */  ldc1      $f20, 0x58($sp)
/* 409B14 E011E184 03E00008 */  jr        $ra
/* 409B18 E011E188 27BD0078 */   addiu    $sp, $sp, 0x78

### DECOMPILED C INSTRUCTIONS:

EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 arg5) {
    EffectBlueprint effectBp;
    EffectInstance* effect;
    IcePillarFXData* data;
    s32 numParts = 1;

    effectBp.init = ice_pillar_init;
    effectBp.update = ice_pillar_update;
    effectBp.renderWorld = ice_pillar_render;
    effectBp.unk_00 = 0;
    effectBp.renderUI = NULL;
    effectBp.effectID = EFFECT_ICE_PILLAR;

    effect = shim_create_effect_instance(&effectBp);
    effect->numParts = numParts;

    data = effect->data.icePillar = shim_general_heap_malloc(numParts * sizeof(*data));
    ASSERT(data != NULL);

    data->unk_00 = arg0;
    data->lifeTime = 0;
    if (arg5 <= 0) {
        data->timeLeft = 1000;
    } else {
        data->timeLeft = arg5;
    }

    data->prim.a = 255;
    data->pos.x = x;
    data->pos.y = y;
    data->pos.z = z;
    data->scale = scale;
    data->prim.r = 255;
    data->prim.g = 255;
    data->prim.b = 255;
    data->env.r = 240;
    data->env.g = 255;
    data->env.b = 255;
    data->env.a = 255;
    data->unk_24 = data->unk_25 = 0;

    shim_load_effect(EFFECT_MISC_PARTICLES);
    data->miscParticles = misc_particles_main(1, x, y + 10.0f, z, 32.0f, 30.0f, scale, 4, 0);

    shim_load_effect(EFFECT_COLD_BREATH);
    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel try_inflict_status
/* 195458 80266B78 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 19545C 80266B7C AFB20018 */  sw        $s2, 0x18($sp)
/* 195460 80266B80 0080902D */  daddu     $s2, $a0, $zero
/* 195464 80266B84 AFB40020 */  sw        $s4, 0x20($sp)
/* 195468 80266B88 00A0A02D */  daddu     $s4, $a1, $zero
/* 19546C 80266B8C AFB50024 */  sw        $s5, 0x24($sp)
/* 195470 80266B90 AFB3001C */  sw        $s3, 0x1C($sp)
/* 195474 80266B94 3C13800E */  lui       $s3, %hi(gBattleStatus)
/* 195478 80266B98 2673C070 */  addiu     $s3, $s3, %lo(gBattleStatus)
/* 19547C 80266B9C AFBF0028 */  sw        $ra, 0x28($sp)
/* 195480 80266BA0 AFB10014 */  sw        $s1, 0x14($sp)
/* 195484 80266BA4 AFB00010 */  sw        $s0, 0x10($sp)
/* 195488 80266BA8 92630194 */  lbu       $v1, 0x194($s3)
/* 19548C 80266BAC 240200FE */  addiu     $v0, $zero, 0xFE
/* 195490 80266BB0 1462000C */  bne       $v1, $v0, .L80266BE4
/* 195494 80266BB4 00C0A82D */   daddu    $s5, $a2, $zero
/* 195498 80266BB8 8E44020C */  lw        $a0, 0x20C($s2)
/* 19549C 80266BBC 82710195 */  lb        $s1, 0x195($s3)
/* 1954A0 80266BC0 0C0997BB */  jal       lookup_status_duration_mod
/* 1954A4 80266BC4 02A0282D */   daddu    $a1, $s5, $zero
/* 1954A8 80266BC8 0240202D */  daddu     $a0, $s2, $zero
/* 1954AC 80266BCC 0280282D */  daddu     $a1, $s4, $zero
/* 1954B0 80266BD0 02A0302D */  daddu     $a2, $s5, $zero
/* 1954B4 80266BD4 0C099B3C */  jal       inflict_status_set_duration
/* 1954B8 80266BD8 02223821 */   addu     $a3, $s1, $v0
/* 1954BC 80266BDC 08099B33 */  j         .L80266CCC
/* 1954C0 80266BE0 00000000 */   nop
.L80266BE4:
/* 1954C4 80266BE4 8E44020C */  lw        $a0, 0x20C($s2)
/* 1954C8 80266BE8 10800026 */  beqz      $a0, .L80266C84
/* 1954CC 80266BEC 0000882D */   daddu    $s1, $zero, $zero
/* 1954D0 80266BF0 8E620190 */  lw        $v0, 0x190($s3)
/* 1954D4 80266BF4 3C034000 */  lui       $v1, (0x40000000 >> 16)
/* 1954D8 80266BF8 00431024 */  and       $v0, $v0, $v1
/* 1954DC 80266BFC 14400005 */  bnez      $v0, .L80266C14
/* 1954E0 80266C00 00000000 */   nop
/* 1954E4 80266C04 0C0997A6 */  jal       lookup_status_chance
/* 1954E8 80266C08 0280282D */   daddu    $a1, $s4, $zero
/* 1954EC 80266C0C 08099B09 */  j         .L80266C24
/* 1954F0 80266C10 0040802D */   daddu    $s0, $v0, $zero
.L80266C14:
/* 1954F4 80266C14 0C0997A6 */  jal       lookup_status_chance
/* 1954F8 80266C18 0280282D */   daddu    $a1, $s4, $zero
/* 1954FC 80266C1C 1040001A */  beqz      $v0, .L80266C88
/* 195500 80266C20 24100064 */   addiu    $s0, $zero, 0x64
.L80266C24:
/* 195504 80266C24 1A000018 */  blez      $s0, .L80266C88
/* 195508 80266C28 3C0351EB */   lui      $v1, (0x51EB851F >> 16)
/* 19550C 80266C2C 92620194 */  lbu       $v0, 0x194($s3)
/* 195510 80266C30 02020018 */  mult      $s0, $v0
/* 195514 80266C34 00001012 */  mflo      $v0
/* 195518 80266C38 3463851F */  ori       $v1, $v1, (0x51EB851F & 0xFFFF)
/* 19551C 80266C3C 00000000 */  nop
/* 195520 80266C40 00430018 */  mult      $v0, $v1
/* 195524 80266C44 000217C3 */  sra       $v0, $v0, 31
/* 195528 80266C48 00001810 */  mfhi      $v1
/* 19552C 80266C4C 00031943 */  sra       $v1, $v1, 5
/* 195530 80266C50 00628023 */  subu      $s0, $v1, $v0
/* 195534 80266C54 1A00000C */  blez      $s0, .L80266C88
/* 195538 80266C58 00000000 */   nop
/* 19553C 80266C5C 0C00A67F */  jal       rand_int
/* 195540 80266C60 24040064 */   addiu    $a0, $zero, 0x64
/* 195544 80266C64 0202102A */  slt       $v0, $s0, $v0
/* 195548 80266C68 14400007 */  bnez      $v0, .L80266C88
/* 19554C 80266C6C 00000000 */   nop
/* 195550 80266C70 8E44020C */  lw        $a0, 0x20C($s2)
/* 195554 80266C74 0C0997BB */  jal       lookup_status_duration_mod
/* 195558 80266C78 02A0282D */   daddu    $a1, $s5, $zero
/* 19555C 80266C7C 08099B22 */  j         .L80266C88
/* 195560 80266C80 24510003 */   addiu    $s1, $v0, 0x3
.L80266C84:
/* 195564 80266C84 24110003 */  addiu     $s1, $zero, 0x3
.L80266C88:
/* 195568 80266C88 5A20000F */  blezl     $s1, .L80266CC8
/* 19556C 80266C8C 0000882D */   daddu    $s1, $zero, $zero
/* 195570 80266C90 8E620190 */  lw        $v0, 0x190($s3)
/* 195574 80266C94 04410007 */  bgez      $v0, .L80266CB4
/* 195578 80266C98 0240202D */   daddu    $a0, $s2, $zero
/* 19557C 80266C9C 8E44020C */  lw        $a0, 0x20C($s2)
/* 195580 80266CA0 82710195 */  lb        $s1, 0x195($s3)
/* 195584 80266CA4 0C0997BB */  jal       lookup_status_duration_mod
/* 195588 80266CA8 02A0282D */   daddu    $a1, $s5, $zero
/* 19558C 80266CAC 02228821 */  addu      $s1, $s1, $v0
/* 195590 80266CB0 0240202D */  daddu     $a0, $s2, $zero
.L80266CB4:
/* 195594 80266CB4 0280282D */  daddu     $a1, $s4, $zero
/* 195598 80266CB8 0C0997D0 */  jal       inflict_status
/* 19559C 80266CBC 0220302D */   daddu    $a2, $s1, $zero
/* 1955A0 80266CC0 08099B33 */  j         .L80266CCC
/* 1955A4 80266CC4 0220102D */   daddu    $v0, $s1, $zero
.L80266CC8:
/* 1955A8 80266CC8 0220102D */  daddu     $v0, $s1, $zero
.L80266CCC:
/* 1955AC 80266CCC 8FBF0028 */  lw        $ra, 0x28($sp)
/* 1955B0 80266CD0 8FB50024 */  lw        $s5, 0x24($sp)
/* 1955B4 80266CD4 8FB40020 */  lw        $s4, 0x20($sp)
/* 1955B8 80266CD8 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1955BC 80266CDC 8FB20018 */  lw        $s2, 0x18($sp)
/* 1955C0 80266CE0 8FB10014 */  lw        $s1, 0x14($sp)
/* 1955C4 80266CE4 8FB00010 */  lw        $s0, 0x10($sp)
/* 1955C8 80266CE8 03E00008 */  jr        $ra
/* 1955CC 80266CEC 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

s32 try_inflict_status(Actor* actor, s32 statusTypeKey, s32 statusKey) {
    BattleStatus* battleStatus = &gBattleStatus;
    s32 chance;
    s32 duration;

    if (battleStatus->statusChance == STATUS_KEY_IGNORE_RES) {
        duration = battleStatus->statusDuration;
        duration += lookup_status_duration_mod(actor->statusTable, statusKey);
        return inflict_status_set_duration(actor, statusTypeKey, statusKey, duration);
    }

    duration = 0;

    if (actor->statusTable != NULL) {
        if (!(battleStatus->currentAttackStatus & STATUS_FLAG_RIGHT_ON)) {
            chance = lookup_status_chance(actor->statusTable, statusTypeKey);
        } else {
            if (lookup_status_chance(actor->statusTable, statusTypeKey) != 0) {
                chance = 100;
            } else {
                goto meow;
            }
        }

        if (chance > 0) {
            chance = (chance * battleStatus->statusChance) / 100;
            if (chance > 0 && chance >= rand_int(100)) {
                duration = 3;
                duration += lookup_status_duration_mod(actor->statusTable, statusKey);
            }
        }
    } else {
        duration = 3;
    }

meow:
    if (duration > 0) {
        if (battleStatus->currentAttackStatus < 0) {
            duration = battleStatus->statusDuration;
            duration += lookup_status_duration_mod(actor->statusTable, statusKey);
            inflict_status(actor, statusTypeKey, duration);
        } else {
            inflict_status(actor, statusTypeKey, duration);

        }
    } else {
        duration = 0;
    }
    return duration;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel show_coin_counter
/* 829C8 800E9518 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 829CC 800E951C AFB00028 */  sw        $s0, 0x28($sp)
/* 829D0 800E9520 3C108011 */  lui       $s0, %hi(D_8010CD10)
/* 829D4 800E9524 2610CD10 */  addiu     $s0, $s0, %lo(D_8010CD10)
/* 829D8 800E9528 AFBF0030 */  sw        $ra, 0x30($sp)
/* 829DC 800E952C AFB1002C */  sw        $s1, 0x2C($sp)
/* 829E0 800E9530 86020000 */  lh        $v0, 0x0($s0)
/* 829E4 800E9534 3C118011 */  lui       $s1, %hi(gUIStatus)
/* 829E8 800E9538 2631EF58 */  addiu     $s1, $s1, %lo(gUIStatus)
/* 829EC 800E953C 14400005 */  bnez      $v0, .L800E9554
/* 829F0 800E9540 24040014 */   addiu    $a0, $zero, 0x14
/* 829F4 800E9544 3C028011 */  lui       $v0, %hi(D_8010CD12)
/* 829F8 800E9548 8442CD12 */  lh        $v0, %lo(D_8010CD12)($v0)
/* 829FC 800E954C 10400012 */  beqz      $v0, .L800E9598
/* 82A00 800E9550 00000000 */   nop
.L800E9554:
/* 82A04 800E9554 0C051F9F */  jal       set_window_update
/* 82A08 800E9558 24050002 */   addiu    $a1, $zero, 0x2
/* 82A0C 800E955C 8E220064 */  lw        $v0, 0x64($s1)
/* 82A10 800E9560 04420009 */  bltzl     $v0, .L800E9588
/* 82A14 800E9564 A220006C */   sb       $zero, 0x6C($s1)
/* 82A18 800E9568 8E24005C */  lw        $a0, 0x5C($s1)
/* 82A1C 800E956C 0C05123D */  jal       hud_element_free
/* 82A20 800E9570 00000000 */   nop
/* 82A24 800E9574 0C05123D */  jal       hud_element_free
/* 82A28 800E9578 8E240060 */   lw       $a0, 0x60($s1)
/* 82A2C 800E957C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 82A30 800E9580 AE220064 */  sw        $v0, 0x64($s1)
/* 82A34 800E9584 A220006C */  sb        $zero, 0x6C($s1)
.L800E9588:
/* 82A38 800E9588 A220006D */  sb        $zero, 0x6D($s1)
/* 82A3C 800E958C A6000000 */  sh        $zero, 0x0($s0)
/* 82A40 800E9590 3C018011 */  lui       $at, %hi(D_8010CD12)
/* 82A44 800E9594 A420CD12 */  sh        $zero, %lo(D_8010CD12)($at)
.L800E9598:
/* 82A48 800E9598 8222006C */  lb        $v0, 0x6C($s1)
/* 82A4C 800E959C 14400039 */  bnez      $v0, .L800E9684
/* 82A50 800E95A0 24040014 */   addiu    $a0, $zero, 0x14
/* 82A54 800E95A4 24050020 */  addiu     $a1, $zero, 0x20
/* 82A58 800E95A8 240600A4 */  addiu     $a2, $zero, 0xA4
/* 82A5C 800E95AC 24070040 */  addiu     $a3, $zero, 0x40
/* 82A60 800E95B0 0080102D */  daddu     $v0, $a0, $zero
/* 82A64 800E95B4 AFA20010 */  sw        $v0, 0x10($sp)
/* 82A68 800E95B8 24020015 */  addiu     $v0, $zero, 0x15
/* 82A6C 800E95BC AFA20014 */  sw        $v0, 0x14($sp)
/* 82A70 800E95C0 3C02800F */  lui       $v0, %hi(coin_counter_draw_content)
/* 82A74 800E95C4 244292D8 */  addiu     $v0, $v0, %lo(coin_counter_draw_content)
/* 82A78 800E95C8 AFA20018 */  sw        $v0, 0x18($sp)
/* 82A7C 800E95CC 2402FFFF */  addiu     $v0, $zero, -0x1
/* 82A80 800E95D0 AFA0001C */  sw        $zero, 0x1C($sp)
/* 82A84 800E95D4 0C051F32 */  jal       set_window_properties
/* 82A88 800E95D8 AFA20020 */   sw       $v0, 0x20($sp)
/* 82A8C 800E95DC 3C058014 */  lui       $a1, %hi(basic_window_update)
/* 82A90 800E95E0 24A57474 */  addiu     $a1, $a1, %lo(basic_window_update)
/* 82A94 800E95E4 0C051F9F */  jal       set_window_update
/* 82A98 800E95E8 24040014 */   addiu    $a0, $zero, 0x14
/* 82A9C 800E95EC 3C048011 */  lui       $a0, %hi(HES_MenuTimes)
/* 82AA0 800E95F0 24849270 */  addiu     $a0, $a0, %lo(HES_MenuTimes)
/* 82AA4 800E95F4 0C050529 */  jal       hud_element_create
/* 82AA8 800E95F8 00000000 */   nop
/* 82AAC 800E95FC 0040802D */  daddu     $s0, $v0, $zero
/* 82AB0 800E9600 0200202D */  daddu     $a0, $s0, $zero
/* 82AB4 800E9604 24050080 */  addiu     $a1, $zero, 0x80
/* 82AB8 800E9608 0C051280 */  jal       hud_element_set_flags
/* 82ABC 800E960C AE30005C */   sw       $s0, 0x5C($s1)
/* 82AC0 800E9610 0200202D */  daddu     $a0, $s0, $zero
/* 82AC4 800E9614 240500FF */  addiu     $a1, $zero, 0xFF
/* 82AC8 800E9618 00A0302D */  daddu     $a2, $a1, $zero
/* 82ACC 800E961C 0C0513BF */  jal       hud_element_set_tint
/* 82AD0 800E9620 00A0382D */   daddu    $a3, $a1, $zero
/* 82AD4 800E9624 3C048011 */  lui       $a0, %hi(HES_StatusCoin)
/* 82AD8 800E9628 24848558 */  addiu     $a0, $a0, %lo(HES_StatusCoin)
/* 82ADC 800E962C 0C050529 */  jal       hud_element_create
/* 82AE0 800E9630 00000000 */   nop
/* 82AE4 800E9634 0040802D */  daddu     $s0, $v0, $zero
/* 82AE8 800E9638 0200202D */  daddu     $a0, $s0, $zero
/* 82AEC 800E963C 24050080 */  addiu     $a1, $zero, 0x80
/* 82AF0 800E9640 0C051280 */  jal       hud_element_set_flags
/* 82AF4 800E9644 AE300060 */   sw       $s0, 0x60($s1)
/* 82AF8 800E9648 0200202D */  daddu     $a0, $s0, $zero
/* 82AFC 800E964C 240500FF */  addiu     $a1, $zero, 0xFF
/* 82B00 800E9650 00A0302D */  daddu     $a2, $a1, $zero
/* 82B04 800E9654 0C0513BF */  jal       hud_element_set_tint
/* 82B08 800E9658 00A0382D */   daddu    $a3, $a1, $zero
/* 82B0C 800E965C 8222006E */  lb        $v0, 0x6E($s1)
/* 82B10 800E9660 04410003 */  bgez      $v0, .L800E9670
/* 82B14 800E9664 A220006C */   sb       $zero, 0x6C($s1)
/* 82B18 800E9668 92220044 */  lbu       $v0, 0x44($s1)
/* 82B1C 800E966C A222006E */  sb        $v0, 0x6E($s1)
.L800E9670:
/* 82B20 800E9670 24020001 */  addiu     $v0, $zero, 0x1
/* 82B24 800E9674 A2220044 */  sb        $v0, 0x44($s1)
/* 82B28 800E9678 24020001 */  addiu     $v0, $zero, 0x1
/* 82B2C 800E967C 3C018011 */  lui       $at, %hi(D_8010CD10)
/* 82B30 800E9680 A422CD10 */  sh        $v0, %lo(D_8010CD10)($at)
.L800E9684:
/* 82B34 800E9684 8FBF0030 */  lw        $ra, 0x30($sp)
/* 82B38 800E9688 8FB1002C */  lw        $s1, 0x2C($sp)
/* 82B3C 800E968C 8FB00028 */  lw        $s0, 0x28($sp)
/* 82B40 800E9690 03E00008 */  jr        $ra
/* 82B44 800E9694 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void show_coin_counter(void) {
    UiStatus* uiStatus = &gUIStatus;
    s32 index;

    if ((D_8010CD10 != 0) || (D_8010CD12 != 0)) {
        set_window_update(WINDOW_ID_CURRENCY_COUNTER, WINDOW_UPDATE_HIDE);
        if (uiStatus->iconIndex12 > -1) {
            hud_element_free(uiStatus->iconIndex10);
            hud_element_free(uiStatus->iconIndex11);
            uiStatus->iconIndex12 = -1;
        }
        uiStatus->unk_6C[0] = 0;
        uiStatus->unk_6C[1] = 0;
        D_8010CD10 = 0;
        D_8010CD12 = 0;
    }

    if (uiStatus->unk_6C[0] == 0) {
        set_window_properties(WINDOW_ID_CURRENCY_COUNTER, 32, 164, 64, 20, WINDOW_PRIORITY_21, coin_counter_draw_content, 0, -1);
        set_window_update(WINDOW_ID_CURRENCY_COUNTER, (s32)basic_window_update);
        index = hud_element_create(&HES_MenuTimes);
        uiStatus->iconIndex10 = index;
        hud_element_set_flags(index, HUD_ELEMENT_FLAG_80);
        hud_element_set_tint(index, 255, 255, 255);
        index = hud_element_create(&HES_StatusCoin);
        uiStatus->iconIndex11 = index;
        hud_element_set_flags(index, HUD_ELEMENT_FLAG_80);
        hud_element_set_tint(index, 255, 255, 255);
        uiStatus->unk_6C[0] = 0;

        if (uiStatus->unk_6C[2] < 0) {
            uiStatus->unk_6C[2] = uiStatus->ignoreChanges;
        }

        uiStatus->ignoreChanges = TRUE;
        D_8010CD10 = 1;
    }
}