### RAW ASSEMBLY INSTRUCTIONS:

glabel virtual_entity_appendGfx_quad
/* F76E0 802D2D30 27BDFFF8 */  addiu     $sp, $sp, -0x8
/* F76E4 802D2D34 0080602D */  daddu     $t4, $a0, $zero
/* F76E8 802D2D38 00A0682D */  daddu     $t5, $a1, $zero
/* F76EC 802D2D3C 00E0582D */  daddu     $t3, $a3, $zero
/* F76F0 802D2D40 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* F76F4 802D2D44 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* F76F8 802D2D48 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* F76FC 802D2D4C AFB00000 */  sw        $s0, 0x0($sp)
/* F7700 802D2D50 8D070000 */  lw        $a3, 0x0($t0)
/* F7704 802D2D54 97B9001A */  lhu       $t9, 0x1A($sp)
/* F7708 802D2D58 97B0001E */  lhu       $s0, 0x1E($sp)
/* F770C 802D2D5C 97AF0022 */  lhu       $t7, 0x22($sp)
/* F7710 802D2D60 97B80026 */  lhu       $t8, 0x26($sp)
/* F7714 802D2D64 00E0182D */  daddu     $v1, $a3, $zero
/* F7718 802D2D68 24E70008 */  addiu     $a3, $a3, 0x8
/* F771C 802D2D6C AD070000 */  sw        $a3, 0x0($t0)
/* F7720 802D2D70 AC620000 */  sw        $v0, 0x0($v1)
/* F7724 802D2D74 AC600004 */  sw        $zero, 0x4($v1)
/* F7728 802D2D78 316300FF */  andi      $v1, $t3, 0xFF
/* F772C 802D2D7C 240200FF */  addiu     $v0, $zero, 0xFF
/* F7730 802D2D80 1462000A */  bne       $v1, $v0, .L802D2DAC
/* F7734 802D2D84 00C0702D */   daddu    $t6, $a2, $zero
/* F7738 802D2D88 3C04FCFF */  lui       $a0, (0xFCFFFFFF >> 16)
/* F773C 802D2D8C 3484FFFF */  ori       $a0, $a0, (0xFCFFFFFF & 0xFFFF)
/* F7740 802D2D90 3C03FFFD */  lui       $v1, (0xFFFDFCFE >> 16)
/* F7744 802D2D94 3463FCFE */  ori       $v1, $v1, (0xFFFDFCFE & 0xFFFF)
/* F7748 802D2D98 24E20008 */  addiu     $v0, $a3, 0x8
/* F774C 802D2D9C AD020000 */  sw        $v0, 0x0($t0)
/* F7750 802D2DA0 ACE40000 */  sw        $a0, 0x0($a3)
/* F7754 802D2DA4 080B4B7B */  j         .L802D2DEC
/* F7758 802D2DA8 ACE30004 */   sw       $v1, 0x4($a3)
.L802D2DAC:
/* F775C 802D2DAC 3C05E200 */  lui       $a1, (0xE200001C >> 16)
/* F7760 802D2DB0 34A5001C */  ori       $a1, $a1, (0xE200001C & 0xFFFF)
/* F7764 802D2DB4 3C030050 */  lui       $v1, (0x504240 >> 16)
/* F7768 802D2DB8 34634240 */  ori       $v1, $v1, (0x504240 & 0xFFFF)
/* F776C 802D2DBC 3C06FCFF */  lui       $a2, (0xFCFFFFFF >> 16)
/* F7770 802D2DC0 34C6FFFF */  ori       $a2, $a2, (0xFCFFFFFF & 0xFFFF)
/* F7774 802D2DC4 3C04FFFD */  lui       $a0, (0xFFFDF6FB >> 16)
/* F7778 802D2DC8 3484F6FB */  ori       $a0, $a0, (0xFFFDF6FB & 0xFFFF)
/* F777C 802D2DCC 24E20008 */  addiu     $v0, $a3, 0x8
/* F7780 802D2DD0 AD020000 */  sw        $v0, 0x0($t0)
/* F7784 802D2DD4 24E20010 */  addiu     $v0, $a3, 0x10
/* F7788 802D2DD8 ACE50000 */  sw        $a1, 0x0($a3)
/* F778C 802D2DDC ACE30004 */  sw        $v1, 0x4($a3)
/* F7790 802D2DE0 AD020000 */  sw        $v0, 0x0($t0)
/* F7794 802D2DE4 ACE60008 */  sw        $a2, 0x8($a3)
/* F7798 802D2DE8 ACE4000C */  sw        $a0, 0xC($a3)
.L802D2DEC:
/* F779C 802D2DEC 3C09E200 */  lui       $t1, (0xE200001C >> 16)
/* F77A0 802D2DF0 3529001C */  ori       $t1, $t1, (0xE200001C & 0xFFFF)
/* F77A4 802D2DF4 3C070F0A */  lui       $a3, (0xF0A7008 >> 16)
/* F77A8 802D2DF8 34E77008 */  ori       $a3, $a3, (0xF0A7008 & 0xFFFF)
/* F77AC 802D2DFC 3C0AFCFF */  lui       $t2, (0xFCFFFFFF >> 16)
/* F77B0 802D2E00 354AFFFF */  ori       $t2, $t2, (0xFCFFFFFF & 0xFFFF)
/* F77B4 802D2E04 3C08FFFC */  lui       $t0, (0xFFFCF279 >> 16)
/* F77B8 802D2E08 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* F77BC 802D2E0C 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* F77C0 802D2E10 3508F279 */  ori       $t0, $t0, (0xFFFCF279 & 0xFFFF)
/* F77C4 802D2E14 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* F77C8 802D2E18 8CC50000 */  lw        $a1, 0x0($a2)
/* F77CC 802D2E1C 000C1E00 */  sll       $v1, $t4, 24
/* F77D0 802D2E20 00A0202D */  daddu     $a0, $a1, $zero
/* F77D4 802D2E24 24A50008 */  addiu     $a1, $a1, 0x8
/* F77D8 802D2E28 ACC50000 */  sw        $a1, 0x0($a2)
/* F77DC 802D2E2C AC820000 */  sw        $v0, 0x0($a0)
/* F77E0 802D2E30 31A200FF */  andi      $v0, $t5, 0xFF
/* F77E4 802D2E34 00021400 */  sll       $v0, $v0, 16
/* F77E8 802D2E38 00621825 */  or        $v1, $v1, $v0
/* F77EC 802D2E3C 31C200FF */  andi      $v0, $t6, 0xFF
/* F77F0 802D2E40 00021200 */  sll       $v0, $v0, 8
/* F77F4 802D2E44 00621825 */  or        $v1, $v1, $v0
/* F77F8 802D2E48 316200FF */  andi      $v0, $t3, 0xFF
/* F77FC 802D2E4C 00621825 */  or        $v1, $v1, $v0
/* F7800 802D2E50 24A20008 */  addiu     $v0, $a1, 0x8
/* F7804 802D2E54 AC830004 */  sw        $v1, 0x4($a0)
/* F7808 802D2E58 31E403FF */  andi      $a0, $t7, 0x3FF
/* F780C 802D2E5C 00042380 */  sll       $a0, $a0, 14
/* F7810 802D2E60 ACC20000 */  sw        $v0, 0x0($a2)
/* F7814 802D2E64 330203FF */  andi      $v0, $t8, 0x3FF
/* F7818 802D2E68 00021080 */  sll       $v0, $v0, 2
/* F781C 802D2E6C 3C03F600 */  lui       $v1, (0xF6000000 >> 16)
/* F7820 802D2E70 00431025 */  or        $v0, $v0, $v1
/* F7824 802D2E74 00822025 */  or        $a0, $a0, $v0
/* F7828 802D2E78 332303FF */  andi      $v1, $t9, 0x3FF
/* F782C 802D2E7C 00031B80 */  sll       $v1, $v1, 14
/* F7830 802D2E80 320203FF */  andi      $v0, $s0, 0x3FF
/* F7834 802D2E84 00021080 */  sll       $v0, $v0, 2
/* F7838 802D2E88 00621825 */  or        $v1, $v1, $v0
/* F783C 802D2E8C 24A20010 */  addiu     $v0, $a1, 0x10
/* F7840 802D2E90 ACA40000 */  sw        $a0, 0x0($a1)
/* F7844 802D2E94 ACA30004 */  sw        $v1, 0x4($a1)
/* F7848 802D2E98 ACC20000 */  sw        $v0, 0x0($a2)
/* F784C 802D2E9C 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* F7850 802D2EA0 ACA20008 */  sw        $v0, 0x8($a1)
/* F7854 802D2EA4 24A20018 */  addiu     $v0, $a1, 0x18
/* F7858 802D2EA8 ACA0000C */  sw        $zero, 0xC($a1)
/* F785C 802D2EAC ACC20000 */  sw        $v0, 0x0($a2)
/* F7860 802D2EB0 24A20020 */  addiu     $v0, $a1, 0x20
/* F7864 802D2EB4 ACA90010 */  sw        $t1, 0x10($a1)
/* F7868 802D2EB8 ACA70014 */  sw        $a3, 0x14($a1)
/* F786C 802D2EBC ACC20000 */  sw        $v0, 0x0($a2)
/* F7870 802D2EC0 ACAA0018 */  sw        $t2, 0x18($a1)
/* F7874 802D2EC4 ACA8001C */  sw        $t0, 0x1C($a1)
/* F7878 802D2EC8 8FB00000 */  lw        $s0, 0x0($sp)
/* F787C 802D2ECC 03E00008 */  jr        $ra
/* F7880 802D2ED0 27BD0008 */   addiu    $sp, $sp, 0x8

### DECOMPILED C INSTRUCTIONS:

void virtual_entity_appendGfx_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 right, u16 bottom) {
    gDPPipeSync(gMainGfxPos++);

    if (a == 0xFF) {
        gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08);
    } else {
        gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
        gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
    }

    gDPSetPrimColor(gMainGfxPos++, 0, 0, r, g, b, a);
    gDPFillRectangle(gMainGfxPos++, left, top, right, bottom);
    gDPPipeSync(gMainGfxPos++);
    gDPSetRenderMode(gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
    gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_Chest_close
/* 108CAC 802E742C 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 108CB0 802E7430 AFBF0014 */  sw        $ra, 0x14($sp)
/* 108CB4 802E7434 AFB00010 */  sw        $s0, 0x10($sp)
/* 108CB8 802E7438 8C900040 */  lw        $s0, 0x40($a0)
/* 108CBC 802E743C 92030004 */  lbu       $v1, 0x4($s0)
/* 108CC0 802E7440 2C620005 */  sltiu     $v0, $v1, 0x5
/* 108CC4 802E7444 1040005A */  beqz      $v0, .L802E75B0
/* 108CC8 802E7448 00031080 */   sll      $v0, $v1, 2
/* 108CCC 802E744C 3C01802F */  lui       $at, %hi(jtbl_802EB308)
/* 108CD0 802E7450 00220821 */  addu      $at, $at, $v0
/* 108CD4 802E7454 8C22B308 */  lw        $v0, %lo(jtbl_802EB308)($at)
/* 108CD8 802E7458 00400008 */  jr        $v0
/* 108CDC 802E745C 00000000 */   nop
glabel .L802E7460
/* 108CE0 802E7460 92020004 */  lbu       $v0, 0x4($s0)
/* 108CE4 802E7464 AE00000C */  sw        $zero, 0xC($s0)
/* 108CE8 802E7468 24420001 */  addiu     $v0, $v0, 0x1
/* 108CEC 802E746C A2020004 */  sb        $v0, 0x4($s0)
glabel .L802E7470
/* 108CF0 802E7470 C600000C */  lwc1      $f0, 0xC($s0)
/* 108CF4 802E7474 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 108CF8 802E7478 44811000 */  mtc1      $at, $f2
/* 108CFC 802E747C 00000000 */  nop
/* 108D00 802E7480 46020000 */  add.s     $f0, $f0, $f2
/* 108D04 802E7484 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 108D08 802E7488 44811000 */  mtc1      $at, $f2
/* 108D0C 802E748C 00000000 */  nop
/* 108D10 802E7490 4600103E */  c.le.s    $f2, $f0
/* 108D14 802E7494 00000000 */  nop
/* 108D18 802E7498 45000005 */  bc1f      .L802E74B0
/* 108D1C 802E749C E600000C */   swc1     $f0, 0xC($s0)
/* 108D20 802E74A0 92020004 */  lbu       $v0, 0x4($s0)
/* 108D24 802E74A4 E602000C */  swc1      $f2, 0xC($s0)
/* 108D28 802E74A8 24420001 */  addiu     $v0, $v0, 0x1
/* 108D2C 802E74AC A2020004 */  sb        $v0, 0x4($s0)
.L802E74B0:
/* 108D30 802E74B0 C60C000C */  lwc1      $f12, 0xC($s0)
/* 108D34 802E74B4 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 108D38 802E74B8 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 108D3C 802E74BC 44810000 */  mtc1      $at, $f0
/* 108D40 802E74C0 00000000 */  nop
/* 108D44 802E74C4 46006302 */  mul.s     $f12, $f12, $f0
/* 108D48 802E74C8 00000000 */  nop
/* 108D4C 802E74CC 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 108D50 802E74D0 44810000 */  mtc1      $at, $f0
/* 108D54 802E74D4 0C00A85B */  jal       sin_rad
/* 108D58 802E74D8 46006303 */   div.s    $f12, $f12, $f0
/* 108D5C 802E74DC 3C014026 */  lui       $at, (0x40266666 >> 16)
/* 108D60 802E74E0 34216666 */  ori       $at, $at, (0x40266666 & 0xFFFF)
/* 108D64 802E74E4 44811000 */  mtc1      $at, $f2
/* 108D68 802E74E8 00000000 */  nop
/* 108D6C 802E74EC 46020082 */  mul.s     $f2, $f0, $f2
/* 108D70 802E74F0 080B9D5C */  j         .L802E7570
/* 108D74 802E74F4 00000000 */   nop
glabel .L802E74F8
/* 108D78 802E74F8 C600000C */  lwc1      $f0, 0xC($s0)
/* 108D7C 802E74FC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 108D80 802E7500 44811000 */  mtc1      $at, $f2
/* 108D84 802E7504 00000000 */  nop
/* 108D88 802E7508 46020000 */  add.s     $f0, $f0, $f2
/* 108D8C 802E750C 3C014339 */  lui       $at, (0x43390000 >> 16)
/* 108D90 802E7510 44811000 */  mtc1      $at, $f2
/* 108D94 802E7514 00000000 */  nop
/* 108D98 802E7518 4600103E */  c.le.s    $f2, $f0
/* 108D9C 802E751C 00000000 */  nop
/* 108DA0 802E7520 45000007 */  bc1f      .L802E7540
/* 108DA4 802E7524 E600000C */   swc1     $f0, 0xC($s0)
/* 108DA8 802E7528 92020004 */  lbu       $v0, 0x4($s0)
/* 108DAC 802E752C 2403000A */  addiu     $v1, $zero, 0xA
/* 108DB0 802E7530 E602000C */  swc1      $f2, 0xC($s0)
/* 108DB4 802E7534 A2030006 */  sb        $v1, 0x6($s0)
/* 108DB8 802E7538 24420001 */  addiu     $v0, $v0, 0x1
/* 108DBC 802E753C A2020004 */  sb        $v0, 0x4($s0)
.L802E7540:
/* 108DC0 802E7540 C60C000C */  lwc1      $f12, 0xC($s0)
/* 108DC4 802E7544 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 108DC8 802E7548 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 108DCC 802E754C 44810000 */  mtc1      $at, $f0
/* 108DD0 802E7550 00000000 */  nop
/* 108DD4 802E7554 46006302 */  mul.s     $f12, $f12, $f0
/* 108DD8 802E7558 00000000 */  nop
/* 108DDC 802E755C 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 108DE0 802E7560 44810000 */  mtc1      $at, $f0
/* 108DE4 802E7564 0C00A85B */  jal       sin_rad
/* 108DE8 802E7568 46006303 */   div.s    $f12, $f12, $f0
/* 108DEC 802E756C 46000080 */  add.s     $f2, $f0, $f0
.L802E7570:
/* 108DF0 802E7570 C6000008 */  lwc1      $f0, 0x8($s0)
/* 108DF4 802E7574 46020000 */  add.s     $f0, $f0, $f2
/* 108DF8 802E7578 080B9D6C */  j         .L802E75B0
/* 108DFC 802E757C E6000008 */   swc1     $f0, 0x8($s0)
glabel .L802E7580
/* 108E00 802E7580 92020006 */  lbu       $v0, 0x6($s0)
/* 108E04 802E7584 2442FFFF */  addiu     $v0, $v0, -0x1
/* 108E08 802E7588 A2020006 */  sb        $v0, 0x6($s0)
/* 108E0C 802E758C 00021600 */  sll       $v0, $v0, 24
/* 108E10 802E7590 14400007 */  bnez      $v0, .L802E75B0
/* 108E14 802E7594 00000000 */   nop
/* 108E18 802E7598 92020004 */  lbu       $v0, 0x4($s0)
/* 108E1C 802E759C 24420001 */  addiu     $v0, $v0, 0x1
/* 108E20 802E75A0 A2020004 */  sb        $v0, 0x4($s0)
/* 108E24 802E75A4 8C820000 */  lw        $v0, 0x0($a0)
/* 108E28 802E75A8 34424000 */  ori       $v0, $v0, 0x4000
/* 108E2C 802E75AC AC820000 */  sw        $v0, 0x0($a0)
glabel .L802E75B0
/* 108E30 802E75B0 8FBF0014 */  lw        $ra, 0x14($sp)
/* 108E34 802E75B4 8FB00010 */  lw        $s0, 0x10($sp)
/* 108E38 802E75B8 03E00008 */  jr        $ra
/* 108E3C 802E75BC 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

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

    switch (data->state) {
        case 0:
            data->lidAnimInterpPhase = 0.0f;
            data->state++;
            // fallthrough
        case 1:
            data->lidAnimInterpPhase += 5.0f;
            if (data->lidAnimInterpPhase >= 180.0f) {
                data->lidAnimInterpPhase = 180.0f;
                data->state++;
            }
            delta = 2.6f * sin_rad(DEG_TO_RAD(data->lidAnimInterpPhase));
            data->lidAngle += delta;
            break;
        case 2:
            data->lidAnimInterpPhase += 1.0f;
            if (data->lidAnimInterpPhase >= 185.0f) {
                data->lidAnimInterpPhase = 185.0f;
                data->postLidAnimDelay = 10;
                data->state++;
            }
            delta = 2.0f * sin_rad(DEG_TO_RAD(data->lidAnimInterpPhase));
            data->lidAngle += delta;
            break;
        case 3:
            data->postLidAnimDelay--;
            if (data->postLidAnimDelay == 0) {
                data->state++;
                entity->flags |= ENTITY_FLAG_4000;
            }
            break;
        case 4:
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel action_update_peach_step_down_land
/* E24D6C 802B644C 27BDFFD8 */  addiu     $sp, $sp, -0x28
.L802B6450:
/* E24D70 802B6450 3C058016 */  lui       $a1, %hi(gCollisionStatus)
.L802B6454:
/* E24D74 802B6454 24A5A550 */  addiu     $a1, $a1, %lo(gCollisionStatus)
/* E24D78 802B6458 AFB00018 */  sw        $s0, 0x18($sp)
/* E24D7C 802B645C 3C108011 */  lui       $s0, %hi(gPlayerStatus)
.L802B6460:
/* E24D80 802B6460 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
.L802B6464:
/* E24D84 802B6464 AFBF0020 */  sw        $ra, 0x20($sp)
/* E24D88 802B6468 AFB1001C */  sw        $s1, 0x1C($sp)
glabel .L802B646C
/* E24D8C 802B646C 8E020000 */  lw        $v0, 0x0($s0)
/* E24D90 802B6470 04410016 */  bgez      $v0, .L802B64CC
/* E24D94 802B6474 00A0882D */   daddu    $s1, $a1, $zero
glabel action_update_raise_arms
/* E24D98 802B6478 3C037FFF */  lui       $v1, (0x7FFFFFFF >> 16)
glabel action_update_peach_falling
/* E24D9C 802B647C 3463FFFF */  ori       $v1, $v1, (0x7FFFFFFF & 0xFFFF)
/* E24DA0 802B6480 00431824 */  and       $v1, $v0, $v1
/* E24DA4 802B6484 C6000028 */  lwc1      $f0, 0x28($s0)
/* E24DA8 802B6488 C6020030 */  lwc1      $f2, 0x30($s0)
.L802B648C:
/* E24DAC 802B648C 2404FFF1 */  addiu     $a0, $zero, -0xF
.L802B6490:
/* E24DB0 802B6490 AE030000 */  sw        $v1, 0x0($s0)
.L802B6494:
/* E24DB4 802B6494 A20000B6 */  sb        $zero, 0xB6($s0)
/* E24DB8 802B6498 A60000C0 */  sh        $zero, 0xC0($s0)
/* E24DBC 802B649C A60000C2 */  sh        $zero, 0xC2($s0)
.L802B64A0:
/* E24DC0 802B64A0 94A20002 */  lhu       $v0, 0x2($a1)
/* E24DC4 802B64A4 00641824 */  and       $v1, $v1, $a0
glabel .L802B64A8
/* E24DC8 802B64A8 AE030000 */  sw        $v1, 0x0($s0)
.L802B64AC:
/* E24DCC 802B64AC 30424000 */  andi      $v0, $v0, 0x4000
/* E24DD0 802B64B0 E6000044 */  swc1      $f0, 0x44($s0)
.L802B64B4:
/* E24DD4 802B64B4 14400003 */  bnez      $v0, .L802B64C4
/* E24DD8 802B64B8 E6020048 */   swc1     $f2, 0x48($s0)
/* E24DDC 802B64BC 0C03954C */  jal       phys_adjust_cam_on_landing
/* E24DE0 802B64C0 00000000 */   nop
.L802B64C4:
/* E24DE4 802B64C4 2402FFFF */  addiu     $v0, $zero, -0x1
/* E24DE8 802B64C8 A6220004 */  sh        $v0, 0x4($s1)
.L802B64CC:
/* E24DEC 802B64CC C6020054 */  lwc1      $f2, 0x54($s0)
.L802B64D0:
/* E24DF0 802B64D0 3C013F19 */  lui       $at, (0x3F19999A >> 16)
.L802B64D4:
/* E24DF4 802B64D4 3421999A */  ori       $at, $at, (0x3F19999A & 0xFFFF)
.L802B64D8:
/* E24DF8 802B64D8 44810000 */  mtc1      $at, $f0
glabel .L802B64DC
/* E24DFC 802B64DC 27A40010 */  addiu     $a0, $sp, 0x10
glabel .L802B64E0
/* E24E00 802B64E0 46001082 */  mul.s     $f2, $f2, $f0
/* E24E04 802B64E4 00000000 */  nop
/* E24E08 802B64E8 920200B6 */  lbu       $v0, 0xB6($s0)
.L802B64EC:
/* E24E0C 802B64EC 27A50014 */  addiu     $a1, $sp, 0x14
glabel .L802B64F0
/* E24E10 802B64F0 24420001 */  addiu     $v0, $v0, 0x1
/* E24E14 802B64F4 A20200B6 */  sb        $v0, 0xB6($s0)
.L802B64F8:
/* E24E18 802B64F8 0C0388C1 */  jal       player_input_to_move_vector
/* E24E1C 802B64FC E6020054 */   swc1     $f2, 0x54($s0)
/* E24E20 802B6500 C7A20014 */  lwc1      $f2, 0x14($sp)
/* E24E24 802B6504 44800000 */  mtc1      $zero, $f0
glabel action_update_pushing_block
/* E24E28 802B6508 00000000 */  nop
.L802B650C:
/* E24E2C 802B650C 46001032 */  c.eq.s    $f2, $f0
glabel .L802B6510
/* E24E30 802B6510 00000000 */  nop
/* E24E34 802B6514 45010003 */  bc1t      .L802B6524
/* E24E38 802B6518 00000000 */   nop
.L802B651C:
/* E24E3C 802B651C C7A00010 */  lwc1      $f0, 0x10($sp)
.L802B6520:
/* E24E40 802B6520 E6000080 */  swc1      $f0, 0x80($s0)
.L802B6524:
/* E24E44 802B6524 8E0200E8 */  lw        $v0, 0xE8($s0)
/* E24E48 802B6528 00420018 */  mult      $v0, $v0
/* E24E4C 802B652C 00001812 */  mflo      $v1
.L802B6530:
/* E24E50 802B6530 8E0200EC */  lw        $v0, 0xEC($s0)
.L802B6534:
/* E24E54 802B6534 00000000 */  nop
/* E24E58 802B6538 00420018 */  mult      $v0, $v0
/* E24E5C 802B653C 00003812 */  mflo      $a3
/* E24E60 802B6540 00671021 */  addu      $v0, $v1, $a3
glabel .L802B6544
/* E24E64 802B6544 44826000 */  mtc1      $v0, $f12
glabel .L802B6548
/* E24E68 802B6548 00000000 */  nop
/* E24E6C 802B654C 46806320 */  cvt.s.w   $f12, $f12
glabel func_802B6550
/* E24E70 802B6550 46006084 */  sqrt.s    $f2, $f12
.L802B6554:
/* E24E74 802B6554 46021032 */  c.eq.s    $f2, $f2
/* E24E78 802B6558 00000000 */  nop
/* E24E7C 802B655C 45010004 */  bc1t      .L802B6570
/* E24E80 802B6560 00000000 */   nop
/* E24E84 802B6564 0C0187BC */  jal       sqrtf
glabel .L802B6568
/* E24E88 802B6568 00000000 */   nop
.L802B656C:
/* E24E8C 802B656C 46000086 */  mov.s     $f2, $f0
.L802B6570:
/* E24E90 802B6570 3C01425C */  lui       $at, (0x425C0000 >> 16)
.L802B6574:
/* E24E94 802B6574 44810000 */  mtc1      $at, $f0
/* E24E98 802B6578 00000000 */  nop
/* E24E9C 802B657C 4602003C */  c.lt.s    $f0, $f2
.L802B6580:
/* E24EA0 802B6580 00000000 */  nop
/* E24EA4 802B6584 45000002 */  bc1f      .L802B6590
/* E24EA8 802B6588 24040001 */   addiu    $a0, $zero, 0x1
glabel .L802B658C
/* E24EAC 802B658C 24040002 */  addiu     $a0, $zero, 0x2
.L802B6590:
/* E24EB0 802B6590 0C039769 */  jal       set_action_state
glabel .L802B6594
/* E24EB4 802B6594 00000000 */   nop
.L802B6598:
/* E24EB8 802B6598 8FBF0020 */  lw        $ra, 0x20($sp)
.L802B659C:
/* E24EBC 802B659C 8FB1001C */  lw        $s1, 0x1C($sp)
/* E24EC0 802B65A0 8FB00018 */  lw        $s0, 0x18($sp)
glabel .L802B65A4
/* E24EC4 802B65A4 03E00008 */  jr        $ra
.L802B65A8:
/* E24EC8 802B65A8 27BD0028 */   addiu    $sp, $sp, 0x28
/* E24ECC 802B65AC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void action_update_peach_step_down_land(void) {
    CollisionStatus* collisionStatus = &gCollisionStatus;
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 inputMoveMagnitude;
    f32 inputMoveAngle;

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
        playerStatus->actionSubstate = SUBSTATE_INIT;
        playerStatus->timeInAir = 0;
        playerStatus->peakJumpTime = 0;
        playerStatus->flags &= ~PS_FLAG_AIRBORNE;
        playerStatus->landPos.x = playerStatus->position.x;
        playerStatus->landPos.z = playerStatus->position.z;

        if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
            phys_adjust_cam_on_landing();
        }
        collisionStatus->lastTouchedFloor = -1;
    }

    playerStatus->actionSubstate++; // SUBSTATE_DONE
    playerStatus->currentSpeed *= 0.6f;
    player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude);

    if (inputMoveMagnitude != 0.0f) {
        playerStatus->targetYaw = inputMoveAngle;
    }

    if (sqrtf(SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1])) > 55.0f) {
        set_action_state(ACTION_STATE_RUN);
    } else {
        set_action_state(ACTION_STATE_WALK);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel guPerspectiveF
/* 3EF90 80063B90 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 3EF94 80063B94 F7BA0038 */  sdc1      $f26, 0x38($sp)
/* 3EF98 80063B98 C7BA0060 */  lwc1      $f26, 0x60($sp)
/* 3EF9C 80063B9C F7BC0040 */  sdc1      $f28, 0x40($sp)
/* 3EFA0 80063BA0 C7BC0064 */  lwc1      $f28, 0x64($sp)
/* 3EFA4 80063BA4 F7BE0048 */  sdc1      $f30, 0x48($sp)
/* 3EFA8 80063BA8 C7BE0068 */  lwc1      $f30, 0x68($sp)
/* 3EFAC 80063BAC F7B80030 */  sdc1      $f24, 0x30($sp)
/* 3EFB0 80063BB0 4486C000 */  mtc1      $a2, $f24
/* 3EFB4 80063BB4 AFB00010 */  sw        $s0, 0x10($sp)
/* 3EFB8 80063BB8 00808021 */  addu      $s0, $a0, $zero
/* 3EFBC 80063BBC AFB10014 */  sw        $s1, 0x14($sp)
/* 3EFC0 80063BC0 F7B60028 */  sdc1      $f22, 0x28($sp)
/* 3EFC4 80063BC4 4487B000 */  mtc1      $a3, $f22
/* 3EFC8 80063BC8 AFBF0018 */  sw        $ra, 0x18($sp)
/* 3EFCC 80063BCC F7B40020 */  sdc1      $f20, 0x20($sp)
/* 3EFD0 80063BD0 0C019D28 */  jal       guMtxIdentF
/* 3EFD4 80063BD4 00A08821 */   addu     $s1, $a1, $zero
/* 3EFD8 80063BD8 3C01800A */  lui       $at, %hi(D_80099BB0)
/* 3EFDC 80063BDC D4229BB0 */  ldc1      $f2, %lo(D_80099BB0)($at)
/* 3EFE0 80063BE0 4600C021 */  cvt.d.s   $f0, $f24
/* 3EFE4 80063BE4 46220002 */  mul.d     $f0, $f0, $f2
/* 3EFE8 80063BE8 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3EFEC 80063BEC 4481A000 */  mtc1      $at, $f20
/* 3EFF0 80063BF0 46200620 */  cvt.s.d   $f24, $f0
/* 3EFF4 80063BF4 4614C503 */  div.s     $f20, $f24, $f20
/* 3EFF8 80063BF8 0C00A874 */  jal       cos_rad
/* 3EFFC 80063BFC 4600A306 */   mov.s    $f12, $f20
/* 3F000 80063C00 4600A306 */  mov.s     $f12, $f20
/* 3F004 80063C04 0C00A85B */  jal       sin_rad
/* 3F008 80063C08 46000506 */   mov.s    $f20, $f0
/* 3F00C 80063C0C 4600A503 */  div.s     $f20, $f20, $f0
/* 3F010 80063C10 461CD100 */  add.s     $f4, $f26, $f28
/* 3F014 80063C14 461CD081 */  sub.s     $f2, $f26, $f28
/* 3F018 80063C18 46022103 */  div.s     $f4, $f4, $f2
/* 3F01C 80063C1C 461AD000 */  add.s     $f0, $f26, $f26
/* 3F020 80063C20 461C0002 */  mul.s     $f0, $f0, $f28
/* 3F024 80063C24 46020003 */  div.s     $f0, $f0, $f2
/* 3F028 80063C28 4616A583 */  div.s     $f22, $f20, $f22
/* 3F02C 80063C2C 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 3F030 80063C30 44811000 */  mtc1      $at, $f2
/* 3F034 80063C34 00002821 */  addu      $a1, $zero, $zero
/* 3F038 80063C38 AE00003C */  sw        $zero, 0x3C($s0)
/* 3F03C 80063C3C E602002C */  swc1      $f2, 0x2C($s0)
/* 3F040 80063C40 E6140014 */  swc1      $f20, 0x14($s0)
/* 3F044 80063C44 E6040028 */  swc1      $f4, 0x28($s0)
/* 3F048 80063C48 E6000038 */  swc1      $f0, 0x38($s0)
/* 3F04C 80063C4C E6160000 */  swc1      $f22, 0x0($s0)
.L80063C50:
/* 3F050 80063C50 00002021 */  addu      $a0, $zero, $zero
/* 3F054 80063C54 02001821 */  addu      $v1, $s0, $zero
.L80063C58:
/* 3F058 80063C58 C4600000 */  lwc1      $f0, 0x0($v1)
/* 3F05C 80063C5C 461E0002 */  mul.s     $f0, $f0, $f30
/* 3F060 80063C60 24840001 */  addiu     $a0, $a0, 0x1
/* 3F064 80063C64 28820004 */  slti      $v0, $a0, 0x4
/* 3F068 80063C68 E4600000 */  swc1      $f0, 0x0($v1)
/* 3F06C 80063C6C 1440FFFA */  bnez      $v0, .L80063C58
/* 3F070 80063C70 24630004 */   addiu    $v1, $v1, 0x4
/* 3F074 80063C74 24A50001 */  addiu     $a1, $a1, 0x1
/* 3F078 80063C78 28A20004 */  slti      $v0, $a1, 0x4
/* 3F07C 80063C7C 1440FFF4 */  bnez      $v0, .L80063C50
/* 3F080 80063C80 26100010 */   addiu    $s0, $s0, 0x10
/* 3F084 80063C84 12200023 */  beqz      $s1, .L80063D14
/* 3F088 80063C88 00000000 */   nop
/* 3F08C 80063C8C 461CD080 */  add.s     $f2, $f26, $f28
/* 3F090 80063C90 3C01800A */  lui       $at, %hi(D_80099BB8)
/* 3F094 80063C94 D4209BB8 */  ldc1      $f0, %lo(D_80099BB8)($at)
/* 3F098 80063C98 460010A1 */  cvt.d.s   $f2, $f2
/* 3F09C 80063C9C 4620103E */  c.le.d    $f2, $f0
/* 3F0A0 80063CA0 00000000 */  nop
/* 3F0A4 80063CA4 00000000 */  nop
/* 3F0A8 80063CA8 45010019 */  bc1t      .L80063D10
/* 3F0AC 80063CAC 3402FFFF */   ori      $v0, $zero, 0xFFFF
/* 3F0B0 80063CB0 3C01800A */  lui       $at, %hi(D_80099BC0)
/* 3F0B4 80063CB4 D4209BC0 */  ldc1      $f0, %lo(D_80099BC0)($at)
/* 3F0B8 80063CB8 46220083 */  div.d     $f2, $f0, $f2
/* 3F0BC 80063CBC 3C01800A */  lui       $at, %hi(D_80099BC8)
/* 3F0C0 80063CC0 D4209BC8 */  ldc1      $f0, %lo(D_80099BC8)($at)
/* 3F0C4 80063CC4 4622003E */  c.le.d    $f0, $f2
/* 3F0C8 80063CC8 00000000 */  nop
/* 3F0CC 80063CCC 00000000 */  nop
/* 3F0D0 80063CD0 45030006 */  bc1tl     .L80063CEC
/* 3F0D4 80063CD4 46201001 */   sub.d    $f0, $f2, $f0
/* 3F0D8 80063CD8 4620100D */  trunc.w.d $f0, $f2
/* 3F0DC 80063CDC 44030000 */  mfc1      $v1, $f0
/* 3F0E0 80063CE0 00000000 */  nop
/* 3F0E4 80063CE4 08018F40 */  j         .L80063D00
/* 3F0E8 80063CE8 00601021 */   addu     $v0, $v1, $zero
.L80063CEC:
/* 3F0EC 80063CEC 4620008D */  trunc.w.d $f2, $f0
/* 3F0F0 80063CF0 44031000 */  mfc1      $v1, $f2
/* 3F0F4 80063CF4 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 3F0F8 80063CF8 00621825 */  or        $v1, $v1, $v0
/* 3F0FC 80063CFC 00601021 */  addu      $v0, $v1, $zero
.L80063D00:
/* 3F100 80063D00 A6220000 */  sh        $v0, 0x0($s1)
/* 3F104 80063D04 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3F108 80063D08 14400002 */  bnez      $v0, .L80063D14
/* 3F10C 80063D0C 24020001 */   addiu    $v0, $zero, 0x1
.L80063D10:
/* 3F110 80063D10 A6220000 */  sh        $v0, 0x0($s1)
.L80063D14:
/* 3F114 80063D14 8FBF0018 */  lw        $ra, 0x18($sp)
/* 3F118 80063D18 8FB10014 */  lw        $s1, 0x14($sp)
/* 3F11C 80063D1C 8FB00010 */  lw        $s0, 0x10($sp)
/* 3F120 80063D20 D7BE0048 */  ldc1      $f30, 0x48($sp)
/* 3F124 80063D24 D7BC0040 */  ldc1      $f28, 0x40($sp)
/* 3F128 80063D28 D7BA0038 */  ldc1      $f26, 0x38($sp)
/* 3F12C 80063D2C D7B80030 */  ldc1      $f24, 0x30($sp)
/* 3F130 80063D30 D7B60028 */  ldc1      $f22, 0x28($sp)
/* 3F134 80063D34 D7B40020 */  ldc1      $f20, 0x20($sp)
/* 3F138 80063D38 03E00008 */  jr        $ra
/* 3F13C 80063D3C 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void guPerspectiveF(f32 mf[4][4], u16 *perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) {
    f32 cot;
    s32 i, j;

    guMtxIdentF(mf);

    fovy *= 3.1415926 / 180.0;
    cot = cos_rad(fovy/2) / sin_rad(fovy/2);

    mf[0][0] = cot / aspect;
    mf[1][1] = cot;
    mf[2][2] = (near + far) / (near - far);
    mf[2][3] = -1;
    mf[3][2] = (2 * near * far) / (near - far);
    mf[3][3] = 0;

    for (i = 0; i < 4; i++) {
        for (j = 0; j < 4; j++) {
            mf[i][j] *= scale;
        }
    }

    if (perspNorm != (u16 *) NULL) {
        if (near + far <= 2.0) {
            *perspNorm = (u16) 0xFFFF;
        } else  {
            *perspNorm = (u16) ((2.0 * 65536.0) / (near + far));
            if (*perspNorm <= 0) {
                *perspNorm = (u16) 0x0001;
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel state_init_file_select
/* 10458 80035058 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 1045C 8003505C AFBF001C */  sw        $ra, 0x1C($sp)
/* 10460 80035060 AFB00018 */  sw        $s0, 0x18($sp)
/* 10464 80035064 F7B40020 */  sdc1      $f20, 0x20($sp)
/* 10468 80035068 3C01800A */  lui       $at, %hi(D_800A0931)
/* 1046C 8003506C A0200931 */  sb        $zero, %lo(D_800A0931)($at)
/* 10470 80035070 3C01800A */  lui       $at, %hi(D_800A0932)
/* 10474 80035074 A4200932 */  sh        $zero, %lo(D_800A0932)($at)
/* 10478 80035078 0C03805E */  jal       disable_player_input
/* 1047C 8003507C 00000000 */   nop
/* 10480 80035080 0C009C22 */  jal       set_time_freeze_mode
/* 10484 80035084 24040002 */   addiu    $a0, $zero, 0x2
/* 10488 80035088 0C00AB00 */  jal       general_heap_create
/* 1048C 8003508C 00000000 */   nop
/* 10490 80035090 0000202D */  daddu     $a0, $zero, $zero
/* 10494 80035094 0C0514BA */  jal       hud_element_set_aux_cache
/* 10498 80035098 0080282D */   daddu    $a1, $a0, $zero
/* 1049C 8003509C 0C050440 */  jal       hud_element_clear_cache
/* 104A0 800350A0 00000000 */   nop
/* 104A4 800350A4 0000202D */  daddu     $a0, $zero, $zero
/* 104A8 800350A8 0080282D */  daddu     $a1, $a0, $zero
/* 104AC 800350AC 0C045709 */  jal       load_model_textures
/* 104B0 800350B0 0080302D */   daddu    $a2, $a0, $zero
/* 104B4 800350B4 0000202D */  daddu     $a0, $zero, $zero
/* 104B8 800350B8 2405000C */  addiu     $a1, $zero, 0xC
/* 104BC 800350BC 2406001C */  addiu     $a2, $zero, 0x1C
/* 104C0 800350C0 3C10800B */  lui       $s0, %hi(gCameras)
/* 104C4 800350C4 26101D80 */  addiu     $s0, $s0, %lo(gCameras)
/* 104C8 800350C8 24020006 */  addiu     $v0, $zero, 0x6
/* 104CC 800350CC A6020004 */  sh        $v0, 0x4($s0)
/* 104D0 800350D0 24020001 */  addiu     $v0, $zero, 0x1
/* 104D4 800350D4 A6020006 */  sh        $v0, 0x6($s0)
/* 104D8 800350D8 24020010 */  addiu     $v0, $zero, 0x10
/* 104DC 800350DC A6020012 */  sh        $v0, 0x12($s0)
/* 104E0 800350E0 24021000 */  addiu     $v0, $zero, 0x1000
/* 104E4 800350E4 A6020014 */  sh        $v0, 0x14($s0)
/* 104E8 800350E8 96020000 */  lhu       $v0, 0x0($s0)
/* 104EC 800350EC 240300B8 */  addiu     $v1, $zero, 0xB8
/* 104F0 800350F0 AFA30010 */  sw        $v1, 0x10($sp)
/* 104F4 800350F4 96030AB0 */  lhu       $v1, 0xAB0($s0)
/* 104F8 800350F8 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 104FC 800350FC 4481A000 */  mtc1      $at, $f20
/* 10500 80035100 34420002 */  ori       $v0, $v0, 0x2
/* 10504 80035104 A6020000 */  sh        $v0, 0x0($s0)
/* 10508 80035108 96020558 */  lhu       $v0, 0x558($s0)
/* 1050C 8003510C 24070128 */  addiu     $a3, $zero, 0x128
/* 10510 80035110 3C018007 */  lui       $at, %hi(gCurrentCameraID)
/* 10514 80035114 AC207410 */  sw        $zero, %lo(gCurrentCameraID)($at)
/* 10518 80035118 34420002 */  ori       $v0, $v0, 0x2
/* 1051C 8003511C A6020558 */  sh        $v0, 0x558($s0)
/* 10520 80035120 96021008 */  lhu       $v0, 0x1008($s0)
/* 10524 80035124 34630002 */  ori       $v1, $v1, 0x2
/* 10528 80035128 A6030AB0 */  sh        $v1, 0xAB0($s0)
/* 1052C 8003512C E6140018 */  swc1      $f20, 0x18($s0)
/* 10530 80035130 34420002 */  ori       $v0, $v0, 0x2
/* 10534 80035134 0C00B8C5 */  jal       set_cam_viewport
/* 10538 80035138 A6021008 */   sh       $v0, 0x1008($s0)
/* 1053C 8003513C 24020028 */  addiu     $v0, $zero, 0x28
/* 10540 80035140 A602001E */  sh        $v0, 0x1E($s0)
/* 10544 80035144 24020064 */  addiu     $v0, $zero, 0x64
/* 10548 80035148 3C0143FA */  lui       $at, (0x43FA0000 >> 16)
/* 1054C 8003514C 44810000 */  mtc1      $at, $f0
/* 10550 80035150 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* 10554 80035154 44811000 */  mtc1      $at, $f2
/* 10558 80035158 3C0144BB */  lui       $at, (0x44BB8000 >> 16)
/* 1055C 8003515C 34218000 */  ori       $at, $at, (0x44BB8000 & 0xFFFF)
/* 10560 80035160 44812000 */  mtc1      $at, $f4
/* 10564 80035164 3C014316 */  lui       $at, (0x43160000 >> 16)
/* 10568 80035168 44813000 */  mtc1      $at, $f6
/* 1056C 8003516C 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* 10570 80035170 2484A650 */  addiu     $a0, $a0, %lo(gOverrideFlags)
/* 10574 80035174 A600002C */  sh        $zero, 0x2C($s0)
/* 10578 80035178 A600002E */  sh        $zero, 0x2E($s0)
/* 1057C 8003517C A6000030 */  sh        $zero, 0x30($s0)
/* 10580 80035180 E6140054 */  swc1      $f20, 0x54($s0)
/* 10584 80035184 E6140058 */  swc1      $f20, 0x58($s0)
/* 10588 80035188 A600001C */  sh        $zero, 0x1C($s0)
/* 1058C 8003518C A6020020 */  sh        $v0, 0x20($s0)
/* 10590 80035190 A6000022 */  sh        $zero, 0x22($s0)
/* 10594 80035194 E600003C */  swc1      $f0, 0x3C($s0)
/* 10598 80035198 E6020040 */  swc1      $f2, 0x40($s0)
/* 1059C 8003519C E6040044 */  swc1      $f4, 0x44($s0)
/* 105A0 800351A0 E606005C */  swc1      $f6, 0x5C($s0)
/* 105A4 800351A4 8C820000 */  lw        $v0, 0x0($a0)
/* 105A8 800351A8 3C030001 */  lui       $v1, (0x10000 >> 16)
/* 105AC 800351AC 00431025 */  or        $v0, $v0, $v1
/* 105B0 800351B0 AC820000 */  sw        $v0, 0x0($a0)
/* 105B4 800351B4 8FBF001C */  lw        $ra, 0x1C($sp)
/* 105B8 800351B8 8FB00018 */  lw        $s0, 0x18($sp)
/* 105BC 800351BC D7B40020 */  ldc1      $f20, 0x20($sp)
/* 105C0 800351C0 03E00008 */  jr        $ra
/* 105C4 800351C4 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void state_init_file_select(void) {
    D_800A0931 = 0;
    D_800A0932[0] = 0;
    disable_player_input();
    set_time_freeze_mode(TIME_FREEZE_FULL);
    general_heap_create();
    hud_element_set_aux_cache(0, 0);
    hud_element_clear_cache();
    load_model_textures(0, 0, 0);
    gCameras[CAM_DEFAULT].updateMode = CAM_UPDATE_MODE_6;
    gCameras[CAM_DEFAULT].needsInit = TRUE;
    gCameras[CAM_DEFAULT].nearClip = 16;
    gCameras[CAM_DEFAULT].farClip = 4096;
    gCameras[CAM_DEFAULT].flags |= CAMERA_FLAG_DISABLED;
    gCurrentCameraID = CAM_DEFAULT;
    gCameras[CAM_BATTLE].flags |= CAMERA_FLAG_DISABLED;
    gCameras[CAM_TATTLE].flags |= CAMERA_FLAG_DISABLED;
    gCameras[CAM_3].flags |= CAMERA_FLAG_DISABLED;
    gCameras[CAM_DEFAULT].vfov = 25.0f;
    set_cam_viewport(0, 12, 28, 296, 184);
    gCameras[CAM_DEFAULT].auxBoomLength = 40;
    gCameras[CAM_DEFAULT].lookAt_eye.x = 500.0f;
    gCameras[CAM_DEFAULT].lookAt_eye.y = 1000.0f;
    gCameras[CAM_DEFAULT].lookAt_eye.z = 1500.0f;
    gCameras[CAM_DEFAULT].lookAt_obj_target.z = 150.0f;
    gCameras[CAM_DEFAULT].bgColor[0] = 0;
    gCameras[CAM_DEFAULT].bgColor[1] = 0;
    gCameras[CAM_DEFAULT].bgColor[2] = 0;
    gCameras[CAM_DEFAULT].lookAt_obj_target.x = 25.0f;
    gCameras[CAM_DEFAULT].lookAt_obj_target.y = 25.0f;
    gCameras[CAM_DEFAULT].auxPitch = 0;
    gCameras[CAM_DEFAULT].lookAt_dist = 100;
    gCameras[CAM_DEFAULT].auxBoomPitch = 0;
    gOverrideFlags |= GLOBAL_OVERRIDES_WINDOWS_IN_FRONT_OF_CURTAINS;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel get_player_back_anim
/* 7A49C 800E0FEC 00041403 */  sra       $v0, $a0, 16
/* 7A4A0 800E0FF0 304300FF */  andi      $v1, $v0, 0xFF
/* 7A4A4 800E0FF4 24020001 */  addiu     $v0, $zero, 0x1
/* 7A4A8 800E0FF8 10620009 */  beq       $v1, $v0, .L800E1020
/* 7A4AC 800E0FFC 0000282D */   daddu    $a1, $zero, $zero
/* 7A4B0 800E1000 24020006 */  addiu     $v0, $zero, 0x6
/* 7A4B4 800E1004 10620003 */  beq       $v1, $v0, .L800E1014
/* 7A4B8 800E1008 2402000A */   addiu    $v0, $zero, 0xA
/* 7A4BC 800E100C 14620009 */  bne       $v1, $v0, .L800E1034
/* 7A4C0 800E1010 00000000 */   nop
.L800E1014:
/* 7A4C4 800E1014 24020001 */  addiu     $v0, $zero, 0x1
/* 7A4C8 800E1018 14620008 */  bne       $v1, $v0, .L800E103C
/* 7A4CC 800E101C 24020006 */   addiu    $v0, $zero, 0x6
.L800E1020:
/* 7A4D0 800E1020 3C020001 */  lui       $v0, (0x1000C >> 16)
/* 7A4D4 800E1024 3442000C */  ori       $v0, $v0, (0x1000C & 0xFFFF)
/* 7A4D8 800E1028 0044102A */  slt       $v0, $v0, $a0
/* 7A4DC 800E102C 1040003C */  beqz      $v0, .L800E1120
/* 7A4E0 800E1030 00000000 */   nop
.L800E1034:
/* 7A4E4 800E1034 03E00008 */  jr        $ra
/* 7A4E8 800E1038 0080102D */   daddu    $v0, $a0, $zero
.L800E103C:
/* 7A4EC 800E103C 14620032 */  bne       $v1, $v0, .L800E1108
/* 7A4F0 800E1040 2402000A */   addiu    $v0, $zero, 0xA
/* 7A4F4 800E1044 3C020006 */  lui       $v0, (0x6000C >> 16)
/* 7A4F8 800E1048 3442000C */  ori       $v0, $v0, (0x6000C & 0xFFFF)
/* 7A4FC 800E104C 14820004 */  bne       $a0, $v0, .L800E1060
/* 7A500 800E1050 3C020006 */   lui      $v0, (0x6000E >> 16)
/* 7A504 800E1054 3C050006 */  lui       $a1, (0x6000D >> 16)
/* 7A508 800E1058 08038448 */  j         .L800E1120
/* 7A50C 800E105C 34A5000D */   ori      $a1, $a1, (0x6000D & 0xFFFF)
.L800E1060:
/* 7A510 800E1060 3442000E */  ori       $v0, $v0, (0x6000E & 0xFFFF)
/* 7A514 800E1064 14820004 */  bne       $a0, $v0, .L800E1078
/* 7A518 800E1068 3C020006 */   lui      $v0, (0x60010 >> 16)
/* 7A51C 800E106C 3C050006 */  lui       $a1, (0x6000F >> 16)
/* 7A520 800E1070 08038448 */  j         .L800E1120
/* 7A524 800E1074 34A5000F */   ori      $a1, $a1, (0x6000F & 0xFFFF)
.L800E1078:
/* 7A528 800E1078 34420010 */  ori       $v0, $v0, (0x60010 & 0xFFFF)
/* 7A52C 800E107C 14820004 */  bne       $a0, $v0, .L800E1090
/* 7A530 800E1080 3C020006 */   lui      $v0, (0x60012 >> 16)
/* 7A534 800E1084 3C050006 */  lui       $a1, (0x60011 >> 16)
/* 7A538 800E1088 08038448 */  j         .L800E1120
/* 7A53C 800E108C 34A50011 */   ori      $a1, $a1, (0x60011 & 0xFFFF)
.L800E1090:
/* 7A540 800E1090 34420012 */  ori       $v0, $v0, (0x60012 & 0xFFFF)
/* 7A544 800E1094 14820004 */  bne       $a0, $v0, .L800E10A8
/* 7A548 800E1098 3C020006 */   lui      $v0, (0x60014 >> 16)
/* 7A54C 800E109C 3C050006 */  lui       $a1, (0x60013 >> 16)
/* 7A550 800E10A0 08038448 */  j         .L800E1120
/* 7A554 800E10A4 34A50013 */   ori      $a1, $a1, (0x60013 & 0xFFFF)
.L800E10A8:
/* 7A558 800E10A8 34420014 */  ori       $v0, $v0, (0x60014 & 0xFFFF)
/* 7A55C 800E10AC 14820004 */  bne       $a0, $v0, .L800E10C0
/* 7A560 800E10B0 3C020006 */   lui      $v0, (0x60016 >> 16)
/* 7A564 800E10B4 3C050006 */  lui       $a1, (0x60015 >> 16)
/* 7A568 800E10B8 08038448 */  j         .L800E1120
/* 7A56C 800E10BC 34A50015 */   ori      $a1, $a1, (0x60015 & 0xFFFF)
.L800E10C0:
/* 7A570 800E10C0 34420016 */  ori       $v0, $v0, (0x60016 & 0xFFFF)
/* 7A574 800E10C4 14820004 */  bne       $a0, $v0, .L800E10D8
/* 7A578 800E10C8 3C020006 */   lui      $v0, (0x60018 >> 16)
/* 7A57C 800E10CC 3C050006 */  lui       $a1, (0x60017 >> 16)
/* 7A580 800E10D0 08038448 */  j         .L800E1120
/* 7A584 800E10D4 34A50017 */   ori      $a1, $a1, (0x60017 & 0xFFFF)
.L800E10D8:
/* 7A588 800E10D8 34420018 */  ori       $v0, $v0, (0x60018 & 0xFFFF)
/* 7A58C 800E10DC 14820004 */  bne       $a0, $v0, .L800E10F0
/* 7A590 800E10E0 3C020006 */   lui      $v0, (0x6001A >> 16)
/* 7A594 800E10E4 3C050006 */  lui       $a1, (0x60019 >> 16)
/* 7A598 800E10E8 08038448 */  j         .L800E1120
/* 7A59C 800E10EC 34A50019 */   ori      $a1, $a1, (0x60019 & 0xFFFF)
.L800E10F0:
/* 7A5A0 800E10F0 3442001A */  ori       $v0, $v0, (0x6001A & 0xFFFF)
/* 7A5A4 800E10F4 1482000A */  bne       $a0, $v0, .L800E1120
/* 7A5A8 800E10F8 00000000 */   nop
/* 7A5AC 800E10FC 3C050006 */  lui       $a1, (0x6001B >> 16)
/* 7A5B0 800E1100 08038448 */  j         .L800E1120
/* 7A5B4 800E1104 34A5001B */   ori      $a1, $a1, (0x6001B & 0xFFFF)
.L800E1108:
/* 7A5B8 800E1108 14620005 */  bne       $v1, $v0, .L800E1120
/* 7A5BC 800E110C 3C02000A */   lui      $v0, (0xA0006 >> 16)
/* 7A5C0 800E1110 34420006 */  ori       $v0, $v0, (0xA0006 & 0xFFFF)
/* 7A5C4 800E1114 0044102A */  slt       $v0, $v0, $a0
/* 7A5C8 800E1118 54400001 */  bnel      $v0, $zero, .L800E1120
/* 7A5CC 800E111C 24850001 */   addiu    $a1, $a0, 0x1
.L800E1120:
/* 7A5D0 800E1120 14A00003 */  bnez      $a1, .L800E1130
/* 7A5D4 800E1124 3C020100 */   lui      $v0, (0x1000000 >> 16)
/* 7A5D8 800E1128 03E00008 */  jr        $ra
/* 7A5DC 800E112C 00821025 */   or       $v0, $a0, $v0
.L800E1130:
/* 7A5E0 800E1130 03E00008 */  jr        $ra
/* 7A5E4 800E1134 00A0102D */   daddu    $v0, $a1, $zero

### DECOMPILED C INSTRUCTIONS:

s32 get_player_back_anim(s32 anim) {
    s32 sprIndex = (anim >> 16) & 0xff;
    s32 outAnim = 0;

    if (sprIndex != SPR_Mario1) {
        if (sprIndex != SPR_MarioW1 && sprIndex != SPR_Peach1) {
            return anim;
        }

        if (sprIndex == SPR_Mario1) {
            if (anim > ANIM_Mario1_SpinFall) {
                return anim;
            }
        } else if (sprIndex == SPR_MarioW1) {
            if (anim == ANIM_MarioW1_Lift) {
                outAnim = ANIM_MarioW1_Lift_Back;
            } else if (anim == ANIM_MarioW1_Toss) {
                outAnim = ANIM_MarioW1_Toss_Back;
            } else if (anim == ANIM_MarioW1_Smash1_Miss) {
                outAnim = ANIM_MarioW1_Smash1_Miss_Back;
            } else if (anim == ANIM_MarioW1_Smash1_Hit) {
                outAnim = ANIM_MarioW1_Smash1_Hit_Back;
            } else if (anim == ANIM_MarioW1_Smash2_Miss) {
                outAnim = ANIM_MarioW1_Smash2_Miss_Back;
            } else if (anim == ANIM_MarioW1_Smash2_Hit) {
                outAnim = ANIM_MarioW1_Smash2_Hit_Back;
            } else if (anim == ANIM_MarioW1_Smash3_Miss) {
                outAnim = ANIM_MarioW1_Smash3_Miss_Back;
            } else if (anim == ANIM_MarioW1_Smash3_Hit) {
                outAnim = ANIM_MarioW1_Smash3_Hit_Back;
            }
        } else if (sprIndex == SPR_Peach1) {
            if (anim > ANIM_Peach1_StepDown) {
                outAnim = anim + 1;
            }
        }
    } else if (anim > ANIM_Mario1_SpinFall) {
        return anim;
    }

    if (outAnim != 0) {
        return outAnim;
    } else {
        return anim | SPRITE_ID_BACK_FACING;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel init_model_data
/* AC6E8 80115FE8 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* AC6EC 80115FEC 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* AC6F0 80115FF0 80420070 */  lb        $v0, 0x70($v0)
/* AC6F4 80115FF4 14400027 */  bnez      $v0, .L80116094
/* AC6F8 80115FF8 00000000 */   nop
/* AC6FC 80115FFC 3C028015 */  lui       $v0, %hi(wModelList)
/* AC700 80116000 24421770 */  addiu     $v0, $v0, %lo(wModelList)
/* AC704 80116004 3C018015 */  lui       $at, %hi(gCurrentModels)
/* AC708 80116008 AC2212CC */  sw        $v0, %lo(gCurrentModels)($at)
/* AC70C 8011600C 3C028015 */  lui       $v0, %hi(wTransformGroups)
/* AC710 80116010 24421F70 */  addiu     $v0, $v0, %lo(wTransformGroups)
/* AC714 80116014 3C018015 */  lui       $at, %hi(gCurrentTransformGroups)
/* AC718 80116018 AC2212E0 */  sw        $v0, %lo(gCurrentTransformGroups)($at)
/* AC71C 8011601C 3C028015 */  lui       $v0, %hi(wModelSpecialDls)
/* AC720 80116020 24421F90 */  addiu     $v0, $v0, %lo(wModelSpecialDls)
/* AC724 80116024 3C018015 */  lui       $at, %hi(gCurrentCustomModelGfxPtr)
/* AC728 80116028 AC2212E8 */  sw        $v0, %lo(gCurrentCustomModelGfxPtr)($at)
/* AC72C 8011602C 3C028015 */  lui       $v0, %hi(wCustomModelGfxBuilders)
/* AC730 80116030 24422090 */  addiu     $v0, $v0, %lo(wCustomModelGfxBuilders)
/* AC734 80116034 3C018015 */  lui       $at, %hi(gCurrentCustomModelGfxBuildersPtr)
/* AC738 80116038 AC2212B8 */  sw        $v0, %lo(gCurrentCustomModelGfxBuildersPtr)($at)
/* AC73C 8011603C 3C028015 */  lui       $v0, %hi(D_80152214)
/* AC740 80116040 24422214 */  addiu     $v0, $v0, %lo(D_80152214)
/* AC744 80116044 3C018015 */  lui       $at, %hi(gCurrentModelTreeRoot)
/* AC748 80116048 AC2212FC */  sw        $v0, %lo(gCurrentModelTreeRoot)($at)
/* AC74C 8011604C 3C028015 */  lui       $v0, %hi(wModelLocalVtxBuffers)
/* AC750 80116050 24422190 */  addiu     $v0, $v0, %lo(wModelLocalVtxBuffers)
/* AC754 80116054 3C018015 */  lui       $at, %hi(gCurrentModelLocalVtxBuffers)
/* AC758 80116058 AC222210 */  sw        $v0, %lo(gCurrentModelLocalVtxBuffers)($at)
/* AC75C 8011605C 3C028015 */  lui       $v0, %hi(D_80152220)
/* AC760 80116060 24422220 */  addiu     $v0, $v0, %lo(D_80152220)
/* AC764 80116064 3C01800A */  lui       $at, %hi(mdl_currentModelTreeNodeInfo)
/* AC768 80116068 AC22A5F4 */  sw        $v0, %lo(mdl_currentModelTreeNodeInfo)($at)
/* AC76C 8011606C 3C028015 */  lui       $v0, %hi(wBackgroundFogMode)
/* AC770 80116070 24423220 */  addiu     $v0, $v0, %lo(wBackgroundFogMode)
/* AC774 80116074 3C018015 */  lui       $at, %hi(gBackgroundFogModePtr)
/* AC778 80116078 AC2212F0 */  sw        $v0, %lo(gBackgroundFogModePtr)($at)
/* AC77C 8011607C 3C028015 */  lui       $v0, %hi(wFogSettings)
/* AC780 80116080 24423228 */  addiu     $v0, $v0, %lo(wFogSettings)
/* AC784 80116084 3C018015 */  lui       $at, %hi(gCurrentFogSettings)
/* AC788 80116088 AC223264 */  sw        $v0, %lo(gCurrentFogSettings)($at)
/* AC78C 8011608C 03E00008 */  jr        $ra
/* AC790 80116090 00000000 */   nop
.L80116094:
/* AC794 80116094 3C028015 */  lui       $v0, %hi(bModelList)
/* AC798 80116098 24421B70 */  addiu     $v0, $v0, %lo(bModelList)
/* AC79C 8011609C 3C018015 */  lui       $at, %hi(gCurrentModels)
/* AC7A0 801160A0 AC2212CC */  sw        $v0, %lo(gCurrentModels)($at)
/* AC7A4 801160A4 3C028015 */  lui       $v0, %hi(bTransformGroups)
/* AC7A8 801160A8 24421F80 */  addiu     $v0, $v0, %lo(bTransformGroups)
/* AC7AC 801160AC 3C018015 */  lui       $at, %hi(gCurrentTransformGroups)
/* AC7B0 801160B0 AC2212E0 */  sw        $v0, %lo(gCurrentTransformGroups)($at)
/* AC7B4 801160B4 3C028015 */  lui       $v0, %hi(bModelSpecialDls)
/* AC7B8 801160B8 24422010 */  addiu     $v0, $v0, %lo(bModelSpecialDls)
/* AC7BC 801160BC 3C018015 */  lui       $at, %hi(gCurrentCustomModelGfxPtr)
/* AC7C0 801160C0 AC2212E8 */  sw        $v0, %lo(gCurrentCustomModelGfxPtr)($at)
/* AC7C4 801160C4 3C028015 */  lui       $v0, %hi(bCustomModelGfxBuilders)
/* AC7C8 801160C8 24422110 */  addiu     $v0, $v0, %lo(bCustomModelGfxBuilders)
/* AC7CC 801160CC 3C018015 */  lui       $at, %hi(gCurrentCustomModelGfxBuildersPtr)
/* AC7D0 801160D0 AC2212B8 */  sw        $v0, %lo(gCurrentCustomModelGfxBuildersPtr)($at)
/* AC7D4 801160D4 3C028015 */  lui       $v0, %hi(D_80152218)
/* AC7D8 801160D8 24422218 */  addiu     $v0, $v0, %lo(D_80152218)
/* AC7DC 801160DC 3C018015 */  lui       $at, %hi(gCurrentModelTreeRoot)
/* AC7E0 801160E0 AC2212FC */  sw        $v0, %lo(gCurrentModelTreeRoot)($at)
/* AC7E4 801160E4 3C028015 */  lui       $v0, %hi(bModelLocalVtxBuffers)
/* AC7E8 801160E8 244221D0 */  addiu     $v0, $v0, %lo(bModelLocalVtxBuffers)
/* AC7EC 801160EC 3C018015 */  lui       $at, %hi(gCurrentModelLocalVtxBuffers)
/* AC7F0 801160F0 AC222210 */  sw        $v0, %lo(gCurrentModelLocalVtxBuffers)($at)
/* AC7F4 801160F4 3C028015 */  lui       $v0, %hi(D_80152A20)
/* AC7F8 801160F8 24422A20 */  addiu     $v0, $v0, %lo(D_80152A20)
/* AC7FC 801160FC 3C01800A */  lui       $at, %hi(mdl_currentModelTreeNodeInfo)
/* AC800 80116100 AC22A5F4 */  sw        $v0, %lo(mdl_currentModelTreeNodeInfo)($at)
/* AC804 80116104 3C028015 */  lui       $v0, %hi(bBackgroundFogMode)
/* AC808 80116108 24423221 */  addiu     $v0, $v0, %lo(bBackgroundFogMode)
/* AC80C 8011610C 3C018015 */  lui       $at, %hi(gBackgroundFogModePtr)
/* AC810 80116110 AC2212F0 */  sw        $v0, %lo(gBackgroundFogModePtr)($at)
/* AC814 80116114 3C028015 */  lui       $v0, %hi(bFogSettings)
/* AC818 80116118 24423248 */  addiu     $v0, $v0, %lo(bFogSettings)
/* AC81C 8011611C 3C018015 */  lui       $at, %hi(gCurrentFogSettings)
/* AC820 80116120 AC223264 */  sw        $v0, %lo(gCurrentFogSettings)($at)
/* AC824 80116124 03E00008 */  jr        $ra
/* AC828 80116128 00000000 */   nop

### DECOMPILED C INSTRUCTIONS:

void init_model_data(void) {
    if (!gGameStatusPtr->isBattle) {
        gCurrentModels = &wModelList;
        gCurrentTransformGroups = &wTransformGroups;
        gCurrentCustomModelGfxPtr = &wModelSpecialDls;
        gCurrentCustomModelGfxBuildersPtr = &wCustomModelGfxBuilders;
        gCurrentModelTreeRoot = &D_80152214;
        gCurrentModelLocalVtxBuffers = &wModelLocalVtxBuffers;
        mdl_currentModelTreeNodeInfo = &D_80152220;
        gBackgroundFogModePtr = &wBackgroundFogMode;
        gCurrentFogSettings = &wFogSettings;
    } else {
        gCurrentModels = &bModelList;
        gCurrentTransformGroups = &bTransformGroups;
        gCurrentCustomModelGfxPtr = &bModelSpecialDls;
        gCurrentCustomModelGfxBuildersPtr = &bCustomModelGfxBuilders;
        gCurrentModelTreeRoot = &D_80152218;
        gCurrentModelLocalVtxBuffers = &bModelLocalVtxBuffers;
        mdl_currentModelTreeNodeInfo = &D_80152A20;
        gBackgroundFogModePtr = &bBackgroundFogMode;
        gCurrentFogSettings = &bFogSettings;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_syn_set_fxmix
/* 32DD8 800579D8 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 32DDC 800579DC AFB20018 */  sw        $s2, 0x18($sp)
/* 32DE0 800579E0 00A0902D */  daddu     $s2, $a1, $zero
/* 32DE4 800579E4 308400FF */  andi      $a0, $a0, 0xFF
/* 32DE8 800579E8 00041140 */  sll       $v0, $a0, 5
/* 32DEC 800579EC 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 32DF0 800579F0 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 32DF4 800579F4 00441023 */  subu      $v0, $v0, $a0
/* 32DF8 800579F8 AFBF001C */  sw        $ra, 0x1C($sp)
/* 32DFC 800579FC AFB10014 */  sw        $s1, 0x14($sp)
/* 32E00 80057A00 AFB00010 */  sw        $s0, 0x10($sp)
/* 32E04 80057A04 8C63001C */  lw        $v1, 0x1C($v1)
/* 32E08 80057A08 00021080 */  sll       $v0, $v0, 2
/* 32E0C 80057A0C 00628021 */  addu      $s0, $v1, $v0
/* 32E10 80057A10 8E050064 */  lw        $a1, 0x64($s0)
/* 32E14 80057A14 8E030068 */  lw        $v1, 0x68($s0)
/* 32E18 80057A18 00A3102A */  slt       $v0, $a1, $v1
/* 32E1C 80057A1C 14400029 */  bnez      $v0, .L80057AC4
/* 32E20 80057A20 26110048 */   addiu    $s1, $s0, 0x48
/* 32E24 80057A24 3C028008 */  lui       $v0, %hi(AuSynUseStereo)
/* 32E28 80057A28 24428181 */  addiu     $v0, $v0, %lo(AuSynUseStereo)
/* 32E2C 80057A2C 90420000 */  lbu       $v0, 0x0($v0)
/* 32E30 80057A30 1440000E */  bnez      $v0, .L80057A6C
/* 32E34 80057A34 AE030064 */   sw       $v1, 0x64($s0)
/* 32E38 80057A38 3C048008 */  lui       $a0, %hi(AlCosineBlend)
/* 32E3C 80057A3C 24848E60 */  addiu     $a0, $a0, %lo(AlCosineBlend)
/* 32E40 80057A40 8603004E */  lh        $v1, 0x4E($s0)
/* 32E44 80057A44 84820080 */  lh        $v0, 0x80($a0)
/* 32E48 80057A48 00620018 */  mult      $v1, $v0
/* 32E4C 80057A4C 00004012 */  mflo      $t0
/* 32E50 80057A50 000813C3 */  sra       $v0, $t0, 15
/* 32E54 80057A54 A6020050 */  sh        $v0, 0x50($s0)
/* 32E58 80057A58 84820080 */  lh        $v0, 0x80($a0)
/* 32E5C 80057A5C 00620018 */  mult      $v1, $v0
/* 32E60 80057A60 00004012 */  mflo      $t0
/* 32E64 80057A64 08015EBB */  j         .L80057AEC
/* 32E68 80057A68 000813C3 */   sra      $v0, $t0, 15
.L80057A6C:
/* 32E6C 80057A6C 8602004C */  lh        $v0, 0x4C($s0)
/* 32E70 80057A70 8603004E */  lh        $v1, 0x4E($s0)
/* 32E74 80057A74 00021040 */  sll       $v0, $v0, 1
/* 32E78 80057A78 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32E7C 80057A7C 00220821 */  addu      $at, $at, $v0
/* 32E80 80057A80 84228E60 */  lh        $v0, %lo(AlCosineBlend)($at)
/* 32E84 80057A84 00620018 */  mult      $v1, $v0
/* 32E88 80057A88 8603004C */  lh        $v1, 0x4C($s0)
/* 32E8C 80057A8C 00004012 */  mflo      $t0
/* 32E90 80057A90 000813C3 */  sra       $v0, $t0, 15
/* 32E94 80057A94 A6020050 */  sh        $v0, 0x50($s0)
/* 32E98 80057A98 2402007F */  addiu     $v0, $zero, 0x7F
/* 32E9C 80057A9C 00431023 */  subu      $v0, $v0, $v1
/* 32EA0 80057AA0 00021040 */  sll       $v0, $v0, 1
/* 32EA4 80057AA4 8603004E */  lh        $v1, 0x4E($s0)
/* 32EA8 80057AA8 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32EAC 80057AAC 00220821 */  addu      $at, $at, $v0
/* 32EB0 80057AB0 84228E60 */  lh        $v0, %lo(AlCosineBlend)($at)
/* 32EB4 80057AB4 00620018 */  mult      $v1, $v0
/* 32EB8 80057AB8 00004012 */  mflo      $t0
/* 32EBC 80057ABC 08015EBB */  j         .L80057AEC
/* 32EC0 80057AC0 000813C3 */   sra      $v0, $t0, 15
.L80057AC4:
/* 32EC4 80057AC4 86040050 */  lh        $a0, 0x50($s0)
/* 32EC8 80057AC8 8606005A */  lh        $a2, 0x5A($s0)
/* 32ECC 80057ACC 0C016001 */  jal       func_80058004
/* 32ED0 80057AD0 96070058 */   lhu      $a3, 0x58($s0)
/* 32ED4 80057AD4 86040052 */  lh        $a0, 0x52($s0)
/* 32ED8 80057AD8 8E050064 */  lw        $a1, 0x64($s0)
/* 32EDC 80057ADC 86060060 */  lh        $a2, 0x60($s0)
/* 32EE0 80057AE0 9607005E */  lhu       $a3, 0x5E($s0)
/* 32EE4 80057AE4 0C016001 */  jal       func_80058004
/* 32EE8 80057AE8 A6020050 */   sh       $v0, 0x50($s0)
.L80057AEC:
/* 32EEC 80057AEC A6020052 */  sh        $v0, 0x52($s0)
/* 32EF0 80057AF0 86220008 */  lh        $v0, 0x8($s1)
/* 32EF4 80057AF4 14400002 */  bnez      $v0, .L80057B00
/* 32EF8 80057AF8 24020001 */   addiu    $v0, $zero, 0x1
/* 32EFC 80057AFC A6220008 */  sh        $v0, 0x8($s1)
.L80057B00:
/* 32F00 80057B00 8622000A */  lh        $v0, 0xA($s1)
/* 32F04 80057B04 14400003 */  bnez      $v0, .L80057B14
/* 32F08 80057B08 324300FF */   andi     $v1, $s2, 0xFF
/* 32F0C 80057B0C 24020001 */  addiu     $v0, $zero, 0x1
/* 32F10 80057B10 A622000A */  sh        $v0, 0xA($s1)
.L80057B14:
/* 32F14 80057B14 00031040 */  sll       $v0, $v1, 1
/* 32F18 80057B18 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32F1C 80057B1C 00220821 */  addu      $at, $at, $v0
/* 32F20 80057B20 94228E60 */  lhu       $v0, %lo(AlCosineBlend)($at)
/* 32F24 80057B24 A622000C */  sh        $v0, 0xC($s1)
/* 32F28 80057B28 2402007F */  addiu     $v0, $zero, 0x7F
/* 32F2C 80057B2C 00431023 */  subu      $v0, $v0, $v1
/* 32F30 80057B30 00021040 */  sll       $v0, $v0, 1
/* 32F34 80057B34 3C038008 */  lui       $v1, %hi(AlCosineBlend)
/* 32F38 80057B38 00621821 */  addu      $v1, $v1, $v0
/* 32F3C 80057B3C 94638E60 */  lhu       $v1, %lo(AlCosineBlend)($v1)
/* 32F40 80057B40 24020001 */  addiu     $v0, $zero, 0x1
/* 32F44 80057B44 AE220024 */  sw        $v0, 0x24($s1)
/* 32F48 80057B48 A623000E */  sh        $v1, 0xE($s1)
/* 32F4C 80057B4C 8FBF001C */  lw        $ra, 0x1C($sp)
/* 32F50 80057B50 8FB20018 */  lw        $s2, 0x18($sp)
/* 32F54 80057B54 8FB10014 */  lw        $s1, 0x14($sp)
/* 32F58 80057B58 8FB00010 */  lw        $s0, 0x10($sp)
/* 32F5C 80057B5C 03E00008 */  jr        $ra
/* 32F60 80057B60 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void au_syn_set_fxmix(u8 voiceIdx, 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->dryamt = AuEqPower[fxMix];
    envMixer->wetamt = AuEqPower[AU_EQPOW_MAX_IDX - fxMix];
    envMixer->first = 1;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel SetPartPos
/* 1997F8 8026AF18 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 1997FC 8026AF1C AFB10014 */  sw        $s1, 0x14($sp)
/* 199800 8026AF20 0080882D */  daddu     $s1, $a0, $zero
/* 199804 8026AF24 AFBF0020 */  sw        $ra, 0x20($sp)
/* 199808 8026AF28 AFB3001C */  sw        $s3, 0x1C($sp)
/* 19980C 8026AF2C AFB20018 */  sw        $s2, 0x18($sp)
/* 199810 8026AF30 AFB00010 */  sw        $s0, 0x10($sp)
/* 199814 8026AF34 F7B80038 */  sdc1      $f24, 0x38($sp)
/* 199818 8026AF38 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 19981C 8026AF3C F7B40028 */  sdc1      $f20, 0x28($sp)
/* 199820 8026AF40 8E30000C */  lw        $s0, 0xC($s1)
/* 199824 8026AF44 8E050000 */  lw        $a1, 0x0($s0)
/* 199828 8026AF48 0C0B1EAF */  jal       evt_get_variable
/* 19982C 8026AF4C 26100004 */   addiu    $s0, $s0, 0x4
/* 199830 8026AF50 0040902D */  daddu     $s2, $v0, $zero
/* 199834 8026AF54 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 199838 8026AF58 16420002 */  bne       $s2, $v0, .L8026AF64
/* 19983C 8026AF5C 00000000 */   nop
/* 199840 8026AF60 8E320148 */  lw        $s2, 0x148($s1)
.L8026AF64:
/* 199844 8026AF64 8E050000 */  lw        $a1, 0x0($s0)
/* 199848 8026AF68 26100004 */  addiu     $s0, $s0, 0x4
/* 19984C 8026AF6C 0C0B1EAF */  jal       evt_get_variable
/* 199850 8026AF70 0220202D */   daddu    $a0, $s1, $zero
/* 199854 8026AF74 8E050000 */  lw        $a1, 0x0($s0)
/* 199858 8026AF78 26100004 */  addiu     $s0, $s0, 0x4
/* 19985C 8026AF7C 0220202D */  daddu     $a0, $s1, $zero
/* 199860 8026AF80 0C0B1EAF */  jal       evt_get_variable
/* 199864 8026AF84 0040982D */   daddu    $s3, $v0, $zero
/* 199868 8026AF88 8E050000 */  lw        $a1, 0x0($s0)
/* 19986C 8026AF8C 26100004 */  addiu     $s0, $s0, 0x4
/* 199870 8026AF90 4482A000 */  mtc1      $v0, $f20
/* 199874 8026AF94 00000000 */  nop
/* 199878 8026AF98 4680A520 */  cvt.s.w   $f20, $f20
/* 19987C 8026AF9C 0C0B1EAF */  jal       evt_get_variable
/* 199880 8026AFA0 0220202D */   daddu    $a0, $s1, $zero
/* 199884 8026AFA4 8E050000 */  lw        $a1, 0x0($s0)
/* 199888 8026AFA8 4482B000 */  mtc1      $v0, $f22
/* 19988C 8026AFAC 00000000 */  nop
/* 199890 8026AFB0 4680B5A0 */  cvt.s.w   $f22, $f22
/* 199894 8026AFB4 0C0B1EAF */  jal       evt_get_variable
/* 199898 8026AFB8 0220202D */   daddu    $a0, $s1, $zero
/* 19989C 8026AFBC 4482C000 */  mtc1      $v0, $f24
/* 1998A0 8026AFC0 00000000 */  nop
/* 1998A4 8026AFC4 4680C620 */  cvt.s.w   $f24, $f24
/* 1998A8 8026AFC8 0C09A75B */  jal       get_actor
/* 1998AC 8026AFCC 0240202D */   daddu    $a0, $s2, $zero
/* 1998B0 8026AFD0 0040182D */  daddu     $v1, $v0, $zero
/* 1998B4 8026AFD4 32440700 */  andi      $a0, $s2, 0x700
/* 1998B8 8026AFD8 24020100 */  addiu     $v0, $zero, 0x100
/* 1998BC 8026AFDC 1082000E */  beq       $a0, $v0, .L8026B018
/* 1998C0 8026AFE0 28820101 */   slti     $v0, $a0, 0x101
/* 1998C4 8026AFE4 10400005 */  beqz      $v0, .L8026AFFC
/* 1998C8 8026AFE8 24020200 */   addiu    $v0, $zero, 0x200
/* 1998CC 8026AFEC 50800007 */  beql      $a0, $zero, .L8026B00C
/* 1998D0 8026AFF0 E4740144 */   swc1     $f20, 0x144($v1)
/* 1998D4 8026AFF4 0809AC1D */  j         .L8026B074
/* 1998D8 8026AFF8 00000000 */   nop
.L8026AFFC:
/* 1998DC 8026AFFC 10820007 */  beq       $a0, $v0, .L8026B01C
/* 1998E0 8026B000 0060202D */   daddu    $a0, $v1, $zero
/* 1998E4 8026B004 0809AC1D */  j         .L8026B074
/* 1998E8 8026B008 00000000 */   nop
.L8026B00C:
/* 1998EC 8026B00C E4760148 */  swc1      $f22, 0x148($v1)
/* 1998F0 8026B010 0809AC1D */  j         .L8026B074
/* 1998F4 8026B014 E478014C */   swc1     $f24, 0x14C($v1)
.L8026B018:
/* 1998F8 8026B018 0060202D */  daddu     $a0, $v1, $zero
.L8026B01C:
/* 1998FC 8026B01C 0C099117 */  jal       get_actor_part
/* 199900 8026B020 0260282D */   daddu    $a1, $s3, $zero
/* 199904 8026B024 0040202D */  daddu     $a0, $v0, $zero
/* 199908 8026B028 8C820000 */  lw        $v0, 0x0($a0)
/* 19990C 8026B02C 3C030010 */  lui       $v1, (0x100000 >> 16)
/* 199910 8026B030 00431024 */  and       $v0, $v0, $v1
/* 199914 8026B034 5440000D */  bnel      $v0, $zero, .L8026B06C
/* 199918 8026B038 E494002C */   swc1     $f20, 0x2C($a0)
/* 19991C 8026B03C 4600A00D */  trunc.w.s $f0, $f20
/* 199920 8026B040 44020000 */  mfc1      $v0, $f0
/* 199924 8026B044 00000000 */  nop
/* 199928 8026B048 A4820014 */  sh        $v0, 0x14($a0)
/* 19992C 8026B04C 4600B00D */  trunc.w.s $f0, $f22
/* 199930 8026B050 44020000 */  mfc1      $v0, $f0
/* 199934 8026B054 00000000 */  nop
/* 199938 8026B058 A4820016 */  sh        $v0, 0x16($a0)
/* 19993C 8026B05C 4600C00D */  trunc.w.s $f0, $f24
/* 199940 8026B060 44020000 */  mfc1      $v0, $f0
/* 199944 8026B064 0809AC1D */  j         .L8026B074
/* 199948 8026B068 A4820018 */   sh       $v0, 0x18($a0)
.L8026B06C:
/* 19994C 8026B06C E4960030 */  swc1      $f22, 0x30($a0)
/* 199950 8026B070 E4980034 */  swc1      $f24, 0x34($a0)
.L8026B074:
/* 199954 8026B074 8FBF0020 */  lw        $ra, 0x20($sp)
/* 199958 8026B078 8FB3001C */  lw        $s3, 0x1C($sp)
/* 19995C 8026B07C 8FB20018 */  lw        $s2, 0x18($sp)
/* 199960 8026B080 8FB10014 */  lw        $s1, 0x14($sp)
/* 199964 8026B084 8FB00010 */  lw        $s0, 0x10($sp)
/* 199968 8026B088 D7B80038 */  ldc1      $f24, 0x38($sp)
/* 19996C 8026B08C D7B60030 */  ldc1      $f22, 0x30($sp)
/* 199970 8026B090 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 199974 8026B094 24020002 */  addiu     $v0, $zero, 0x2
/* 199978 8026B098 03E00008 */  jr        $ra
/* 19997C 8026B09C 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

ApiStatus SetPartPos(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    s32 actorID = evt_get_variable(script, *args++);
    Actor* actor;
    s32 partID;
    f32 x, y, z;
    ActorPart* actorPart;

    if (actorID == ACTOR_SELF) {
        actorID = script->owner1.actorID;
    }

    partID = evt_get_variable(script, *args++);
    x = evt_get_variable(script, *args++);
    y = evt_get_variable(script, *args++);
    z = evt_get_variable(script, *args++);

    actor = get_actor(actorID);

    switch (actorID & ACTOR_CLASS_MASK) {
        case ACTOR_CLASS_PLAYER:
            actor->currentPos.x = x;
            actor->currentPos.y = y;
            actor->currentPos.z = z;
            break;
        case ACTOR_CLASS_PARTNER:
        case ACTOR_CLASS_ENEMY:
            actorPart = get_actor_part(actor, partID);

            if (!(actorPart->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) {
                actorPart->partOffset.x = x;
                actorPart->partOffset.y = y;
                actorPart->partOffset.z = z;
            } else {
                actorPart->absolutePosition.x = x;
                actorPart->absolutePosition.y = y;
                actorPart->absolutePosition.z = z;
            }
            break;
    }

    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel is_entity_data_loaded
/* A785C 8011115C ACC00000 */  sw        $zero, 0x0($a2)
/* A7860 80111160 ACE00000 */  sw        $zero, 0x0($a3)
/* A7864 80111164 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* A7868 80111168 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* A786C 8011116C 80420070 */  lb        $v0, 0x70($v0)
/* A7870 80111170 3C098015 */  lui       $t1, %hi(bEntityBlueprint)
/* A7874 80111174 252916E8 */  addiu     $t1, $t1, %lo(bEntityBlueprint)
/* A7878 80111178 14400003 */  bnez      $v0, .L80111188
/* A787C 8011117C 0000582D */   daddu    $t3, $zero, $zero
/* A7880 80111180 3C098015 */  lui       $t1, %hi(wEntityBlueprint)
/* A7884 80111184 25291668 */  addiu     $t1, $t1, %lo(wEntityBlueprint)
.L80111188:
/* A7888 80111188 0000502D */  daddu     $t2, $zero, $zero
.L8011118C:
/* A788C 8011118C 8D240000 */  lw        $a0, 0x0($t1)
/* A7890 80111190 1480000A */  bnez      $a0, .L801111BC
/* A7894 80111194 00000000 */   nop
/* A7898 80111198 AD250000 */  sw        $a1, 0x0($t1)
/* A789C 8011119C AD200004 */  sw        $zero, 0x4($t1)
/* A78A0 801111A0 94A20000 */  lhu       $v0, 0x0($a1)
/* A78A4 801111A4 30420008 */  andi      $v0, $v0, 0x8
/* A78A8 801111A8 1040003C */  beqz      $v0, .L8011129C
/* A78AC 801111AC 240B0001 */   addiu    $t3, $zero, 0x1
/* A78B0 801111B0 8CA30018 */  lw        $v1, 0x18($a1)
/* A78B4 801111B4 08044481 */  j         .L80111204
/* A78B8 801111B8 00000000 */   nop
.L801111BC:
/* A78BC 801111BC 8C880018 */  lw        $t0, 0x18($a0)
/* A78C0 801111C0 8CA30018 */  lw        $v1, 0x18($a1)
/* A78C4 801111C4 15030009 */  bne       $t0, $v1, .L801111EC
/* A78C8 801111C8 00000000 */   nop
/* A78CC 801111CC 94A20000 */  lhu       $v0, 0x0($a1)
/* A78D0 801111D0 30420008 */  andi      $v0, $v0, 0x8
/* A78D4 801111D4 10400031 */  beqz      $v0, .L8011129C
/* A78D8 801111D8 00000000 */   nop
/* A78DC 801111DC 8D020004 */  lw        $v0, 0x4($t0)
/* A78E0 801111E0 8D030000 */  lw        $v1, 0x0($t0)
/* A78E4 801111E4 08044484 */  j         .L80111210
/* A78E8 801111E8 00431023 */   subu     $v0, $v0, $v1
.L801111EC:
/* A78EC 801111EC 1485000D */  bne       $a0, $a1, .L80111224
/* A78F0 801111F0 00000000 */   nop
/* A78F4 801111F4 94820000 */  lhu       $v0, 0x0($a0)
/* A78F8 801111F8 30420008 */  andi      $v0, $v0, 0x8
/* A78FC 801111FC 10400027 */  beqz      $v0, .L8011129C
/* A7900 80111200 00000000 */   nop
.L80111204:
/* A7904 80111204 8C620004 */  lw        $v0, 0x4($v1)
/* A7908 80111208 8C630000 */  lw        $v1, 0x0($v1)
/* A790C 8011120C 00431023 */  subu      $v0, $v0, $v1
.L80111210:
/* A7910 80111210 8CC30000 */  lw        $v1, 0x0($a2)
/* A7914 80111214 00021083 */  sra       $v0, $v0, 2
/* A7918 80111218 00621821 */  addu      $v1, $v1, $v0
/* A791C 8011121C 080444A7 */  j         .L8011129C
/* A7920 80111220 ACE30000 */   sw       $v1, 0x0($a3)
.L80111224:
/* A7924 80111224 94820000 */  lhu       $v0, 0x0($a0)
/* A7928 80111228 30420008 */  andi      $v0, $v0, 0x8
/* A792C 8011122C 10400011 */  beqz      $v0, .L80111274
/* A7930 80111230 00000000 */   nop
/* A7934 80111234 8D030004 */  lw        $v1, 0x4($t0)
/* A7938 80111238 8D020000 */  lw        $v0, 0x0($t0)
/* A793C 8011123C 00621823 */  subu      $v1, $v1, $v0
/* A7940 80111240 8CC20000 */  lw        $v0, 0x0($a2)
/* A7944 80111244 00031883 */  sra       $v1, $v1, 2
/* A7948 80111248 00431021 */  addu      $v0, $v0, $v1
/* A794C 8011124C ACC20000 */  sw        $v0, 0x0($a2)
/* A7950 80111250 ACE20000 */  sw        $v0, 0x0($a3)
/* A7954 80111254 8D03000C */  lw        $v1, 0xC($t0)
/* A7958 80111258 8D020008 */  lw        $v0, 0x8($t0)
/* A795C 8011125C 00621823 */  subu      $v1, $v1, $v0
/* A7960 80111260 8CC20000 */  lw        $v0, 0x0($a2)
/* A7964 80111264 00031883 */  sra       $v1, $v1, 2
/* A7968 80111268 00431021 */  addu      $v0, $v0, $v1
/* A796C 8011126C 080444A3 */  j         .L8011128C
/* A7970 80111270 ACC20000 */   sw       $v0, 0x0($a2)
.L80111274:
/* A7974 80111274 8C82001C */  lw        $v0, 0x1C($a0)
/* A7978 80111278 8CC30000 */  lw        $v1, 0x0($a2)
/* A797C 8011127C 00481023 */  subu      $v0, $v0, $t0
/* A7980 80111280 00021083 */  sra       $v0, $v0, 2
/* A7984 80111284 00621821 */  addu      $v1, $v1, $v0
/* A7988 80111288 ACC30000 */  sw        $v1, 0x0($a2)
.L8011128C:
/* A798C 8011128C 254A0001 */  addiu     $t2, $t2, 0x1
/* A7990 80111290 2942001E */  slti      $v0, $t2, 0x1E
/* A7994 80111294 1440FFBD */  bnez      $v0, .L8011118C
/* A7998 80111298 25290004 */   addiu    $t1, $t1, 0x4
.L8011129C:
/* A799C 8011129C 03E00008 */  jr        $ra
/* A79A0 801112A0 0160102D */   daddu    $v0, $t3, $zero

### DECOMPILED C INSTRUCTIONS:

s32 is_entity_data_loaded(Entity* entity, EntityBlueprint* blueprint, s32* loadedStart, s32* loadedEnd) {
    EntityBlueprint** blueprints;
    s32 i;
    s32 ret;
    s32 size;
    DmaEntry* entDmaList;

    *loadedStart = 0;
    *loadedEnd = 0;
    ret = FALSE;

    if (!gGameStatusPtr->isBattle) {
        blueprints = wEntityBlueprint;
    } else {
        blueprints = bEntityBlueprint;
    }

    for (i = 0; i < MAX_ENTITIES; i++, blueprints++) {
        EntityBlueprint* bp = *blueprints;
        if (bp == NULL) {
            blueprints[0] = blueprint;
            blueprints[1] = NULL;
            ret = TRUE;
            if (blueprint->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) {
                s32 size;
                entDmaList = blueprint->dmaList;
                size = (entDmaList[0].end - entDmaList[0].start) >> 2;
                *loadedEnd = *loadedStart + size;
            }
            break;
        } else {
            DmaEntry* bpDmaList = bp->dmaList;
            do {} while (0); // TODO find better match
            entDmaList = blueprint->dmaList;
            if (bpDmaList == entDmaList) {
                if (blueprint->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) {
                    s32 size = (bpDmaList[0].end - bpDmaList[0].start) >> 2;
                    *loadedEnd = *loadedStart + size;
                }
                break;
            } else if (bp == blueprint) {
                if (bp->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) {
                    s32 size = (entDmaList[0].end - entDmaList[0].start) >> 2;
                    *loadedEnd = *loadedStart + size;
                }
                break;
            } else {
                if (bp->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) {
                    s32 size = (bpDmaList[0].end - bpDmaList[0].start) >> 2;
                    *loadedEnd = *loadedStart = *loadedStart + size;
                    size = (bpDmaList[1].end - bpDmaList[1].start) >> 2;
                    *loadedStart = *loadedStart + size;
                } else {
                    *loadedStart += (bp->dma.end - bp->dma.start) >> 2;
                }
            }
        }
    }

    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_scripts
/* E8724 802C3D74 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* E8728 802C3D78 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* E872C 802C3D7C 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* E8730 802C3D80 AFBF002C */  sw        $ra, 0x2C($sp)
/* E8734 802C3D84 AFB60028 */  sw        $s6, 0x28($sp)
/* E8738 802C3D88 AFB50024 */  sw        $s5, 0x24($sp)
/* E873C 802C3D8C AFB40020 */  sw        $s4, 0x20($sp)
/* E8740 802C3D90 AFB3001C */  sw        $s3, 0x1C($sp)
/* E8744 802C3D94 AFB20018 */  sw        $s2, 0x18($sp)
/* E8748 802C3D98 AFB10014 */  sw        $s1, 0x14($sp)
/* E874C 802C3D9C AFB00010 */  sw        $s0, 0x10($sp)
/* E8750 802C3DA0 F7B40030 */  sdc1      $f20, 0x30($sp)
/* E8754 802C3DA4 80420078 */  lb        $v0, 0x78($v0)
/* E8758 802C3DA8 24030001 */  addiu     $v1, $zero, 0x1
/* E875C 802C3DAC 10430042 */  beq       $v0, $v1, .L802C3EB8
/* E8760 802C3DB0 00000000 */   nop
/* E8764 802C3DB4 3C01802E */  lui       $at, %hi(gIsUpdatingScripts)
/* E8768 802C3DB8 AC239CA4 */  sw        $v1, %lo(gIsUpdatingScripts)($at)
/* E876C 802C3DBC 0C0B0C00 */  jal       sort_scripts
/* E8770 802C3DC0 0000902D */   daddu    $s2, $zero, $zero
/* E8774 802C3DC4 3C02802E */  lui       $v0, %hi(gScriptListCount)
/* E8778 802C3DC8 8C42AC98 */  lw        $v0, %lo(gScriptListCount)($v0)
/* E877C 802C3DCC 18400038 */  blez      $v0, .L802C3EB0
/* E8780 802C3DD0 24160001 */   addiu    $s6, $zero, 0x1
/* E8784 802C3DD4 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* E8788 802C3DD8 4481A800 */  mtc1      $at, $f21
/* E878C 802C3DDC 4480A000 */  mtc1      $zero, $f20
/* E8790 802C3DE0 2415FFFF */  addiu     $s5, $zero, -0x1
/* E8794 802C3DE4 3C14802E */  lui       $s4, %hi(gScriptIdList)
/* E8798 802C3DE8 2694AA98 */  addiu     $s4, $s4, %lo(gScriptIdList)
/* E879C 802C3DEC 3C13802E */  lui       $s3, %hi(gScriptIndexList)
/* E87A0 802C3DF0 2673A898 */  addiu     $s3, $s3, %lo(gScriptIndexList)
.L802C3DF4:
/* E87A4 802C3DF4 8E620000 */  lw        $v0, 0x0($s3)
/* E87A8 802C3DF8 3C03802E */  lui       $v1, %hi(gCurrentScriptListPtr)
/* E87AC 802C3DFC 8C63A890 */  lw        $v1, %lo(gCurrentScriptListPtr)($v1)
/* E87B0 802C3E00 00021080 */  sll       $v0, $v0, 2
/* E87B4 802C3E04 00431021 */  addu      $v0, $v0, $v1
/* E87B8 802C3E08 8C500000 */  lw        $s0, 0x0($v0)
/* E87BC 802C3E0C 52000022 */  beql      $s0, $zero, .L802C3E98
/* E87C0 802C3E10 26940004 */   addiu    $s4, $s4, 0x4
/* E87C4 802C3E14 8E030144 */  lw        $v1, 0x144($s0)
/* E87C8 802C3E18 8E820000 */  lw        $v0, 0x0($s4)
/* E87CC 802C3E1C 5462001E */  bnel      $v1, $v0, .L802C3E98
/* E87D0 802C3E20 26940004 */   addiu    $s4, $s4, 0x4
/* E87D4 802C3E24 92020000 */  lbu       $v0, 0x0($s0)
/* E87D8 802C3E28 5040001B */  beql      $v0, $zero, .L802C3E98
/* E87DC 802C3E2C 26940004 */   addiu    $s4, $s4, 0x4
/* E87E0 802C3E30 30420092 */  andi      $v0, $v0, 0x92
/* E87E4 802C3E34 54400018 */  bnel      $v0, $zero, .L802C3E98
/* E87E8 802C3E38 26940004 */   addiu    $s4, $s4, 0x4
/* E87EC 802C3E3C C6020154 */  lwc1      $f2, 0x154($s0)
/* E87F0 802C3E40 C6000150 */  lwc1      $f0, 0x150($s0)
/* E87F4 802C3E44 46001080 */  add.s     $f2, $f2, $f0
/* E87F8 802C3E48 0000882D */  daddu     $s1, $zero, $zero
/* E87FC 802C3E4C E6020154 */  swc1      $f2, 0x154($s0)
.L802C3E50:
/* E8800 802C3E50 C6000154 */  lwc1      $f0, 0x154($s0)
/* E8804 802C3E54 46000021 */  cvt.d.s   $f0, $f0
/* E8808 802C3E58 4634003C */  c.lt.d    $f0, $f20
/* E880C 802C3E5C 00000000 */  nop
/* E8810 802C3E60 4501000B */  bc1t      .L802C3E90
/* E8814 802C3E64 0200202D */   daddu    $a0, $s0, $zero
/* E8818 802C3E68 46340001 */  sub.d     $f0, $f0, $f20
/* E881C 802C3E6C 46200020 */  cvt.s.d   $f0, $f0
/* E8820 802C3E70 0C0B1D01 */  jal       evt_execute_next_command
/* E8824 802C3E74 E6000154 */   swc1     $f0, 0x154($s0)
/* E8828 802C3E78 14560003 */  bne       $v0, $s6, .L802C3E88
/* E882C 802C3E7C 00000000 */   nop
/* E8830 802C3E80 080B0FA4 */  j         .L802C3E90
/* E8834 802C3E84 24110001 */   addiu    $s1, $zero, 0x1
.L802C3E88:
/* E8838 802C3E88 1455FFF1 */  bne       $v0, $s5, .L802C3E50
/* E883C 802C3E8C 00000000 */   nop
.L802C3E90:
/* E8840 802C3E90 16200007 */  bnez      $s1, .L802C3EB0
/* E8844 802C3E94 26940004 */   addiu    $s4, $s4, 0x4
.L802C3E98:
/* E8848 802C3E98 3C02802E */  lui       $v0, %hi(gScriptListCount)
/* E884C 802C3E9C 8C42AC98 */  lw        $v0, %lo(gScriptListCount)($v0)
/* E8850 802C3EA0 26520001 */  addiu     $s2, $s2, 0x1
/* E8854 802C3EA4 0242102A */  slt       $v0, $s2, $v0
/* E8858 802C3EA8 1440FFD2 */  bnez      $v0, .L802C3DF4
/* E885C 802C3EAC 26730004 */   addiu    $s3, $s3, 0x4
.L802C3EB0:
/* E8860 802C3EB0 3C01802E */  lui       $at, %hi(gIsUpdatingScripts)
/* E8864 802C3EB4 AC209CA4 */  sw        $zero, %lo(gIsUpdatingScripts)($at)
.L802C3EB8:
/* E8868 802C3EB8 8FBF002C */  lw        $ra, 0x2C($sp)
/* E886C 802C3EBC 8FB60028 */  lw        $s6, 0x28($sp)
/* E8870 802C3EC0 8FB50024 */  lw        $s5, 0x24($sp)
/* E8874 802C3EC4 8FB40020 */  lw        $s4, 0x20($sp)
/* E8878 802C3EC8 8FB3001C */  lw        $s3, 0x1C($sp)
/* E887C 802C3ECC 8FB20018 */  lw        $s2, 0x18($sp)
/* E8880 802C3ED0 8FB10014 */  lw        $s1, 0x14($sp)
/* E8884 802C3ED4 8FB00010 */  lw        $s0, 0x10($sp)
/* E8888 802C3ED8 D7B40030 */  ldc1      $f20, 0x30($sp)
/* E888C 802C3EDC 03E00008 */  jr        $ra
/* E8890 802C3EE0 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void update_scripts(void) {
    if (gGameStatusPtr->disableScripts != TRUE) {
        s32 i;

        gIsUpdatingScripts = TRUE;
        sort_scripts();

        for (i = 0; i < gScriptListCount; i++) {
            Evt* script = (*gCurrentScriptListPtr)[gScriptIndexList[i]];

            if (script != NULL &&
                script->id == gScriptIdList[i] &&
                script->stateFlags != 0 &&
                !(script->stateFlags & (EVT_FLAG_SUSPENDED | EVT_FLAG_BLOCKED_BY_CHILD | EVT_FLAG_SUSPENDED_IN_GROUP)))
            {
                s32 stop = FALSE;
                s32 status;

                script->frameCounter += script->timeScale;

                do {
                    if (script->frameCounter < 1.0) {
                        // Continue to next script
                        do {} while (0); // TODO required to match
                        break;
                    };

                    script->frameCounter -= 1.0;
                    status = evt_execute_next_command(script);
                    if (status == EVT_CMD_RESULT_ERROR) {
                        stop = TRUE;
                        break;
                    }
                } while (status != EVT_CMD_RESULT_YIELD);

                if (stop) {
                    break;
                }
            }
        }
        gIsUpdatingScripts = FALSE;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_load_song_files
/* 2F0F8 80053CF8 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 2F0FC 80053CFC AFB20028 */  sw        $s2, 0x28($sp)
/* 2F100 80053D00 3C12800A */  lui       $s2, %hi(gSoundGlobals)
/* 2F104 80053D04 8E52A5C0 */  lw        $s2, %lo(gSoundGlobals)($s2)
/* 2F108 80053D08 AFB60038 */  sw        $s6, 0x38($sp)
/* 2F10C 80053D0C 0080B02D */  daddu     $s6, $a0, $zero
/* 2F110 80053D10 AFB3002C */  sw        $s3, 0x2C($sp)
/* 2F114 80053D14 00C0982D */  daddu     $s3, $a2, $zero
/* 2F118 80053D18 AFBF0044 */  sw        $ra, 0x44($sp)
/* 2F11C 80053D1C AFBE0040 */  sw        $fp, 0x40($sp)
/* 2F120 80053D20 AFB7003C */  sw        $s7, 0x3C($sp)
/* 2F124 80053D24 AFB50034 */  sw        $s5, 0x34($sp)
/* 2F128 80053D28 AFB40030 */  sw        $s4, 0x30($sp)
/* 2F12C 80053D2C AFB10024 */  sw        $s1, 0x24($sp)
/* 2F130 80053D30 AFB00020 */  sw        $s0, 0x20($sp)
/* 2F134 80053D34 AFA5004C */  sw        $a1, 0x4C($sp)
/* 2F138 80053D38 8E420030 */  lw        $v0, 0x30($s2)
/* 2F13C 80053D3C 02C2102B */  sltu      $v0, $s6, $v0
/* 2F140 80053D40 10400038 */  beqz      $v0, .L80053E24
/* 2F144 80053D44 00A0B82D */   daddu    $s7, $a1, $zero
/* 2F148 80053D48 24050010 */  addiu     $a1, $zero, 0x10
/* 2F14C 80053D4C 8E43002C */  lw        $v1, 0x2C($s2)
/* 2F150 80053D50 001610C0 */  sll       $v0, $s6, 3
/* 2F154 80053D54 0062A021 */  addu      $s4, $v1, $v0
/* 2F158 80053D58 96840000 */  lhu       $a0, 0x0($s4)
/* 2F15C 80053D5C 0C01511F */  jal       au_fetch_SBN_file
/* 2F160 80053D60 03A53021 */   addu     $a2, $sp, $a1
/* 2F164 80053D64 14400030 */  bnez      $v0, .L80053E28
/* 2F168 80053D68 00000000 */   nop
/* 2F16C 80053D6C 0C0136CA */  jal       func_8004DB28
/* 2F170 80053D70 0260202D */   daddu    $a0, $s3, $zero
/* 2F174 80053D74 1440002C */  bnez      $v0, .L80053E28
/* 2F178 80053D78 240200C9 */   addiu    $v0, $zero, 0xC9
/* 2F17C 80053D7C 3C0200FF */  lui       $v0, (0xFFFFFF >> 16)
/* 2F180 80053D80 3442FFFF */  ori       $v0, $v0, (0xFFFFFF & 0xFFFF)
/* 2F184 80053D84 02E0282D */  daddu     $a1, $s7, $zero
/* 2F188 80053D88 0000802D */  daddu     $s0, $zero, $zero
/* 2F18C 80053D8C 3C1500FF */  lui       $s5, (0xFFFFFF >> 16)
/* 2F190 80053D90 36B5FFFF */  ori       $s5, $s5, (0xFFFFFF & 0xFFFF)
/* 2F194 80053D94 241E0030 */  addiu     $fp, $zero, 0x30
/* 2F198 80053D98 0280882D */  daddu     $s1, $s4, $zero
/* 2F19C 80053D9C 8FA60014 */  lw        $a2, 0x14($sp)
/* 2F1A0 80053DA0 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F1A4 80053DA4 0C015380 */  jal       au_read_rom
/* 2F1A8 80053DA8 00C23024 */   and      $a2, $a2, $v0
.L80053DAC:
/* 2F1AC 80053DAC 96220002 */  lhu       $v0, 0x2($s1)
/* 2F1B0 80053DB0 50400012 */  beql      $v0, $zero, .L80053DFC
/* 2F1B4 80053DB4 26100001 */   addiu    $s0, $s0, 0x1
/* 2F1B8 80053DB8 8E440020 */  lw        $a0, 0x20($s2)
/* 2F1BC 80053DBC 000210C0 */  sll       $v0, $v0, 3
/* 2F1C0 80053DC0 00822021 */  addu      $a0, $a0, $v0
/* 2F1C4 80053DC4 8C820000 */  lw        $v0, 0x0($a0)
/* 2F1C8 80053DC8 8E43001C */  lw        $v1, 0x1C($s2)
/* 2F1CC 80053DCC 00551024 */  and       $v0, $v0, $s5
/* 2F1D0 80053DD0 00431821 */  addu      $v1, $v0, $v1
/* 2F1D4 80053DD4 AFA30018 */  sw        $v1, 0x18($sp)
/* 2F1D8 80053DD8 8C820004 */  lw        $v0, 0x4($a0)
/* 2F1DC 80053DDC AFA2001C */  sw        $v0, 0x1C($sp)
/* 2F1E0 80053DE0 00021602 */  srl       $v0, $v0, 24
/* 2F1E4 80053DE4 545E0005 */  bnel      $v0, $fp, .L80053DFC
/* 2F1E8 80053DE8 26100001 */   addiu    $s0, $s0, 0x1
/* 2F1EC 80053DEC 0060202D */  daddu     $a0, $v1, $zero
/* 2F1F0 80053DF0 0C015313 */  jal       snd_load_BK
/* 2F1F4 80053DF4 0200282D */   daddu    $a1, $s0, $zero
/* 2F1F8 80053DF8 26100001 */  addiu     $s0, $s0, 0x1
.L80053DFC:
/* 2F1FC 80053DFC 2A020003 */  slti      $v0, $s0, 0x3
/* 2F200 80053E00 1440FFEA */  bnez      $v0, .L80053DAC
/* 2F204 80053E04 26310002 */   addiu    $s1, $s1, 0x2
/* 2F208 80053E08 96820000 */  lhu       $v0, 0x0($s4)
/* 2F20C 80053E0C AE760028 */  sw        $s6, 0x28($s3)
/* 2F210 80053E10 8FA7004C */  lw        $a3, 0x4C($sp)
/* 2F214 80053E14 AE670064 */  sw        $a3, 0x64($s3)
/* 2F218 80053E18 AE620024 */  sw        $v0, 0x24($s3)
/* 2F21C 80053E1C 08014F8A */  j         .L80053E28
/* 2F220 80053E20 8EE20008 */   lw       $v0, 0x8($s7)
.L80053E24:
/* 2F224 80053E24 24020097 */  addiu     $v0, $zero, 0x97
.L80053E28:
/* 2F228 80053E28 8FBF0044 */  lw        $ra, 0x44($sp)
/* 2F22C 80053E2C 8FBE0040 */  lw        $fp, 0x40($sp)
/* 2F230 80053E30 8FB7003C */  lw        $s7, 0x3C($sp)
/* 2F234 80053E34 8FB60038 */  lw        $s6, 0x38($sp)
/* 2F238 80053E38 8FB50034 */  lw        $s5, 0x34($sp)
/* 2F23C 80053E3C 8FB40030 */  lw        $s4, 0x30($sp)
/* 2F240 80053E40 8FB3002C */  lw        $s3, 0x2C($sp)
/* 2F244 80053E44 8FB20028 */  lw        $s2, 0x28($sp)
/* 2F248 80053E48 8FB10024 */  lw        $s1, 0x24($sp)
/* 2F24C 80053E4C 8FB00020 */  lw        $s0, 0x20($sp)
/* 2F250 80053E50 03E00008 */  jr        $ra
/* 2F254 80053E54 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

AuResult au_load_song_files(u32 songID, BGMHeader* bgmFile, BGMPlayer* player) {
    AuResult status;
    SBNFileEntry fileEntry;
    SBNFileEntry fileEntry2;
    SBNFileEntry* bkFileEntry;
    AuGlobals* soundData;
    InitSongEntry* songInfo;
    s32 i;
    u16 bkFileIndex;
    s32 bgmFileIndex;
    u32 data;
    u32 offset;
    BGMPlayer* arg2_copy ;
    BGMHeader* arg1_copy;
    s32 cond;

    soundData = gSoundGlobals;

    // needed to match
    cond = songID < soundData->songListLength;
    arg2_copy = player;
    arg1_copy = bgmFile;

    if (cond) {
        songInfo = &soundData->songList[songID];
        status = au_fetch_SBN_file(songInfo->bgmFileIndex, AU_FMT_BGM, &fileEntry);
        if (status != AU_RESULT_OK) {
            return status;
        }

        if (func_8004DB28(arg2_copy)) {
            return AU_ERROR_201;
        }

        au_read_rom(fileEntry.offset, arg1_copy, fileEntry.data & 0xFFFFFF);

        for (i = 0; i < ARRAY_COUNT(songInfo->bkFileIndex); i++) {
            bkFileIndex = songInfo->bkFileIndex[i];
            if (bkFileIndex != 0) {
                bkFileEntry = &soundData->sbnFileList[bkFileIndex];

                offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset;
                fileEntry2.offset = offset;

                data = bkFileEntry->data;
                fileEntry2.data = data;

                if ((data >> 0x18) == AU_FMT_BK) {
                    snd_load_BK(offset, i);
                }
            }
        }
        bgmFileIndex = songInfo->bgmFileIndex;
        arg2_copy->songID = songID;
        arg2_copy->bgmFile = bgmFile;
        arg2_copy->bgmFileIndex = bgmFileIndex;
        return arg1_copy->name;
    } else {
        return AU_ERROR_151;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel hud_element_create
/* D7BA4 801414A4 3C038015 */  lui       $v1, %hi(gHudElements)
/* D7BA8 801414A8 8C637960 */  lw        $v1, %lo(gHudElements)($v1)
/* D7BAC 801414AC 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* D7BB0 801414B0 AFB20018 */  sw        $s2, 0x18($sp)
/* D7BB4 801414B4 0080902D */  daddu     $s2, $a0, $zero
/* D7BB8 801414B8 AFB10014 */  sw        $s1, 0x14($sp)
/* D7BBC 801414BC 0000882D */  daddu     $s1, $zero, $zero
/* D7BC0 801414C0 AFBF001C */  sw        $ra, 0x1C($sp)
/* D7BC4 801414C4 AFB00010 */  sw        $s0, 0x10($sp)
.L801414C8:
/* D7BC8 801414C8 8C620000 */  lw        $v0, 0x0($v1)
/* D7BCC 801414CC 10400006 */  beqz      $v0, .L801414E8
/* D7BD0 801414D0 2A220140 */   slti     $v0, $s1, 0x140
/* D7BD4 801414D4 26310001 */  addiu     $s1, $s1, 0x1
/* D7BD8 801414D8 2A220140 */  slti      $v0, $s1, 0x140
/* D7BDC 801414DC 1440FFFA */  bnez      $v0, .L801414C8
/* D7BE0 801414E0 24630004 */   addiu    $v1, $v1, 0x4
/* D7BE4 801414E4 2A220140 */  slti      $v0, $s1, 0x140
.L801414E8:
/* D7BE8 801414E8 14400003 */  bnez      $v0, .L801414F8
/* D7BEC 801414EC 00000000 */   nop
.L801414F0:
/* D7BF0 801414F0 0805053C */  j         .L801414F0
/* D7BF4 801414F4 00000000 */   nop
.L801414F8:
/* D7BF8 801414F8 0C00AB39 */  jal       heap_malloc
/* D7BFC 801414FC 24040054 */   addiu    $a0, $zero, 0x54
/* D7C00 80141500 00112080 */  sll       $a0, $s1, 2
/* D7C04 80141504 3C038015 */  lui       $v1, %hi(gHudElements)
/* D7C08 80141508 8C637960 */  lw        $v1, %lo(gHudElements)($v1)
/* D7C0C 8014150C 3C058015 */  lui       $a1, %hi(gHudElementsNumber)
/* D7C10 80141510 24A512B4 */  addiu     $a1, $a1, %lo(gHudElementsNumber)
/* D7C14 80141514 00832021 */  addu      $a0, $a0, $v1
/* D7C18 80141518 8CA30000 */  lw        $v1, 0x0($a1)
/* D7C1C 8014151C 0040802D */  daddu     $s0, $v0, $zero
/* D7C20 80141520 AC900000 */  sw        $s0, 0x0($a0)
/* D7C24 80141524 24630001 */  addiu     $v1, $v1, 0x1
/* D7C28 80141528 16000003 */  bnez      $s0, .L80141538
/* D7C2C 8014152C ACA30000 */   sw       $v1, 0x0($a1)
.L80141530:
/* D7C30 80141530 0805054C */  j         .L80141530
/* D7C34 80141534 00000000 */   nop
.L80141538:
/* D7C38 80141538 24030001 */  addiu     $v1, $zero, 0x1
/* D7C3C 8014153C AE030000 */  sw        $v1, 0x0($s0)
/* D7C40 80141540 16400004 */  bnez      $s2, .L80141554
/* D7C44 80141544 AE120004 */   sw       $s2, 0x4($s0)
/* D7C48 80141548 3C028015 */  lui       $v0, %hi(HES_Empty)
/* D7C4C 8014154C 2442EFC8 */  addiu     $v0, $v0, %lo(HES_Empty)
/* D7C50 80141550 AE020004 */  sw        $v0, 0x4($s0)
.L80141554:
/* D7C54 80141554 A2030047 */  sb        $v1, 0x47($s0)
/* D7C58 80141558 8E030004 */  lw        $v1, 0x4($s0)
/* D7C5C 8014155C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* D7C60 80141560 44810000 */  mtc1      $at, $f0
/* D7C64 80141564 2402FFFF */  addiu     $v0, $zero, -0x1
/* D7C68 80141568 A2020045 */  sb        $v0, 0x45($s0)
/* D7C6C 8014156C A2020046 */  sb        $v0, 0x46($s0)
/* D7C70 80141570 240200FF */  addiu     $v0, $zero, 0xFF
/* D7C74 80141574 A2000040 */  sb        $zero, 0x40($s0)
/* D7C78 80141578 A2000041 */  sb        $zero, 0x41($s0)
/* D7C7C 8014157C A2000042 */  sb        $zero, 0x42($s0)
/* D7C80 80141580 A2000043 */  sb        $zero, 0x43($s0)
/* D7C84 80141584 A2000044 */  sb        $zero, 0x44($s0)
/* D7C88 80141588 A202004A */  sb        $v0, 0x4A($s0)
/* D7C8C 8014158C A202004B */  sb        $v0, 0x4B($s0)
/* D7C90 80141590 A202004C */  sb        $v0, 0x4C($s0)
/* D7C94 80141594 A202004D */  sb        $v0, 0x4D($s0)
/* D7C98 80141598 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* D7C9C 8014159C 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* D7CA0 801415A0 24020400 */  addiu     $v0, $zero, 0x400
/* D7CA4 801415A4 A600003C */  sh        $zero, 0x3C($s0)
/* D7CA8 801415A8 A600003E */  sh        $zero, 0x3E($s0)
/* D7CAC 801415AC AE12000C */  sw        $s2, 0xC($s0)
/* D7CB0 801415B0 AE020034 */  sw        $v0, 0x34($s0)
/* D7CB4 801415B4 AE020038 */  sw        $v0, 0x38($s0)
/* D7CB8 801415B8 AE030008 */  sw        $v1, 0x8($s0)
/* D7CBC 801415BC E6000030 */  swc1      $f0, 0x30($s0)
/* D7CC0 801415C0 80820070 */  lb        $v0, 0x70($a0)
/* D7CC4 801415C4 10400005 */  beqz      $v0, .L801415DC
/* D7CC8 801415C8 00000000 */   nop
/* D7CCC 801415CC 8E020000 */  lw        $v0, 0x0($s0)
/* D7CD0 801415D0 36310800 */  ori       $s1, $s1, 0x800
/* D7CD4 801415D4 34420400 */  ori       $v0, $v0, 0x400
/* D7CD8 801415D8 AE020000 */  sw        $v0, 0x0($s0)
.L801415DC:
/* D7CDC 801415DC 8E050004 */  lw        $a1, 0x4($s0)
/* D7CE0 801415E0 0C04FCD4 */  jal       hud_element_load_script
/* D7CE4 801415E4 0200202D */   daddu    $a0, $s0, $zero
.L801415E8:
/* D7CE8 801415E8 0C0505C1 */  jal       hud_element_update
/* D7CEC 801415EC 0200202D */   daddu    $a0, $s0, $zero
/* D7CF0 801415F0 1440FFFD */  bnez      $v0, .L801415E8
/* D7CF4 801415F4 0220102D */   daddu    $v0, $s1, $zero
/* D7CF8 801415F8 8FBF001C */  lw        $ra, 0x1C($sp)
/* D7CFC 801415FC 8FB20018 */  lw        $s2, 0x18($sp)
/* D7D00 80141600 8FB10014 */  lw        $s1, 0x14($sp)
/* D7D04 80141604 8FB00010 */  lw        $s0, 0x10($sp)
/* D7D08 80141608 03E00008 */  jr        $ra
/* D7D0C 8014160C 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

s32 hud_element_create(HudScript* anim) {
    HudElement* hudElement;
    s32 id;

    for (id = 0; id < ARRAY_COUNT(*gHudElements); id++) {
        if ((*gHudElements)[id] == NULL) {
            break;
        }
    }

    ASSERT(id < ARRAY_COUNT(*gHudElements));

    (*gHudElements)[id] = hudElement = heap_malloc(sizeof(*hudElement));
    gHudElementsNumber += 1;

    ASSERT(hudElement != NULL);

    hudElement->flags = HUD_ELEMENT_FLAG_INITIALIZED;
    hudElement->readPos = anim;
    if (anim == NULL) {
        hudElement->readPos = &HES_Empty;
    }
    hudElement->updateTimer = 1;
    hudElement->drawSizePreset = -1;
    hudElement->tileSizePreset = -1;
    hudElement->renderPosX = 0;
    hudElement->renderPosY = 0;
    hudElement->loopStartPos = anim;
    hudElement->widthScale = X10(1.0f);
    hudElement->heightScale = X10(1.0f);
    hudElement->anim = hudElement->readPos;
    hudElement->uniformScale = 1.0f;
    hudElement->screenPosOffset.x = 0;
    hudElement->screenPosOffset.y = 0;
    hudElement->worldPosOffset.x = 0;
    hudElement->worldPosOffset.y = 0;
    hudElement->worldPosOffset.z = 0;
    hudElement->opacity = 255;
    hudElement->tint.r = 255;
    hudElement->tint.g = 255;
    hudElement->tint.b = 255;

    if (gGameStatusPtr->isBattle) {
        hudElement->flags |= HUD_ELEMENT_FLAG_BATTLE;
        id |= HUD_ELEMENT_BATTLE_ID_MASK;
    }

    hud_element_load_script(hudElement, hudElement->readPos);
    while (hud_element_update(hudElement) != 0);

    return id;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel lens_flare_update
/* 344B20 E0034110 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 344B24 E0034114 AFBF0018 */  sw        $ra, 0x18($sp)
/* 344B28 E0034118 AFB10014 */  sw        $s1, 0x14($sp)
/* 344B2C E003411C AFB00010 */  sw        $s0, 0x10($sp)
/* 344B30 E0034120 8C90000C */  lw        $s0, 0xC($a0)
/* 344B34 E0034124 8E02002C */  lw        $v0, 0x2C($s0)
/* 344B38 E0034128 2442FFFF */  addiu     $v0, $v0, -0x1
/* 344B3C E003412C AE02002C */  sw        $v0, 0x2C($s0)
/* 344B40 E0034130 8E020030 */  lw        $v0, 0x30($s0)
/* 344B44 E0034134 8E03002C */  lw        $v1, 0x2C($s0)
/* 344B48 E0034138 24420001 */  addiu     $v0, $v0, 0x1
/* 344B4C E003413C 04610005 */  bgez      $v1, .LE0034154
/* 344B50 E0034140 AE020030 */   sw       $v0, 0x30($s0)
/* 344B54 E0034144 0C080128 */  jal       shim_remove_effect
/* 344B58 E0034148 00000000 */   nop
/* 344B5C E003414C 0800D0AD */  j         .LE00342B4
/* 344B60 E0034150 00000000 */   nop
.LE0034154:
/* 344B64 E0034154 28420007 */  slti      $v0, $v0, 0x7
/* 344B68 E0034158 10400011 */  beqz      $v0, .LE00341A0
/* 344B6C E003415C 0060882D */   daddu    $s1, $v1, $zero
/* 344B70 E0034160 240200DA */  addiu     $v0, $zero, 0xDA
/* 344B74 E0034164 8E030024 */  lw        $v1, 0x24($s0)
/* 344B78 E0034168 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 344B7C E003416C 44810800 */  mtc1      $at, $f1
/* 344B80 E0034170 44800000 */  mtc1      $zero, $f0
/* 344B84 E0034174 00431023 */  subu      $v0, $v0, $v1
/* 344B88 E0034178 44821000 */  mtc1      $v0, $f2
/* 344B8C E003417C 00000000 */  nop
/* 344B90 E0034180 468010A1 */  cvt.d.w   $f2, $f2
/* 344B94 E0034184 46201082 */  mul.d     $f2, $f2, $f0
/* 344B98 E0034188 00000000 */  nop
/* 344B9C E003418C 44830000 */  mtc1      $v1, $f0
/* 344BA0 E0034190 00000000 */  nop
/* 344BA4 E0034194 46800021 */  cvt.d.w   $f0, $f0
/* 344BA8 E0034198 0800D06E */  j         .LE00341B8
/* 344BAC E003419C 46220000 */   add.d    $f0, $f0, $f2
.LE00341A0:
/* 344BB0 E00341A0 3C01E003 */  lui       $at, (0xE00347B0 >> 16)
/* 344BB4 E00341A4 D42247B0 */  ldc1      $f2, (0xE00347B0 & 0xFFFF)($at)
/* 344BB8 E00341A8 C6000024 */  lwc1      $f0, 0x24($s0)
/* 344BBC E00341AC 46800021 */  cvt.d.w   $f0, $f0
/* 344BC0 E00341B0 46220002 */  mul.d     $f0, $f0, $f2
/* 344BC4 E00341B4 00000000 */  nop
.LE00341B8:
/* 344BC8 E00341B8 4620028D */  trunc.w.d $f10, $f0
/* 344BCC E00341BC E60A0024 */  swc1      $f10, 0x24($s0)
/* 344BD0 E00341C0 00111040 */  sll       $v0, $s1, 1
/* 344BD4 E00341C4 00511021 */  addu      $v0, $v0, $s1
/* 344BD8 E00341C8 C6040014 */  lwc1      $f4, 0x14($s0)
/* 344BDC E00341CC 3C01E003 */  lui       $at, (0xE00347B8 >> 16)
/* 344BE0 E00341D0 D42247B8 */  ldc1      $f2, (0xE00347B8 & 0xFFFF)($at)
/* 344BE4 E00341D4 46002121 */  cvt.d.s   $f4, $f4
/* 344BE8 E00341D8 46222102 */  mul.d     $f4, $f4, $f2
/* 344BEC E00341DC 00000000 */  nop
/* 344BF0 E00341E0 000210C0 */  sll       $v0, $v0, 3
/* 344BF4 E00341E4 00511021 */  addu      $v0, $v0, $s1
/* 344BF8 E00341E8 00021040 */  sll       $v0, $v0, 1
/* 344BFC E00341EC C600001C */  lwc1      $f0, 0x1C($s0)
/* 344C00 E00341F0 C6060018 */  lwc1      $f6, 0x18($s0)
/* 344C04 E00341F4 C602001C */  lwc1      $f2, 0x1C($s0)
/* 344C08 E00341F8 C6080014 */  lwc1      $f8, 0x14($s0)
/* 344C0C E00341FC 46023180 */  add.s     $f6, $f6, $f2
/* 344C10 E0034200 3C01E003 */  lui       $at, (0xE00347C0 >> 16)
/* 344C14 E0034204 D42247C0 */  ldc1      $f2, (0xE00347C0 & 0xFFFF)($at)
/* 344C18 E0034208 46000021 */  cvt.d.s   $f0, $f0
/* 344C1C E003420C 46220000 */  add.d     $f0, $f0, $f2
/* 344C20 E0034210 C6020010 */  lwc1      $f2, 0x10($s0)
/* 344C24 E0034214 44826000 */  mtc1      $v0, $f12
/* 344C28 E0034218 00000000 */  nop
/* 344C2C E003421C 46806320 */  cvt.s.w   $f12, $f12
/* 344C30 E0034220 46081080 */  add.s     $f2, $f2, $f8
/* 344C34 E0034224 E6060018 */  swc1      $f6, 0x18($s0)
/* 344C38 E0034228 46200020 */  cvt.s.d   $f0, $f0
/* 344C3C E003422C E600001C */  swc1      $f0, 0x1C($s0)
/* 344C40 E0034230 E6020010 */  swc1      $f2, 0x10($s0)
/* 344C44 E0034234 46202120 */  cvt.s.d   $f4, $f4
/* 344C48 E0034238 0C080140 */  jal       shim_sin_deg
/* 344C4C E003423C E6040014 */   swc1     $f4, 0x14($s0)
/* 344C50 E0034240 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 344C54 E0034244 44811800 */  mtc1      $at, $f3
/* 344C58 E0034248 44801000 */  mtc1      $zero, $f2
/* 344C5C E003424C 46000021 */  cvt.d.s   $f0, $f0
/* 344C60 E0034250 46220002 */  mul.d     $f0, $f0, $f2
/* 344C64 E0034254 00000000 */  nop
/* 344C68 E0034258 00111080 */  sll       $v0, $s1, 2
/* 344C6C E003425C 3C01E003 */  lui       $at, (0xE00347C8 >> 16)
/* 344C70 E0034260 D42247C8 */  ldc1      $f2, (0xE00347C8 & 0xFFFF)($at)
/* 344C74 E0034264 00511021 */  addu      $v0, $v0, $s1
/* 344C78 E0034268 46220000 */  add.d     $f0, $f0, $f2
/* 344C7C E003426C 000210C0 */  sll       $v0, $v0, 3
/* 344C80 E0034270 44826000 */  mtc1      $v0, $f12
/* 344C84 E0034274 00000000 */  nop
/* 344C88 E0034278 46806320 */  cvt.s.w   $f12, $f12
/* 344C8C E003427C 46200020 */  cvt.s.d   $f0, $f0
/* 344C90 E0034280 0C080140 */  jal       shim_sin_deg
/* 344C94 E0034284 E6000020 */   swc1     $f0, 0x20($s0)
/* 344C98 E0034288 3C014280 */  lui       $at, (0x42800000 >> 16)
/* 344C9C E003428C 44811000 */  mtc1      $at, $f2
/* 344CA0 E0034290 00000000 */  nop
/* 344CA4 E0034294 46020002 */  mul.s     $f0, $f0, $f2
/* 344CA8 E0034298 00000000 */  nop
/* 344CAC E003429C 3C014310 */  lui       $at, (0x43100000 >> 16)
/* 344CB0 E00342A0 44811000 */  mtc1      $at, $f2
/* 344CB4 E00342A4 00000000 */  nop
/* 344CB8 E00342A8 46020000 */  add.s     $f0, $f0, $f2
/* 344CBC E00342AC 4600028D */  trunc.w.s $f10, $f0
/* 344CC0 E00342B0 E60A0028 */  swc1      $f10, 0x28($s0)
.LE00342B4:
/* 344CC4 E00342B4 8FBF0018 */  lw        $ra, 0x18($sp)
/* 344CC8 E00342B8 8FB10014 */  lw        $s1, 0x14($sp)
/* 344CCC E00342BC 8FB00010 */  lw        $s0, 0x10($sp)
/* 344CD0 E00342C0 03E00008 */  jr        $ra
/* 344CD4 E00342C4 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void lens_flare_update(EffectInstance* effect) {
    LensFlareFXData* data = effect->data.lensFlare;
    s32 time;

    data->timeLeft--;
    data->lifetime++;

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

    time = data->timeLeft;

    if (data->lifetime < 7) {
        data->largeFlareAlpha += (218 - data->largeFlareAlpha) * 0.5;
    } else {
        data->largeFlareAlpha *= 0.78;
    }

    data->largeFlareScale += data->largeFlareScaleVel;
    data->largeFlareScaleVel += 0.29;
    data->largeFlareRot += data->largeFlareRotVel;
    data->largeFlareRotVel *= 0.93;
    data->smallFlareScale = shim_sin_deg(time * 50) * 0.5 + 0.9;
    data->smallFlareAlpha = shim_sin_deg(time * 40) * 64.0f + 144.0f;
}