### RAW ASSEMBLY INSTRUCTIONS:

glabel quizmo_audience_appendGfx
/* 3A7410 E00A8320 27BDFF40 */  addiu     $sp, $sp, -0xC0
/* 3A7414 E00A8324 0080302D */  daddu     $a2, $a0, $zero
/* 3A7418 E00A8328 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3A741C E00A832C 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3A7420 E00A8330 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A7424 E00A8334 AFB200A0 */  sw        $s2, 0xA0($sp)
/* 3A7428 E00A8338 3C120001 */  lui       $s2, (0x11630 >> 16)
/* 3A742C E00A833C 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* 3A7430 E00A8340 AFB400A8 */  sw        $s4, 0xA8($sp)
/* 3A7434 E00A8344 0000A02D */  daddu     $s4, $zero, $zero
/* 3A7438 E00A8348 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 3A743C E00A834C 2442A674 */  addiu     $v0, $v0, %lo(gDisplayContext)
/* 3A7440 E00A8350 AFBE00B8 */  sw        $fp, 0xB8($sp)
/* 3A7444 E00A8354 0040F02D */  daddu     $fp, $v0, $zero
/* 3A7448 E00A8358 3C028007 */  lui       $v0, %hi(gMatrixListPos)
/* 3A744C E00A835C 244241F0 */  addiu     $v0, $v0, %lo(gMatrixListPos)
/* 3A7450 E00A8360 AFB600B0 */  sw        $s6, 0xB0($sp)
/* 3A7454 E00A8364 0040B02D */  daddu     $s6, $v0, $zero
/* 3A7458 E00A8368 AFB700B4 */  sw        $s7, 0xB4($sp)
/* 3A745C E00A836C 3C170001 */  lui       $s7, (0x11630 >> 16)
/* 3A7460 E00A8370 36F71630 */  ori       $s7, $s7, (0x11630 & 0xFFFF)
/* 3A7464 E00A8374 3C02800A */  lui       $v0, %hi(gMainGfxPos)
/* 3A7468 E00A8378 2442A66C */  addiu     $v0, $v0, %lo(gMainGfxPos)
/* 3A746C E00A837C AFB500AC */  sw        $s5, 0xAC($sp)
/* 3A7470 E00A8380 0040A82D */  daddu     $s5, $v0, $zero
/* 3A7474 E00A8384 AFBF00BC */  sw        $ra, 0xBC($sp)
/* 3A7478 E00A8388 AFB300A4 */  sw        $s3, 0xA4($sp)
/* 3A747C E00A838C AFB1009C */  sw        $s1, 0x9C($sp)
/* 3A7480 E00A8390 AFB00098 */  sw        $s0, 0x98($sp)
/* 3A7484 E00A8394 8C480000 */  lw        $t0, 0x0($v0)
/* 3A7488 E00A8398 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3A748C E00A839C 8CC5000C */  lw        $a1, 0xC($a2)
/* 3A7490 E00A83A0 0100182D */  daddu     $v1, $t0, $zero
/* 3A7494 E00A83A4 8CB00018 */  lw        $s0, 0x18($a1)
/* 3A7498 E00A83A8 25080008 */  addiu     $t0, $t0, 0x8
/* 3A749C E00A83AC AC620000 */  sw        $v0, 0x0($v1)
/* 3A74A0 E00A83B0 AC600004 */  sw        $zero, 0x4($v1)
/* 3A74A4 E00A83B4 AD070000 */  sw        $a3, 0x0($t0)
/* 3A74A8 E00A83B8 8CC20010 */  lw        $v0, 0x10($a2)
/* 3A74AC E00A83BC 00A0982D */  daddu     $s3, $a1, $zero
/* 3A74B0 E00A83C0 AEA80000 */  sw        $t0, 0x0($s5)
/* 3A74B4 E00A83C4 8C42001C */  lw        $v0, 0x1C($v0)
/* 3A74B8 E00A83C8 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3A74BC E00A83CC 00431021 */  addu      $v0, $v0, $v1
/* 3A74C0 E00A83D0 AD020004 */  sw        $v0, 0x4($t0)
/* 3A74C4 E00A83D4 8E65000C */  lw        $a1, 0xC($s3)
/* 3A74C8 E00A83D8 8E660010 */  lw        $a2, 0x10($s3)
/* 3A74CC E00A83DC 8E670014 */  lw        $a3, 0x14($s3)
/* 3A74D0 E00A83E0 25080008 */  addiu     $t0, $t0, 0x8
/* 3A74D4 E00A83E4 0C080108 */  jal       shim_guTranslateF
/* 3A74D8 E00A83E8 AEA80000 */   sw       $t0, 0x0($s5)
/* 3A74DC E00A83EC 27B10058 */  addiu     $s1, $sp, 0x58
/* 3A74E0 E00A83F0 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3A74E4 E00A83F4 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3A74E8 E00A83F8 44800000 */  mtc1      $zero, $f0
/* 3A74EC E00A83FC 00031080 */  sll       $v0, $v1, 2
/* 3A74F0 E00A8400 00431021 */  addu      $v0, $v0, $v1
/* 3A74F4 E00A8404 00021080 */  sll       $v0, $v0, 2
/* 3A74F8 E00A8408 00431023 */  subu      $v0, $v0, $v1
/* 3A74FC E00A840C 000218C0 */  sll       $v1, $v0, 3
/* 3A7500 E00A8410 00431021 */  addu      $v0, $v0, $v1
/* 3A7504 E00A8414 000210C0 */  sll       $v0, $v0, 3
/* 3A7508 E00A8418 44060000 */  mfc1      $a2, $f0
/* 3A750C E00A841C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3A7510 E00A8420 00220821 */  addu      $at, $at, $v0
/* 3A7514 E00A8424 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 3A7518 E00A8428 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 3A751C E00A842C 46000007 */  neg.s     $f0, $f0
/* 3A7520 E00A8430 44050000 */  mfc1      $a1, $f0
/* 3A7524 E00A8434 0220202D */  daddu     $a0, $s1, $zero
/* 3A7528 E00A8438 0C080104 */  jal       shim_guRotateF
/* 3A752C E00A843C AFA60010 */   sw       $a2, 0x10($sp)
/* 3A7530 E00A8440 0220202D */  daddu     $a0, $s1, $zero
/* 3A7534 E00A8444 27A50018 */  addiu     $a1, $sp, 0x18
/* 3A7538 E00A8448 0C080114 */  jal       shim_guMtxCatF
/* 3A753C E00A844C 00A0302D */   daddu    $a2, $a1, $zero
/* 3A7540 E00A8450 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A7544 E00A8454 96C50000 */  lhu       $a1, 0x0($s6)
/* 3A7548 E00A8458 8FC20000 */  lw        $v0, 0x0($fp)
/* 3A754C E00A845C 00052980 */  sll       $a1, $a1, 6
/* 3A7550 E00A8460 00B22821 */  addu      $a1, $a1, $s2
/* 3A7554 E00A8464 0C080118 */  jal       shim_guMtxF2L
/* 3A7558 E00A8468 00452821 */   addu     $a1, $v0, $a1
/* 3A755C E00A846C 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 3A7560 E00A8470 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3A7564 E00A8474 321000FF */  andi      $s0, $s0, 0xFF
/* 3A7568 E00A8478 8EA40000 */  lw        $a0, 0x0($s5)
/* 3A756C E00A847C 96C20000 */  lhu       $v0, 0x0($s6)
/* 3A7570 E00A8480 0080282D */  daddu     $a1, $a0, $zero
/* 3A7574 E00A8484 24840008 */  addiu     $a0, $a0, 0x8
/* 3A7578 E00A8488 AEA40000 */  sw        $a0, 0x0($s5)
/* 3A757C E00A848C ACA30000 */  sw        $v1, 0x0($a1)
/* 3A7580 E00A8490 24430001 */  addiu     $v1, $v0, 0x1
/* 3A7584 E00A8494 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3A7588 E00A8498 00021180 */  sll       $v0, $v0, 6
/* 3A758C E00A849C A6C30000 */  sh        $v1, 0x0($s6)
/* 3A7590 E00A84A0 8FC30000 */  lw        $v1, 0x0($fp)
/* 3A7594 E00A84A4 00521021 */  addu      $v0, $v0, $s2
/* 3A7598 E00A84A8 00621821 */  addu      $v1, $v1, $v0
/* 3A759C E00A84AC 24820008 */  addiu     $v0, $a0, 0x8
/* 3A75A0 E00A84B0 ACA30004 */  sw        $v1, 0x4($a1)
/* 3A75A4 E00A84B4 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A75A8 E00A84B8 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3A75AC E00A84BC AC820000 */  sw        $v0, 0x0($a0)
/* 3A75B0 E00A84C0 00101600 */  sll       $v0, $s0, 24
/* 3A75B4 E00A84C4 00101C00 */  sll       $v1, $s0, 16
/* 3A75B8 E00A84C8 00431025 */  or        $v0, $v0, $v1
/* 3A75BC E00A84CC 00108200 */  sll       $s0, $s0, 8
/* 3A75C0 E00A84D0 00501025 */  or        $v0, $v0, $s0
/* 3A75C4 E00A84D4 344200FF */  ori       $v0, $v0, 0xFF
/* 3A75C8 E00A84D8 AC820004 */  sw        $v0, 0x4($a0)
/* 3A75CC E00A84DC 24820010 */  addiu     $v0, $a0, 0x10
/* 3A75D0 E00A84E0 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A75D4 E00A84E4 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3A75D8 E00A84E8 AC820008 */  sw        $v0, 0x8($a0)
/* 3A75DC E00A84EC 3C020900 */  lui       $v0, %hi(D_09003110_4103A0)
/* 3A75E0 E00A84F0 24423110 */  addiu     $v0, $v0, %lo(D_09003110_4103A0)
/* 3A75E4 E00A84F4 AC82000C */  sw        $v0, 0xC($a0)
.LE00A84F8:
/* 3A75E8 E00A84F8 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A75EC E00A84FC 0000382D */  daddu     $a3, $zero, $zero
/* 3A75F0 E00A8500 8E6500BC */  lw        $a1, 0xBC($s3)
/* 3A75F4 E00A8504 8E6600E4 */  lw        $a2, 0xE4($s3)
/* 3A75F8 E00A8508 26730004 */  addiu     $s3, $s3, 0x4
/* 3A75FC E00A850C 00148080 */  sll       $s0, $s4, 2
/* 3A7600 E00A8510 0C080108 */  jal       shim_guTranslateF
/* 3A7604 E00A8514 26940001 */   addiu    $s4, $s4, 0x1
/* 3A7608 E00A8518 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A760C E00A851C 96C50000 */  lhu       $a1, 0x0($s6)
/* 3A7610 E00A8520 8FC20000 */  lw        $v0, 0x0($fp)
/* 3A7614 E00A8524 00052980 */  sll       $a1, $a1, 6
/* 3A7618 E00A8528 00B72821 */  addu      $a1, $a1, $s7
/* 3A761C E00A852C 0C080118 */  jal       shim_guMtxF2L
/* 3A7620 E00A8530 00452821 */   addu     $a1, $v0, $a1
/* 3A7624 E00A8534 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 3A7628 E00A8538 8EA40000 */  lw        $a0, 0x0($s5)
/* 3A762C E00A853C 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3A7630 E00A8540 0080282D */  daddu     $a1, $a0, $zero
/* 3A7634 E00A8544 24840008 */  addiu     $a0, $a0, 0x8
/* 3A7638 E00A8548 AEA40000 */  sw        $a0, 0x0($s5)
/* 3A763C E00A854C 96C20000 */  lhu       $v0, 0x0($s6)
/* 3A7640 E00A8550 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 3A7644 E00A8554 ACA30000 */  sw        $v1, 0x0($a1)
/* 3A7648 E00A8558 24430001 */  addiu     $v1, $v0, 0x1
/* 3A764C E00A855C 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3A7650 E00A8560 00021180 */  sll       $v0, $v0, 6
/* 3A7654 E00A8564 A6C30000 */  sh        $v1, 0x0($s6)
/* 3A7658 E00A8568 8FC30000 */  lw        $v1, 0x0($fp)
/* 3A765C E00A856C 00571021 */  addu      $v0, $v0, $s7
/* 3A7660 E00A8570 00621821 */  addu      $v1, $v1, $v0
/* 3A7664 E00A8574 24820008 */  addiu     $v0, $a0, 0x8
/* 3A7668 E00A8578 ACA30004 */  sw        $v1, 0x4($a1)
/* 3A766C E00A857C AEA20000 */  sw        $v0, 0x0($s5)
/* 3A7670 E00A8580 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3A7674 E00A8584 AC820000 */  sw        $v0, 0x0($a0)
/* 3A7678 E00A8588 24820010 */  addiu     $v0, $a0, 0x10
/* 3A767C E00A858C 3C03E00B */  lui       $v1, (0xE00B0000 >> 16)
/* 3A7680 E00A8590 00701821 */  addu      $v1, $v1, $s0
/* 3A7684 E00A8594 8C638620 */  lw        $v1, -0x79E0($v1)
/* 3A7688 E00A8598 24050040 */  addiu     $a1, $zero, 0x40
/* 3A768C E00A859C AEA20000 */  sw        $v0, 0x0($s5)
/* 3A7690 E00A85A0 2A82000A */  slti      $v0, $s4, 0xA
/* 3A7694 E00A85A4 AC860008 */  sw        $a2, 0x8($a0)
/* 3A7698 E00A85A8 AC85000C */  sw        $a1, 0xC($a0)
/* 3A769C E00A85AC 1440FFD2 */  bnez      $v0, .LE00A84F8
/* 3A76A0 E00A85B0 AC830004 */   sw       $v1, 0x4($a0)
/* 3A76A4 E00A85B4 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 3A76A8 E00A85B8 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 3A76AC E00A85BC 8C820000 */  lw        $v0, 0x0($a0)
/* 3A76B0 E00A85C0 0040182D */  daddu     $v1, $v0, $zero
/* 3A76B4 E00A85C4 24420008 */  addiu     $v0, $v0, 0x8
/* 3A76B8 E00A85C8 AC820000 */  sw        $v0, 0x0($a0)
/* 3A76BC E00A85CC AC660000 */  sw        $a2, 0x0($v1)
/* 3A76C0 E00A85D0 AC650004 */  sw        $a1, 0x4($v1)
/* 3A76C4 E00A85D4 24430008 */  addiu     $v1, $v0, 0x8
/* 3A76C8 E00A85D8 AC830000 */  sw        $v1, 0x0($a0)
/* 3A76CC E00A85DC 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* 3A76D0 E00A85E0 AC430000 */  sw        $v1, 0x0($v0)
/* 3A76D4 E00A85E4 AC400004 */  sw        $zero, 0x4($v0)
/* 3A76D8 E00A85E8 8FBF00BC */  lw        $ra, 0xBC($sp)
/* 3A76DC E00A85EC 8FBE00B8 */  lw        $fp, 0xB8($sp)
/* 3A76E0 E00A85F0 8FB700B4 */  lw        $s7, 0xB4($sp)
/* 3A76E4 E00A85F4 8FB600B0 */  lw        $s6, 0xB0($sp)
/* 3A76E8 E00A85F8 8FB500AC */  lw        $s5, 0xAC($sp)
/* 3A76EC E00A85FC 8FB400A8 */  lw        $s4, 0xA8($sp)
/* 3A76F0 E00A8600 8FB300A4 */  lw        $s3, 0xA4($sp)
/* 3A76F4 E00A8604 8FB200A0 */  lw        $s2, 0xA0($sp)
/* 3A76F8 E00A8608 8FB1009C */  lw        $s1, 0x9C($sp)
/* 3A76FC E00A860C 8FB00098 */  lw        $s0, 0x98($sp)
/* 3A7700 E00A8610 03E00008 */  jr        $ra
/* 3A7704 E00A8614 27BD00C0 */   addiu    $sp, $sp, 0xC0
/* 3A7708 E00A8618 00000000 */  nop
/* 3A770C E00A861C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void quizmo_audience_appendGfx(void* effect) {
    Matrix4f sp18;
    Matrix4f sp58;
    QuizmoAudienceFXData* data = ((EffectInstance*)effect)->data.quizmoAudience;
    s32 primColor = data->primColor;
    s32 i;

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

    shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
    shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
              G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 255);
    gSPDisplayList(gMainGfxPos++, D_09003110_3AA8B0);

    for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) {
        shim_guTranslateF(sp18, data->compX[i], data->compY[i], 0.0f);
        shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                  G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, quizmo_audience_renderAudienceMember[i]);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_BGMCmd_FF
/* 2B6F0 800502F0 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 2B6F4 800502F4 AFB20018 */  sw        $s2, 0x18($sp)
/* 2B6F8 800502F8 0080902D */  daddu     $s2, $a0, $zero
/* 2B6FC 800502FC AFBF0020 */  sw        $ra, 0x20($sp)
/* 2B700 80050300 AFB3001C */  sw        $s3, 0x1C($sp)
/* 2B704 80050304 AFB10014 */  sw        $s1, 0x14($sp)
/* 2B708 80050308 AFB00010 */  sw        $s0, 0x10($sp)
/* 2B70C 8005030C 924200D4 */  lbu       $v0, 0xD4($s2)
/* 2B710 80050310 924300D5 */  lbu       $v1, 0xD5($s2)
/* 2B714 80050314 924600D6 */  lbu       $a2, 0xD6($s2)
/* 2B718 80050318 2444FFFF */  addiu     $a0, $v0, -0x1
/* 2B71C 8005031C 2C820006 */  sltiu     $v0, $a0, 0x6
/* 2B720 80050320 10400088 */  beqz      $v0, .L80050544
/* 2B724 80050324 00041080 */   sll      $v0, $a0, 2
/* 2B728 80050328 3C01800A */  lui       $at, %hi(jtbl_800988D8)
/* 2B72C 8005032C 00220821 */  addu      $at, $at, $v0
/* 2B730 80050330 8C2288D8 */  lw        $v0, %lo(jtbl_800988D8)($at)
/* 2B734 80050334 00400008 */  jr        $v0
/* 2B738 80050338 00000000 */   nop
glabel .L8005033C
/* 2B73C 8005033C 2C620004 */  sltiu     $v0, $v1, 0x4
/* 2B740 80050340 10400080 */  beqz      $v0, .L80050544
/* 2B744 80050344 02431021 */   addu     $v0, $s2, $v1
/* 2B748 80050348 8043004C */  lb        $v1, 0x4C($v0)
/* 2B74C 8005034C 0460007D */  bltz      $v1, .L80050544
/* 2B750 80050350 9044004C */   lbu      $a0, 0x4C($v0)
/* 2B754 80050354 8E420000 */  lw        $v0, 0x0($s2)
/* 2B758 80050358 10C00010 */  beqz      $a2, .L8005039C
/* 2B75C 8005035C A0440051 */   sb       $a0, 0x51($v0)
/* 2B760 80050360 30C7000F */  andi      $a3, $a2, 0xF
/* 2B764 80050364 00061102 */  srl       $v0, $a2, 4
/* 2B768 80050368 30420001 */  andi      $v0, $v0, 0x1
/* 2B76C 8005036C 8E430000 */  lw        $v1, 0x0($s2)
/* 2B770 80050370 24450001 */  addiu     $a1, $v0, 0x1
/* 2B774 80050374 90620052 */  lbu       $v0, 0x52($v1)
/* 2B778 80050378 14470004 */  bne       $v0, $a3, .L8005038C
/* 2B77C 8005037C 00A0202D */   daddu    $a0, $a1, $zero
/* 2B780 80050380 90620053 */  lbu       $v0, 0x53($v1)
/* 2B784 80050384 1044006F */  beq       $v0, $a0, .L80050544
/* 2B788 80050388 00000000 */   nop
.L8005038C:
/* 2B78C 8005038C A0670052 */  sb        $a3, 0x52($v1)
/* 2B790 80050390 8E420000 */  lw        $v0, 0x0($s2)
/* 2B794 80050394 080140EC */  j         .L800503B0
/* 2B798 80050398 A0450053 */   sb       $a1, 0x53($v0)
.L8005039C:
/* 2B79C 8005039C 8E430000 */  lw        $v1, 0x0($s2)
/* 2B7A0 800503A0 90620053 */  lbu       $v0, 0x53($v1)
/* 2B7A4 800503A4 10400067 */  beqz      $v0, .L80050544
/* 2B7A8 800503A8 00000000 */   nop
/* 2B7AC 800503AC A0600053 */  sb        $zero, 0x53($v1)
.L800503B0:
/* 2B7B0 800503B0 8E430000 */  lw        $v1, 0x0($s2)
/* 2B7B4 800503B4 24020001 */  addiu     $v0, $zero, 0x1
/* 2B7B8 800503B8 08014151 */  j         .L80050544
/* 2B7BC 800503BC A0620050 */   sb       $v0, 0x50($v1)
glabel .L800503C0
/* 2B7C0 800503C0 2465FFFF */  addiu     $a1, $v1, -0x1
/* 2B7C4 800503C4 2CA20008 */  sltiu     $v0, $a1, 0x8
/* 2B7C8 800503C8 5040005E */  beql      $v0, $zero, .L80050544
/* 2B7CC 800503CC A2400211 */   sb       $zero, 0x211($s2)
/* 2B7D0 800503D0 A2430211 */  sb        $v1, 0x211($s2)
/* 2B7D4 800503D4 0C013A11 */  jal       func_8004E844
/* 2B7D8 800503D8 0240202D */   daddu    $a0, $s2, $zero
/* 2B7DC 800503DC 08014151 */  j         .L80050544
/* 2B7E0 800503E0 00000000 */   nop
glabel .L800503E4
/* 2B7E4 800503E4 92500211 */  lbu       $s0, 0x211($s2)
/* 2B7E8 800503E8 2604FFFF */  addiu     $a0, $s0, -0x1
/* 2B7EC 800503EC 2C820008 */  sltiu     $v0, $a0, 0x8
/* 2B7F0 800503F0 10400054 */  beqz      $v0, .L80050544
/* 2B7F4 800503F4 0080802D */   daddu    $s0, $a0, $zero
/* 2B7F8 800503F8 02501021 */  addu      $v0, $s2, $s0
/* 2B7FC 800503FC 90440212 */  lbu       $a0, 0x212($v0)
/* 2B800 80050400 2C820008 */  sltiu     $v0, $a0, 0x8
/* 2B804 80050404 1040004F */  beqz      $v0, .L80050544
/* 2B808 80050408 2C620028 */   sltiu    $v0, $v1, 0x28
/* 2B80C 8005040C 14400005 */  bnez      $v0, .L80050424
/* 2B810 80050410 001010C0 */   sll      $v0, $s0, 3
/* 2B814 80050414 00501021 */  addu      $v0, $v0, $s0
/* 2B818 80050418 00441021 */  addu      $v0, $v0, $a0
/* 2B81C 8005041C 0801410F */  j         .L8005043C
/* 2B820 80050420 00021040 */   sll      $v0, $v0, 1
.L80050424:
/* 2B824 80050424 00501021 */  addu      $v0, $v0, $s0
/* 2B828 80050428 00441021 */  addu      $v0, $v0, $a0
/* 2B82C 8005042C 00021040 */  sll       $v0, $v0, 1
/* 2B830 80050430 3C018008 */  lui       $at, %hi(D_80078558)
/* 2B834 80050434 00230821 */  addu      $at, $at, $v1
/* 2B838 80050438 90238558 */  lbu       $v1, %lo(D_80078558)($at)
.L8005043C:
/* 2B83C 8005043C 02421021 */  addu      $v0, $s2, $v0
/* 2B840 80050440 00031A00 */  sll       $v1, $v1, 8
/* 2B844 80050444 00661821 */  addu      $v1, $v1, $a2
/* 2B848 80050448 A4430174 */  sh        $v1, 0x174($v0)
/* 2B84C 8005044C 02501821 */  addu      $v1, $s2, $s0
/* 2B850 80050450 24820001 */  addiu     $v0, $a0, 0x1
/* 2B854 80050454 08014151 */  j         .L80050544
/* 2B858 80050458 A0620212 */   sb       $v0, 0x212($v1)
glabel .L8005045C
/* 2B85C 8005045C 2C620009 */  sltiu     $v0, $v1, 0x9
/* 2B860 80050460 50400038 */  beql      $v0, $zero, .L80050544
/* 2B864 80050464 A0A0004C */   sb       $zero, 0x4C($a1)
/* 2B868 80050468 08014151 */  j         .L80050544
/* 2B86C 8005046C A0A3004C */   sb       $v1, 0x4C($a1)
glabel .L80050470
/* 2B870 80050470 8E420004 */  lw        $v0, 0x4($s2)
/* 2B874 80050474 10400033 */  beqz      $v0, .L80050544
/* 2B878 80050478 0000802D */   daddu    $s0, $zero, $zero
/* 2B87C 8005047C 0040282D */  daddu     $a1, $v0, $zero
.L80050480:
/* 2B880 80050480 00A0202D */  daddu     $a0, $a1, $zero
/* 2B884 80050484 90820090 */  lbu       $v0, 0x90($a0)
/* 2B888 80050488 10400022 */  beqz      $v0, .L80050514
/* 2B88C 8005048C 00103080 */   sll      $a2, $s0, 2
/* 2B890 80050490 26100001 */  addiu     $s0, $s0, 0x1
/* 2B894 80050494 2E020004 */  sltiu     $v0, $s0, 0x4
/* 2B898 80050498 1440FFF9 */  bnez      $v0, .L80050480
/* 2B89C 8005049C 24850004 */   addiu    $a1, $a0, 0x4
/* 2B8A0 800504A0 08014151 */  j         .L80050544
/* 2B8A4 800504A4 00000000 */   nop
glabel .L800504A8
/* 2B8A8 800504A8 54600025 */  bnel      $v1, $zero, .L80050540
/* 2B8AC 800504AC A0A3004F */   sb       $v1, 0x4F($a1)
/* 2B8B0 800504B0 90A2004E */  lbu       $v0, 0x4E($a1)
/* 2B8B4 800504B4 10400023 */  beqz      $v0, .L80050544
/* 2B8B8 800504B8 0000802D */   daddu    $s0, $zero, $zero
/* 2B8BC 800504BC A0A0004E */  sb        $zero, 0x4E($a1)
/* 2B8C0 800504C0 2413007F */  addiu     $s3, $zero, 0x7F
/* 2B8C4 800504C4 2411025C */  addiu     $s1, $zero, 0x25C
.L800504C8:
/* 2B8C8 800504C8 92420171 */  lbu       $v0, 0x171($s2)
/* 2B8CC 800504CC 14530004 */  bne       $v0, $s3, .L800504E0
/* 2B8D0 800504D0 02512821 */   addu     $a1, $s2, $s1
/* 2B8D4 800504D4 90A2004F */  lbu       $v0, 0x4F($a1)
/* 2B8D8 800504D8 08014139 */  j         .L800504E4
/* 2B8DC 800504DC 00000000 */   nop
.L800504E0:
/* 2B8E0 800504E0 90A20050 */  lbu       $v0, 0x50($a1)
.L800504E4:
/* 2B8E4 800504E4 10400005 */  beqz      $v0, .L800504FC
/* 2B8E8 800504E8 0240202D */   daddu    $a0, $s2, $zero
/* 2B8EC 800504EC 0040302D */  daddu     $a2, $v0, $zero
/* 2B8F0 800504F0 24070048 */  addiu     $a3, $zero, 0x48
/* 2B8F4 800504F4 0C014222 */  jal       func_80050888
/* 2B8F8 800504F8 A0A0004E */   sb       $zero, 0x4E($a1)
.L800504FC:
/* 2B8FC 800504FC 26100001 */  addiu     $s0, $s0, 0x1
/* 2B900 80050500 2E020010 */  sltiu     $v0, $s0, 0x10
/* 2B904 80050504 1440FFF0 */  bnez      $v0, .L800504C8
/* 2B908 80050508 26310060 */   addiu    $s1, $s1, 0x60
/* 2B90C 8005050C 08014151 */  j         .L80050544
/* 2B910 80050510 00000000 */   nop
.L80050514:
/* 2B914 80050514 A0A30090 */  sb        $v1, 0x90($a1)
/* 2B918 80050518 9643002C */  lhu       $v1, 0x2C($s2)
/* 2B91C 8005051C 9642003C */  lhu       $v0, 0x3C($s2)
/* 2B920 80050520 00620018 */  mult      $v1, $v0
/* 2B924 80050524 8E430004 */  lw        $v1, 0x4($s2)
/* 2B928 80050528 00661821 */  addu      $v1, $v1, $a2
/* 2B92C 8005052C 00004012 */  mflo      $t0
/* 2B930 80050530 25027FFF */  addiu     $v0, $t0, 0x7FFF
/* 2B934 80050534 000215C3 */  sra       $v0, $v0, 23
/* 2B938 80050538 08014151 */  j         .L80050544
/* 2B93C 8005053C A0620093 */   sb       $v0, 0x93($v1)
.L80050540:
/* 2B940 80050540 A0A60050 */  sb        $a2, 0x50($a1)
.L80050544:
/* 2B944 80050544 8FBF0020 */  lw        $ra, 0x20($sp)
/* 2B948 80050548 8FB3001C */  lw        $s3, 0x1C($sp)
/* 2B94C 8005054C 8FB20018 */  lw        $s2, 0x18($sp)
/* 2B950 80050550 8FB10014 */  lw        $s1, 0x14($sp)
/* 2B954 80050554 8FB00010 */  lw        $s0, 0x10($sp)
/* 2B958 80050558 03E00008 */  jr        $ra
/* 2B95C 8005055C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) {
    u32 i;
    u32 j;
    u8 temp_a1;
    u8 temp_a3;

    u32 arg0 = player->seqCmdArgs.UnkCmdFF.unk_00;
    u32 arg1 = player->seqCmdArgs.UnkCmdFF.unk_01;
    u32 arg2 = player->seqCmdArgs.UnkCmdFF.unk_02;

    switch (arg0) {
        case 1:
            if ((arg1 < ARRAY_COUNT(player->effectIndices)) && ((s8)player->effectIndices[arg1] >= 0)) {
                player->globals->channelDelayBusId = player->effectIndices[arg1];
                if (arg2 != 0) {
                    temp_a3 = arg2 & 0xF;
                    temp_a1 = ((arg2 >> 4) & 1) + 1;
                    if ((player->globals->channelDelayTime != temp_a3) || (player->globals->channelDelaySide != temp_a1)) {
                        player->globals->channelDelayTime = temp_a3;
                        player->globals->channelDelaySide = temp_a1;
                        player->globals->channelDelayPending = 1;
                    }
                } else {
                    if (player->globals->channelDelaySide != 0) {
                        player->globals->channelDelaySide = 0;
                        player->globals->channelDelayPending = 1;
                    }
                }
            }
            break;
        case 2:
            if (arg1 - 1 < 8) {
                player->unk_211 = arg1;
                func_8004E844(player, arg1 - 1);
            } else {
                player->unk_211 = 0;
            }
            break;
        case 3:
            i = player->unk_211;
            if (i - 1 < 8) {
                i = i - 1; // needed to match
                j = player->unk_212[i];
                if (j < 8) {
                    if (arg1 >= 40) {
                        player->unk_174[i][j] = (arg1 << 8) + arg2;
                    } else {
                        player->unk_174[i][j] = (D_80078558[arg1] << 8) + arg2;
                    }
                    player->unk_212[i] = j + 1;
                }
            }
            break;
        case 4:
            if (arg1 < 9) {
                track->unk_4C = arg1;
            } else {
                track->unk_4C = 0;
            }
            break;
        case 5:
            if (player->soundManager != NULL) {
                for (i = 0; i < ARRAY_COUNT(player->soundManager->bgmSounds); i++) {
                    if ((player->soundManager->bgmSounds[i].unk_0) == 0) {
                        player->soundManager->bgmSounds[i].unk_0 = arg1;
                        player->soundManager->bgmSounds[i].volume = ((player->fadeInfo.currentVolume.u16 * player->fadeInfo.volScale.u16) + 0x7FFF) >> 0x17;
                        break;
                    }
                }
            }
            break;
        case 6:
            if (arg1 == 0) {
                if (track->unk_4E != 0) {
                    track->unk_4E = 0;
                    for (i = 0; i < 16; i++) {
                        BGMPlayerTrack* otherTrack = &player->tracks[i];
                        if (player->proxMixVolume == 0x7F) {
                            if (otherTrack->unk_4F != 0) {
                                otherTrack->unk_4E = 0;
                                func_80050888(player, otherTrack, otherTrack->unk_4F, 72);
                            }
                        } else {
                            if (otherTrack->unk_50 != 0) {
                                otherTrack->unk_4E = 0;
                                func_80050888(player, otherTrack, otherTrack->unk_50, 72);
                            }
                        }
                    }
                }
            } else {
                track->unk_4F = arg1;
                track->unk_50 = arg2;
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel partner_buff_update
/* 404324 E011A104 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 404328 E011A108 AFBF002C */  sw        $ra, 0x2C($sp)
/* 40432C E011A10C AFB60028 */  sw        $s6, 0x28($sp)
/* 404330 E011A110 AFB50024 */  sw        $s5, 0x24($sp)
/* 404334 E011A114 AFB40020 */  sw        $s4, 0x20($sp)
/* 404338 E011A118 AFB3001C */  sw        $s3, 0x1C($sp)
/* 40433C E011A11C AFB20018 */  sw        $s2, 0x18($sp)
/* 404340 E011A120 AFB10014 */  sw        $s1, 0x14($sp)
/* 404344 E011A124 AFB00010 */  sw        $s0, 0x10($sp)
/* 404348 E011A128 8C830000 */  lw        $v1, 0x0($a0)
/* 40434C E011A12C 8C91000C */  lw        $s1, 0xC($a0)
/* 404350 E011A130 30620010 */  andi      $v0, $v1, 0x10
/* 404354 E011A134 86360000 */  lh        $s6, 0x0($s1)
/* 404358 E011A138 10400005 */  beqz      $v0, .LE011A150
/* 40435C E011A13C 2402FFEF */   addiu    $v0, $zero, -0x11
/* 404360 E011A140 00621024 */  and       $v0, $v1, $v0
/* 404364 E011A144 AC820000 */  sw        $v0, 0x0($a0)
/* 404368 E011A148 24020010 */  addiu     $v0, $zero, 0x10
/* 40436C E011A14C AE220004 */  sw        $v0, 0x4($s1)
.LE011A150:
/* 404370 E011A150 8E230004 */  lw        $v1, 0x4($s1)
/* 404374 E011A154 286203E8 */  slti      $v0, $v1, 0x3E8
/* 404378 E011A158 10400002 */  beqz      $v0, .LE011A164
/* 40437C E011A15C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 404380 E011A160 AE220004 */  sw        $v0, 0x4($s1)
.LE011A164:
/* 404384 E011A164 8E220008 */  lw        $v0, 0x8($s1)
/* 404388 E011A168 8E230004 */  lw        $v1, 0x4($s1)
/* 40438C E011A16C 24450001 */  addiu     $a1, $v0, 0x1
/* 404390 E011A170 04610005 */  bgez      $v1, .LE011A188
/* 404394 E011A174 AE250008 */   sw       $a1, 0x8($s1)
/* 404398 E011A178 0C080128 */  jal       shim_remove_effect
/* 40439C E011A17C 00000000 */   nop
/* 4043A0 E011A180 080468DC */  j         .LE011A370
/* 4043A4 E011A184 00000000 */   nop
.LE011A188:
/* 4043A8 E011A188 3C028888 */  lui       $v0, (0x88888889 >> 16)
/* 4043AC E011A18C 34428889 */  ori       $v0, $v0, (0x88888889 & 0xFFFF)
/* 4043B0 E011A190 00A20018 */  mult      $a1, $v0
/* 4043B4 E011A194 0000982D */  daddu     $s3, $zero, $zero
/* 4043B8 E011A198 24140001 */  addiu     $s4, $zero, 0x1
/* 4043BC E011A19C 2412000C */  addiu     $s2, $zero, 0xC
/* 4043C0 E011A1A0 000517C3 */  sra       $v0, $a1, 31
/* 4043C4 E011A1A4 00003010 */  mfhi      $a2
/* 4043C8 E011A1A8 00C51821 */  addu      $v1, $a2, $a1
/* 4043CC E011A1AC 00031903 */  sra       $v1, $v1, 4
/* 4043D0 E011A1B0 00621823 */  subu      $v1, $v1, $v0
/* 4043D4 E011A1B4 00031100 */  sll       $v0, $v1, 4
/* 4043D8 E011A1B8 00431023 */  subu      $v0, $v0, $v1
/* 4043DC E011A1BC 02821004 */  sllv      $v0, $v0, $s4
/* 4043E0 E011A1C0 00A2A823 */  subu      $s5, $a1, $v0
.LE011A1C4:
/* 4043E4 E011A1C4 02328021 */  addu      $s0, $s1, $s2
/* 4043E8 E011A1C8 86020004 */  lh        $v0, 0x4($s0)
/* 4043EC E011A1CC 04420001 */  bltzl     $v0, .LE011A1D4
/* 4043F0 E011A1D0 A6000004 */   sh       $zero, 0x4($s0)
.LE011A1D4:
/* 4043F4 E011A1D4 16D40006 */  bne       $s6, $s4, .LE011A1F0
/* 4043F8 E011A1D8 00000000 */   nop
/* 4043FC E011A1DC 16A00004 */  bnez      $s5, .LE011A1F0
/* 404400 E011A1E0 00000000 */   nop
/* 404404 E011A1E4 0C080138 */  jal       shim_rand_int
/* 404408 E011A1E8 24040004 */   addiu    $a0, $zero, 0x4
/* 40440C E011A1EC A6020004 */  sh        $v0, 0x4($s0)
.LE011A1F0:
/* 404410 E011A1F0 86030006 */  lh        $v1, 0x6($s0)
/* 404414 E011A1F4 2C620029 */  sltiu     $v0, $v1, 0x29
/* 404418 E011A1F8 10400059 */  beqz      $v0, .LE011A360
/* 40441C E011A1FC 00031080 */   sll      $v0, $v1, 2
/* 404420 E011A200 3C01E012 */  lui       $at, (0xE0120000 >> 16)
/* 404424 E011A204 00220821 */  addu      $at, $at, $v0
/* 404428 E011A208 8C22AC70 */  lw        $v0, -0x5390($at)
/* 40442C E011A20C 00400008 */  jr        $v0
/* 404430 E011A210 00000000 */   nop
/* 404434 E011A214 86030000 */  lh        $v1, 0x0($s0)
/* 404438 E011A218 240200FF */  addiu     $v0, $zero, 0xFF
/* 40443C E011A21C 14620011 */  bne       $v1, $v0, .LE011A264
/* 404440 E011A220 00000000 */   nop
/* 404444 E011A224 86040004 */  lh        $a0, 0x4($s0)
/* 404448 E011A228 86030002 */  lh        $v1, 0x2($s0)
/* 40444C E011A22C 0083102A */  slt       $v0, $a0, $v1
/* 404450 E011A230 10400003 */  beqz      $v0, .LE011A240
/* 404454 E011A234 0064102A */   slt      $v0, $v1, $a0
/* 404458 E011A238 080468D8 */  j         .LE011A360
/* 40445C E011A23C A6140006 */   sh       $s4, 0x6($s0)
.LE011A240:
/* 404460 E011A240 10400003 */  beqz      $v0, .LE011A250
/* 404464 E011A244 24020002 */   addiu    $v0, $zero, 0x2
/* 404468 E011A248 080468D8 */  j         .LE011A360
/* 40446C E011A24C A6020006 */   sh       $v0, 0x6($s0)
.LE011A250:
/* 404470 E011A250 54600044 */  bnel      $v1, $zero, .LE011A364
/* 404474 E011A254 26730001 */   addiu    $s3, $s3, 0x1
/* 404478 E011A258 24020003 */  addiu     $v0, $zero, 0x3
/* 40447C E011A25C 080468D8 */  j         .LE011A360
/* 404480 E011A260 A6020006 */   sh       $v0, 0x6($s0)
.LE011A264:
/* 404484 E011A264 5460003F */  bnel      $v1, $zero, .LE011A364
/* 404488 E011A268 26730001 */   addiu    $s3, $s3, 0x1
/* 40448C E011A26C 86020004 */  lh        $v0, 0x4($s0)
/* 404490 E011A270 1840003B */  blez      $v0, .LE011A360
/* 404494 E011A274 24020004 */   addiu    $v0, $zero, 0x4
/* 404498 E011A278 080468D8 */  j         .LE011A360
/* 40449C E011A27C A6020006 */   sh       $v0, 0x6($s0)
/* 4044A0 E011A280 2402000A */  addiu     $v0, $zero, 0xA
/* 4044A4 E011A284 A6000008 */  sh        $zero, 0x8($s0)
/* 4044A8 E011A288 A6020006 */  sh        $v0, 0x6($s0)
/* 4044AC E011A28C 96020008 */  lhu       $v0, 0x8($s0)
/* 4044B0 E011A290 24420001 */  addiu     $v0, $v0, 0x1
/* 4044B4 E011A294 A6020008 */  sh        $v0, 0x8($s0)
/* 4044B8 E011A298 00021400 */  sll       $v0, $v0, 16
/* 4044BC E011A29C 00021403 */  sra       $v0, $v0, 16
/* 4044C0 E011A2A0 2842000B */  slti      $v0, $v0, 0xB
/* 4044C4 E011A2A4 5440002F */  bnel      $v0, $zero, .LE011A364
/* 4044C8 E011A2A8 26730001 */   addiu    $s3, $s3, 0x1
/* 4044CC E011A2AC 96020002 */  lhu       $v0, 0x2($s0)
/* 4044D0 E011A2B0 A6000008 */  sh        $zero, 0x8($s0)
/* 4044D4 E011A2B4 A6000006 */  sh        $zero, 0x6($s0)
/* 4044D8 E011A2B8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 4044DC E011A2BC 080468D8 */  j         .LE011A360
/* 4044E0 E011A2C0 A6020002 */   sh       $v0, 0x2($s0)
/* 4044E4 E011A2C4 24020014 */  addiu     $v0, $zero, 0x14
/* 4044E8 E011A2C8 A6000008 */  sh        $zero, 0x8($s0)
/* 4044EC E011A2CC A6020006 */  sh        $v0, 0x6($s0)
/* 4044F0 E011A2D0 96020008 */  lhu       $v0, 0x8($s0)
/* 4044F4 E011A2D4 24420001 */  addiu     $v0, $v0, 0x1
/* 4044F8 E011A2D8 A6020008 */  sh        $v0, 0x8($s0)
/* 4044FC E011A2DC 00021400 */  sll       $v0, $v0, 16
/* 404500 E011A2E0 00021403 */  sra       $v0, $v0, 16
/* 404504 E011A2E4 2842000B */  slti      $v0, $v0, 0xB
/* 404508 E011A2E8 5440001E */  bnel      $v0, $zero, .LE011A364
/* 40450C E011A2EC 26730001 */   addiu    $s3, $s3, 0x1
/* 404510 E011A2F0 96020004 */  lhu       $v0, 0x4($s0)
/* 404514 E011A2F4 A6000008 */  sh        $zero, 0x8($s0)
/* 404518 E011A2F8 A6000006 */  sh        $zero, 0x6($s0)
/* 40451C E011A2FC 080468D8 */  j         .LE011A360
/* 404520 E011A300 A6020002 */   sh       $v0, 0x2($s0)
/* 404524 E011A304 96020000 */  lhu       $v0, 0x0($s0)
/* 404528 E011A308 2442FFE0 */  addiu     $v0, $v0, -0x20
/* 40452C E011A30C A6020000 */  sh        $v0, 0x0($s0)
/* 404530 E011A310 00021400 */  sll       $v0, $v0, 16
/* 404534 E011A314 04430013 */  bgezl     $v0, .LE011A364
/* 404538 E011A318 26730001 */   addiu    $s3, $s3, 0x1
/* 40453C E011A31C 080468D7 */  j         .LE011A35C
/* 404540 E011A320 A6000000 */   sh       $zero, 0x0($s0)
/* 404544 E011A324 96030004 */  lhu       $v1, 0x4($s0)
/* 404548 E011A328 24020028 */  addiu     $v0, $zero, 0x28
/* 40454C E011A32C A6020006 */  sh        $v0, 0x6($s0)
/* 404550 E011A330 A6030002 */  sh        $v1, 0x2($s0)
/* 404554 E011A334 96020000 */  lhu       $v0, 0x0($s0)
/* 404558 E011A338 24420040 */  addiu     $v0, $v0, 0x40
/* 40455C E011A33C A6020000 */  sh        $v0, 0x0($s0)
/* 404560 E011A340 00021400 */  sll       $v0, $v0, 16
/* 404564 E011A344 00021403 */  sra       $v0, $v0, 16
/* 404568 E011A348 28420100 */  slti      $v0, $v0, 0x100
/* 40456C E011A34C 54400005 */  bnel      $v0, $zero, .LE011A364
/* 404570 E011A350 26730001 */   addiu    $s3, $s3, 0x1
/* 404574 E011A354 240200FF */  addiu     $v0, $zero, 0xFF
/* 404578 E011A358 A6020000 */  sh        $v0, 0x0($s0)
.LE011A35C:
/* 40457C E011A35C A6000006 */  sh        $zero, 0x6($s0)
.LE011A360:
/* 404580 E011A360 26730001 */  addiu     $s3, $s3, 0x1
.LE011A364:
/* 404584 E011A364 2A620003 */  slti      $v0, $s3, 0x3
/* 404588 E011A368 1440FF96 */  bnez      $v0, .LE011A1C4
/* 40458C E011A36C 2652000A */   addiu    $s2, $s2, 0xA
.LE011A370:
/* 404590 E011A370 8FBF002C */  lw        $ra, 0x2C($sp)
/* 404594 E011A374 8FB60028 */  lw        $s6, 0x28($sp)
/* 404598 E011A378 8FB50024 */  lw        $s5, 0x24($sp)
/* 40459C E011A37C 8FB40020 */  lw        $s4, 0x20($sp)
/* 4045A0 E011A380 8FB3001C */  lw        $s3, 0x1C($sp)
/* 4045A4 E011A384 8FB20018 */  lw        $s2, 0x18($sp)
/* 4045A8 E011A388 8FB10014 */  lw        $s1, 0x14($sp)
/* 4045AC E011A38C 8FB00010 */  lw        $s0, 0x10($sp)
/* 4045B0 E011A390 03E00008 */  jr        $ra
/* 4045B4 E011A394 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void partner_buff_update(EffectInstance* effect) {
    PartnerBuffFXData* data = effect->data.partnerBuff;
    s32 useRandomValues = data->useRandomValues;
    s32 time;
    s32 i;

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

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

    time = data->lifeTime;

    for (i = 0; i < ARRAY_COUNT(data->unk_0C); i++) {
        BuffData* buff = &data->unk_0C[i];

        if (buff->turnsLeft < 0) {
            buff->turnsLeft = 0;
        }
        // possibly a leftover debug option
        if (useRandomValues == 1 && time % 30 == 0) {
            buff->turnsLeft = shim_rand_int(4);
        }

        switch (buff->state) {
            case BUFF_STATE_IDLE:
                if (buff->alpha == 255) {
                    if (buff->turnsLeft < buff->turnsDisplay) {
                        buff->state = BUFF_STATE_DECREMENT_TURNS_INIT;
                    } else if (buff->turnsDisplay < buff->turnsLeft) {
                        buff->state = BUFF_STATE_SET_TURNS_INIT;
                    } else if (buff->turnsDisplay == 0) {
                        buff->state = BUFF_STATE_FADE_OUT;
                    }
                } else if ((buff->alpha == 0) && (buff->turnsLeft > 0)) {
                    buff->state = BUFF_STATE_FADE_IN_INIT;
                }
                break;
            case BUFF_STATE_DECREMENT_TURNS_INIT:
                buff->stateTimer = 0;
                buff->state = BUFF_STATE_DECREMENT_TURNS;
                // fallthrough
            case BUFF_STATE_DECREMENT_TURNS:
                buff->stateTimer++;
                if (buff->stateTimer > 10) {
                    buff->stateTimer = 0;
                    buff->state = BUFF_STATE_IDLE;
                    buff->turnsDisplay--;
                }
                break;
            case BUFF_STATE_SET_TURNS_INIT:
                buff->stateTimer = 0;
                buff->state = BUFF_STATE_SET_TURNS;
                // fallthrough
            case BUFF_STATE_SET_TURNS:
                buff->stateTimer++;
                if (buff->stateTimer > 10) {
                    buff->stateTimer = 0;
                    buff->state = BUFF_STATE_IDLE;
                    buff->turnsDisplay = buff->turnsLeft;
                }
                break;
            case BUFF_STATE_FADE_OUT:
                buff->alpha -= 32;
                if (buff->alpha < 0) {
                    buff->alpha = 0;
                    buff->state = BUFF_STATE_IDLE;
                }
                break;
            case BUFF_STATE_FADE_IN_INIT:
                buff->state = BUFF_STATE_FADE_IN;
                buff->turnsDisplay = buff->turnsLeft;
                // fallthrough
            case BUFF_STATE_FADE_IN:
                buff->alpha += 64;
                if (buff->alpha > 255) {
                    buff->alpha = 255;
                    buff->state = BUFF_STATE_IDLE;
                }
                break;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_80259AAC
/* 18838C 80259AAC 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 188390 80259AB0 AFB20018 */  sw        $s2, 0x18($sp)
/* 188394 80259AB4 0080902D */  daddu     $s2, $a0, $zero
/* 188398 80259AB8 AFB10014 */  sw        $s1, 0x14($sp)
/* 18839C 80259ABC 00A0882D */  daddu     $s1, $a1, $zero
/* 1883A0 80259AC0 AFBF0024 */  sw        $ra, 0x24($sp)
/* 1883A4 80259AC4 AFB40020 */  sw        $s4, 0x20($sp)
/* 1883A8 80259AC8 AFB3001C */  sw        $s3, 0x1C($sp)
/* 1883AC 80259ACC AFB00010 */  sw        $s0, 0x10($sp)
/* 1883B0 80259AD0 8E3000C0 */  lw        $s0, 0xC0($s1)
/* 1883B4 80259AD4 00C0982D */  daddu     $s3, $a2, $zero
/* 1883B8 80259AD8 820206C1 */  lb        $v0, 0x6C1($s0)
/* 1883BC 80259ADC 1040002E */  beqz      $v0, .L80259B98
/* 1883C0 80259AE0 00E0A02D */   daddu    $s4, $a3, $zero
/* 1883C4 80259AE4 16400016 */  bnez      $s2, .L80259B40
/* 1883C8 80259AE8 00000000 */   nop
/* 1883CC 80259AEC 0C0B7830 */  jal       spr_get_player_palettes
/* 1883D0 80259AF0 96240088 */   lhu      $a0, 0x88($s1)
/* 1883D4 80259AF4 AE0206D0 */  sw        $v0, 0x6D0($s0)
/* 1883D8 80259AF8 0040202D */  daddu     $a0, $v0, $zero
/* 1883DC 80259AFC A20006CD */  sb        $zero, 0x6CD($s0)
/* 1883E0 80259B00 8C830000 */  lw        $v1, 0x0($a0)
/* 1883E4 80259B04 2402FFFF */  addiu     $v0, $zero, -0x1
/* 1883E8 80259B08 10620021 */  beq       $v1, $v0, .L80259B90
/* 1883EC 80259B0C 0080182D */   daddu    $v1, $a0, $zero
/* 1883F0 80259B10 0040202D */  daddu     $a0, $v0, $zero
.L80259B14:
/* 1883F4 80259B14 920206CD */  lbu       $v0, 0x6CD($s0)
/* 1883F8 80259B18 24420001 */  addiu     $v0, $v0, 0x1
/* 1883FC 80259B1C A20206CD */  sb        $v0, 0x6CD($s0)
/* 188400 80259B20 00021600 */  sll       $v0, $v0, 24
/* 188404 80259B24 00021583 */  sra       $v0, $v0, 22
/* 188408 80259B28 00431021 */  addu      $v0, $v0, $v1
/* 18840C 80259B2C 8C420000 */  lw        $v0, 0x0($v0)
/* 188410 80259B30 1444FFF8 */  bne       $v0, $a0, .L80259B14
/* 188414 80259B34 00000000 */   nop
/* 188418 80259B38 080966E5 */  j         .L80259B94
/* 18841C 80259B3C A20006C2 */   sb       $zero, 0x6C2($s0)
.L80259B40:
/* 188420 80259B40 96240088 */  lhu       $a0, 0x88($s1)
/* 188424 80259B44 0C0B7A90 */  jal       spr_get_npc_palettes
/* 188428 80259B48 00000000 */   nop
/* 18842C 80259B4C AE0206D0 */  sw        $v0, 0x6D0($s0)
/* 188430 80259B50 0040202D */  daddu     $a0, $v0, $zero
/* 188434 80259B54 A20006CD */  sb        $zero, 0x6CD($s0)
/* 188438 80259B58 8C830000 */  lw        $v1, 0x0($a0)
/* 18843C 80259B5C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 188440 80259B60 1062000B */  beq       $v1, $v0, .L80259B90
/* 188444 80259B64 0080182D */   daddu    $v1, $a0, $zero
/* 188448 80259B68 0040202D */  daddu     $a0, $v0, $zero
.L80259B6C:
/* 18844C 80259B6C 920206CD */  lbu       $v0, 0x6CD($s0)
/* 188450 80259B70 24420001 */  addiu     $v0, $v0, 0x1
/* 188454 80259B74 A20206CD */  sb        $v0, 0x6CD($s0)
/* 188458 80259B78 00021600 */  sll       $v0, $v0, 24
/* 18845C 80259B7C 00021583 */  sra       $v0, $v0, 22
/* 188460 80259B80 00431021 */  addu      $v0, $v0, $v1
/* 188464 80259B84 8C420000 */  lw        $v0, 0x0($v0)
/* 188468 80259B88 1444FFF8 */  bne       $v0, $a0, .L80259B6C
/* 18846C 80259B8C 00000000 */   nop
.L80259B90:
/* 188470 80259B90 A20006C2 */  sb        $zero, 0x6C2($s0)
.L80259B94:
/* 188474 80259B94 A20006C1 */  sb        $zero, 0x6C1($s0)
.L80259B98:
/* 188478 80259B98 820206CD */  lb        $v0, 0x6CD($s0)
/* 18847C 80259B9C 18400067 */  blez      $v0, .L80259D3C
/* 188480 80259BA0 0000502D */   daddu    $t2, $zero, $zero
/* 188484 80259BA4 3C0B8000 */  lui       $t3, (0x80000000 >> 16)
/* 188488 80259BA8 0200602D */  daddu     $t4, $s0, $zero
/* 18848C 80259BAC 3C01802A */  lui       $at, %hi(D_8029D3E8)
/* 188490 80259BB0 D428D3E8 */  ldc1      $f8, %lo(D_8029D3E8)($at)
/* 188494 80259BB4 3C0141E0 */  lui       $at, (0x41E00000 >> 16)
/* 188498 80259BB8 44811800 */  mtc1      $at, $f3
/* 18849C 80259BBC 44801000 */  mtc1      $zero, $f2
/* 1884A0 80259BC0 3C01802A */  lui       $at, %hi(D_8029D3F0)
/* 1884A4 80259BC4 D426D3F0 */  ldc1      $f6, %lo(D_8029D3F0)($at)
/* 1884A8 80259BC8 3C01802A */  lui       $at, %hi(D_8029D3F8)
/* 1884AC 80259BCC D424D3F8 */  ldc1      $f4, %lo(D_8029D3F8)($at)
.L80259BD0:
/* 1884B0 80259BD0 8E0206D0 */  lw        $v0, 0x6D0($s0)
/* 1884B4 80259BD4 000A1880 */  sll       $v1, $t2, 2
/* 1884B8 80259BD8 00621821 */  addu      $v1, $v1, $v0
/* 1884BC 80259BDC 000A1140 */  sll       $v0, $t2, 5
/* 1884C0 80259BE0 8C670000 */  lw        $a3, 0x0($v1)
/* 1884C4 80259BE4 02024021 */  addu      $t0, $s0, $v0
/* 1884C8 80259BE8 10E0004F */  beqz      $a3, .L80259D28
/* 1884CC 80259BEC AD8806D4 */   sw       $t0, 0x6D4($t4)
/* 1884D0 80259BF0 0000482D */  daddu     $t1, $zero, $zero
.L80259BF4:
/* 1884D4 80259BF4 94E30000 */  lhu       $v1, 0x0($a3)
/* 1884D8 80259BF8 000312C2 */  srl       $v0, $v1, 11
/* 1884DC 80259BFC 44820000 */  mtc1      $v0, $f0
/* 1884E0 80259C00 00000000 */  nop
/* 1884E4 80259C04 46800021 */  cvt.d.w   $f0, $f0
/* 1884E8 80259C08 46280002 */  mul.d     $f0, $f0, $f8
/* 1884EC 80259C0C 00000000 */  nop
/* 1884F0 80259C10 90E40001 */  lbu       $a0, 0x1($a3)
/* 1884F4 80259C14 24E70002 */  addiu     $a3, $a3, 0x2
/* 1884F8 80259C18 00031182 */  srl       $v0, $v1, 6
/* 1884FC 80259C1C 3042001F */  andi      $v0, $v0, 0x1F
/* 188500 80259C20 00031842 */  srl       $v1, $v1, 1
/* 188504 80259C24 3066001F */  andi      $a2, $v1, 0x1F
/* 188508 80259C28 4620103E */  c.le.d    $f2, $f0
/* 18850C 80259C2C 00000000 */  nop
/* 188510 80259C30 45010005 */  bc1t      .L80259C48
/* 188514 80259C34 30840001 */   andi     $a0, $a0, 0x1
/* 188518 80259C38 4620028D */  trunc.w.d $f10, $f0
/* 18851C 80259C3C 44035000 */  mfc1      $v1, $f10
/* 188520 80259C40 08096718 */  j         .L80259C60
/* 188524 80259C44 304200FF */   andi     $v0, $v0, 0xFF
.L80259C48:
/* 188528 80259C48 46220001 */  sub.d     $f0, $f0, $f2
/* 18852C 80259C4C 4620028D */  trunc.w.d $f10, $f0
/* 188530 80259C50 44035000 */  mfc1      $v1, $f10
/* 188534 80259C54 00000000 */  nop
/* 188538 80259C58 006B1825 */  or        $v1, $v1, $t3
/* 18853C 80259C5C 304200FF */  andi      $v0, $v0, 0xFF
.L80259C60:
/* 188540 80259C60 44820000 */  mtc1      $v0, $f0
/* 188544 80259C64 00000000 */  nop
/* 188548 80259C68 46800021 */  cvt.d.w   $f0, $f0
/* 18854C 80259C6C 46260002 */  mul.d     $f0, $f0, $f6
/* 188550 80259C70 00000000 */  nop
/* 188554 80259C74 4620103E */  c.le.d    $f2, $f0
/* 188558 80259C78 00000000 */  nop
/* 18855C 80259C7C 45030005 */  bc1tl     .L80259C94
/* 188560 80259C80 46220001 */   sub.d    $f0, $f0, $f2
/* 188564 80259C84 4620028D */  trunc.w.d $f10, $f0
/* 188568 80259C88 44055000 */  mfc1      $a1, $f10
/* 18856C 80259C8C 0809672A */  j         .L80259CA8
/* 188570 80259C90 30C200FF */   andi     $v0, $a2, 0xFF
.L80259C94:
/* 188574 80259C94 4620028D */  trunc.w.d $f10, $f0
/* 188578 80259C98 44055000 */  mfc1      $a1, $f10
/* 18857C 80259C9C 00000000 */  nop
/* 188580 80259CA0 00AB2825 */  or        $a1, $a1, $t3
/* 188584 80259CA4 30C200FF */  andi      $v0, $a2, 0xFF
.L80259CA8:
/* 188588 80259CA8 44820000 */  mtc1      $v0, $f0
/* 18858C 80259CAC 00000000 */  nop
/* 188590 80259CB0 46800021 */  cvt.d.w   $f0, $f0
/* 188594 80259CB4 46240002 */  mul.d     $f0, $f0, $f4
/* 188598 80259CB8 00000000 */  nop
/* 18859C 80259CBC 4620103E */  c.le.d    $f2, $f0
/* 1885A0 80259CC0 00000000 */  nop
/* 1885A4 80259CC4 45010005 */  bc1t      .L80259CDC
/* 1885A8 80259CC8 00A0102D */   daddu    $v0, $a1, $zero
/* 1885AC 80259CCC 4620028D */  trunc.w.d $f10, $f0
/* 1885B0 80259CD0 44055000 */  mfc1      $a1, $f10
/* 1885B4 80259CD4 0809673D */  j         .L80259CF4
/* 1885B8 80259CD8 306300FF */   andi     $v1, $v1, 0xFF
.L80259CDC:
/* 1885BC 80259CDC 46220001 */  sub.d     $f0, $f0, $f2
/* 1885C0 80259CE0 4620028D */  trunc.w.d $f10, $f0
/* 1885C4 80259CE4 44055000 */  mfc1      $a1, $f10
/* 1885C8 80259CE8 00000000 */  nop
/* 1885CC 80259CEC 00AB2825 */  or        $a1, $a1, $t3
/* 1885D0 80259CF0 306300FF */  andi      $v1, $v1, 0xFF
.L80259CF4:
/* 1885D4 80259CF4 00031AC0 */  sll       $v1, $v1, 11
/* 1885D8 80259CF8 304200FF */  andi      $v0, $v0, 0xFF
/* 1885DC 80259CFC 00021180 */  sll       $v0, $v0, 6
/* 1885E0 80259D00 00621825 */  or        $v1, $v1, $v0
/* 1885E4 80259D04 30A200FF */  andi      $v0, $a1, 0xFF
/* 1885E8 80259D08 00021040 */  sll       $v0, $v0, 1
/* 1885EC 80259D0C 00621825 */  or        $v1, $v1, $v0
/* 1885F0 80259D10 00831825 */  or        $v1, $a0, $v1
/* 1885F4 80259D14 A5030000 */  sh        $v1, 0x0($t0)
/* 1885F8 80259D18 25290001 */  addiu     $t1, $t1, 0x1
/* 1885FC 80259D1C 29220010 */  slti      $v0, $t1, 0x10
/* 188600 80259D20 1440FFB4 */  bnez      $v0, .L80259BF4
/* 188604 80259D24 25080002 */   addiu    $t0, $t0, 0x2
.L80259D28:
/* 188608 80259D28 820206CD */  lb        $v0, 0x6CD($s0)
/* 18860C 80259D2C 254A0001 */  addiu     $t2, $t2, 0x1
/* 188610 80259D30 0142102A */  slt       $v0, $t2, $v0
/* 188614 80259D34 1440FFA6 */  bnez      $v0, .L80259BD0
/* 188618 80259D38 258C0004 */   addiu    $t4, $t4, 0x4
.L80259D3C:
/* 18861C 80259D3C 820306C2 */  lb        $v1, 0x6C2($s0)
/* 188620 80259D40 28620002 */  slti      $v0, $v1, 0x2
/* 188624 80259D44 1040000D */  beqz      $v0, .L80259D7C
/* 188628 80259D48 00000000 */   nop
/* 18862C 80259D4C 0460000B */  bltz      $v1, .L80259D7C
/* 188630 80259D50 00000000 */   nop
/* 188634 80259D54 16400006 */  bnez      $s2, .L80259D70
/* 188638 80259D58 0220202D */   daddu    $a0, $s1, $zero
/* 18863C 80259D5C 0260282D */  daddu     $a1, $s3, $zero
/* 188640 80259D60 0C096657 */  jal       func_8025995C
/* 188644 80259D64 0280302D */   daddu    $a2, $s4, $zero
/* 188648 80259D68 0809675F */  j         .L80259D7C
/* 18864C 80259D6C 00000000 */   nop
.L80259D70:
/* 188650 80259D70 0260282D */  daddu     $a1, $s3, $zero
/* 188654 80259D74 0C0965B0 */  jal       func_802596C0
/* 188658 80259D78 0280302D */   daddu    $a2, $s4, $zero
.L80259D7C:
/* 18865C 80259D7C 8FBF0024 */  lw        $ra, 0x24($sp)
/* 188660 80259D80 8FB40020 */  lw        $s4, 0x20($sp)
/* 188664 80259D84 8FB3001C */  lw        $s3, 0x1C($sp)
/* 188668 80259D88 8FB20018 */  lw        $s2, 0x18($sp)
/* 18866C 80259D8C 8FB10014 */  lw        $s1, 0x14($sp)
/* 188670 80259D90 8FB00010 */  lw        $s0, 0x10($sp)
/* 188674 80259D94 03E00008 */  jr        $ra
/* 188678 80259D98 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void render_with_sleep_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
    DecorationTable* decorationTable = part->decorationTable;
    s32 i, j;

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

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

                // make colors darker and bluer
                r *= 0.2;
                g *= 0.4;
                b *= 0.7;

                *palOut++ = PACK_PAL_RGBA(r, g, b, a);
            }
        }
    }
    switch (decorationTable->palAnimState) {
        case 0:
        case 1:
            if (isNpcSprite == SPRITE_MODE_PLAYER) {
                func_8025995C(part, yaw, mtx);
            } else {
                func_802596C0(part, yaw, mtx);
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_ambient_load
/* 2F380 80053F80 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 2F384 80053F84 AFB30024 */  sw        $s3, 0x24($sp)
/* 2F388 80053F88 3C13800A */  lui       $s3, %hi(gSoundGlobals)
/* 2F38C 80053F8C 8E73A5C0 */  lw        $s3, %lo(gSoundGlobals)($s3)
/* 2F390 80053F90 AFB5002C */  sw        $s5, 0x2C($sp)
/* 2F394 80053F94 0080A82D */  daddu     $s5, $a0, $zero
/* 2F398 80053F98 AFB20020 */  sw        $s2, 0x20($sp)
/* 2F39C 80053F9C 3C12800A */  lui       $s2, %hi(gAuAmbienceManager)
/* 2F3A0 80053FA0 8E52A628 */  lw        $s2, %lo(gAuAmbienceManager)($s2)
/* 2F3A4 80053FA4 2EA20010 */  sltiu     $v0, $s5, 0x10
/* 2F3A8 80053FA8 AFBF0030 */  sw        $ra, 0x30($sp)
/* 2F3AC 80053FAC AFB40028 */  sw        $s4, 0x28($sp)
/* 2F3B0 80053FB0 AFB1001C */  sw        $s1, 0x1C($sp)
/* 2F3B4 80053FB4 10400022 */  beqz      $v0, .L80054040
/* 2F3B8 80053FB8 AFB00018 */   sw       $s0, 0x18($sp)
/* 2F3BC 80053FBC 8E420044 */  lw        $v0, 0x44($s2)
/* 2F3C0 80053FC0 14400097 */  bnez      $v0, .L80054220
/* 2F3C4 80053FC4 00000000 */   nop
/* 2F3C8 80053FC8 24050040 */  addiu     $a1, $zero, 0x40
/* 2F3CC 80053FCC 3C028008 */  lui       $v0, %hi(D_80078580)
/* 2F3D0 80053FD0 00551021 */  addu      $v0, $v0, $s5
/* 2F3D4 80053FD4 90428580 */  lbu       $v0, %lo(D_80078580)($v0)
/* 2F3D8 80053FD8 8E63003C */  lw        $v1, 0x3C($s3)
/* 2F3DC 80053FDC 00021040 */  sll       $v0, $v0, 1
/* 2F3E0 80053FE0 00431021 */  addu      $v0, $v0, $v1
/* 2F3E4 80053FE4 94440000 */  lhu       $a0, 0x0($v0)
/* 2F3E8 80053FE8 0C01511F */  jal       au_fetch_SBN_file
/* 2F3EC 80053FEC 27A60010 */   addiu    $a2, $sp, 0x10
/* 2F3F0 80053FF0 1440008B */  bnez      $v0, .L80054220
/* 2F3F4 80053FF4 3C0200FF */   lui      $v0, (0xFFFFFF >> 16)
/* 2F3F8 80053FF8 3442FFFF */  ori       $v0, $v0, (0xFFFFFF & 0xFFFF)
/* 2F3FC 80053FFC 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F400 80054000 8FA60014 */  lw        $a2, 0x14($sp)
/* 2F404 80054004 8E650064 */  lw        $a1, 0x64($s3)
/* 2F408 80054008 0C015380 */  jal       au_read_rom
/* 2F40C 8005400C 00C23024 */   and      $a2, $a2, $v0
/* 2F410 80054010 24030001 */  addiu     $v1, $zero, 0x1
/* 2F414 80054014 8E620064 */  lw        $v0, 0x64($s3)
/* 2F418 80054018 26440004 */  addiu     $a0, $s2, 0x4
/* 2F41C 8005401C AE420010 */  sw        $v0, 0x10($s2)
.L80054020:
/* 2F420 80054020 AC800010 */  sw        $zero, 0x10($a0)
/* 2F424 80054024 24630001 */  addiu     $v1, $v1, 0x1
/* 2F428 80054028 2C620004 */  sltiu     $v0, $v1, 0x4
/* 2F42C 8005402C 1440FFFC */  bnez      $v0, .L80054020
/* 2F430 80054030 24840004 */   addiu    $a0, $a0, 0x4
/* 2F434 80054034 24020001 */  addiu     $v0, $zero, 0x1
/* 2F438 80054038 08015088 */  j         .L80054220
/* 2F43C 8005403C A2420020 */   sb       $v0, 0x20($s2)
.L80054040:
/* 2F440 80054040 24020010 */  addiu     $v0, $zero, 0x10
/* 2F444 80054044 16A20076 */  bne       $s5, $v0, .L80054220
/* 2F448 80054048 00000000 */   nop
/* 2F44C 8005404C 8E420044 */  lw        $v0, 0x44($s2)
/* 2F450 80054050 14400073 */  bnez      $v0, .L80054220
/* 2F454 80054054 00000000 */   nop
/* 2F458 80054058 8E420228 */  lw        $v0, 0x228($s2)
/* 2F45C 8005405C 14400070 */  bnez      $v0, .L80054220
/* 2F460 80054060 00000000 */   nop
/* 2F464 80054064 8E42040C */  lw        $v0, 0x40C($s2)
/* 2F468 80054068 1440006D */  bnez      $v0, .L80054220
/* 2F46C 8005406C 0000182D */   daddu    $v1, $zero, $zero
/* 2F470 80054070 A2400020 */  sb        $zero, 0x20($s2)
/* 2F474 80054074 0240202D */  daddu     $a0, $s2, $zero
.L80054078:
/* 2F478 80054078 AC800010 */  sw        $zero, 0x10($a0)
/* 2F47C 8005407C 24630001 */  addiu     $v1, $v1, 0x1
/* 2F480 80054080 2C620004 */  sltiu     $v0, $v1, 0x4
/* 2F484 80054084 1440FFFC */  bnez      $v0, .L80054078
/* 2F488 80054088 24840004 */   addiu    $a0, $a0, 0x4
/* 2F48C 8005408C 8E700068 */  lw        $s0, 0x68($s3)
/* 2F490 80054090 24050040 */  addiu     $a1, $zero, 0x40
/* 2F494 80054094 3C148008 */  lui       $s4, %hi(D_80078580)
/* 2F498 80054098 26948580 */  addiu     $s4, $s4, %lo(D_80078580)
/* 2F49C 8005409C 3C028008 */  lui       $v0, %hi(D_80078580)
/* 2F4A0 800540A0 00551021 */  addu      $v0, $v0, $s5
/* 2F4A4 800540A4 90428580 */  lbu       $v0, %lo(D_80078580)($v0)
/* 2F4A8 800540A8 8E63003C */  lw        $v1, 0x3C($s3)
/* 2F4AC 800540AC 00021040 */  sll       $v0, $v0, 1
/* 2F4B0 800540B0 00431021 */  addu      $v0, $v0, $v1
/* 2F4B4 800540B4 94440000 */  lhu       $a0, 0x0($v0)
/* 2F4B8 800540B8 0C01511F */  jal       au_fetch_SBN_file
/* 2F4BC 800540BC 27A60010 */   addiu    $a2, $sp, 0x10
/* 2F4C0 800540C0 14400057 */  bnez      $v0, .L80054220
/* 2F4C4 800540C4 3C1100FF */   lui      $s1, (0xFFFFFF >> 16)
/* 2F4C8 800540C8 3631FFFF */  ori       $s1, $s1, (0xFFFFFF & 0xFFFF)
/* 2F4CC 800540CC 0200282D */  daddu     $a1, $s0, $zero
/* 2F4D0 800540D0 8FA60014 */  lw        $a2, 0x14($sp)
/* 2F4D4 800540D4 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F4D8 800540D8 0C015380 */  jal       au_read_rom
/* 2F4DC 800540DC 00D13024 */   and      $a2, $a2, $s1
/* 2F4E0 800540E0 24050040 */  addiu     $a1, $zero, 0x40
/* 2F4E4 800540E4 27A60010 */  addiu     $a2, $sp, 0x10
/* 2F4E8 800540E8 02B41021 */  addu      $v0, $s5, $s4
/* 2F4EC 800540EC AE500010 */  sw        $s0, 0x10($s2)
/* 2F4F0 800540F0 90430001 */  lbu       $v1, 0x1($v0)
/* 2F4F4 800540F4 8E62003C */  lw        $v0, 0x3C($s3)
/* 2F4F8 800540F8 00031840 */  sll       $v1, $v1, 1
/* 2F4FC 800540FC 00621821 */  addu      $v1, $v1, $v0
/* 2F500 80054100 8FA20014 */  lw        $v0, 0x14($sp)
/* 2F504 80054104 94640000 */  lhu       $a0, 0x0($v1)
/* 2F508 80054108 00451021 */  addu      $v0, $v0, $a1
/* 2F50C 8005410C 00511024 */  and       $v0, $v0, $s1
/* 2F510 80054110 0C01511F */  jal       au_fetch_SBN_file
/* 2F514 80054114 02028021 */   addu     $s0, $s0, $v0
/* 2F518 80054118 14400041 */  bnez      $v0, .L80054220
/* 2F51C 8005411C 00000000 */   nop
/* 2F520 80054120 0200282D */  daddu     $a1, $s0, $zero
/* 2F524 80054124 8FA60014 */  lw        $a2, 0x14($sp)
/* 2F528 80054128 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F52C 8005412C 0C015380 */  jal       au_read_rom
/* 2F530 80054130 00D13024 */   and      $a2, $a2, $s1
/* 2F534 80054134 24050040 */  addiu     $a1, $zero, 0x40
/* 2F538 80054138 27A60010 */  addiu     $a2, $sp, 0x10
/* 2F53C 8005413C 02B41021 */  addu      $v0, $s5, $s4
/* 2F540 80054140 AE500014 */  sw        $s0, 0x14($s2)
/* 2F544 80054144 90430002 */  lbu       $v1, 0x2($v0)
/* 2F548 80054148 8E62003C */  lw        $v0, 0x3C($s3)
/* 2F54C 8005414C 00031840 */  sll       $v1, $v1, 1
/* 2F550 80054150 00621821 */  addu      $v1, $v1, $v0
/* 2F554 80054154 8FA20014 */  lw        $v0, 0x14($sp)
/* 2F558 80054158 94640000 */  lhu       $a0, 0x0($v1)
/* 2F55C 8005415C 00451021 */  addu      $v0, $v0, $a1
/* 2F560 80054160 00511024 */  and       $v0, $v0, $s1
/* 2F564 80054164 0C01511F */  jal       au_fetch_SBN_file
/* 2F568 80054168 02028021 */   addu     $s0, $s0, $v0
/* 2F56C 8005416C 1440002C */  bnez      $v0, .L80054220
/* 2F570 80054170 00000000 */   nop
/* 2F574 80054174 0200282D */  daddu     $a1, $s0, $zero
/* 2F578 80054178 8FA60014 */  lw        $a2, 0x14($sp)
/* 2F57C 8005417C 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F580 80054180 0C015380 */  jal       au_read_rom
/* 2F584 80054184 00D13024 */   and      $a2, $a2, $s1
/* 2F588 80054188 24050040 */  addiu     $a1, $zero, 0x40
/* 2F58C 8005418C 27A60010 */  addiu     $a2, $sp, 0x10
/* 2F590 80054190 02B41021 */  addu      $v0, $s5, $s4
/* 2F594 80054194 AE500018 */  sw        $s0, 0x18($s2)
/* 2F598 80054198 90430003 */  lbu       $v1, 0x3($v0)
/* 2F59C 8005419C 8E62003C */  lw        $v0, 0x3C($s3)
/* 2F5A0 800541A0 00031840 */  sll       $v1, $v1, 1
/* 2F5A4 800541A4 00621821 */  addu      $v1, $v1, $v0
/* 2F5A8 800541A8 8FA20014 */  lw        $v0, 0x14($sp)
/* 2F5AC 800541AC 94640000 */  lhu       $a0, 0x0($v1)
/* 2F5B0 800541B0 00451021 */  addu      $v0, $v0, $a1
/* 2F5B4 800541B4 00511024 */  and       $v0, $v0, $s1
/* 2F5B8 800541B8 0C01511F */  jal       au_fetch_SBN_file
/* 2F5BC 800541BC 02028021 */   addu     $s0, $s0, $v0
/* 2F5C0 800541C0 14400017 */  bnez      $v0, .L80054220
/* 2F5C4 800541C4 00000000 */   nop
/* 2F5C8 800541C8 0200282D */  daddu     $a1, $s0, $zero
/* 2F5CC 800541CC 8FA60014 */  lw        $a2, 0x14($sp)
/* 2F5D0 800541D0 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F5D4 800541D4 0C015380 */  jal       au_read_rom
/* 2F5D8 800541D8 00D13024 */   and      $a2, $a2, $s1
/* 2F5DC 800541DC 24050030 */  addiu     $a1, $zero, 0x30
/* 2F5E0 800541E0 24020004 */  addiu     $v0, $zero, 0x4
/* 2F5E4 800541E4 A2420020 */  sb        $v0, 0x20($s2)
/* 2F5E8 800541E8 02B41021 */  addu      $v0, $s5, $s4
/* 2F5EC 800541EC AE50001C */  sw        $s0, 0x1C($s2)
/* 2F5F0 800541F0 90420004 */  lbu       $v0, 0x4($v0)
/* 2F5F4 800541F4 8E63003C */  lw        $v1, 0x3C($s3)
/* 2F5F8 800541F8 00021040 */  sll       $v0, $v0, 1
/* 2F5FC 800541FC 00431021 */  addu      $v0, $v0, $v1
/* 2F600 80054200 94440000 */  lhu       $a0, 0x0($v0)
/* 2F604 80054204 0C01511F */  jal       au_fetch_SBN_file
/* 2F608 80054208 27A60010 */   addiu    $a2, $sp, 0x10
/* 2F60C 8005420C 14400004 */  bnez      $v0, .L80054220
/* 2F610 80054210 00000000 */   nop
/* 2F614 80054214 8FA40010 */  lw        $a0, 0x10($sp)
/* 2F618 80054218 0C015313 */  jal       snd_load_BK
/* 2F61C 8005421C 24050002 */   addiu    $a1, $zero, 0x2
.L80054220:
/* 2F620 80054220 8FBF0030 */  lw        $ra, 0x30($sp)
/* 2F624 80054224 8FB5002C */  lw        $s5, 0x2C($sp)
/* 2F628 80054228 8FB40028 */  lw        $s4, 0x28($sp)
/* 2F62C 8005422C 8FB30024 */  lw        $s3, 0x24($sp)
/* 2F630 80054230 8FB20020 */  lw        $s2, 0x20($sp)
/* 2F634 80054234 8FB1001C */  lw        $s1, 0x1C($sp)
/* 2F638 80054238 8FB00018 */  lw        $s0, 0x18($sp)
/* 2F63C 8005423C 0000102D */  daddu     $v0, $zero, $zero
/* 2F640 80054240 03E00008 */  jr        $ra
/* 2F644 80054244 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

AuResult au_ambient_load(u32 ambSoundID) {
    AmbienceManager* manager;
    SBNFileEntry fileEntry;
    AuGlobals* globals;
    MSEQHeader* mseqFile;
    u32 i;

    globals = gSoundGlobals;
    manager = gAuAmbienceManager;
    if (ambSoundID < AMBIENT_RADIO) {
        if (manager->players[0].mseqName == 0 && SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
            au_read_rom(fileEntry.offset, globals->dataMSEQ[0], fileEntry.data & 0xFFFFFF);
            manager->mseqFiles[0] = globals->dataMSEQ[0];
            for (i = 1; i < ARRAY_COUNT(manager->mseqFiles); i++) {
                manager->mseqFiles[i] = NULL;
            }
            manager->numActivePlayers = 1;
        }
    } else if (ambSoundID == AMBIENT_RADIO
            && manager->players[0].mseqName == 0
            && manager->players[1].mseqName == 0
            && manager->players[2].mseqName == 0) {
        manager->numActivePlayers = 0;
        for (i = 0; i < ARRAY_COUNT(manager->mseqFiles); i++) {
            manager->mseqFiles[i] = NULL;
        }

        mseqFile = globals->dataMSEQ[1];
        if (SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
            au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
            manager->mseqFiles[0] = mseqFile;

            mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
            if (SBN_LOOKUP(ambSoundID + 1, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
                au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
                manager->mseqFiles[1] = mseqFile;

                mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
                if (SBN_LOOKUP(ambSoundID + 2, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
                    au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
                    manager->mseqFiles[2] = mseqFile;

                    mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
                    if (SBN_LOOKUP(ambSoundID + 3, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
                        au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
                        manager->mseqFiles[3] = mseqFile;

                        manager->numActivePlayers = 4;
                        if (SBN_LOOKUP(ambSoundID + 4, AU_FMT_BK, fileEntry) == AU_RESULT_OK) {
                            snd_load_BK(fileEntry.offset, 2);
                        }
                    }
                }
            }
        }
    }

    return AU_RESULT_OK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel test_ray_triangle_down
/* 3789C 8005C49C C4800030 */  lwc1      $f0, 0x30($a0)
/* 378A0 8005C4A0 44801000 */  mtc1      $zero, $f2
/* 378A4 8005C4A4 00000000 */  nop
/* 378A8 8005C4A8 46020032 */  c.eq.s    $f0, $f2
/* 378AC 8005C4AC 00000000 */  nop
/* 378B0 8005C4B0 4500000B */  bc1f      .L8005C4E0
/* 378B4 8005C4B4 00000000 */   nop
/* 378B8 8005C4B8 C4800034 */  lwc1      $f0, 0x34($a0)
/* 378BC 8005C4BC 46020032 */  c.eq.s    $f0, $f2
/* 378C0 8005C4C0 00000000 */  nop
/* 378C4 8005C4C4 45000006 */  bc1f      .L8005C4E0
/* 378C8 8005C4C8 00000000 */   nop
/* 378CC 8005C4CC C4800038 */  lwc1      $f0, 0x38($a0)
/* 378D0 8005C4D0 46020032 */  c.eq.s    $f0, $f2
/* 378D4 8005C4D4 00000000 */  nop
/* 378D8 8005C4D8 45010050 */  bc1t      .L8005C61C
/* 378DC 8005C4DC 00000000 */   nop
.L8005C4E0:
/* 378E0 8005C4E0 8C820000 */  lw        $v0, 0x0($a0)
/* 378E4 8005C4E4 3C01800A */  lui       $at, %hi(gCollisionRayStartX)
/* 378E8 8005C4E8 C4324230 */  lwc1      $f18, %lo(gCollisionRayStartX)($at)
/* 378EC 8005C4EC C4400000 */  lwc1      $f0, 0x0($v0)
/* 378F0 8005C4F0 46009301 */  sub.s     $f12, $f18, $f0
/* 378F4 8005C4F4 C4840030 */  lwc1      $f4, 0x30($a0)
/* 378F8 8005C4F8 460C2102 */  mul.s     $f4, $f4, $f12
/* 378FC 8005C4FC 00000000 */  nop
/* 37900 8005C500 3C01800A */  lui       $at, %hi(gCollisionRayStartY)
/* 37904 8005C504 C4224234 */  lwc1      $f2, %lo(gCollisionRayStartY)($at)
/* 37908 8005C508 C4400004 */  lwc1      $f0, 0x4($v0)
/* 3790C 8005C50C 46001081 */  sub.s     $f2, $f2, $f0
/* 37910 8005C510 C4860034 */  lwc1      $f6, 0x34($a0)
/* 37914 8005C514 46023082 */  mul.s     $f2, $f6, $f2
/* 37918 8005C518 00000000 */  nop
/* 3791C 8005C51C 3C01800A */  lui       $at, %hi(gCollisionRayStartZ)
/* 37920 8005C520 C42E4238 */  lwc1      $f14, %lo(gCollisionRayStartZ)($at)
/* 37924 8005C524 C4400008 */  lwc1      $f0, 0x8($v0)
/* 37928 8005C528 46007201 */  sub.s     $f8, $f14, $f0
/* 3792C 8005C52C C4800038 */  lwc1      $f0, 0x38($a0)
/* 37930 8005C530 46080002 */  mul.s     $f0, $f0, $f8
/* 37934 8005C534 00000000 */  nop
/* 37938 8005C538 8C830004 */  lw        $v1, 0x4($a0)
/* 3793C 8005C53C 46022100 */  add.s     $f4, $f4, $f2
/* 37940 8005C540 8C850008 */  lw        $a1, 0x8($a0)
/* 37944 8005C544 8482003C */  lh        $v0, 0x3C($a0)
/* 37948 8005C548 10400036 */  beqz      $v0, .L8005C624
/* 3794C 8005C54C 46002280 */   add.s    $f10, $f4, $f0
/* 37950 8005C550 44808000 */  mtc1      $zero, $f16
/* 37954 8005C554 00000000 */  nop
/* 37958 8005C558 4610503C */  c.lt.s    $f10, $f16
/* 3795C 8005C55C 00000000 */  nop
/* 37960 8005C560 4501002E */  bc1t      .L8005C61C
/* 37964 8005C564 00000000 */   nop
/* 37968 8005C568 4610303E */  c.le.s    $f6, $f16
/* 3796C 8005C56C 00000000 */  nop
/* 37970 8005C570 4501002A */  bc1t      .L8005C61C
/* 37974 8005C574 00000000 */   nop
/* 37978 8005C578 C482000C */  lwc1      $f2, 0xC($a0)
/* 3797C 8005C57C 46024082 */  mul.s     $f2, $f8, $f2
/* 37980 8005C580 00000000 */  nop
/* 37984 8005C584 C4800014 */  lwc1      $f0, 0x14($a0)
/* 37988 8005C588 46006002 */  mul.s     $f0, $f12, $f0
/* 3798C 8005C58C 00000000 */  nop
/* 37990 8005C590 46001081 */  sub.s     $f2, $f2, $f0
/* 37994 8005C594 4610103C */  c.lt.s    $f2, $f16
/* 37998 8005C598 00000000 */  nop
/* 3799C 8005C59C 4501001F */  bc1t      .L8005C61C
/* 379A0 8005C5A0 00000000 */   nop
/* 379A4 8005C5A4 C4620008 */  lwc1      $f2, 0x8($v1)
/* 379A8 8005C5A8 46027081 */  sub.s     $f2, $f14, $f2
/* 379AC 8005C5AC C4800018 */  lwc1      $f0, 0x18($a0)
/* 379B0 8005C5B0 46001082 */  mul.s     $f2, $f2, $f0
/* 379B4 8005C5B4 00000000 */  nop
/* 379B8 8005C5B8 C4600000 */  lwc1      $f0, 0x0($v1)
/* 379BC 8005C5BC 46009001 */  sub.s     $f0, $f18, $f0
/* 379C0 8005C5C0 C4840020 */  lwc1      $f4, 0x20($a0)
/* 379C4 8005C5C4 46040002 */  mul.s     $f0, $f0, $f4
/* 379C8 8005C5C8 00000000 */  nop
/* 379CC 8005C5CC 46001081 */  sub.s     $f2, $f2, $f0
/* 379D0 8005C5D0 4610103C */  c.lt.s    $f2, $f16
/* 379D4 8005C5D4 00000000 */  nop
/* 379D8 8005C5D8 45010010 */  bc1t      .L8005C61C
/* 379DC 8005C5DC 00000000 */   nop
/* 379E0 8005C5E0 C4A20008 */  lwc1      $f2, 0x8($a1)
/* 379E4 8005C5E4 46027081 */  sub.s     $f2, $f14, $f2
/* 379E8 8005C5E8 C4800024 */  lwc1      $f0, 0x24($a0)
/* 379EC 8005C5EC 46001082 */  mul.s     $f2, $f2, $f0
/* 379F0 8005C5F0 00000000 */  nop
/* 379F4 8005C5F4 C4A00000 */  lwc1      $f0, 0x0($a1)
/* 379F8 8005C5F8 46009001 */  sub.s     $f0, $f18, $f0
/* 379FC 8005C5FC C484002C */  lwc1      $f4, 0x2C($a0)
/* 37A00 8005C600 46040002 */  mul.s     $f0, $f0, $f4
/* 37A04 8005C604 00000000 */  nop
/* 37A08 8005C608 46001081 */  sub.s     $f2, $f2, $f0
/* 37A0C 8005C60C 4610103C */  c.lt.s    $f2, $f16
/* 37A10 8005C610 00000000 */  nop
.L8005C614:
/* 37A14 8005C614 45000039 */  bc1f      .L8005C6FC
/* 37A18 8005C618 00000000 */   nop
.L8005C61C:
/* 37A1C 8005C61C 03E00008 */  jr        $ra
/* 37A20 8005C620 0000102D */   daddu    $v0, $zero, $zero
.L8005C624:
/* 37A24 8005C624 460A3002 */  mul.s     $f0, $f6, $f10
/* 37A28 8005C628 00000000 */  nop
/* 37A2C 8005C62C 44803000 */  mtc1      $zero, $f6
/* 37A30 8005C630 00000000 */  nop
/* 37A34 8005C634 4606003E */  c.le.s    $f0, $f6
/* 37A38 8005C638 00000000 */  nop
/* 37A3C 8005C63C 4501FFF7 */  bc1t      .L8005C61C
/* 37A40 8005C640 00000000 */   nop
/* 37A44 8005C644 C480000C */  lwc1      $f0, 0xC($a0)
/* 37A48 8005C648 46004002 */  mul.s     $f0, $f8, $f0
/* 37A4C 8005C64C 00000000 */  nop
/* 37A50 8005C650 C4820014 */  lwc1      $f2, 0x14($a0)
/* 37A54 8005C654 46026082 */  mul.s     $f2, $f12, $f2
/* 37A58 8005C658 00000000 */  nop
/* 37A5C 8005C65C 46020001 */  sub.s     $f0, $f0, $f2
/* 37A60 8005C660 460A0002 */  mul.s     $f0, $f0, $f10
/* 37A64 8005C664 00000000 */  nop
/* 37A68 8005C668 4606003C */  c.lt.s    $f0, $f6
/* 37A6C 8005C66C 00000000 */  nop
/* 37A70 8005C670 4501FFEA */  bc1t      .L8005C61C
/* 37A74 8005C674 00000000 */   nop
/* 37A78 8005C678 C4600008 */  lwc1      $f0, 0x8($v1)
/* 37A7C 8005C67C 46007001 */  sub.s     $f0, $f14, $f0
/* 37A80 8005C680 C4820018 */  lwc1      $f2, 0x18($a0)
/* 37A84 8005C684 46020002 */  mul.s     $f0, $f0, $f2
/* 37A88 8005C688 00000000 */  nop
/* 37A8C 8005C68C C4620000 */  lwc1      $f2, 0x0($v1)
/* 37A90 8005C690 46029081 */  sub.s     $f2, $f18, $f2
/* 37A94 8005C694 C4840020 */  lwc1      $f4, 0x20($a0)
/* 37A98 8005C698 46041082 */  mul.s     $f2, $f2, $f4
/* 37A9C 8005C69C 00000000 */  nop
/* 37AA0 8005C6A0 46020001 */  sub.s     $f0, $f0, $f2
/* 37AA4 8005C6A4 460A0002 */  mul.s     $f0, $f0, $f10
/* 37AA8 8005C6A8 00000000 */  nop
/* 37AAC 8005C6AC 4606003C */  c.lt.s    $f0, $f6
/* 37AB0 8005C6B0 00000000 */  nop
/* 37AB4 8005C6B4 4501FFD9 */  bc1t      .L8005C61C
/* 37AB8 8005C6B8 00000000 */   nop
/* 37ABC 8005C6BC C4A00008 */  lwc1      $f0, 0x8($a1)
/* 37AC0 8005C6C0 46007001 */  sub.s     $f0, $f14, $f0
/* 37AC4 8005C6C4 C4820024 */  lwc1      $f2, 0x24($a0)
/* 37AC8 8005C6C8 46020002 */  mul.s     $f0, $f0, $f2
/* 37ACC 8005C6CC 00000000 */  nop
/* 37AD0 8005C6D0 C4A20000 */  lwc1      $f2, 0x0($a1)
/* 37AD4 8005C6D4 46029081 */  sub.s     $f2, $f18, $f2
/* 37AD8 8005C6D8 C484002C */  lwc1      $f4, 0x2C($a0)
/* 37ADC 8005C6DC 46041082 */  mul.s     $f2, $f2, $f4
/* 37AE0 8005C6E0 00000000 */  nop
/* 37AE4 8005C6E4 46020001 */  sub.s     $f0, $f0, $f2
/* 37AE8 8005C6E8 460A0002 */  mul.s     $f0, $f0, $f10
/* 37AEC 8005C6EC 00000000 */  nop
/* 37AF0 8005C6F0 4606003C */  c.lt.s    $f0, $f6
/* 37AF4 8005C6F4 08017185 */  j         .L8005C614
/* 37AF8 8005C6F8 00000000 */   nop
.L8005C6FC:
/* 37AFC 8005C6FC 3C01800A */  lui       $at, %hi(gCollisionRayLength)
/* 37B00 8005C700 C4244254 */  lwc1      $f4, %lo(gCollisionRayLength)($at)
/* 37B04 8005C704 44800000 */  mtc1      $zero, $f0
/* 37B08 8005C708 C4820034 */  lwc1      $f2, 0x34($a0)
/* 37B0C 8005C70C 4604003E */  c.le.s    $f0, $f4
/* 37B10 8005C710 00000000 */  nop
/* 37B14 8005C714 45000007 */  bc1f      .L8005C734
/* 37B18 8005C718 46001207 */   neg.s    $f8, $f2
/* 37B1C 8005C71C 46005007 */  neg.s     $f0, $f10
/* 37B20 8005C720 46080003 */  div.s     $f0, $f0, $f8
/* 37B24 8005C724 4600203E */  c.le.s    $f4, $f0
/* 37B28 8005C728 00000000 */  nop
/* 37B2C 8005C72C 4501FFBB */  bc1t      .L8005C61C
/* 37B30 8005C730 00000000 */   nop
.L8005C734:
/* 37B34 8005C734 3C01800A */  lui       $at, %hi(gCollisionRayStartX)
/* 37B38 8005C738 C4204230 */  lwc1      $f0, %lo(gCollisionRayStartX)($at)
/* 37B3C 8005C73C 3C01800A */  lui       $at, %hi(gCollisionRayStartZ)
/* 37B40 8005C740 C4244238 */  lwc1      $f4, %lo(gCollisionRayStartZ)($at)
/* 37B44 8005C744 C4860030 */  lwc1      $f6, 0x30($a0)
/* 37B48 8005C748 3C01800A */  lui       $at, %hi(gCollisionPointX)
/* 37B4C 8005C74C E4204248 */  swc1      $f0, %lo(gCollisionPointX)($at)
/* 37B50 8005C750 3C01800A */  lui       $at, %hi(gCollisionRayStartY)
/* 37B54 8005C754 C4204234 */  lwc1      $f0, %lo(gCollisionRayStartY)($at)
/* 37B58 8005C758 46005087 */  neg.s     $f2, $f10
/* 37B5C 8005C75C 3C01800A */  lui       $at, %hi(gCollisionPointZ)
/* 37B60 8005C760 E4244250 */  swc1      $f4, %lo(gCollisionPointZ)($at)
/* 37B64 8005C764 C4840034 */  lwc1      $f4, 0x34($a0)
/* 37B68 8005C768 46081083 */  div.s     $f2, $f2, $f8
/* 37B6C 8005C76C 3C01800A */  lui       $at, %hi(gCollisionRayLength)
/* 37B70 8005C770 E4224254 */  swc1      $f2, %lo(gCollisionRayLength)($at)
/* 37B74 8005C774 3C01800A */  lui       $at, %hi(gCollisionNormalX)
/* 37B78 8005C778 E4264258 */  swc1      $f6, %lo(gCollisionNormalX)($at)
/* 37B7C 8005C77C C4860038 */  lwc1      $f6, 0x38($a0)
/* 37B80 8005C780 46020001 */  sub.s     $f0, $f0, $f2
/* 37B84 8005C784 3C01800A */  lui       $at, %hi(gCollisionNormalY)
/* 37B88 8005C788 E424425C */  swc1      $f4, %lo(gCollisionNormalY)($at)
/* 37B8C 8005C78C 3C01800A */  lui       $at, %hi(gCollisionNormalZ)
/* 37B90 8005C790 E4264260 */  swc1      $f6, %lo(gCollisionNormalZ)($at)
/* 37B94 8005C794 3C01800A */  lui       $at, %hi(gCollisionPointY)
/* 37B98 8005C798 E420424C */  swc1      $f0, %lo(gCollisionPointY)($at)
/* 37B9C 8005C79C 03E00008 */  jr        $ra
/* 37BA0 8005C7A0 24020001 */   addiu    $v0, $zero, 0x1

### DECOMPILED C INSTRUCTIONS:

s32 test_ray_triangle_down(ColliderTriangle* triangle, Vec3f* vertices) {
    f32 distToTrianglePlane, cosAngle;
    Vec3f* v1;
    Vec3f* v2;
    Vec3f* v3;

    if (triangle->normal.x == 0 && triangle->normal.y == 0 && triangle->normal.z == 0) {
        return FALSE;
    }

    v1 = triangle->v1;
    v2 = triangle->v2;
    v3 = triangle->v3;

    distToTrianglePlane = triangle->normal.x * (gCollisionRayStartX - v1->x) +
                          triangle->normal.y * (gCollisionRayStartY - v1->y) +
                          triangle->normal.z * (gCollisionRayStartZ - v1->z);

    if (triangle->oneSided) {
        if (distToTrianglePlane < 0) {
            return FALSE;
        }

        if (triangle->normal.y <= 0)
            return FALSE;

        if ((gCollisionRayStartZ - v1->z) * triangle->e13.x - (gCollisionRayStartX - v1->x) * triangle->e13.z < 0) {
            return FALSE;
        }

        if ((gCollisionRayStartZ - v2->z) * triangle->e21.x - (gCollisionRayStartX - v2->x) * triangle->e21.z < 0) {
            return FALSE;
        }

        if ((gCollisionRayStartZ - v3->z) * triangle->e32.x - (gCollisionRayStartX - v3->x) * triangle->e32.z < 0) {
            return FALSE;
        }
    } else {
        if (triangle->normal.y * distToTrianglePlane <= 0) {
            return FALSE;
        }

        if (((gCollisionRayStartZ - v1->z) * triangle->e13.x - (gCollisionRayStartX - v1->x) * triangle->e13.z) * distToTrianglePlane < 0) {
            return FALSE;
        }

        if (((gCollisionRayStartZ - v2->z) * triangle->e21.x - (gCollisionRayStartX - v2->x) * triangle->e21.z) * distToTrianglePlane < 0) {
            return FALSE;
        }

        if (((gCollisionRayStartZ - v3->z) * triangle->e32.x - (gCollisionRayStartX - v3->x) * triangle->e32.z) * distToTrianglePlane < 0) {
            return FALSE;
        }
    }

    cosAngle = -triangle->normal.y;
    if (gCollisionRayLength >= 0 && gCollisionRayLength <= -distToTrianglePlane / cosAngle) {
        return FALSE;
    }

    gCollisionRayLength = -distToTrianglePlane  / cosAngle;

    gCollisionPointX = gCollisionRayStartX;
    gCollisionPointY = gCollisionRayStartY - gCollisionRayLength;
    gCollisionPointZ = gCollisionRayStartZ;

    gCollisionNormalX = triangle->normal.x;
    gCollisionNormalY = triangle->normal.y;
    gCollisionNormalZ = triangle->normal.z;

    return TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_player
/* 78BF0 800DF740 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 78BF4 800DF744 AFBF0018 */  sw        $ra, 0x18($sp)
/* 78BF8 800DF748 AFB10014 */  sw        $s1, 0x14($sp)
/* 78BFC 800DF74C 0C0382CE */  jal       update_partner_timers
/* 78C00 800DF750 AFB00010 */   sw       $s0, 0x10($sp)
/* 78C04 800DF754 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* 78C08 800DF758 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* 78C0C 800DF75C 860200C0 */  lh        $v0, 0xC0($s0)
/* 78C10 800DF760 3C118016 */  lui       $s1, %hi(gCollisionStatus)
/* 78C14 800DF764 2631A550 */  addiu     $s1, $s1, %lo(gCollisionStatus)
/* 78C18 800DF768 28420065 */  slti      $v0, $v0, 0x65
/* 78C1C 800DF76C 10400009 */  beqz      $v0, .L800DF794
/* 78C20 800DF770 00000000 */   nop
/* 78C24 800DF774 C602002C */  lwc1      $f2, 0x2C($s0)
/* 78C28 800DF778 3C01C4FA */  lui       $at, (0xC4FA0000 >> 16)
/* 78C2C 800DF77C 44810000 */  mtc1      $at, $f0
/* 78C30 800DF780 00000000 */  nop
/* 78C34 800DF784 4600103C */  c.lt.s    $f2, $f0
/* 78C38 800DF788 00000000 */  nop
/* 78C3C 800DF78C 45000039 */  bc1f      .L800DF874
/* 78C40 800DF790 2402FFFF */   addiu    $v0, $zero, -0x1
.L800DF794:
/* 78C44 800DF794 8E040004 */  lw        $a0, 0x4($s0)
/* 78C48 800DF798 3C021000 */  lui       $v0, (0x10000000 >> 16)
/* 78C4C 800DF79C 00821024 */  and       $v0, $a0, $v0
/* 78C50 800DF7A0 14400034 */  bnez      $v0, .L800DF874
/* 78C54 800DF7A4 2402FFFF */   addiu    $v0, $zero, -0x1
/* 78C58 800DF7A8 86020016 */  lh        $v0, 0x16($s0)
/* 78C5C 800DF7AC 8603001A */  lh        $v1, 0x1A($s0)
/* 78C60 800DF7B0 44820000 */  mtc1      $v0, $f0
/* 78C64 800DF7B4 00000000 */  nop
/* 78C68 800DF7B8 46800020 */  cvt.s.w   $f0, $f0
/* 78C6C 800DF7BC 86020018 */  lh        $v0, 0x18($s0)
/* 78C70 800DF7C0 A60000C0 */  sh        $zero, 0xC0($s0)
/* 78C74 800DF7C4 E6000028 */  swc1      $f0, 0x28($s0)
/* 78C78 800DF7C8 44820000 */  mtc1      $v0, $f0
/* 78C7C 800DF7CC 00000000 */  nop
/* 78C80 800DF7D0 46800020 */  cvt.s.w   $f0, $f0
/* 78C84 800DF7D4 E600002C */  swc1      $f0, 0x2C($s0)
/* 78C88 800DF7D8 44830000 */  mtc1      $v1, $f0
/* 78C8C 800DF7DC 00000000 */  nop
/* 78C90 800DF7E0 46800020 */  cvt.s.w   $f0, $f0
/* 78C94 800DF7E4 3C020040 */  lui       $v0, (0x400000 >> 16)
/* 78C98 800DF7E8 00821024 */  and       $v0, $a0, $v0
/* 78C9C 800DF7EC 1040001E */  beqz      $v0, .L800DF868
/* 78CA0 800DF7F0 E6000030 */   swc1     $f0, 0x30($s0)
/* 78CA4 800DF7F4 3C022000 */  lui       $v0, (0x20000004 >> 16)
/* 78CA8 800DF7F8 34420004 */  ori       $v0, $v0, (0x20000004 & 0xFFFF)
/* 78CAC 800DF7FC 00821025 */  or        $v0, $a0, $v0
/* 78CB0 800DF800 2404FFFC */  addiu     $a0, $zero, -0x4
/* 78CB4 800DF804 0C00EABB */  jal       get_npc_unsafe
/* 78CB8 800DF808 AE020004 */   sw       $v0, 0x4($s0)
/* 78CBC 800DF80C 86030016 */  lh        $v1, 0x16($s0)
/* 78CC0 800DF810 44830000 */  mtc1      $v1, $f0
/* 78CC4 800DF814 00000000 */  nop
/* 78CC8 800DF818 46800020 */  cvt.s.w   $f0, $f0
/* 78CCC 800DF81C E4400038 */  swc1      $f0, 0x38($v0)
/* 78CD0 800DF820 86030018 */  lh        $v1, 0x18($s0)
/* 78CD4 800DF824 860400B0 */  lh        $a0, 0xB0($s0)
/* 78CD8 800DF828 00641821 */  addu      $v1, $v1, $a0
/* 78CDC 800DF82C 44830000 */  mtc1      $v1, $f0
/* 78CE0 800DF830 00000000 */  nop
/* 78CE4 800DF834 46800020 */  cvt.s.w   $f0, $f0
/* 78CE8 800DF838 E440003C */  swc1      $f0, 0x3C($v0)
/* 78CEC 800DF83C 8603001A */  lh        $v1, 0x1A($s0)
/* 78CF0 800DF840 44830000 */  mtc1      $v1, $f0
/* 78CF4 800DF844 00000000 */  nop
/* 78CF8 800DF848 46800020 */  cvt.s.w   $f0, $f0
/* 78CFC 800DF84C E4400040 */  swc1      $f0, 0x40($v0)
/* 78D00 800DF850 86030018 */  lh        $v1, 0x18($s0)
/* 78D04 800DF854 44830000 */  mtc1      $v1, $f0
/* 78D08 800DF858 00000000 */  nop
/* 78D0C 800DF85C 46800020 */  cvt.s.w   $f0, $f0
/* 78D10 800DF860 08037E1C */  j         .L800DF870
/* 78D14 800DF864 E4400064 */   swc1     $f0, 0x64($v0)
.L800DF868:
/* 78D18 800DF868 2402000A */  addiu     $v0, $zero, 0xA
/* 78D1C 800DF86C A60200C0 */  sh        $v0, 0xC0($s0)
.L800DF870:
/* 78D20 800DF870 2402FFFF */  addiu     $v0, $zero, -0x1
.L800DF874:
/* 78D24 800DF874 A6220012 */  sh        $v0, 0x12($s1)
/* 78D28 800DF878 A6220014 */  sh        $v0, 0x14($s1)
/* 78D2C 800DF87C A622000A */  sh        $v0, 0xA($s1)
/* 78D30 800DF880 24020001 */  addiu     $v0, $zero, 0x1
/* 78D34 800DF884 0C0387E4 */  jal       update_player_input
/* 78D38 800DF888 A6220006 */   sh       $v0, 0x6($s1)
/* 78D3C 800DF88C 8E020000 */  lw        $v0, 0x0($s0)
/* 78D40 800DF890 2403FBFF */  addiu     $v1, $zero, -0x401
/* 78D44 800DF894 00431024 */  and       $v0, $v0, $v1
/* 78D48 800DF898 0C037FF3 */  jal       update_player_blink
/* 78D4C 800DF89C AE020000 */   sw       $v0, 0x0($s0)
/* 78D50 800DF8A0 8E020000 */  lw        $v0, 0x0($s0)
/* 78D54 800DF8A4 30421000 */  andi      $v0, $v0, 0x1000
/* 78D58 800DF8A8 1040000B */  beqz      $v0, .L800DF8D8
/* 78D5C 800DF8AC 24020017 */   addiu    $v0, $zero, 0x17
/* 78D60 800DF8B0 0C03968B */  jal       phys_update_action_state
/* 78D64 800DF8B4 00000000 */   nop
/* 78D68 800DF8B8 0C038082 */  jal       func_800E0208
/* 78D6C 800DF8BC 00000000 */   nop
/* 78D70 800DF8C0 1440000E */  bnez      $v0, .L800DF8FC
/* 78D74 800DF8C4 00000000 */   nop
/* 78D78 800DF8C8 0C038D8F */  jal       collision_main_lateral
/* 78D7C 800DF8CC 00000000 */   nop
/* 78D80 800DF8D0 08037E3F */  j         .L800DF8FC
/* 78D84 800DF8D4 00000000 */   nop
.L800DF8D8:
/* 78D88 800DF8D8 820300B4 */  lb        $v1, 0xB4($s0)
/* 78D8C 800DF8DC 10620005 */  beq       $v1, $v0, .L800DF8F4
/* 78D90 800DF8E0 00000000 */   nop
/* 78D94 800DF8E4 0C037EAB */  jal       phys_update_standard
/* 78D98 800DF8E8 00000000 */   nop
/* 78D9C 800DF8EC 08037E3F */  j         .L800DF8FC
/* 78DA0 800DF8F0 00000000 */   nop
.L800DF8F4:
/* 78DA4 800DF8F4 0C037EFA */  jal       phys_update_lava_reset
/* 78DA8 800DF8F8 00000000 */   nop
.L800DF8FC:
/* 78DAC 800DF8FC 8E020000 */  lw        $v0, 0x0($s0)
/* 78DB0 800DF900 30424000 */  andi      $v0, $v0, 0x4000
/* 78DB4 800DF904 1040000B */  beqz      $v0, .L800DF934
/* 78DB8 800DF908 00000000 */   nop
/* 78DBC 800DF90C 96020012 */  lhu       $v0, 0x12($s0)
/* 78DC0 800DF910 2442FFFF */  addiu     $v0, $v0, -0x1
/* 78DC4 800DF914 A6020012 */  sh        $v0, 0x12($s0)
/* 78DC8 800DF918 00021400 */  sll       $v0, $v0, 16
/* 78DCC 800DF91C 1C400005 */  bgtz      $v0, .L800DF934
/* 78DD0 800DF920 2403BFFF */   addiu    $v1, $zero, -0x4001
/* 78DD4 800DF924 8E020000 */  lw        $v0, 0x0($s0)
/* 78DD8 800DF928 A6000012 */  sh        $zero, 0x12($s0)
/* 78DDC 800DF92C 00431024 */  and       $v0, $v0, $v1
/* 78DE0 800DF930 AE020000 */  sw        $v0, 0x0($s0)
.L800DF934:
/* 78DE4 800DF934 8E020004 */  lw        $v0, 0x4($s0)
/* 78DE8 800DF938 30421000 */  andi      $v0, $v0, 0x1000
/* 78DEC 800DF93C 14400003 */  bnez      $v0, .L800DF94C
/* 78DF0 800DF940 00000000 */   nop
/* 78DF4 800DF944 0C03BF42 */  jal       func_800EFD08
/* 78DF8 800DF948 00000000 */   nop
.L800DF94C:
/* 78DFC 800DF94C 0C0382E4 */  jal       func_800E0B90
/* 78E00 800DF950 00000000 */   nop
/* 78E04 800DF954 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 78E08 800DF958 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 78E0C 800DF95C C6000028 */  lwc1      $f0, 0x28($s0)
/* 78E10 800DF960 E4400098 */  swc1      $f0, 0x98($v0)
/* 78E14 800DF964 C600002C */  lwc1      $f0, 0x2C($s0)
/* 78E18 800DF968 E440009C */  swc1      $f0, 0x9C($v0)
/* 78E1C 800DF96C C6000030 */  lwc1      $f0, 0x30($s0)
/* 78E20 800DF970 E44000A0 */  swc1      $f0, 0xA0($v0)
/* 78E24 800DF974 C6000084 */  lwc1      $f0, 0x84($s0)
/* 78E28 800DF978 0C039B39 */  jal       check_input_open_menus
/* 78E2C 800DF97C E44000A4 */   swc1     $f0, 0xA4($v0)
/* 78E30 800DF980 8E020004 */  lw        $v0, 0x4($s0)
/* 78E34 800DF984 30421000 */  andi      $v0, $v0, 0x1000
/* 78E38 800DF988 14400003 */  bnez      $v0, .L800DF998
/* 78E3C 800DF98C 00000000 */   nop
/* 78E40 800DF990 0C039CA3 */  jal       check_input_status_bar
/* 78E44 800DF994 00000000 */   nop
.L800DF998:
/* 78E48 800DF998 0C0386F1 */  jal       update_player_shadow
/* 78E4C 800DF99C 00000000 */   nop
/* 78E50 800DF9A0 0C038206 */  jal       check_for_interactables
/* 78E54 800DF9A4 00000000 */   nop
/* 78E58 800DF9A8 0C038160 */  jal       check_for_conversation_prompt
/* 78E5C 800DF9AC 00000000 */   nop
/* 78E60 800DF9B0 0C0380E6 */  jal       check_for_pulse_stone
/* 78E64 800DF9B4 00000000 */   nop
/* 78E68 800DF9B8 0C0380A5 */  jal       check_for_ispy
/* 78E6C 800DF9BC 00000000 */   nop
/* 78E70 800DF9C0 8E020000 */  lw        $v0, 0x0($s0)
/* 78E74 800DF9C4 2403FFEF */  addiu     $v1, $zero, -0x11
/* 78E78 800DF9C8 AE00001C */  sw        $zero, 0x1C($s0)
/* 78E7C 800DF9CC AE000020 */  sw        $zero, 0x20($s0)
/* 78E80 800DF9D0 AE000024 */  sw        $zero, 0x24($s0)
/* 78E84 800DF9D4 00431024 */  and       $v0, $v0, $v1
/* 78E88 800DF9D8 AE020000 */  sw        $v0, 0x0($s0)
/* 78E8C 800DF9DC 8E020004 */  lw        $v0, 0x4($s0)
/* 78E90 800DF9E0 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 78E94 800DF9E4 00431024 */  and       $v0, $v0, $v1
/* 78E98 800DF9E8 AE020004 */  sw        $v0, 0x4($s0)
/* 78E9C 800DF9EC 8FBF0018 */  lw        $ra, 0x18($sp)
/* 78EA0 800DF9F0 8FB10014 */  lw        $s1, 0x14($sp)
/* 78EA4 800DF9F4 8FB00010 */  lw        $s0, 0x10($sp)
/* 78EA8 800DF9F8 03E00008 */  jr        $ra
/* 78EAC 800DF9FC 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void update_player(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    CollisionStatus* collisionStatus = &gCollisionStatus;
    GameStatus* gameStatus;

    update_partner_timers();

    if ((playerStatus->timeInAir > 100) || (playerStatus->position.y < -2000.0f)) {
        if (!(playerStatus->animFlags & PA_FLAG_NO_OOB_RESPAWN)) {
            playerStatus->timeInAir = 0;
            playerStatus->position.x = playerStatus->lastGoodPosition.x;
            playerStatus->position.y = playerStatus->lastGoodPosition.y;
            playerStatus->position.z = playerStatus->lastGoodPosition.z;

            if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) {
                Npc* partner;

                playerStatus->animFlags |= PA_FLAG_DISMOUNTING_ALLOWED | PA_FLAG_INTERRUPT_USE_PARTNER;
                partner = get_npc_unsafe(NPC_PARTNER);
                partner->pos.x = playerStatus->lastGoodPosition.x;
                partner->pos.y = playerStatus->lastGoodPosition.y + playerStatus->colliderHeight;
                partner->pos.z = playerStatus->lastGoodPosition.z;
                partner->moveToPos.y = playerStatus->lastGoodPosition.y;
            } else {
                playerStatus->timeInAir = 10;
            }
        }
    }

    collisionStatus->currentWall = NO_COLLIDER;
    collisionStatus->lastWallHammered = NO_COLLIDER;
    collisionStatus->currentInspect = NO_COLLIDER;
    collisionStatus->floorBelow = TRUE;

    update_player_input();
    playerStatus->flags &= ~PS_FLAG_SPECIAL_LAND;
    update_player_blink();

    if (playerStatus->flags & PS_FLAG_NO_STATIC_COLLISION) {
        phys_update_action_state();
        if (!game_scripts_disabled()) {
            collision_main_lateral();
        }
    } else if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
        phys_update_standard();
    } else {
        phys_update_lava_reset();
    }

    if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
        playerStatus->moveFrames--;
        if (playerStatus->moveFrames <= 0) {
            playerStatus->moveFrames = 0;
            playerStatus->flags &= ~PS_FLAG_CUTSCENE_MOVEMENT;
        }
    }

    if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
        handle_floor_behavior();
    }

    player_update_sprite();

    gameStatus = gGameStatusPtr;
    gameStatus->playerPos.x = playerStatus->position.x;
    gameStatus->playerPos.y = playerStatus->position.y;
    gameStatus->playerPos.z = playerStatus->position.z;
    gameStatus->playerYaw = playerStatus->currentYaw;

    check_input_open_menus();
    if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
        check_input_status_bar();
    }

    update_player_shadow();
    check_for_interactables();
    check_for_conversation_prompt();
    check_for_pulse_stone();
    check_for_ispy();

    playerStatus->pushVelocity.x = 0.0f;
    playerStatus->pushVelocity.y = 0.0f;
    playerStatus->pushVelocity.z = 0.0f;
    playerStatus->flags &= ~PS_FLAG_SLIDING;
    playerStatus->animFlags &= ~PA_FLAG_FORCE_USE_PARTNER;
}