### RAW ASSEMBLY INSTRUCTIONS:

glabel step_entity_commandlist
/* A62D8 8010FBD8 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* A62DC 8010FBDC AFB10014 */  sw        $s1, 0x14($sp)
/* A62E0 8010FBE0 0080882D */  daddu     $s1, $a0, $zero
/* A62E4 8010FBE4 AFBF0018 */  sw        $ra, 0x18($sp)
/* A62E8 8010FBE8 AFB00010 */  sw        $s0, 0x10($sp)
/* A62EC 8010FBEC 8E300018 */  lw        $s0, 0x18($s1)
/* A62F0 8010FBF0 8E030000 */  lw        $v1, 0x0($s0)
/* A62F4 8010FBF4 2C62000A */  sltiu     $v0, $v1, 0xA
/* A62F8 8010FBF8 10400052 */  beqz      $v0, .L8010FD44
/* A62FC 8010FBFC 26100004 */   addiu    $s0, $s0, 0x4
/* A6300 8010FC00 00031080 */  sll       $v0, $v1, 2
/* A6304 8010FC04 3C018015 */  lui       $at, %hi(jtbl_8014F740)
/* A6308 8010FC08 00220821 */  addu      $at, $at, $v0
/* A630C 8010FC0C 8C22F740 */  lw        $v0, %lo(jtbl_8014F740)($at)
/* A6310 8010FC10 00400008 */  jr        $v0
/* A6314 8010FC14 00000000 */   nop
glabel .L8010FC18
/* A6318 8010FC18 0000202D */  daddu     $a0, $zero, $zero
/* A631C 8010FC1C 240200FF */  addiu     $v0, $zero, 0xFF
/* A6320 8010FC20 A2220009 */  sb        $v0, 0x9($s1)
/* A6324 8010FC24 AE20001C */  sw        $zero, 0x1C($s1)
/* A6328 8010FC28 08043F54 */  j         .L8010FD50
/* A632C 8010FC2C AE200018 */   sw       $zero, 0x18($s1)
glabel .L8010FC30
/* A6330 8010FC30 8E020000 */  lw        $v0, 0x0($s0)
/* A6334 8010FC34 24040001 */  addiu     $a0, $zero, 0x1
/* A6338 8010FC38 AE220018 */  sw        $v0, 0x18($s1)
/* A633C 8010FC3C 0040182D */  daddu     $v1, $v0, $zero
/* A6340 8010FC40 0080102D */  daddu     $v0, $a0, $zero
/* A6344 8010FC44 A2220009 */  sb        $v0, 0x9($s1)
/* A6348 8010FC48 08043F54 */  j         .L8010FD50
/* A634C 8010FC4C AE23002C */   sw       $v1, 0x2C($s1)
glabel .L8010FC50
/* A6350 8010FC50 8E020000 */  lw        $v0, 0x0($s0)
/* A6354 8010FC54 26100004 */  addiu     $s0, $s0, 0x4
/* A6358 8010FC58 0220202D */  daddu     $a0, $s1, $zero
/* A635C 8010FC5C 0040F809 */  jalr      $v0
/* A6360 8010FC60 AC900018 */   sw       $s0, 0x18($a0)
/* A6364 8010FC64 08043F54 */  j         .L8010FD50
/* A6368 8010FC68 24040001 */   addiu    $a0, $zero, 0x1
glabel .L8010FC6C
/* A636C 8010FC6C 92020003 */  lbu       $v0, 0x3($s0)
/* A6370 8010FC70 26100004 */  addiu     $s0, $s0, 0x4
/* A6374 8010FC74 0000202D */  daddu     $a0, $zero, $zero
/* A6378 8010FC78 A2220009 */  sb        $v0, 0x9($s1)
/* A637C 8010FC7C 8E020000 */  lw        $v0, 0x0($s0)
/* A6380 8010FC80 26100004 */  addiu     $s0, $s0, 0x4
/* A6384 8010FC84 AE300018 */  sw        $s0, 0x18($s1)
/* A6388 8010FC88 08043F54 */  j         .L8010FD50
/* A638C 8010FC8C AE22001C */   sw       $v0, 0x1C($s1)
glabel .L8010FC90
/* A6390 8010FC90 8E020000 */  lw        $v0, 0x0($s0)
/* A6394 8010FC94 00021080 */  sll       $v0, $v0, 2
/* A6398 8010FC98 02221021 */  addu      $v0, $s1, $v0
/* A639C 8010FC9C 8C42002C */  lw        $v0, 0x2C($v0)
/* A63A0 8010FCA0 24040001 */  addiu     $a0, $zero, 0x1
/* A63A4 8010FCA4 08043F54 */  j         .L8010FD50
/* A63A8 8010FCA8 AE220018 */   sw       $v0, 0x18($s1)
glabel .L8010FCAC
/* A63AC 8010FCAC 8E020000 */  lw        $v0, 0x0($s0)
/* A63B0 8010FCB0 26100004 */  addiu     $s0, $s0, 0x4
/* A63B4 8010FCB4 24040001 */  addiu     $a0, $zero, 0x1
/* A63B8 8010FCB8 00021080 */  sll       $v0, $v0, 2
/* A63BC 8010FCBC 02221021 */  addu      $v0, $s1, $v0
/* A63C0 8010FCC0 AC50002C */  sw        $s0, 0x2C($v0)
/* A63C4 8010FCC4 08043F54 */  j         .L8010FD50
/* A63C8 8010FCC8 AE300018 */   sw       $s0, 0x18($s1)
glabel .L8010FCCC
/* A63CC 8010FCCC 8E220028 */  lw        $v0, 0x28($s1)
/* A63D0 8010FCD0 1040001D */  beqz      $v0, .L8010FD48
/* A63D4 8010FCD4 3C030100 */   lui      $v1, (0x1000000 >> 16)
/* A63D8 8010FCD8 8E220000 */  lw        $v0, 0x0($s1)
/* A63DC 8010FCDC 00431025 */  or        $v0, $v0, $v1
/* A63E0 8010FCE0 08043F52 */  j         .L8010FD48
/* A63E4 8010FCE4 AE220000 */   sw       $v0, 0x0($s1)
glabel .L8010FCE8
/* A63E8 8010FCE8 8E030000 */  lw        $v1, 0x0($s0)
/* A63EC 8010FCEC 26100004 */  addiu     $s0, $s0, 0x4
/* A63F0 8010FCF0 8E220000 */  lw        $v0, 0x0($s1)
/* A63F4 8010FCF4 24040001 */  addiu     $a0, $zero, 0x1
/* A63F8 8010FCF8 AE300018 */  sw        $s0, 0x18($s1)
/* A63FC 8010FCFC 00431025 */  or        $v0, $v0, $v1
/* A6400 8010FD00 08043F54 */  j         .L8010FD50
/* A6404 8010FD04 AE220000 */   sw       $v0, 0x0($s1)
glabel .L8010FD08
/* A6408 8010FD08 8E030000 */  lw        $v1, 0x0($s0)
/* A640C 8010FD0C 26100004 */  addiu     $s0, $s0, 0x4
/* A6410 8010FD10 8E220000 */  lw        $v0, 0x0($s1)
/* A6414 8010FD14 24040001 */  addiu     $a0, $zero, 0x1
/* A6418 8010FD18 AE300018 */  sw        $s0, 0x18($s1)
/* A641C 8010FD1C 00031827 */  nor       $v1, $zero, $v1
/* A6420 8010FD20 00431024 */  and       $v0, $v0, $v1
/* A6424 8010FD24 08043F54 */  j         .L8010FD50
/* A6428 8010FD28 AE220000 */   sw       $v0, 0x0($s1)
glabel .L8010FD2C
/* A642C 8010FD2C 8E040000 */  lw        $a0, 0x0($s0)
/* A6430 8010FD30 0C05272D */  jal       sfx_play_sound
/* A6434 8010FD34 26100004 */   addiu    $s0, $s0, 0x4
/* A6438 8010FD38 24040001 */  addiu     $a0, $zero, 0x1
/* A643C 8010FD3C 08043F54 */  j         .L8010FD50
/* A6440 8010FD40 AE300018 */   sw       $s0, 0x18($s1)
.L8010FD44:
/* A6444 8010FD44 26100004 */  addiu     $s0, $s0, 0x4
.L8010FD48:
/* A6448 8010FD48 AE300018 */  sw        $s0, 0x18($s1)
/* A644C 8010FD4C 24040001 */  addiu     $a0, $zero, 0x1
.L8010FD50:
/* A6450 8010FD50 8FBF0018 */  lw        $ra, 0x18($sp)
/* A6454 8010FD54 8FB10014 */  lw        $s1, 0x14($sp)
/* A6458 8010FD58 8FB00010 */  lw        $s0, 0x10($sp)
/* A645C 8010FD5C 0080102D */  daddu     $v0, $a0, $zero
/* A6460 8010FD60 03E00008 */  jr        $ra
/* A6464 8010FD64 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

s32 step_entity_commandlist(Entity* entity) {
    s32* args = entity->scriptReadPos;
    s32 ret;
    s32 labelId;
    void (*tempfunc)(Entity*);

    switch (*args++) {
        case ENTITY_SCRIPT_OP_End:
            entity->scriptDelay = -1;
            entity->updateScriptCallback = NULL;
            entity->scriptReadPos = NULL;
            ret = FALSE;
            break;
        case ENTITY_SCRIPT_OP_Jump:
            entity->scriptReadPos = (s32*)*args;
            entity->scriptDelay = 1;
            entity->savedReadPos[0] = entity->scriptReadPos;
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_Call:
            tempfunc = (void (*)(Entity*))(*args++);
            entity->scriptReadPos = args;
            (tempfunc)(entity);
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_SetCallback:
            entity->scriptDelay = *args++;
            entity->updateScriptCallback = (s32 (*)(Entity*)) *args++;
            entity->scriptReadPos = args++;
            ret = FALSE;
            break;
        case ENTITY_SCRIPT_OP_Goto:
            entity->scriptReadPos = entity->savedReadPos[*args];
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_Label:
            labelId = *args++;
            entity->savedReadPos[labelId] = args;
            entity->scriptReadPos = args;
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_RestartBoundScript:
            if (entity->boundScriptBytecode != NULL) {
                entity->flags |= ENTITY_FLAG_BOUND_SCRIPT_DIRTY;
            }
            entity->scriptReadPos = args++;
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_SetFlags:
            entity->flags |= *args++;
            entity->scriptReadPos = args++;
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_ClearFlags:
            entity->flags &= ~*args++;
            entity->scriptReadPos = args++;
            ret = TRUE;
            break;
        case ENTITY_SCRIPT_OP_PlaySound:
            sfx_play_sound(*args++);
            entity->scriptReadPos = args++;
            ret = TRUE;
            break;
        default:
            args++;
            entity->scriptReadPos = args++;
            ret = TRUE;
            break;
    }
    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_syn_set_mixer_params
/* 3276C 8005736C 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 32770 80057370 AFB50024 */  sw        $s5, 0x24($sp)
/* 32774 80057374 00C0A82D */  daddu     $s5, $a2, $zero
/* 32778 80057378 AFB3001C */  sw        $s3, 0x1C($sp)
/* 3277C 8005737C 00A0982D */  daddu     $s3, $a1, $zero
/* 32780 80057380 AFB40020 */  sw        $s4, 0x20($sp)
/* 32784 80057384 00E0A02D */  daddu     $s4, $a3, $zero
/* 32788 80057388 308400FF */  andi      $a0, $a0, 0xFF
/* 3278C 8005738C 00041140 */  sll       $v0, $a0, 5
/* 32790 80057390 00441023 */  subu      $v0, $v0, $a0
/* 32794 80057394 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 32798 80057398 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 3279C 8005739C 00021080 */  sll       $v0, $v0, 2
/* 327A0 800573A0 AFBF0028 */  sw        $ra, 0x28($sp)
/* 327A4 800573A4 AFB20018 */  sw        $s2, 0x18($sp)
/* 327A8 800573A8 AFB10014 */  sw        $s1, 0x14($sp)
/* 327AC 800573AC AFB00010 */  sw        $s0, 0x10($sp)
/* 327B0 800573B0 8C63001C */  lw        $v1, 0x1C($v1)
/* 327B4 800573B4 93B20043 */  lbu       $s2, 0x43($sp)
/* 327B8 800573B8 00628021 */  addu      $s0, $v1, $v0
/* 327BC 800573BC 8E050064 */  lw        $a1, 0x64($s0)
/* 327C0 800573C0 8E030068 */  lw        $v1, 0x68($s0)
/* 327C4 800573C4 00A3102A */  slt       $v0, $a1, $v1
/* 327C8 800573C8 14400029 */  bnez      $v0, .L80057470
/* 327CC 800573CC 26110048 */   addiu    $s1, $s0, 0x48
/* 327D0 800573D0 3C028008 */  lui       $v0, %hi(AuSynUseStereo)
/* 327D4 800573D4 24428181 */  addiu     $v0, $v0, %lo(AuSynUseStereo)
/* 327D8 800573D8 90420000 */  lbu       $v0, 0x0($v0)
/* 327DC 800573DC 1440000E */  bnez      $v0, .L80057418
/* 327E0 800573E0 AE030064 */   sw       $v1, 0x64($s0)
/* 327E4 800573E4 3C048008 */  lui       $a0, %hi(AlCosineBlend)
/* 327E8 800573E8 24848E60 */  addiu     $a0, $a0, %lo(AlCosineBlend)
/* 327EC 800573EC 8603004E */  lh        $v1, 0x4E($s0)
/* 327F0 800573F0 84820080 */  lh        $v0, 0x80($a0)
/* 327F4 800573F4 00620018 */  mult      $v1, $v0
/* 327F8 800573F8 00004012 */  mflo      $t0
/* 327FC 800573FC 000813C3 */  sra       $v0, $t0, 15
/* 32800 80057400 A6020050 */  sh        $v0, 0x50($s0)
/* 32804 80057404 84820080 */  lh        $v0, 0x80($a0)
/* 32808 80057408 00620018 */  mult      $v1, $v0
/* 3280C 8005740C 00004012 */  mflo      $t0
/* 32810 80057410 08015D26 */  j         .L80057498
/* 32814 80057414 000813C3 */   sra      $v0, $t0, 15
.L80057418:
/* 32818 80057418 8602004C */  lh        $v0, 0x4C($s0)
/* 3281C 8005741C 8603004E */  lh        $v1, 0x4E($s0)
/* 32820 80057420 00021040 */  sll       $v0, $v0, 1
/* 32824 80057424 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32828 80057428 00220821 */  addu      $at, $at, $v0
/* 3282C 8005742C 84228E60 */  lh        $v0, %lo(AlCosineBlend)($at)
/* 32830 80057430 00620018 */  mult      $v1, $v0
/* 32834 80057434 8603004C */  lh        $v1, 0x4C($s0)
/* 32838 80057438 00004012 */  mflo      $t0
/* 3283C 8005743C 000813C3 */  sra       $v0, $t0, 15
/* 32840 80057440 A6020050 */  sh        $v0, 0x50($s0)
/* 32844 80057444 2402007F */  addiu     $v0, $zero, 0x7F
/* 32848 80057448 00431023 */  subu      $v0, $v0, $v1
/* 3284C 8005744C 00021040 */  sll       $v0, $v0, 1
/* 32850 80057450 8603004E */  lh        $v1, 0x4E($s0)
/* 32854 80057454 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 32858 80057458 00220821 */  addu      $at, $at, $v0
/* 3285C 8005745C 84228E60 */  lh        $v0, %lo(AlCosineBlend)($at)
/* 32860 80057460 00620018 */  mult      $v1, $v0
/* 32864 80057464 00004012 */  mflo      $t0
/* 32868 80057468 08015D26 */  j         .L80057498
/* 3286C 8005746C 000813C3 */   sra      $v0, $t0, 15
.L80057470:
/* 32870 80057470 86040050 */  lh        $a0, 0x50($s0)
/* 32874 80057474 8606005A */  lh        $a2, 0x5A($s0)
/* 32878 80057478 0C016001 */  jal       func_80058004
/* 3287C 8005747C 96070058 */   lhu      $a3, 0x58($s0)
/* 32880 80057480 86040052 */  lh        $a0, 0x52($s0)
/* 32884 80057484 8E050064 */  lw        $a1, 0x64($s0)
/* 32888 80057488 86060060 */  lh        $a2, 0x60($s0)
/* 3288C 8005748C 9607005E */  lhu       $a3, 0x5E($s0)
/* 32890 80057490 0C016001 */  jal       func_80058004
/* 32894 80057494 A6020050 */   sh       $v0, 0x50($s0)
.L80057498:
/* 32898 80057498 A6020052 */  sh        $v0, 0x52($s0)
/* 3289C 8005749C 86220008 */  lh        $v0, 0x8($s1)
/* 328A0 800574A0 14400002 */  bnez      $v0, .L800574AC
/* 328A4 800574A4 24020001 */   addiu    $v0, $zero, 0x1
/* 328A8 800574A8 A6220008 */  sh        $v0, 0x8($s1)
.L800574AC:
/* 328AC 800574AC 8622000A */  lh        $v0, 0xA($s1)
/* 328B0 800574B0 14400004 */  bnez      $v0, .L800574C4
/* 328B4 800574B4 00131400 */   sll      $v0, $s3, 16
/* 328B8 800574B8 24020001 */  addiu     $v0, $zero, 0x1
/* 328BC 800574BC A622000A */  sh        $v0, 0xA($s1)
/* 328C0 800574C0 00131400 */  sll       $v0, $s3, 16
.L800574C4:
/* 328C4 800574C4 00021403 */  sra       $v0, $v0, 16
/* 328C8 800574C8 00420018 */  mult      $v0, $v0
/* 328CC 800574CC 328200FF */  andi      $v0, $s4, 0xFF
/* 328D0 800574D0 324300FF */  andi      $v1, $s2, 0xFF
/* 328D4 800574D4 AE20001C */  sw        $zero, 0x1C($s1)
/* 328D8 800574D8 AE350020 */  sw        $s5, 0x20($s1)
/* 328DC 800574DC A6220004 */  sh        $v0, 0x4($s1)
/* 328E0 800574E0 00004012 */  mflo      $t0
/* 328E4 800574E4 000813C3 */  sra       $v0, $t0, 15
/* 328E8 800574E8 A6220006 */  sh        $v0, 0x6($s1)
/* 328EC 800574EC 00031040 */  sll       $v0, $v1, 1
/* 328F0 800574F0 3C018008 */  lui       $at, %hi(AlCosineBlend)
/* 328F4 800574F4 00220821 */  addu      $at, $at, $v0
/* 328F8 800574F8 94228E60 */  lhu       $v0, %lo(AlCosineBlend)($at)
/* 328FC 800574FC A622000C */  sh        $v0, 0xC($s1)
/* 32900 80057500 2402007F */  addiu     $v0, $zero, 0x7F
/* 32904 80057504 00431023 */  subu      $v0, $v0, $v1
/* 32908 80057508 00021040 */  sll       $v0, $v0, 1
/* 3290C 8005750C 3C038008 */  lui       $v1, %hi(AlCosineBlend)
/* 32910 80057510 00621821 */  addu      $v1, $v1, $v0
/* 32914 80057514 94638E60 */  lhu       $v1, %lo(AlCosineBlend)($v1)
/* 32918 80057518 24020001 */  addiu     $v0, $zero, 0x1
/* 3291C 8005751C AE220024 */  sw        $v0, 0x24($s1)
/* 32920 80057520 A623000E */  sh        $v1, 0xE($s1)
/* 32924 80057524 8FBF0028 */  lw        $ra, 0x28($sp)
/* 32928 80057528 8FB50024 */  lw        $s5, 0x24($sp)
/* 3292C 8005752C 8FB40020 */  lw        $s4, 0x20($sp)
/* 32930 80057530 8FB3001C */  lw        $s3, 0x1C($sp)
/* 32934 80057534 8FB20018 */  lw        $s2, 0x18($sp)
/* 32938 80057538 8FB10014 */  lw        $s1, 0x14($sp)
/* 3293C 8005753C 8FB00010 */  lw        $s0, 0x10($sp)
/* 32940 80057540 03E00008 */  jr        $ra
/* 32944 80057544 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void au_syn_set_mixer_params(u8 voiceIdx, s16 volume, s32 delta, u8 pan, u8 fxMix) {
    AuPVoice* pvoice = &gSynDriverPtr->pvoices[voiceIdx];
    AuEnvMixer* envMixer = &pvoice->envMixer;

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

    envMixer->delta = 0;
    envMixer->segEnd = delta;
    envMixer->pan = pan;
    envMixer->volume = SQ(volume) >> 0xF;
    envMixer->dryamt = AuEqPower[fxMix];
    envMixer->wetamt = AuEqPower[AU_EQPOW_MAX_IDX - fxMix];
    envMixer->first = 1;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel quizmo_audience_update
/* 3A71F4 E00A8104 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 3A71F8 E00A8108 AFBF0020 */  sw        $ra, 0x20($sp)
/* 3A71FC E00A810C AFB3001C */  sw        $s3, 0x1C($sp)
/* 3A7200 E00A8110 AFB20018 */  sw        $s2, 0x18($sp)
/* 3A7204 E00A8114 AFB10014 */  sw        $s1, 0x14($sp)
/* 3A7208 E00A8118 AFB00010 */  sw        $s0, 0x10($sp)
/* 3A720C E00A811C 8C830000 */  lw        $v1, 0x0($a0)
/* 3A7210 E00A8120 8C85000C */  lw        $a1, 0xC($a0)
/* 3A7214 E00A8124 30620010 */  andi      $v0, $v1, 0x10
/* 3A7218 E00A8128 10400005 */  beqz      $v0, .LE00A8140
/* 3A721C E00A812C 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3A7220 E00A8130 00621024 */  and       $v0, $v1, $v0
/* 3A7224 E00A8134 AC820000 */  sw        $v0, 0x0($a0)
/* 3A7228 E00A8138 2402001E */  addiu     $v0, $zero, 0x1E
/* 3A722C E00A813C ACA20004 */  sw        $v0, 0x4($a1)
.LE00A8140:
/* 3A7230 E00A8140 8CA30004 */  lw        $v1, 0x4($a1)
/* 3A7234 E00A8144 28620064 */  slti      $v0, $v1, 0x64
/* 3A7238 E00A8148 10400002 */  beqz      $v0, .LE00A8154
/* 3A723C E00A814C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3A7240 E00A8150 ACA20004 */  sw        $v0, 0x4($a1)
.LE00A8154:
/* 3A7244 E00A8154 8CA20008 */  lw        $v0, 0x8($a1)
/* 3A7248 E00A8158 8CA30004 */  lw        $v1, 0x4($a1)
/* 3A724C E00A815C 24420001 */  addiu     $v0, $v0, 0x1
/* 3A7250 E00A8160 04610005 */  bgez      $v1, .LE00A8178
/* 3A7254 E00A8164 ACA20008 */   sw       $v0, 0x8($a1)
/* 3A7258 E00A8168 0C080128 */  jal       shim_remove_effect
/* 3A725C E00A816C 00000000 */   nop
/* 3A7260 E00A8170 0802A0AE */  j         .LE00A82B8
/* 3A7264 E00A8174 00000000 */   nop
.LE00A8178:
/* 3A7268 E00A8178 28620010 */  slti      $v0, $v1, 0x10
/* 3A726C E00A817C 10400002 */  beqz      $v0, .LE00A8188
/* 3A7270 E00A8180 00031100 */   sll      $v0, $v1, 4
/* 3A7274 E00A8184 ACA20018 */  sw        $v0, 0x18($a1)
.LE00A8188:
/* 3A7278 E00A8188 0000882D */  daddu     $s1, $zero, $zero
/* 3A727C E00A818C 24120001 */  addiu     $s2, $zero, 0x1
/* 3A7280 E00A8190 3C13E00B */  lui       $s3, %hi(D_E00A8690)
/* 3A7284 E00A8194 26738690 */  addiu     $s3, $s3, %lo(D_E00A8690)
/* 3A7288 E00A8198 00A0802D */  daddu     $s0, $a1, $zero
.LE00A819C:
/* 3A728C E00A819C 8E02001C */  lw        $v0, 0x1C($s0)
/* 3A7290 E00A81A0 10400005 */  beqz      $v0, .LE00A81B8
/* 3A7294 E00A81A4 00000000 */   nop
/* 3A7298 E00A81A8 1052001E */  beq       $v0, $s2, .LE00A8224
/* 3A729C E00A81AC 00000000 */   nop
/* 3A72A0 E00A81B0 0802A0AA */  j         .LE00A82A8
/* 3A72A4 E00A81B4 26100004 */   addiu    $s0, $s0, 0x4
.LE00A81B8:
/* 3A72A8 E00A81B8 0C080138 */  jal       shim_rand_int
/* 3A72AC E00A81BC 2404000A */   addiu    $a0, $zero, 0xA
/* 3A72B0 E00A81C0 2403000A */  addiu     $v1, $zero, 0xA
/* 3A72B4 E00A81C4 54430038 */  bnel      $v0, $v1, .LE00A82A8
/* 3A72B8 E00A81C8 26100004 */   addiu    $s0, $s0, 0x4
/* 3A72BC E00A81CC 24040001 */  addiu     $a0, $zero, 0x1
/* 3A72C0 E00A81D0 0C080138 */  jal       shim_rand_int
/* 3A72C4 E00A81D4 AE12001C */   sw       $s2, 0x1C($s0)
/* 3A72C8 E00A81D8 24040032 */  addiu     $a0, $zero, 0x32
/* 3A72CC E00A81DC AE020044 */  sw        $v0, 0x44($s0)
/* 3A72D0 E00A81E0 0C080138 */  jal       shim_rand_int
/* 3A72D4 E00A81E4 AE00006C */   sw       $zero, 0x6C($s0)
/* 3A72D8 E00A81E8 3C01E00B */  lui       $at, (0xE00B0000 >> 16)
/* 3A72DC E00A81EC D42086A0 */  ldc1      $f0, -0x7960($at)
/* 3A72E0 E00A81F0 44821000 */  mtc1      $v0, $f2
/* 3A72E4 E00A81F4 00000000 */  nop
/* 3A72E8 E00A81F8 468010A1 */  cvt.d.w   $f2, $f2
/* 3A72EC E00A81FC 46201082 */  mul.d     $f2, $f2, $f0
/* 3A72F0 E00A8200 00000000 */  nop
/* 3A72F4 E00A8204 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3A72F8 E00A8208 44810800 */  mtc1      $at, $f1
/* 3A72FC E00A820C 44800000 */  mtc1      $zero, $f0
/* 3A7300 E00A8210 00000000 */  nop
/* 3A7304 E00A8214 46201080 */  add.d     $f2, $f2, $f0
/* 3A7308 E00A8218 462010A0 */  cvt.s.d   $f2, $f2
/* 3A730C E00A821C 0802A0A9 */  j         .LE00A82A4
/* 3A7310 E00A8220 E6020094 */   swc1     $f2, 0x94($s0)
.LE00A8224:
/* 3A7314 E00A8224 8E020044 */  lw        $v0, 0x44($s0)
/* 3A7318 E00A8228 8E03006C */  lw        $v1, 0x6C($s0)
/* 3A731C E00A822C 000210C0 */  sll       $v0, $v0, 3
/* 3A7320 E00A8230 00532021 */  addu      $a0, $v0, $s3
/* 3A7324 E00A8234 90820004 */  lbu       $v0, 0x4($a0)
/* 3A7328 E00A8238 0062102A */  slt       $v0, $v1, $v0
/* 3A732C E00A823C 14400003 */  bnez      $v0, .LE00A824C
/* 3A7330 E00A8240 00031840 */   sll      $v1, $v1, 1
/* 3A7334 E00A8244 0802A0A9 */  j         .LE00A82A4
/* 3A7338 E00A8248 AE00001C */   sw       $zero, 0x1C($s0)
.LE00A824C:
/* 3A733C E00A824C 8C820000 */  lw        $v0, 0x0($a0)
/* 3A7340 E00A8250 00621021 */  addu      $v0, $v1, $v0
/* 3A7344 E00A8254 80420000 */  lb        $v0, 0x0($v0)
/* 3A7348 E00A8258 C6020094 */  lwc1      $f2, 0x94($s0)
/* 3A734C E00A825C 44820000 */  mtc1      $v0, $f0
/* 3A7350 E00A8260 00000000 */  nop
/* 3A7354 E00A8264 46800020 */  cvt.s.w   $f0, $f0
/* 3A7358 E00A8268 46020002 */  mul.s     $f0, $f0, $f2
/* 3A735C E00A826C 00000000 */  nop
/* 3A7360 E00A8270 E60000BC */  swc1      $f0, 0xBC($s0)
/* 3A7364 E00A8274 8C820000 */  lw        $v0, 0x0($a0)
/* 3A7368 E00A8278 00621821 */  addu      $v1, $v1, $v0
/* 3A736C E00A827C 80620001 */  lb        $v0, 0x1($v1)
/* 3A7370 E00A8280 44820000 */  mtc1      $v0, $f0
/* 3A7374 E00A8284 00000000 */  nop
/* 3A7378 E00A8288 46800020 */  cvt.s.w   $f0, $f0
/* 3A737C E00A828C 46020002 */  mul.s     $f0, $f0, $f2
/* 3A7380 E00A8290 00000000 */  nop
/* 3A7384 E00A8294 8E02006C */  lw        $v0, 0x6C($s0)
/* 3A7388 E00A8298 24420001 */  addiu     $v0, $v0, 0x1
/* 3A738C E00A829C AE02006C */  sw        $v0, 0x6C($s0)
/* 3A7390 E00A82A0 E60000E4 */  swc1      $f0, 0xE4($s0)
.LE00A82A4:
/* 3A7394 E00A82A4 26100004 */  addiu     $s0, $s0, 0x4
.LE00A82A8:
/* 3A7398 E00A82A8 26310001 */  addiu     $s1, $s1, 0x1
/* 3A739C E00A82AC 2A22000A */  slti      $v0, $s1, 0xA
/* 3A73A0 E00A82B0 1440FFBA */  bnez      $v0, .LE00A819C
/* 3A73A4 E00A82B4 00000000 */   nop
.LE00A82B8:
/* 3A73A8 E00A82B8 8FBF0020 */  lw        $ra, 0x20($sp)
/* 3A73AC E00A82BC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 3A73B0 E00A82C0 8FB20018 */  lw        $s2, 0x18($sp)
/* 3A73B4 E00A82C4 8FB10014 */  lw        $s1, 0x14($sp)
/* 3A73B8 E00A82C8 8FB00010 */  lw        $s0, 0x10($sp)
/* 3A73BC E00A82CC 03E00008 */  jr        $ra
/* 3A73C0 E00A82D0 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void quizmo_audience_update(EffectInstance* effect) {
    QuizmoAudienceFXData* data = effect->data.quizmoAudience;
    QuizmoAudiencePositonOffsets* unkStruct;
    s32 posIdx;
    s32 i;

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

    if (data->timeLeft < 100) {
        data->timeLeft--;
    }

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

    if (data->timeLeft < 16) {
        data->primColor = data->timeLeft * 16;
    }

    for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) {
        switch (data->compState[i]) {
            case 0:
                if (shim_rand_int(10) == 10) {
                    data->compState[i] = 1;
                    data->compType[i] = shim_rand_int(1);
                    data->compPosIdx[i] = 0;
                    data->compMoveMagnitude[i] = (shim_rand_int(50) * 0.01) + 0.5;
                }
                break;
            case 1:
                posIdx = data->compPosIdx[i];
                unkStruct = &quizmo_audience_positionOffsets[data->compType[i]];
                if (data->compPosIdx[i] >= unkStruct->count) {
                    data->compState[i] = 0;
                } else {
                    data->compX[i] = unkStruct->offsets[posIdx].x * data->compMoveMagnitude[i];
                    data->compY[i] = unkStruct->offsets[posIdx].y * data->compMoveMagnitude[i];
                    data->compPosIdx[i]++;
                }
                break;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel NpcFaceNpc
/* F3830 802CEE80 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* F3834 802CEE84 AFB10014 */  sw        $s1, 0x14($sp)
/* F3838 802CEE88 0080882D */  daddu     $s1, $a0, $zero
/* F383C 802CEE8C AFB60028 */  sw        $s6, 0x28($sp)
/* F3840 802CEE90 26360074 */  addiu     $s6, $s1, 0x74
/* F3844 802CEE94 AFB50024 */  sw        $s5, 0x24($sp)
/* F3848 802CEE98 26350078 */  addiu     $s5, $s1, 0x78
/* F384C 802CEE9C AFB40020 */  sw        $s4, 0x20($sp)
/* F3850 802CEEA0 AFBF002C */  sw        $ra, 0x2C($sp)
/* F3854 802CEEA4 AFB3001C */  sw        $s3, 0x1C($sp)
/* F3858 802CEEA8 AFB20018 */  sw        $s2, 0x18($sp)
/* F385C 802CEEAC AFB00010 */  sw        $s0, 0x10($sp)
/* F3860 802CEEB0 8E32000C */  lw        $s2, 0xC($s1)
/* F3864 802CEEB4 10A00040 */  beqz      $a1, .L802CEFB8
/* F3868 802CEEB8 2634007C */   addiu    $s4, $s1, 0x7C
/* F386C 802CEEBC 8E450000 */  lw        $a1, 0x0($s2)
/* F3870 802CEEC0 0C0B1EAF */  jal       evt_get_variable
/* F3874 802CEEC4 26520004 */   addiu    $s2, $s2, 0x4
/* F3878 802CEEC8 8E450000 */  lw        $a1, 0x0($s2)
/* F387C 802CEECC 26520004 */  addiu     $s2, $s2, 0x4
/* F3880 802CEED0 0220202D */  daddu     $a0, $s1, $zero
/* F3884 802CEED4 0C0B1EAF */  jal       evt_get_variable
/* F3888 802CEED8 0040802D */   daddu    $s0, $v0, $zero
/* F388C 802CEEDC 0220202D */  daddu     $a0, $s1, $zero
/* F3890 802CEEE0 0C0B36B0 */  jal       resolve_npc
/* F3894 802CEEE4 0040282D */   daddu    $a1, $v0, $zero
/* F3898 802CEEE8 0040982D */  daddu     $s3, $v0, $zero
/* F389C 802CEEEC 12600006 */  beqz      $s3, .L802CEF08
/* F38A0 802CEEF0 0220202D */   daddu    $a0, $s1, $zero
/* F38A4 802CEEF4 0C0B36B0 */  jal       resolve_npc
/* F38A8 802CEEF8 0200282D */   daddu    $a1, $s0, $zero
/* F38AC 802CEEFC 0040802D */  daddu     $s0, $v0, $zero
/* F38B0 802CEF00 16000003 */  bnez      $s0, .L802CEF10
/* F38B4 802CEF04 00000000 */   nop
.L802CEF08:
/* F38B8 802CEF08 080B3C0E */  j         .L802CF038
/* F38BC 802CEF0C 24020002 */   addiu    $v0, $zero, 0x2
.L802CEF10:
/* F38C0 802CEF10 C600000C */  lwc1      $f0, 0xC($s0)
/* F38C4 802CEF14 E6200074 */  swc1      $f0, 0x74($s1)
/* F38C8 802CEF18 C60C0038 */  lwc1      $f12, 0x38($s0)
/* F38CC 802CEF1C C60E0040 */  lwc1      $f14, 0x40($s0)
/* F38D0 802CEF20 8E660038 */  lw        $a2, 0x38($s3)
/* F38D4 802CEF24 0C00A720 */  jal       atan2
/* F38D8 802CEF28 8E670040 */   lw       $a3, 0x40($s3)
/* F38DC 802CEF2C C6220074 */  lwc1      $f2, 0x74($s1)
/* F38E0 802CEF30 46020001 */  sub.s     $f0, $f0, $f2
/* F38E4 802CEF34 AE300070 */  sw        $s0, 0x70($s1)
/* F38E8 802CEF38 E6200078 */  swc1      $f0, 0x78($s1)
/* F38EC 802CEF3C 8E450000 */  lw        $a1, 0x0($s2)
/* F38F0 802CEF40 0C0B1EAF */  jal       evt_get_variable
/* F38F4 802CEF44 0220202D */   daddu    $a0, $s1, $zero
/* F38F8 802CEF48 AE22007C */  sw        $v0, 0x7C($s1)
/* F38FC 802CEF4C A600008E */  sh        $zero, 0x8E($s0)
/* F3900 802CEF50 C6220078 */  lwc1      $f2, 0x78($s1)
/* F3904 802CEF54 3C01C334 */  lui       $at, (0xC3340000 >> 16)
/* F3908 802CEF58 44810000 */  mtc1      $at, $f0
/* F390C 802CEF5C 00000000 */  nop
/* F3910 802CEF60 4600103C */  c.lt.s    $f2, $f0
/* F3914 802CEF64 00000000 */  nop
/* F3918 802CEF68 45000007 */  bc1f      .L802CEF88
/* F391C 802CEF6C 00000000 */   nop
/* F3920 802CEF70 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F3924 802CEF74 44810000 */  mtc1      $at, $f0
/* F3928 802CEF78 00000000 */  nop
/* F392C 802CEF7C 46001000 */  add.s     $f0, $f2, $f0
/* F3930 802CEF80 E6200078 */  swc1      $f0, 0x78($s1)
/* F3934 802CEF84 C6220078 */  lwc1      $f2, 0x78($s1)
.L802CEF88:
/* F3938 802CEF88 3C014334 */  lui       $at, (0x43340000 >> 16)
/* F393C 802CEF8C 44810000 */  mtc1      $at, $f0
/* F3940 802CEF90 00000000 */  nop
/* F3944 802CEF94 4602003C */  c.lt.s    $f0, $f2
/* F3948 802CEF98 00000000 */  nop
/* F394C 802CEF9C 45000006 */  bc1f      .L802CEFB8
/* F3950 802CEFA0 00000000 */   nop
/* F3954 802CEFA4 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F3958 802CEFA8 44810000 */  mtc1      $at, $f0
/* F395C 802CEFAC 00000000 */  nop
/* F3960 802CEFB0 46001001 */  sub.s     $f0, $f2, $f0
/* F3964 802CEFB4 E6200078 */  swc1      $f0, 0x78($s1)
.L802CEFB8:
/* F3968 802CEFB8 8E820000 */  lw        $v0, 0x0($s4)
/* F396C 802CEFBC 8E300070 */  lw        $s0, 0x70($s1)
/* F3970 802CEFC0 1C400006 */  bgtz      $v0, .L802CEFDC
/* F3974 802CEFC4 24020002 */   addiu    $v0, $zero, 0x2
/* F3978 802CEFC8 C600000C */  lwc1      $f0, 0xC($s0)
/* F397C 802CEFCC C6A20000 */  lwc1      $f2, 0x0($s5)
/* F3980 802CEFD0 46020000 */  add.s     $f0, $f0, $f2
/* F3984 802CEFD4 080B3C0E */  j         .L802CF038
/* F3988 802CEFD8 E600000C */   swc1     $f0, 0xC($s0)
.L802CEFDC:
/* F398C 802CEFDC 9602008E */  lhu       $v0, 0x8E($s0)
/* F3990 802CEFE0 24420001 */  addiu     $v0, $v0, 0x1
/* F3994 802CEFE4 A602008E */  sh        $v0, 0x8E($s0)
/* F3998 802CEFE8 00021400 */  sll       $v0, $v0, 16
/* F399C 802CEFEC 00021403 */  sra       $v0, $v0, 16
/* F39A0 802CEFF0 C6A00000 */  lwc1      $f0, 0x0($s5)
/* F39A4 802CEFF4 44821000 */  mtc1      $v0, $f2
/* F39A8 802CEFF8 00000000 */  nop
/* F39AC 802CEFFC 468010A0 */  cvt.s.w   $f2, $f2
/* F39B0 802CF000 46020002 */  mul.s     $f0, $f0, $f2
/* F39B4 802CF004 00000000 */  nop
/* F39B8 802CF008 C6CC0000 */  lwc1      $f12, 0x0($s6)
/* F39BC 802CF00C C6820000 */  lwc1      $f2, 0x0($s4)
/* F39C0 802CF010 468010A0 */  cvt.s.w   $f2, $f2
/* F39C4 802CF014 46020003 */  div.s     $f0, $f0, $f2
/* F39C8 802CF018 46006300 */  add.s     $f12, $f12, $f0
/* F39CC 802CF01C 0C00A6C9 */  jal       clamp_angle
/* F39D0 802CF020 E60C000C */   swc1     $f12, 0xC($s0)
/* F39D4 802CF024 8602008E */  lh        $v0, 0x8E($s0)
/* F39D8 802CF028 E600000C */  swc1      $f0, 0xC($s0)
/* F39DC 802CF02C 8E830000 */  lw        $v1, 0x0($s4)
/* F39E0 802CF030 0043102A */  slt       $v0, $v0, $v1
/* F39E4 802CF034 38420001 */  xori      $v0, $v0, 0x1
.L802CF038:
/* F39E8 802CF038 8FBF002C */  lw        $ra, 0x2C($sp)
/* F39EC 802CF03C 8FB60028 */  lw        $s6, 0x28($sp)
/* F39F0 802CF040 8FB50024 */  lw        $s5, 0x24($sp)
/* F39F4 802CF044 8FB40020 */  lw        $s4, 0x20($sp)
/* F39F8 802CF048 8FB3001C */  lw        $s3, 0x1C($sp)
/* F39FC 802CF04C 8FB20018 */  lw        $s2, 0x18($sp)
/* F3A00 802CF050 8FB10014 */  lw        $s1, 0x14($sp)
/* F3A04 802CF054 8FB00010 */  lw        $s0, 0x10($sp)
/* F3A08 802CF058 03E00008 */  jr        $ra
/* F3A0C 802CF05C 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

ApiStatus NpcFaceNpc(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    f32* initialYaw = &script->functionTempF[1];
    f32* deltaYaw = &script->functionTempF[2];
    s32* turnTime = &script->functionTemp[3];
    Npc* targetNpc;
    Npc* turningNpc;

    if (isInitialCall) {
        s32 turningNpcID = evt_get_variable(script, *args++);
        s32 targetNpcID = evt_get_variable(script, *args++);

        targetNpc = resolve_npc(script, targetNpcID);
        if (targetNpc == NULL) {
            return ApiStatus_DONE2;
        }

        turningNpc = resolve_npc(script, turningNpcID);
        if (turningNpc == NULL) {
            return ApiStatus_DONE2;
        }

        *initialYaw = turningNpc->yaw;
        *deltaYaw = atan2(turningNpc->pos.x, turningNpc->pos.z, targetNpc->pos.x, targetNpc->pos.z) - *initialYaw;
        script->functionTempPtr[0] = turningNpc;
        *turnTime = evt_get_variable(script, *args++);
        turningNpc->duration = 0;

        if (*deltaYaw < -180.0f) {
            *deltaYaw += 360.0f;
        }
        if (*deltaYaw > 180.0f) {
            *deltaYaw -= 360.0f;
        }
    }

    turningNpc = script->functionTempPtr[0];
    if (*turnTime > 0) {
        turningNpc->duration++;
        turningNpc->yaw = *initialYaw + ((*deltaYaw * turningNpc->duration) / *turnTime);
        turningNpc->yaw = clamp_angle(turningNpc->yaw);
        return !(turningNpc->duration < *turnTime) * ApiStatus_DONE1;
    }

    turningNpc->yaw += *deltaYaw;
    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel create_effect_instance
/* 356BC 8005A2BC 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 356C0 8005A2C0 AFB20018 */  sw        $s2, 0x18($sp)
/* 356C4 8005A2C4 0080902D */  daddu     $s2, $a0, $zero
/* 356C8 8005A2C8 AFB00010 */  sw        $s0, 0x10($sp)
/* 356CC 8005A2CC 0000802D */  daddu     $s0, $zero, $zero
/* 356D0 8005A2D0 3C03800B */  lui       $v1, %hi(gEffectInstances)
/* 356D4 8005A2D4 24634398 */  addiu     $v1, $v1, %lo(gEffectInstances)
/* 356D8 8005A2D8 AFBF001C */  sw        $ra, 0x1C($sp)
/* 356DC 8005A2DC AFB10014 */  sw        $s1, 0x14($sp)
.L8005A2E0:
/* 356E0 8005A2E0 8C620000 */  lw        $v0, 0x0($v1)
/* 356E4 8005A2E4 10400006 */  beqz      $v0, .L8005A300
/* 356E8 8005A2E8 2A020060 */   slti     $v0, $s0, 0x60
/* 356EC 8005A2EC 26100001 */  addiu     $s0, $s0, 0x1
/* 356F0 8005A2F0 2A020060 */  slti      $v0, $s0, 0x60
/* 356F4 8005A2F4 1440FFFA */  bnez      $v0, .L8005A2E0
/* 356F8 8005A2F8 24630004 */   addiu    $v1, $v1, 0x4
/* 356FC 8005A2FC 2A020060 */  slti      $v0, $s0, 0x60
.L8005A300:
/* 35700 8005A300 14400003 */  bnez      $v0, .L8005A310
/* 35704 8005A304 00000000 */   nop
.L8005A308:
/* 35708 8005A308 080168C2 */  j         .L8005A308
/* 3570C 8005A30C 00000000 */   nop
.L8005A310:
/* 35710 8005A310 0C00AB0A */  jal       general_heap_malloc
/* 35714 8005A314 24040014 */   addiu    $a0, $zero, 0x14
/* 35718 8005A318 00101880 */  sll       $v1, $s0, 2
/* 3571C 8005A31C 0040882D */  daddu     $s1, $v0, $zero
/* 35720 8005A320 3C01800B */  lui       $at, %hi(gEffectInstances)
/* 35724 8005A324 00230821 */  addu      $at, $at, $v1
/* 35728 8005A328 AC314398 */  sw        $s1, %lo(gEffectInstances)($at)
/* 3572C 8005A32C 16200003 */  bnez      $s1, .L8005A33C
/* 35730 8005A330 0000802D */   daddu    $s0, $zero, $zero
.L8005A334:
/* 35734 8005A334 080168CD */  j         .L8005A334
/* 35738 8005A338 00000000 */   nop
.L8005A33C:
/* 3573C 8005A33C 3C04800A */  lui       $a0, %hi(gEffectGraphicsData)
/* 35740 8005A340 24844000 */  addiu     $a0, $a0, %lo(gEffectGraphicsData)
/* 35744 8005A344 8E430004 */  lw        $v1, 0x4($s2)
/* 35748 8005A348 24020001 */  addiu     $v0, $zero, 0x1
/* 3574C 8005A34C AE220000 */  sw        $v0, 0x0($s1)
/* 35750 8005A350 AE230004 */  sw        $v1, 0x4($s1)
.L8005A354:
/* 35754 8005A354 8C820000 */  lw        $v0, 0x0($a0)
/* 35758 8005A358 30420001 */  andi      $v0, $v0, 0x1
/* 3575C 8005A35C 50400006 */  beql      $v0, $zero, .L8005A378
/* 35760 8005A360 26100001 */   addiu    $s0, $s0, 0x1
/* 35764 8005A364 8C830004 */  lw        $v1, 0x4($a0)
/* 35768 8005A368 8E420004 */  lw        $v0, 0x4($s2)
/* 3576C 8005A36C 10620006 */  beq       $v1, $v0, .L8005A388
/* 35770 8005A370 2A02000F */   slti     $v0, $s0, 0xF
/* 35774 8005A374 26100001 */  addiu     $s0, $s0, 0x1
.L8005A378:
/* 35778 8005A378 2A02000F */  slti      $v0, $s0, 0xF
/* 3577C 8005A37C 1440FFF5 */  bnez      $v0, .L8005A354
/* 35780 8005A380 24840020 */   addiu    $a0, $a0, 0x20
/* 35784 8005A384 2A02000F */  slti      $v0, $s0, 0xF
.L8005A388:
/* 35788 8005A388 14400003 */  bnez      $v0, .L8005A398
/* 3578C 8005A38C 00000000 */   nop
.L8005A390:
/* 35790 8005A390 080168E4 */  j         .L8005A390
/* 35794 8005A394 00000000 */   nop
.L8005A398:
/* 35798 8005A398 8C820008 */  lw        $v0, 0x8($a0)
/* 3579C 8005A39C 14400016 */  bnez      $v0, .L8005A3F8
/* 357A0 8005A3A0 24420001 */   addiu    $v0, $v0, 0x1
/* 357A4 8005A3A4 8E42000C */  lw        $v0, 0xC($s2)
/* 357A8 8005A3A8 14400004 */  bnez      $v0, .L8005A3BC
/* 357AC 8005A3AC AC820010 */   sw       $v0, 0x10($a0)
/* 357B0 8005A3B0 3C028006 */  lui       $v0, %hi(stub_effect_delegate)
/* 357B4 8005A3B4 24429C80 */  addiu     $v0, $v0, %lo(stub_effect_delegate)
/* 357B8 8005A3B8 AC820014 */  sw        $v0, 0x14($a0)
.L8005A3BC:
/* 357BC 8005A3BC 8E420010 */  lw        $v0, 0x10($s2)
/* 357C0 8005A3C0 8C830018 */  lw        $v1, 0x18($a0)
/* 357C4 8005A3C4 14600004 */  bnez      $v1, .L8005A3D8
/* 357C8 8005A3C8 AC820014 */   sw       $v0, 0x14($a0)
/* 357CC 8005A3CC 3C028006 */  lui       $v0, %hi(stub_effect_delegate)
/* 357D0 8005A3D0 24429C80 */  addiu     $v0, $v0, %lo(stub_effect_delegate)
/* 357D4 8005A3D4 AC820018 */  sw        $v0, 0x18($a0)
.L8005A3D8:
/* 357D8 8005A3D8 8E420014 */  lw        $v0, 0x14($s2)
/* 357DC 8005A3DC 14400004 */  bnez      $v0, .L8005A3F0
/* 357E0 8005A3E0 AC820018 */   sw       $v0, 0x18($a0)
/* 357E4 8005A3E4 3C028006 */  lui       $v0, %hi(stub_effect_delegate)
/* 357E8 8005A3E8 24429C80 */  addiu     $v0, $v0, %lo(stub_effect_delegate)
/* 357EC 8005A3EC AC820018 */  sw        $v0, 0x18($a0)
.L8005A3F0:
/* 357F0 8005A3F0 8C820008 */  lw        $v0, 0x8($a0)
/* 357F4 8005A3F4 24420001 */  addiu     $v0, $v0, 0x1
.L8005A3F8:
/* 357F8 8005A3F8 AC820008 */  sw        $v0, 0x8($a0)
/* 357FC 8005A3FC AE240010 */  sw        $a0, 0x10($s1)
/* 35800 8005A400 8E420008 */  lw        $v0, 0x8($s2)
/* 35804 8005A404 10400003 */  beqz      $v0, .L8005A414
/* 35808 8005A408 00000000 */   nop
/* 3580C 8005A40C 0040F809 */  jalr      $v0
/* 35810 8005A410 0220202D */   daddu    $a0, $s1, $zero
.L8005A414:
/* 35814 8005A414 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 35818 8005A418 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 3581C 8005A41C 80420070 */  lb        $v0, 0x70($v0)
/* 35820 8005A420 10400005 */  beqz      $v0, .L8005A438
/* 35824 8005A424 0220102D */   daddu    $v0, $s1, $zero
/* 35828 8005A428 8E220000 */  lw        $v0, 0x0($s1)
/* 3582C 8005A42C 34420004 */  ori       $v0, $v0, 0x4
/* 35830 8005A430 AE220000 */  sw        $v0, 0x0($s1)
/* 35834 8005A434 0220102D */  daddu     $v0, $s1, $zero
.L8005A438:
/* 35838 8005A438 8FBF001C */  lw        $ra, 0x1C($sp)
/* 3583C 8005A43C 8FB20018 */  lw        $s2, 0x18($sp)
/* 35840 8005A440 8FB10014 */  lw        $s1, 0x14($sp)
/* 35844 8005A444 8FB00010 */  lw        $s0, 0x10($sp)
/* 35848 8005A448 03E00008 */  jr        $ra
/* 3584C 8005A44C 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

EffectInstance* create_effect_instance(EffectBlueprint* effectBp) {
    EffectInstance* newEffectInst;
    EffectGraphics* effectGraphics;
    s32 i;

    // Search for an unused instance
    for (i = 0; i < ARRAY_COUNT(gEffectInstances); i++) {
        if (gEffectInstances[i] == NULL) {
            break;
        }
    }

    ASSERT(i < ARRAY_COUNT(gEffectInstances));

    // Allocate space for the new instance
    gEffectInstances[i] = newEffectInst = general_heap_malloc(sizeof(*newEffectInst));
    ASSERT(newEffectInst != NULL);

    effectGraphics = &gEffectGraphicsData[0];
    newEffectInst->effectIndex = effectBp->effectID;
    newEffectInst->flags = FX_INSTANCE_FLAG_ENABLED;

    // Look for a loaded effect of the proper index
    for (i = 0; i < ARRAY_COUNT(gEffectGraphicsData); i++) {
        if ((effectGraphics->flags & FX_GRAPHICS_LOADED) && (effectGraphics->effectIndex == effectBp->effectID)) {
            break;
        }
        effectGraphics++;
    }

    ASSERT(i < ARRAY_COUNT(gEffectGraphicsData));

    // If this is the first new instance of the effect, initialize the function pointers
    if (effectGraphics->instanceCounter == 0) {
        effectGraphics->update = effectBp->update;
        if (effectGraphics->update == NULL) {
            effectGraphics->renderWorld = stub_effect_delegate;
        }

        effectGraphics->renderWorld = effectBp->renderWorld;
        // @bug? null check for renderUI instead of renderWorld
        if (effectGraphics->renderUI == NULL) {
            effectGraphics->renderUI = stub_effect_delegate;
        }

        effectGraphics->renderUI = effectBp->renderUI;
        if (effectGraphics->renderUI == NULL) {
            effectGraphics->renderUI = stub_effect_delegate;
        }
    }

    effectGraphics->instanceCounter++;
    newEffectInst->graphics = effectGraphics;

    if (effectBp->init != NULL) {
        effectBp->init(newEffectInst);
    }

    if (gGameStatusPtr->isBattle) {
        newEffectInst->flags |= FX_INSTANCE_FLAG_BATTLE;
    }
    return newEffectInst;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel spawn_flower_surface_effects
/* 18E38 8003DA38 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 18E3C 8003DA3C AFB00018 */  sw        $s0, 0x18($sp)
/* 18E40 8003DA40 24020002 */  addiu     $v0, $zero, 0x2
/* 18E44 8003DA44 AFBF0020 */  sw        $ra, 0x20($sp)
/* 18E48 8003DA48 AFB1001C */  sw        $s1, 0x1C($sp)
/* 18E4C 8003DA4C F7B80038 */  sdc1      $f24, 0x38($sp)
/* 18E50 8003DA50 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 18E54 8003DA54 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 18E58 8003DA58 14A20019 */  bne       $a1, $v0, .L8003DAC0
/* 18E5C 8003DA5C 0080802D */   daddu    $s0, $a0, $zero
/* 18E60 8003DA60 3C118007 */  lui       $s1, %hi(D_80077C1E)
/* 18E64 8003DA64 26317C1E */  addiu     $s1, $s1, %lo(D_80077C1E)
/* 18E68 8003DA68 86230000 */  lh        $v1, 0x0($s1)
/* 18E6C 8003DA6C 24020005 */  addiu     $v0, $zero, 0x5
/* 18E70 8003DA70 14620013 */  bne       $v1, $v0, .L8003DAC0
/* 18E74 8003DA74 00000000 */   nop
/* 18E78 8003DA78 C60C0038 */  lwc1      $f12, 0x38($s0)
/* 18E7C 8003DA7C 8E060040 */  lw        $a2, 0x40($s0)
/* 18E80 8003DA80 C600003C */  lwc1      $f0, 0x3C($s0)
/* 18E84 8003DA84 3C014160 */  lui       $at, (0x41600000 >> 16)
/* 18E88 8003DA88 44817000 */  mtc1      $at, $f14
/* 18E8C 8003DA8C 3C108007 */  lui       $s0, %hi(D_80077C18)
/* 18E90 8003DA90 26107C18 */  addiu     $s0, $s0, %lo(D_80077C18)
/* 18E94 8003DA94 8E070000 */  lw        $a3, 0x0($s0)
/* 18E98 8003DA98 0C01BEE4 */  jal       fx_flower_splash
/* 18E9C 8003DA9C 460E0380 */   add.s    $f14, $f0, $f14
/* 18EA0 8003DAA0 C6000000 */  lwc1      $f0, 0x0($s0)
/* 18EA4 8003DAA4 3C01420C */  lui       $at, (0x420C0000 >> 16)
/* 18EA8 8003DAA8 44816000 */  mtc1      $at, $f12
/* 18EAC 8003DAAC 0C00A6C9 */  jal       clamp_angle
/* 18EB0 8003DAB0 460C0300 */   add.s    $f12, $f0, $f12
/* 18EB4 8003DAB4 E6000000 */  swc1      $f0, 0x0($s0)
/* 18EB8 8003DAB8 0800F706 */  j         .L8003DC18
/* 18EBC 8003DABC A6200000 */   sh       $zero, 0x0($s1)
.L8003DAC0:
/* 18EC0 8003DAC0 3C038007 */  lui       $v1, %hi(D_80077C1E)
/* 18EC4 8003DAC4 24637C1E */  addiu     $v1, $v1, %lo(D_80077C1E)
/* 18EC8 8003DAC8 94620000 */  lhu       $v0, 0x0($v1)
/* 18ECC 8003DACC 24420001 */  addiu     $v0, $v0, 0x1
/* 18ED0 8003DAD0 A4620000 */  sh        $v0, 0x0($v1)
/* 18ED4 8003DAD4 00021400 */  sll       $v0, $v0, 16
/* 18ED8 8003DAD8 00021403 */  sra       $v0, $v0, 16
/* 18EDC 8003DADC 28420006 */  slti      $v0, $v0, 0x6
/* 18EE0 8003DAE0 14400002 */  bnez      $v0, .L8003DAEC
/* 18EE4 8003DAE4 24020005 */   addiu    $v0, $zero, 0x5
/* 18EE8 8003DAE8 A4620000 */  sh        $v0, 0x0($v1)
.L8003DAEC:
/* 18EEC 8003DAEC 3C048007 */  lui       $a0, %hi(D_80077C1C)
/* 18EF0 8003DAF0 24847C1C */  addiu     $a0, $a0, %lo(D_80077C1C)
/* 18EF4 8003DAF4 94820000 */  lhu       $v0, 0x0($a0)
/* 18EF8 8003DAF8 24430001 */  addiu     $v1, $v0, 0x1
/* 18EFC 8003DAFC 00021400 */  sll       $v0, $v0, 16
/* 18F00 8003DB00 18400045 */  blez      $v0, .L8003DC18
/* 18F04 8003DB04 A4830000 */   sh       $v1, 0x0($a0)
/* 18F08 8003DB08 C60C000C */  lwc1      $f12, 0xC($s0)
/* 18F0C 8003DB0C A4800000 */  sh        $zero, 0x0($a0)
/* 18F10 8003DB10 0C00A6C9 */  jal       clamp_angle
/* 18F14 8003DB14 46006307 */   neg.s    $f12, $f12
/* 18F18 8003DB18 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 18F1C 8003DB1C 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 18F20 8003DB20 44811000 */  mtc1      $at, $f2
/* 18F24 8003DB24 00000000 */  nop
/* 18F28 8003DB28 46020502 */  mul.s     $f20, $f0, $f2
/* 18F2C 8003DB2C 00000000 */  nop
/* 18F30 8003DB30 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 18F34 8003DB34 44810000 */  mtc1      $at, $f0
/* 18F38 8003DB38 00000000 */  nop
/* 18F3C 8003DB3C 4600A503 */  div.s     $f20, $f20, $f0
/* 18F40 8003DB40 0C00A85B */  jal       sin_rad
/* 18F44 8003DB44 4600A306 */   mov.s    $f12, $f20
/* 18F48 8003DB48 4600A306 */  mov.s     $f12, $f20
/* 18F4C 8003DB4C 0C00A874 */  jal       cos_rad
/* 18F50 8003DB50 46000506 */   mov.s    $f20, $f0
/* 18F54 8003DB54 860200A6 */  lh        $v0, 0xA6($s0)
/* 18F58 8003DB58 44821000 */  mtc1      $v0, $f2
/* 18F5C 8003DB5C 00000000 */  nop
/* 18F60 8003DB60 468010A0 */  cvt.s.w   $f2, $f2
/* 18F64 8003DB64 46141502 */  mul.s     $f20, $f2, $f20
/* 18F68 8003DB68 00000000 */  nop
/* 18F6C 8003DB6C 46001082 */  mul.s     $f2, $f2, $f0
/* 18F70 8003DB70 00000000 */  nop
/* 18F74 8003DB74 3C01BECC */  lui       $at, (0xBECCCCCD >> 16)
/* 18F78 8003DB78 3421CCCD */  ori       $at, $at, (0xBECCCCCD & 0xFFFF)
/* 18F7C 8003DB7C 44810000 */  mtc1      $at, $f0
/* 18F80 8003DB80 00000000 */  nop
/* 18F84 8003DB84 4600A502 */  mul.s     $f20, $f20, $f0
/* 18F88 8003DB88 00000000 */  nop
/* 18F8C 8003DB8C 46001082 */  mul.s     $f2, $f2, $f0
/* 18F90 8003DB90 00000000 */  nop
/* 18F94 8003DB94 C6000038 */  lwc1      $f0, 0x38($s0)
/* 18F98 8003DB98 46140600 */  add.s     $f24, $f0, $f20
/* 18F9C 8003DB9C C6000040 */  lwc1      $f0, 0x40($s0)
/* 18FA0 8003DBA0 C604003C */  lwc1      $f4, 0x3C($s0)
/* 18FA4 8003DBA4 46020580 */  add.s     $f22, $f0, $f2
/* 18FA8 8003DBA8 3C014178 */  lui       $at, (0x41780000 >> 16)
/* 18FAC 8003DBAC 44810000 */  mtc1      $at, $f0
/* 18FB0 8003DBB0 2404000A */  addiu     $a0, $zero, 0xA
/* 18FB4 8003DBB4 0C00A67F */  jal       rand_int
/* 18FB8 8003DBB8 46002500 */   add.s    $f20, $f4, $f0
/* 18FBC 8003DBBC 24040001 */  addiu     $a0, $zero, 0x1
/* 18FC0 8003DBC0 44821000 */  mtc1      $v0, $f2
/* 18FC4 8003DBC4 00000000 */  nop
/* 18FC8 8003DBC8 468010A0 */  cvt.s.w   $f2, $f2
/* 18FCC 8003DBCC C600000C */  lwc1      $f0, 0xC($s0)
/* 18FD0 8003DBD0 3C108007 */  lui       $s0, %hi(D_80077C20)
/* 18FD4 8003DBD4 26107C20 */  addiu     $s0, $s0, %lo(D_80077C20)
/* 18FD8 8003DBD8 4405C000 */  mfc1      $a1, $f24
/* 18FDC 8003DBDC 4407B000 */  mfc1      $a3, $f22
/* 18FE0 8003DBE0 46000007 */  neg.s     $f0, $f0
/* 18FE4 8003DBE4 46020000 */  add.s     $f0, $f0, $f2
/* 18FE8 8003DBE8 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 18FEC 8003DBEC 44811000 */  mtc1      $at, $f2
/* 18FF0 8003DBF0 4406A000 */  mfc1      $a2, $f20
/* 18FF4 8003DBF4 46020001 */  sub.s     $f0, $f0, $f2
/* 18FF8 8003DBF8 C6020000 */  lwc1      $f2, 0x0($s0)
/* 18FFC 8003DBFC 468010A0 */  cvt.s.w   $f2, $f2
/* 19000 8003DC00 E7A20014 */  swc1      $f2, 0x14($sp)
/* 19004 8003DC04 0C01BEFC */  jal       fx_flower_trail
/* 19008 8003DC08 E7A00010 */   swc1     $f0, 0x10($sp)
/* 1900C 8003DC0C 8E020000 */  lw        $v0, 0x0($s0)
/* 19010 8003DC10 2C420001 */  sltiu     $v0, $v0, 0x1
/* 19014 8003DC14 AE020000 */  sw        $v0, 0x0($s0)
.L8003DC18:
/* 19018 8003DC18 8FBF0020 */  lw        $ra, 0x20($sp)
/* 1901C 8003DC1C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 19020 8003DC20 8FB00018 */  lw        $s0, 0x18($sp)
/* 19024 8003DC24 D7B80038 */  ldc1      $f24, 0x38($sp)
/* 19028 8003DC28 D7B60030 */  ldc1      $f22, 0x30($sp)
/* 1902C 8003DC2C D7B40028 */  ldc1      $f20, 0x28($sp)
/* 19030 8003DC30 03E00008 */  jr        $ra
/* 19034 8003DC34 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void spawn_flower_surface_effects(Npc* npc, SurfaceInteractMode mode) {
    f32 theta;
    f32 sinTheta;
    f32 cosTheta;
    f32 x, y, z;

    if (mode == SURFACE_INTERACT_LAND && D_80077C1E == 5) {
        x = npc->pos.x;
        y = npc->pos.y + + 14.0f;
        z = npc->pos.z;

        fx_flower_splash(x, y, z, D_80077C18);
        D_80077C18 = clamp_angle(D_80077C18 + 35.0f);
        D_80077C1E = 0;
        return;
    }

    D_80077C1E++;
    if (D_80077C1E > 5) {
        D_80077C1E = 5;
    }

    if (D_80077C1C++ > 0) {
        D_80077C1C = 0;
        theta = DEG_TO_RAD(clamp_angle(-npc->yaw));
        sinTheta = sin_rad(theta);
        cosTheta = cos_rad(theta);

        x = npc->pos.x + (npc->collisionDiameter * sinTheta * -0.4f);
        z = npc->pos.z + (npc->collisionDiameter * cosTheta * -0.4f);
        y = npc->pos.y + 15.5f;

        fx_flower_trail(1, x, y, z, -npc->yaw + rand_int(10) - 5.0f, D_80077C20);
        D_80077C20 = D_80077C20 == 0;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel floating_flower_update
/* 330054 E001A224 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 330058 E001A228 AFBF0010 */  sw        $ra, 0x10($sp)
/* 33005C E001A22C 8C85000C */  lw        $a1, 0xC($a0)
/* 330060 E001A230 8CA20034 */  lw        $v0, 0x34($a1)
/* 330064 E001A234 8CA60000 */  lw        $a2, 0x0($a1)
/* 330068 E001A238 28420096 */  slti      $v0, $v0, 0x96
/* 33006C E001A23C 10400039 */  beqz      $v0, .LE001A324
/* 330070 E001A240 00000000 */   nop
/* 330074 E001A244 C4A00010 */  lwc1      $f0, 0x10($a1)
/* 330078 E001A248 3C01E002 */  lui       $at, (0xE0020000 >> 16)
/* 33007C E001A24C D422A620 */  ldc1      $f2, -0x59E0($at)
/* 330080 E001A250 C4A6000C */  lwc1      $f6, 0xC($a1)
/* 330084 E001A254 46000021 */  cvt.d.s   $f0, $f0
/* 330088 E001A258 46220001 */  sub.d     $f0, $f0, $f2
/* 33008C E001A25C C4A20018 */  lwc1      $f2, 0x18($a1)
/* 330090 E001A260 C4A40024 */  lwc1      $f4, 0x24($a1)
/* 330094 E001A264 46023180 */  add.s     $f6, $f6, $f2
/* 330098 E001A268 C4A2002C */  lwc1      $f2, 0x2C($a1)
/* 33009C E001A26C 46022100 */  add.s     $f4, $f4, $f2
/* 3300A0 E001A270 C4A20004 */  lwc1      $f2, 0x4($a1)
/* 3300A4 E001A274 46200020 */  cvt.s.d   $f0, $f0
/* 3300A8 E001A278 E4A00010 */  swc1      $f0, 0x10($a1)
/* 3300AC E001A27C 46001080 */  add.s     $f2, $f2, $f0
/* 3300B0 E001A280 E4A6000C */  swc1      $f6, 0xC($a1)
/* 3300B4 E001A284 E4A40024 */  swc1      $f4, 0x24($a1)
/* 3300B8 E001A288 14C00018 */  bnez      $a2, .LE001A2EC
/* 3300BC E001A28C E4A20004 */   swc1     $f2, 0x4($a1)
/* 3300C0 E001A290 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3300C4 E001A294 44811000 */  mtc1      $at, $f2
/* 3300C8 E001A298 00000000 */  nop
/* 3300CC E001A29C 4602203C */  c.lt.s    $f4, $f2
/* 3300D0 E001A2A0 00000000 */  nop
/* 3300D4 E001A2A4 45000005 */  bc1f      .LE001A2BC
/* 3300D8 E001A2A8 00000000 */   nop
/* 3300DC E001A2AC C4A0002C */  lwc1      $f0, 0x2C($a1)
/* 3300E0 E001A2B0 E4A20024 */  swc1      $f2, 0x24($a1)
/* 3300E4 E001A2B4 46000007 */  neg.s     $f0, $f0
/* 3300E8 E001A2B8 E4A0002C */  swc1      $f0, 0x2C($a1)
.LE001A2BC:
/* 3300EC E001A2BC C4A00024 */  lwc1      $f0, 0x24($a1)
/* 3300F0 E001A2C0 3C014234 */  lui       $at, (0x42340000 >> 16)
/* 3300F4 E001A2C4 44811000 */  mtc1      $at, $f2
/* 3300F8 E001A2C8 00000000 */  nop
/* 3300FC E001A2CC 4600103C */  c.lt.s    $f2, $f0
/* 330100 E001A2D0 00000000 */  nop
/* 330104 E001A2D4 45000005 */  bc1f      .LE001A2EC
/* 330108 E001A2D8 00000000 */   nop
/* 33010C E001A2DC C4A0002C */  lwc1      $f0, 0x2C($a1)
/* 330110 E001A2E0 E4A20024 */  swc1      $f2, 0x24($a1)
/* 330114 E001A2E4 46000007 */  neg.s     $f0, $f0
/* 330118 E001A2E8 E4A0002C */  swc1      $f0, 0x2C($a1)
.LE001A2EC:
/* 33011C E001A2EC C4A00028 */  lwc1      $f0, 0x28($a1)
/* 330120 E001A2F0 C4A20030 */  lwc1      $f2, 0x30($a1)
/* 330124 E001A2F4 46020000 */  add.s     $f0, $f0, $f2
/* 330128 E001A2F8 14C00006 */  bnez      $a2, .LE001A314
/* 33012C E001A2FC E4A00028 */   swc1     $f0, 0x28($a1)
/* 330130 E001A300 3C013FB3 */  lui       $at, (0x3FB33333 >> 16)
/* 330134 E001A304 34213333 */  ori       $at, $at, (0x3FB33333 & 0xFFFF)
/* 330138 E001A308 44810000 */  mtc1      $at, $f0
/* 33013C E001A30C 080068DC */  j         .LE001A370
/* 330140 E001A310 E4A00014 */   swc1     $f0, 0x14($a1)
.LE001A314:
/* 330144 E001A314 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 330148 E001A318 44810000 */  mtc1      $at, $f0
/* 33014C E001A31C 080068DC */  j         .LE001A370
/* 330150 E001A320 E4A00014 */   swc1     $f0, 0x14($a1)
.LE001A324:
/* 330154 E001A324 C4A00020 */  lwc1      $f0, 0x20($a1)
/* 330158 E001A328 3C01E002 */  lui       $at, (0xE0020000 >> 16)
/* 33015C E001A32C D422A628 */  ldc1      $f2, -0x59D8($at)
/* 330160 E001A330 46000021 */  cvt.d.s   $f0, $f0
/* 330164 E001A334 46220000 */  add.d     $f0, $f0, $f2
/* 330168 E001A338 C4A4001C */  lwc1      $f4, 0x1C($a1)
/* 33016C E001A33C 46200020 */  cvt.s.d   $f0, $f0
/* 330170 E001A340 46002100 */  add.s     $f4, $f4, $f0
/* 330174 E001A344 C4A20014 */  lwc1      $f2, 0x14($a1)
/* 330178 E001A348 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 33017C E001A34C 44813000 */  mtc1      $at, $f6
/* 330180 E001A350 46041080 */  add.s     $f2, $f2, $f4
/* 330184 E001A354 E4A00020 */  swc1      $f0, 0x20($a1)
/* 330188 E001A358 E4A4001C */  swc1      $f4, 0x1C($a1)
/* 33018C E001A35C 4602303C */  c.lt.s    $f6, $f2
/* 330190 E001A360 00000000 */  nop
/* 330194 E001A364 45000002 */  bc1f      .LE001A370
/* 330198 E001A368 E4A20014 */   swc1     $f2, 0x14($a1)
/* 33019C E001A36C E4A60014 */  swc1      $f6, 0x14($a1)
.LE001A370:
/* 3301A0 E001A370 24020001 */  addiu     $v0, $zero, 0x1
/* 3301A4 E001A374 14C20010 */  bne       $a2, $v0, .LE001A3B8
/* 3301A8 E001A378 00000000 */   nop
/* 3301AC E001A37C 8CA20040 */  lw        $v0, 0x40($a1)
/* 3301B0 E001A380 8CA3003C */  lw        $v1, 0x3C($a1)
/* 3301B4 E001A384 00431821 */  addu      $v1, $v0, $v1
/* 3301B8 E001A388 28620014 */  slti      $v0, $v1, 0x14
/* 3301BC E001A38C 14400006 */  bnez      $v0, .LE001A3A8
/* 3301C0 E001A390 ACA30040 */   sw       $v1, 0x40($a1)
/* 3301C4 E001A394 24020014 */  addiu     $v0, $zero, 0x14
/* 3301C8 E001A398 ACA20040 */  sw        $v0, 0x40($a1)
/* 3301CC E001A39C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 3301D0 E001A3A0 080068EE */  j         .LE001A3B8
/* 3301D4 E001A3A4 ACA2003C */   sw       $v0, 0x3C($a1)
.LE001A3A8:
/* 3301D8 E001A3A8 1C600003 */  bgtz      $v1, .LE001A3B8
/* 3301DC E001A3AC 00000000 */   nop
/* 3301E0 E001A3B0 ACA00040 */  sw        $zero, 0x40($a1)
/* 3301E4 E001A3B4 ACA6003C */  sw        $a2, 0x3C($a1)
.LE001A3B8:
/* 3301E8 E001A3B8 C4A00008 */  lwc1      $f0, 0x8($a1)
/* 3301EC E001A3BC 8CA20034 */  lw        $v0, 0x34($a1)
/* 3301F0 E001A3C0 C4A20014 */  lwc1      $f2, 0x14($a1)
/* 3301F4 E001A3C4 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3301F8 E001A3C8 46020000 */  add.s     $f0, $f0, $f2
/* 3301FC E001A3CC ACA20034 */  sw        $v0, 0x34($a1)
/* 330200 E001A3D0 8CA20038 */  lw        $v0, 0x38($a1)
/* 330204 E001A3D4 8CA30034 */  lw        $v1, 0x34($a1)
/* 330208 E001A3D8 24420001 */  addiu     $v0, $v0, 0x1
/* 33020C E001A3DC ACA20038 */  sw        $v0, 0x38($a1)
/* 330210 E001A3E0 04610003 */  bgez      $v1, .LE001A3F0
/* 330214 E001A3E4 E4A00008 */   swc1     $f0, 0x8($a1)
/* 330218 E001A3E8 0C080128 */  jal       shim_remove_effect
/* 33021C E001A3EC 00000000 */   nop
.LE001A3F0:
/* 330220 E001A3F0 8FBF0010 */  lw        $ra, 0x10($sp)
/* 330224 E001A3F4 03E00008 */  jr        $ra
/* 330228 E001A3F8 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void floating_flower_update(EffectInstance* effect) {
    FloatingFlowerFXData* data = effect->data.floatingFlower;
    s32 type = data->type;

    if (data->timeLeft < 150) {
        data->vel.x -= 0.001;
        data->pos.x += data->vel.x;
        data->pos.z += data->vel.z;
        data->rot.x += data->angularVel.x;
        if (type == 0) {
            if (data->rot.x < 10.0f) {
                data->rot.x = 10.0f;
                data->angularVel.x = -data->angularVel.x;
            }
            if (data->rot.x > 45.0f) {
                data->rot.x = 45.0f;
                data->angularVel.x = -data->angularVel.x;
            }
        }
        data->rot.y += data->angularVel.y;
        if (type == 0) {
            data->vel.y = 1.4f;
        } else {
            data->vel.y = 1.0f;
        }
    } else {
        data->jerkY += 0.0007;
        data->accelY += data->jerkY;
        data->vel.y += data->accelY;
        if (data->vel.y > 1.0f) {
            data->vel.y = 1.0f;
        }
    }

    if (type == 1) {
        data->unk_40 += data->unk_3C;
        if (data->unk_40 >= 20) {
            data->unk_40 = 20;
            data->unk_3C = -1;
        } else if (data->unk_40 <= 0) {
            data->unk_40 = 0;
            data->unk_3C = type;
        }
    }
    data->pos.y += data->vel.y;
    data->timeLeft--;
    data->lifetime++;
    if (data->timeLeft < 0) {
        shim_remove_effect(effect);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel DropStarPoints
/* 1AB184 8027C8A4 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 1AB188 8027C8A8 AFB00020 */  sw        $s0, 0x20($sp)
/* 1AB18C 8027C8AC 0080802D */  daddu     $s0, $a0, $zero
/* 1AB190 8027C8B0 AFBF0034 */  sw        $ra, 0x34($sp)
/* 1AB194 8027C8B4 AFB40030 */  sw        $s4, 0x30($sp)
/* 1AB198 8027C8B8 AFB3002C */  sw        $s3, 0x2C($sp)
/* 1AB19C 8027C8BC AFB20028 */  sw        $s2, 0x28($sp)
/* 1AB1A0 8027C8C0 AFB10024 */  sw        $s1, 0x24($sp)
/* 1AB1A4 8027C8C4 8E02000C */  lw        $v0, 0xC($s0)
/* 1AB1A8 8027C8C8 0C0B1EAF */  jal       evt_get_variable
/* 1AB1AC 8027C8CC 8C450000 */   lw       $a1, 0x0($v0)
/* 1AB1B0 8027C8D0 0040202D */  daddu     $a0, $v0, $zero
/* 1AB1B4 8027C8D4 3C14800E */  lui       $s4, %hi(gBattleStatus)
/* 1AB1B8 8027C8D8 2694C070 */  addiu     $s4, $s4, %lo(gBattleStatus)
/* 1AB1BC 8027C8DC 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 1AB1C0 8027C8E0 14820002 */  bne       $a0, $v0, .L8027C8EC
/* 1AB1C4 8027C8E4 00000000 */   nop
/* 1AB1C8 8027C8E8 8E040148 */  lw        $a0, 0x148($s0)
.L8027C8EC:
/* 1AB1CC 8027C8EC 0C09A75B */  jal       get_actor
/* 1AB1D0 8027C8F0 00000000 */   nop
/* 1AB1D4 8027C8F4 0040882D */  daddu     $s1, $v0, $zero
/* 1AB1D8 8027C8F8 8E220008 */  lw        $v0, 0x8($s1)
/* 1AB1DC 8027C8FC 90420006 */  lbu       $v0, 0x6($v0)
/* 1AB1E0 8027C900 44800000 */  mtc1      $zero, $f0
/* 1AB1E4 8027C904 44823000 */  mtc1      $v0, $f6
/* 1AB1E8 8027C908 00000000 */  nop
/* 1AB1EC 8027C90C 468031A0 */  cvt.s.w   $f6, $f6
/* 1AB1F0 8027C910 46003032 */  c.eq.s    $f6, $f0
/* 1AB1F4 8027C914 00000000 */  nop
/* 1AB1F8 8027C918 45000003 */  bc1f      .L8027C928
/* 1AB1FC 8027C91C 00000000 */   nop
/* 1AB200 8027C920 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 1AB204 8027C924 44813000 */  mtc1      $at, $f6
.L8027C928:
/* 1AB208 8027C928 3C028011 */  lui       $v0, %hi(gPlayerData)
/* 1AB20C 8027C92C 2442F290 */  addiu     $v0, $v0, %lo(gPlayerData)
/* 1AB210 8027C930 80430009 */  lb        $v1, 0x9($v0)
/* 1AB214 8027C934 44832000 */  mtc1      $v1, $f4
/* 1AB218 8027C938 00000000 */  nop
/* 1AB21C 8027C93C 46802120 */  cvt.s.w   $f4, $f4
/* 1AB220 8027C940 46002032 */  c.eq.s    $f4, $f0
/* 1AB224 8027C944 00000000 */  nop
/* 1AB228 8027C948 45000004 */  bc1f      .L8027C95C
/* 1AB22C 8027C94C 00000000 */   nop
/* 1AB230 8027C950 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 1AB234 8027C954 44812000 */  mtc1      $at, $f4
/* 1AB238 8027C958 00000000 */  nop
.L8027C95C:
/* 1AB23C 8027C95C 4604303C */  c.lt.s    $f6, $f4
/* 1AB240 8027C960 00000000 */  nop
/* 1AB244 8027C964 45010017 */  bc1t      .L8027C9C4
/* 1AB248 8027C968 46000086 */   mov.s    $f2, $f0
/* 1AB24C 8027C96C 46043081 */  sub.s     $f2, $f6, $f4
/* 1AB250 8027C970 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 1AB254 8027C974 44810000 */  mtc1      $at, $f0
/* 1AB258 8027C978 00000000 */  nop
/* 1AB25C 8027C97C 46001082 */  mul.s     $f2, $f2, $f0
/* 1AB260 8027C980 00000000 */  nop
/* 1AB264 8027C984 8282008E */  lb        $v0, 0x8E($s4)
/* 1AB268 8027C988 00021080 */  sll       $v0, $v0, 2
/* 1AB26C 8027C98C 3C018029 */  lui       $at, %hi(D_802946E0)
/* 1AB270 8027C990 00220821 */  addu      $at, $at, $v0
/* 1AB274 8027C994 C42046E0 */  lwc1      $f0, %lo(D_802946E0)($at)
/* 1AB278 8027C998 46800020 */  cvt.s.w   $f0, $f0
/* 1AB27C 8027C99C 46001082 */  mul.s     $f2, $f2, $f0
/* 1AB280 8027C9A0 00000000 */  nop
/* 1AB284 8027C9A4 3C014248 */  lui       $at, (0x42480000 >> 16)
/* 1AB288 8027C9A8 44810000 */  mtc1      $at, $f0
/* 1AB28C 8027C9AC 00000000 */  nop
/* 1AB290 8027C9B0 46001000 */  add.s     $f0, $f2, $f0
/* 1AB294 8027C9B4 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 1AB298 8027C9B8 44811000 */  mtc1      $at, $f2
/* 1AB29C 8027C9BC 00000000 */  nop
/* 1AB2A0 8027C9C0 46020083 */  div.s     $f2, $f0, $f2
.L8027C9C4:
/* 1AB2A4 8027C9C4 4600120D */  trunc.w.s $f8, $f2
/* 1AB2A8 8027C9C8 44134000 */  mfc1      $s3, $f8
/* 1AB2AC 8027C9CC 2862001B */  slti      $v0, $v1, 0x1B
/* 1AB2B0 8027C9D0 10400019 */  beqz      $v0, .L8027CA38
/* 1AB2B4 8027C9D4 00000000 */   nop
/* 1AB2B8 8027C9D8 8E220000 */  lw        $v0, 0x0($s1)
/* 1AB2BC 8027C9DC 30420800 */  andi      $v0, $v0, 0x800
/* 1AB2C0 8027C9E0 10400002 */  beqz      $v0, .L8027C9EC
/* 1AB2C4 8027C9E4 24120017 */   addiu    $s2, $zero, 0x17
/* 1AB2C8 8027C9E8 24120019 */  addiu     $s2, $zero, 0x19
.L8027C9EC:
/* 1AB2CC 8027C9EC 1A60000D */  blez      $s3, .L8027CA24
/* 1AB2D0 8027C9F0 0000802D */   daddu    $s0, $zero, $zero
/* 1AB2D4 8027C9F4 24040159 */  addiu     $a0, $zero, 0x159
.L8027C9F8:
/* 1AB2D8 8027C9F8 AFB20010 */  sw        $s2, 0x10($sp)
/* 1AB2DC 8027C9FC AFB00014 */  sw        $s0, 0x14($sp)
/* 1AB2E0 8027CA00 AFA00018 */  sw        $zero, 0x18($sp)
/* 1AB2E4 8027CA04 8E250144 */  lw        $a1, 0x144($s1)
/* 1AB2E8 8027CA08 8E260148 */  lw        $a2, 0x148($s1)
/* 1AB2EC 8027CA0C 8E27014C */  lw        $a3, 0x14C($s1)
/* 1AB2F0 8027CA10 0C04C6B2 */  jal       make_item_entity_delayed
/* 1AB2F4 8027CA14 26100001 */   addiu    $s0, $s0, 0x1
/* 1AB2F8 8027CA18 0213102A */  slt       $v0, $s0, $s3
/* 1AB2FC 8027CA1C 1440FFF6 */  bnez      $v0, .L8027C9F8
/* 1AB300 8027CA20 24040159 */   addiu    $a0, $zero, 0x159
.L8027CA24:
/* 1AB304 8027CA24 92820079 */  lbu       $v0, 0x79($s4)
/* 1AB308 8027CA28 24030028 */  addiu     $v1, $zero, 0x28
/* 1AB30C 8027CA2C A283007A */  sb        $v1, 0x7A($s4)
/* 1AB310 8027CA30 00531021 */  addu      $v0, $v0, $s3
/* 1AB314 8027CA34 A2820079 */  sb        $v0, 0x79($s4)
.L8027CA38:
/* 1AB318 8027CA38 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1AB31C 8027CA3C 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1AB320 8027CA40 8C640000 */  lw        $a0, 0x0($v1)
/* 1AB324 8027CA44 3C050100 */  lui       $a1, (0x1000000 >> 16)
/* 1AB328 8027CA48 00852025 */  or        $a0, $a0, $a1
/* 1AB32C 8027CA4C AC640000 */  sw        $a0, 0x0($v1)
/* 1AB330 8027CA50 8FBF0034 */  lw        $ra, 0x34($sp)
/* 1AB334 8027CA54 8FB40030 */  lw        $s4, 0x30($sp)
/* 1AB338 8027CA58 8FB3002C */  lw        $s3, 0x2C($sp)
/* 1AB33C 8027CA5C 8FB20028 */  lw        $s2, 0x28($sp)
/* 1AB340 8027CA60 8FB10024 */  lw        $s1, 0x24($sp)
/* 1AB344 8027CA64 8FB00020 */  lw        $s0, 0x20($sp)
/* 1AB348 8027CA68 24020002 */  addiu     $v0, $zero, 0x2
/* 1AB34C 8027CA6C 03E00008 */  jr        $ra
/* 1AB350 8027CA70 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

ApiStatus DropStarPoints(Evt* script, s32 isInitialCall) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    Bytecode* args = script->ptrReadPos;
    Actor* dropper;
    f32 playerLevel;
    f32 enemyLevel;
    s32 actorID;
    f32 ntd;
    s32 numToDrop;

    actorID = evt_get_variable(script, *args++);
    if (actorID == ACTOR_SELF) {
        actorID = script->owner1.enemyID;
    }
    dropper = get_actor(actorID);

    enemyLevel = dropper->actorBlueprint->level;
    if (dropper->actorBlueprint->level == 0.0f) {
        enemyLevel = 1.0f;
    }

    playerLevel = playerData->level;
    if (playerLevel == 0.0f) {
        playerLevel = 1.0f;
    }

    ntd = 0.0f;
    if (!(enemyLevel < playerLevel)) {
        ntd = ((enemyLevel - playerLevel) * 0.5f) * D_802946E0[battleStatus->initialEnemyCount];
        ntd = (ntd + 50.0f) / 100.0f;
    }
    numToDrop = ntd;

    if (playerData->level < 27) {
        s32 spawnMode;
        s32 i;

        if (dropper->flags & ACTOR_FLAG_UPSIDE_DOWN) {
            spawnMode = ITEM_SPAWN_MODE_TOSS_FADE3;
        } else {
            spawnMode = ITEM_SPAWN_MODE_TOSS_FADE1;
        }

        for (i = 0; i < numToDrop; i++) {
            make_item_entity_delayed(ITEM_STAR_POINT,
                dropper->currentPos.x, dropper->currentPos.y, dropper->currentPos.z, spawnMode, i, 0);
        }

        battleStatus->incrementStarPointDelay = 40;
        battleStatus->pendingStarPoints += numToDrop;
    }

    gBattleStatus.flags1 |= BS_FLAGS1_STAR_POINTS_DROPPED;
    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel is_debug_print
/* 1174 80025D74 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 1178 80025D78 AFB30024 */  sw        $s3, 0x24($sp)
/* 117C 80025D7C 00A0982D */  daddu     $s3, $a1, $zero
/* 1180 80025D80 AFB40028 */  sw        $s4, 0x28($sp)
/* 1184 80025D84 00C0A02D */  daddu     $s4, $a2, $zero
/* 1188 80025D88 3C05B3FF */  lui       $a1, (0xB3FF0000 >> 16)
/* 118C 80025D8C AFB1001C */  sw        $s1, 0x1C($sp)
/* 1190 80025D90 3C11800A */  lui       $s1, %hi(nuPiCartHandle)
/* 1194 80025D94 2631A638 */  addiu     $s1, $s1, %lo(nuPiCartHandle)
/* 1198 80025D98 AFB00018 */  sw        $s0, 0x18($sp)
/* 119C 80025D9C 27B00010 */  addiu     $s0, $sp, 0x10
/* 11A0 80025DA0 AFBF003C */  sw        $ra, 0x3C($sp)
/* 11A4 80025DA4 AFBE0038 */  sw        $fp, 0x38($sp)
/* 11A8 80025DA8 AFB70034 */  sw        $s7, 0x34($sp)
/* 11AC 80025DAC AFB60030 */  sw        $s6, 0x30($sp)
/* 11B0 80025DB0 AFB5002C */  sw        $s5, 0x2C($sp)
/* 11B4 80025DB4 AFB20020 */  sw        $s2, 0x20($sp)
/* 11B8 80025DB8 8E240000 */  lw        $a0, 0x0($s1)
/* 11BC 80025DBC 0C018370 */  jal       osEPiReadIo
/* 11C0 80025DC0 0200302D */   daddu    $a2, $s0, $zero
/* 11C4 80025DC4 3C034953 */  lui       $v1, (0x49533634 >> 16)
/* 11C8 80025DC8 8FA20010 */  lw        $v0, 0x10($sp)
/* 11CC 80025DCC 34633634 */  ori       $v1, $v1, (0x49533634 & 0xFFFF)
/* 11D0 80025DD0 14430050 */  bne       $v0, $v1, .L80025F14
/* 11D4 80025DD4 24020001 */   addiu    $v0, $zero, 0x1
/* 11D8 80025DD8 3C05B3FF */  lui       $a1, (0xB3FF0004 >> 16)
/* 11DC 80025DDC 34A50004 */  ori       $a1, $a1, (0xB3FF0004 & 0xFFFF)
/* 11E0 80025DE0 8E240000 */  lw        $a0, 0x0($s1)
/* 11E4 80025DE4 0C018370 */  jal       osEPiReadIo
/* 11E8 80025DE8 0200302D */   daddu    $a2, $s0, $zero
/* 11EC 80025DEC 3C05B3FF */  lui       $a1, (0xB3FF0014 >> 16)
/* 11F0 80025DF0 0200302D */  daddu     $a2, $s0, $zero
/* 11F4 80025DF4 8E240000 */  lw        $a0, 0x0($s1)
/* 11F8 80025DF8 8FB00010 */  lw        $s0, 0x10($sp)
/* 11FC 80025DFC 0C018370 */  jal       osEPiReadIo
/* 1200 80025E00 34A50014 */   ori      $a1, $a1, (0xB3FF0014 & 0xFFFF)
/* 1204 80025E04 8FB20010 */  lw        $s2, 0x10($sp)
/* 1208 80025E08 3402FFDF */  ori       $v0, $zero, 0xFFDF
/* 120C 80025E0C 02541821 */  addu      $v1, $s2, $s4
/* 1210 80025E10 0043102A */  slt       $v0, $v0, $v1
/* 1214 80025E14 1040000B */  beqz      $v0, .L80025E44
/* 1218 80025E18 3C02FFFF */   lui      $v0, (0xFFFF0020 >> 16)
/* 121C 80025E1C 34420020 */  ori       $v0, $v0, (0xFFFF0020 & 0xFFFF)
/* 1220 80025E20 00621821 */  addu      $v1, $v1, $v0
/* 1224 80025E24 0203102A */  slt       $v0, $s0, $v1
/* 1228 80025E28 1440003A */  bnez      $v0, .L80025F14
/* 122C 80025E2C 24020001 */   addiu    $v0, $zero, 0x1
/* 1230 80025E30 0250102A */  slt       $v0, $s2, $s0
/* 1234 80025E34 10400008 */  beqz      $v0, .L80025E58
/* 1238 80025E38 24020001 */   addiu    $v0, $zero, 0x1
/* 123C 80025E3C 080097C5 */  j         .L80025F14
/* 1240 80025E40 00000000 */   nop
.L80025E44:
/* 1244 80025E44 0250102A */  slt       $v0, $s2, $s0
/* 1248 80025E48 10400003 */  beqz      $v0, .L80025E58
/* 124C 80025E4C 0203102A */   slt      $v0, $s0, $v1
/* 1250 80025E50 14400030 */  bnez      $v0, .L80025F14
/* 1254 80025E54 24020001 */   addiu    $v0, $zero, 0x1
.L80025E58:
/* 1258 80025E58 12800027 */  beqz      $s4, .L80025EF8
/* 125C 80025E5C 3C1E0FFF */   lui      $fp, (0xFFFFFFC >> 16)
/* 1260 80025E60 37DEFFFC */  ori       $fp, $fp, (0xFFFFFFC & 0xFFFF)
/* 1264 80025E64 3C17B3FF */  lui       $s7, (0xB3FF0020 >> 16)
/* 1268 80025E68 36F70020 */  ori       $s7, $s7, (0xB3FF0020 & 0xFFFF)
/* 126C 80025E6C 3C15800A */  lui       $s5, %hi(nuPiCartHandle)
/* 1270 80025E70 26B5A638 */  addiu     $s5, $s5, %lo(nuPiCartHandle)
/* 1274 80025E74 3C16FFFF */  lui       $s6, (0xFFFF0020 >> 16)
/* 1278 80025E78 36D60020 */  ori       $s6, $s6, (0xFFFF0020 & 0xFFFF)
.L80025E7C:
/* 127C 80025E7C 92620000 */  lbu       $v0, 0x0($s3)
/* 1280 80025E80 1040001A */  beqz      $v0, .L80025EEC
/* 1284 80025E84 025E8824 */   and      $s1, $s2, $fp
/* 1288 80025E88 02378821 */  addu      $s1, $s1, $s7
/* 128C 80025E8C 0220282D */  daddu     $a1, $s1, $zero
/* 1290 80025E90 27A60010 */  addiu     $a2, $sp, 0x10
/* 1294 80025E94 32500003 */  andi      $s0, $s2, 0x3
/* 1298 80025E98 26520001 */  addiu     $s2, $s2, 0x1
/* 129C 80025E9C 24070003 */  addiu     $a3, $zero, 0x3
/* 12A0 80025EA0 00F08023 */  subu      $s0, $a3, $s0
/* 12A4 80025EA4 8EA40000 */  lw        $a0, 0x0($s5)
/* 12A8 80025EA8 0C018370 */  jal       osEPiReadIo
/* 12AC 80025EAC 00F08004 */   sllv     $s0, $s0, $a3
/* 12B0 80025EB0 0220282D */  daddu     $a1, $s1, $zero
/* 12B4 80025EB4 240700FF */  addiu     $a3, $zero, 0xFF
/* 12B8 80025EB8 02071004 */  sllv      $v0, $a3, $s0
/* 12BC 80025EBC 00021027 */  nor       $v0, $zero, $v0
/* 12C0 80025EC0 8EA40000 */  lw        $a0, 0x0($s5)
/* 12C4 80025EC4 8FA30010 */  lw        $v1, 0x10($sp)
/* 12C8 80025EC8 92660000 */  lbu       $a2, 0x0($s3)
/* 12CC 80025ECC 00621824 */  and       $v1, $v1, $v0
/* 12D0 80025ED0 02063004 */  sllv      $a2, $a2, $s0
/* 12D4 80025ED4 0C018358 */  jal       osEPiWriteIo
/* 12D8 80025ED8 00663025 */   or       $a2, $v1, $a2
/* 12DC 80025EDC 3407FFDF */  ori       $a3, $zero, 0xFFDF
/* 12E0 80025EE0 00F2102A */  slt       $v0, $a3, $s2
/* 12E4 80025EE4 54400001 */  bnel      $v0, $zero, .L80025EEC
/* 12E8 80025EE8 02569021 */   addu     $s2, $s2, $s6
.L80025EEC:
/* 12EC 80025EEC 2694FFFF */  addiu     $s4, $s4, -0x1
/* 12F0 80025EF0 1680FFE2 */  bnez      $s4, .L80025E7C
/* 12F4 80025EF4 26730001 */   addiu    $s3, $s3, 0x1
.L80025EF8:
/* 12F8 80025EF8 3C04800A */  lui       $a0, %hi(nuPiCartHandle)
/* 12FC 80025EFC 8C84A638 */  lw        $a0, %lo(nuPiCartHandle)($a0)
/* 1300 80025F00 3C05B3FF */  lui       $a1, (0xB3FF0014 >> 16)
/* 1304 80025F04 34A50014 */  ori       $a1, $a1, (0xB3FF0014 & 0xFFFF)
/* 1308 80025F08 0C018358 */  jal       osEPiWriteIo
/* 130C 80025F0C 0240302D */   daddu    $a2, $s2, $zero
/* 1310 80025F10 24020001 */  addiu     $v0, $zero, 0x1
.L80025F14:
/* 1314 80025F14 8FBF003C */  lw        $ra, 0x3C($sp)
/* 1318 80025F18 8FBE0038 */  lw        $fp, 0x38($sp)
/* 131C 80025F1C 8FB70034 */  lw        $s7, 0x34($sp)
/* 1320 80025F20 8FB60030 */  lw        $s6, 0x30($sp)
/* 1324 80025F24 8FB5002C */  lw        $s5, 0x2C($sp)
/* 1328 80025F28 8FB40028 */  lw        $s4, 0x28($sp)
/* 132C 80025F2C 8FB30024 */  lw        $s3, 0x24($sp)
/* 1330 80025F30 8FB20020 */  lw        $s2, 0x20($sp)
/* 1334 80025F34 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1338 80025F38 8FB00018 */  lw        $s0, 0x18($sp)
/* 133C 80025F3C 03E00008 */  jr        $ra
/* 1340 80025F40 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

char* is_debug_print(char* arg0, const char* str, size_t count) {
    u32 data;
    s32 pos;
    s32 start;
    s32 end;

    osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->magic, &data);
    if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
        return (char*) 1;
    }
    osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->get, &data);
    pos = data;
    osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->put, &data);
    start = data;
    end = start + count;
    if (end >= 0xffe0) {
        end -= 0xffe0;
        if (pos < end || start < pos) {
            return (char*) 1;
        }
    } else {
        if (start < pos && pos < end) {
            return (char*) 1;
        }
    }
    while (count) {
        u8 c = *str;

        if (c != 0) {
            u32 addr = (u32) &gISVDbgPrnAdrs->data + (start & 0xffffffc);
            s32 shift = ((3 - (start & 3)) * 8);

            osEPiReadIo(nuPiCartHandle, addr, &data);
            osEPiWriteIo(nuPiCartHandle, addr, (data & ~(0xff << shift)) | ((u8)*str << shift));

            start++;
            if (start >= 0xffe0) {
                start -= 0xffe0;
            }
        }
        count--;
        str++;
    }
    osEPiWriteIo(nuPiCartHandle, (u32)&gISVDbgPrnAdrs->put, start);
    return (char*) 1;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel initialize_next_camera
/* 956C 8002E16C 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 9570 8002E170 0080382D */  daddu     $a3, $a0, $zero
/* 9574 8002E174 0000202D */  daddu     $a0, $zero, $zero
/* 9578 8002E178 3C03800B */  lui       $v1, %hi(gCameras)
/* 957C 8002E17C 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
/* 9580 8002E180 AFBF001C */  sw        $ra, 0x1C($sp)
/* 9584 8002E184 AFB00018 */  sw        $s0, 0x18($sp)
.L8002E188:
/* 9588 8002E188 0060802D */  daddu     $s0, $v1, $zero
/* 958C 8002E18C 96020000 */  lhu       $v0, 0x0($s0)
/* 9590 8002E190 10400006 */  beqz      $v0, .L8002E1AC
/* 9594 8002E194 28820004 */   slti     $v0, $a0, 0x4
/* 9598 8002E198 24840001 */  addiu     $a0, $a0, 0x1
/* 959C 8002E19C 28820004 */  slti      $v0, $a0, 0x4
/* 95A0 8002E1A0 1440FFF9 */  bnez      $v0, .L8002E188
/* 95A4 8002E1A4 26030558 */   addiu    $v1, $s0, 0x558
/* 95A8 8002E1A8 28820004 */  slti      $v0, $a0, 0x4
.L8002E1AC:
/* 95AC 8002E1AC 54400003 */  bnel      $v0, $zero, .L8002E1BC
/* 95B0 8002E1B0 24030001 */   addiu    $v1, $zero, 0x1
.L8002E1B4:
/* 95B4 8002E1B4 0800B86D */  j         .L8002E1B4
/* 95B8 8002E1B8 00000000 */   nop
.L8002E1BC:
/* 95BC 8002E1BC 94E20000 */  lhu       $v0, 0x0($a3)
/* 95C0 8002E1C0 3C01C2C8 */  lui       $at, (0xC2C80000 >> 16)
/* 95C4 8002E1C4 44810000 */  mtc1      $at, $f0
/* 95C8 8002E1C8 A6000002 */  sh        $zero, 0x2($s0)
/* 95CC 8002E1CC AE00003C */  sw        $zero, 0x3C($s0)
/* 95D0 8002E1D0 AE000040 */  sw        $zero, 0x40($s0)
/* 95D4 8002E1D4 AE000044 */  sw        $zero, 0x44($s0)
/* 95D8 8002E1D8 AE000048 */  sw        $zero, 0x48($s0)
/* 95DC 8002E1DC AE00004C */  sw        $zero, 0x4C($s0)
/* 95E0 8002E1E0 AE00006C */  sw        $zero, 0x6C($s0)
/* 95E4 8002E1E4 AE000078 */  sw        $zero, 0x78($s0)
/* 95E8 8002E1E8 AE00007C */  sw        $zero, 0x7C($s0)
/* 95EC 8002E1EC AE000084 */  sw        $zero, 0x84($s0)
/* 95F0 8002E1F0 AE000088 */  sw        $zero, 0x88($s0)
/* 95F4 8002E1F4 AE00008C */  sw        $zero, 0x8C($s0)
/* 95F8 8002E1F8 34420005 */  ori       $v0, $v0, 0x5
/* 95FC 8002E1FC A6020000 */  sh        $v0, 0x0($s0)
/* 9600 8002E200 E6000050 */  swc1      $f0, 0x50($s0)
/* 9604 8002E204 90E20002 */  lbu       $v0, 0x2($a3)
/* 9608 8002E208 A6030006 */  sh        $v1, 0x6($s0)
/* 960C 8002E20C 00021600 */  sll       $v0, $v0, 24
/* 9610 8002E210 00021603 */  sra       $v0, $v0, 24
/* 9614 8002E214 A6020004 */  sh        $v0, 0x4($s0)
/* 9618 8002E218 94E2000C */  lhu       $v0, 0xC($a3)
/* 961C 8002E21C A6020012 */  sh        $v0, 0x12($s0)
/* 9620 8002E220 94E2000E */  lhu       $v0, 0xE($a3)
/* 9624 8002E224 00042400 */  sll       $a0, $a0, 16
/* 9628 8002E228 A6020014 */  sh        $v0, 0x14($s0)
/* 962C 8002E22C 84E30010 */  lh        $v1, 0x10($a3)
/* 9630 8002E230 24020064 */  addiu     $v0, $zero, 0x64
/* 9634 8002E234 A602002A */  sh        $v0, 0x2A($s0)
/* 9638 8002E238 44830000 */  mtc1      $v1, $f0
/* 963C 8002E23C 00000000 */  nop
/* 9640 8002E240 46800020 */  cvt.s.w   $f0, $f0
/* 9644 8002E244 E6000018 */  swc1      $f0, 0x18($s0)
/* 9648 8002E248 84E20006 */  lh        $v0, 0x6($a3)
/* 964C 8002E24C 84E50008 */  lh        $a1, 0x8($a3)
/* 9650 8002E250 84E6000A */  lh        $a2, 0xA($a3)
/* 9654 8002E254 84E70004 */  lh        $a3, 0x4($a3)
/* 9658 8002E258 00042403 */  sra       $a0, $a0, 16
/* 965C 8002E25C 0C00B8C5 */  jal       set_cam_viewport
/* 9660 8002E260 AFA20010 */   sw       $v0, 0x10($sp)
/* 9664 8002E264 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* 9668 8002E268 44810000 */  mtc1      $at, $f0
/* 966C 8002E26C 3C013E4C */  lui       $at, (0x3E4CCCCD >> 16)
/* 9670 8002E270 3421CCCD */  ori       $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 9674 8002E274 44811000 */  mtc1      $at, $f2
/* 9678 8002E278 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 967C 8002E27C 44812000 */  mtc1      $at, $f4
/* 9680 8002E280 2402FFFF */  addiu     $v0, $zero, -0x1
/* 9684 8002E284 A6020212 */  sh        $v0, 0x212($s0)
/* 9688 8002E288 24020001 */  addiu     $v0, $zero, 0x1
/* 968C 8002E28C AE020530 */  sw        $v0, 0x530($s0)
/* 9690 8002E290 0200102D */  daddu     $v0, $s0, $zero
/* 9694 8002E294 A600002C */  sh        $zero, 0x2C($s0)
/* 9698 8002E298 A600002E */  sh        $zero, 0x2E($s0)
/* 969C 8002E29C A6000030 */  sh        $zero, 0x30($s0)
/* 96A0 8002E2A0 AE0000C0 */  sw        $zero, 0xC0($s0)
/* 96A4 8002E2A4 AE000054 */  sw        $zero, 0x54($s0)
/* 96A8 8002E2A8 AE000058 */  sw        $zero, 0x58($s0)
/* 96AC 8002E2AC AE00005C */  sw        $zero, 0x5C($s0)
/* 96B0 8002E2B0 AE000060 */  sw        $zero, 0x60($s0)
/* 96B4 8002E2B4 AE000064 */  sw        $zero, 0x64($s0)
/* 96B8 8002E2B8 AE000068 */  sw        $zero, 0x68($s0)
/* 96BC 8002E2BC AE000098 */  sw        $zero, 0x98($s0)
/* 96C0 8002E2C0 AE00009C */  sw        $zero, 0x9C($s0)
/* 96C4 8002E2C4 AE0001FC */  sw        $zero, 0x1FC($s0)
/* 96C8 8002E2C8 AE000200 */  sw        $zero, 0x200($s0)
/* 96CC 8002E2CC AE00050C */  sw        $zero, 0x50C($s0)
/* 96D0 8002E2D0 AE000510 */  sw        $zero, 0x510($s0)
/* 96D4 8002E2D4 AE000514 */  sw        $zero, 0x514($s0)
/* 96D8 8002E2D8 AE000518 */  sw        $zero, 0x518($s0)
/* 96DC 8002E2DC AE00051C */  sw        $zero, 0x51C($s0)
/* 96E0 8002E2E0 AE000524 */  sw        $zero, 0x524($s0)
/* 96E4 8002E2E4 AE000528 */  sw        $zero, 0x528($s0)
/* 96E8 8002E2E8 AE00052C */  sw        $zero, 0x52C($s0)
/* 96EC 8002E2EC AE000534 */  sw        $zero, 0x534($s0)
/* 96F0 8002E2F0 A6000506 */  sh        $zero, 0x506($s0)
/* 96F4 8002E2F4 A6000504 */  sh        $zero, 0x504($s0)
/* 96F8 8002E2F8 E60000C4 */  swc1      $f0, 0xC4($s0)
/* 96FC 8002E2FC E6020520 */  swc1      $f2, 0x520($s0)
/* 9700 8002E300 E6040490 */  swc1      $f4, 0x490($s0)
/* 9704 8002E304 8FBF001C */  lw        $ra, 0x1C($sp)
/* 9708 8002E308 8FB00018 */  lw        $s0, 0x18($sp)
/* 970C 8002E30C 03E00008 */  jr        $ra
/* 9710 8002E310 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

Camera* initialize_next_camera(CameraInitData* initData) {
    Camera* camera;
    s32 camID;

    for (camID = 0; camID < ARRAY_COUNT(gCameras); camID++) {
        camera = &gCameras[camID];

        if (camera->flags == 0) {
            break;
        }
    }

    ASSERT(camID < ARRAY_COUNT(gCameras));

    camera->flags = initData->flags | (CAMERA_FLAG_1 | CAMERA_FLAG_LEAD_PLAYER);
    camera->moveFlags = 0;
    camera->lookAt_eye.x = 0;
    camera->lookAt_eye.y = 0;
    camera->lookAt_eye.z = 0;
    camera->lookAt_obj.x = 0;
    camera->lookAt_obj.y = 0;
    camera->lookAt_obj.z = -100.0f;
    camera->currentYaw = 0;
    camera->currentBoomLength = 0;
    camera->currentYOffset = 0;
    camera->trueRotation.x = 0.0f;
    camera->trueRotation.y = 0.0f;
    camera->trueRotation.z = 0.0f;
    camera->updateMode = initData->updateMode;
    camera->needsInit = TRUE;
    camera->nearClip = initData->nearClip;
    camera->farClip = initData->farClip;
    camera->vfov = initData->vfov;
    camera->zoomPercent = 100;
    set_cam_viewport(camID, initData->viewStartX, initData->viewStartY, initData->viewWidth, initData->viewHeight);
    camera->unk_212 = -1;
    camera->unk_530 = 1;
    camera->bgColor[0] = 0;
    camera->bgColor[1] = 0;
    camera->bgColor[2] = 0;
    camera->unk_C0 = 0;
    camera->lookAt_obj_target.x = 0;
    camera->lookAt_obj_target.y = 0;
    camera->lookAt_obj_target.z = 0;
    camera->targetPos.x = 0;
    camera->targetPos.y = 0;
    camera->targetPos.z = 0;
    camera->unk_98 = 0;
    camera->unk_9C = 0;
    camera->fpDoPreRender = NULL;
    camera->fpDoPostRender = NULL;
    camera->leadAmount = 0;
    camera->unk_510 = 0.0f;
    camera->unk_514 = 0.0f;
    camera->unk_518 = 0.0f;
    camera->unk_51C = 0;
    camera->unk_524 = 0.0f;
    camera->unk_528 = 0.0f;
    camera->unk_52C = 0;
    camera->aabbForZoneBelow = 0;
    camera->panActive = FALSE;
    camera->followPlayer = 0;
    camera->unk_C4 = 1000.0f;
    camera->unk_520 = 0.2f;
    camera->moveSpeed = 1.0f;
    return camera;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel big_snowflakes_main
/* 363160 E0060000 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 363164 E0060004 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 363168 E0060008 4485A000 */  mtc1      $a1, $f20
/* 36316C E006000C AFB20030 */  sw        $s2, 0x30($sp)
/* 363170 E0060010 0080902D */  daddu     $s2, $a0, $zero
/* 363174 E0060014 F7B60048 */  sdc1      $f22, 0x48($sp)
/* 363178 E0060018 4486B000 */  mtc1      $a2, $f22
/* 36317C E006001C 27A40010 */  addiu     $a0, $sp, 0x10
/* 363180 E0060020 F7B80050 */  sdc1      $f24, 0x50($sp)
/* 363184 E0060024 4487C000 */  mtc1      $a3, $f24
/* 363188 E0060028 3C02E006 */  lui       $v0, %hi(big_snowflakes_init)
/* 36318C E006002C 244201D8 */  addiu     $v0, $v0, %lo(big_snowflakes_init)
/* 363190 E0060030 AFA20018 */  sw        $v0, 0x18($sp)
/* 363194 E0060034 3C02E006 */  lui       $v0, %hi(big_snowflakes_update)
/* 363198 E0060038 244201E0 */  addiu     $v0, $v0, %lo(big_snowflakes_update)
/* 36319C E006003C AFA2001C */  sw        $v0, 0x1C($sp)
/* 3631A0 E0060040 3C02E006 */  lui       $v0, %hi(big_snowflakes_render)
/* 3631A4 E0060044 2442040C */  addiu     $v0, $v0, %lo(big_snowflakes_render)
/* 3631A8 E0060048 AFA20020 */  sw        $v0, 0x20($sp)
/* 3631AC E006004C 24020030 */  addiu     $v0, $zero, 0x30
/* 3631B0 E0060050 AFBF003C */  sw        $ra, 0x3C($sp)
/* 3631B4 E0060054 AFB40038 */  sw        $s4, 0x38($sp)
/* 3631B8 E0060058 AFB30034 */  sw        $s3, 0x34($sp)
/* 3631BC E006005C AFB1002C */  sw        $s1, 0x2C($sp)
/* 3631C0 E0060060 AFB00028 */  sw        $s0, 0x28($sp)
/* 3631C4 E0060064 AFA00010 */  sw        $zero, 0x10($sp)
/* 3631C8 E0060068 AFA00024 */  sw        $zero, 0x24($sp)
/* 3631CC E006006C 0C080124 */  jal       shim_create_effect_instance
/* 3631D0 E0060070 AFA20014 */   sw       $v0, 0x14($sp)
/* 3631D4 E0060074 240401B0 */  addiu     $a0, $zero, 0x1B0
/* 3631D8 E0060078 24130009 */  addiu     $s3, $zero, 0x9
/* 3631DC E006007C 0040802D */  daddu     $s0, $v0, $zero
/* 3631E0 E0060080 0C08012C */  jal       shim_general_heap_malloc
/* 3631E4 E0060084 AE130008 */   sw       $s3, 0x8($s0)
/* 3631E8 E0060088 0040882D */  daddu     $s1, $v0, $zero
/* 3631EC E006008C 16200003 */  bnez      $s1, .LE006009C
/* 3631F0 E0060090 AE11000C */   sw       $s1, 0xC($s0)
.LE0060094:
/* 3631F4 E0060094 08018025 */  j         .LE0060094
/* 3631F8 E0060098 00000000 */   nop
.LE006009C:
/* 3631FC E006009C 0220202D */  daddu     $a0, $s1, $zero
/* 363200 E00600A0 00132840 */  sll       $a1, $s3, 1
/* 363204 E00600A4 00B32821 */  addu      $a1, $a1, $s3
/* 363208 E00600A8 0C080130 */  jal       shim_mem_clear
/* 36320C E00600AC 00052900 */   sll      $a1, $a1, 4
/* 363210 E00600B0 2402001E */  addiu     $v0, $zero, 0x1E
/* 363214 E00600B4 AE320000 */  sw        $s2, 0x0($s1)
/* 363218 E00600B8 E6340004 */  swc1      $f20, 0x4($s1)
/* 36321C E00600BC E6360008 */  swc1      $f22, 0x8($s1)
/* 363220 E00600C0 E638000C */  swc1      $f24, 0xC($s1)
/* 363224 E00600C4 AE220028 */  sw        $v0, 0x28($s1)
/* 363228 E00600C8 AE20002C */  sw        $zero, 0x2C($s1)
/* 36322C E00600CC AE200024 */  sw        $zero, 0x24($s1)
/* 363230 E00600D0 24120001 */  addiu     $s2, $zero, 0x1
/* 363234 E00600D4 0253102A */  slt       $v0, $s2, $s3
/* 363238 E00600D8 10400034 */  beqz      $v0, .LE00601AC
/* 36323C E00600DC 26310030 */   addiu    $s1, $s1, 0x30
/* 363240 E00600E0 3C146666 */  lui       $s4, (0x66666667 >> 16)
/* 363244 E00600E4 36946667 */  ori       $s4, $s4, (0x66666667 & 0xFFFF)
/* 363248 E00600E8 26300014 */  addiu     $s0, $s1, 0x14
/* 36324C E00600EC 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 363250 E00600F0 4481B000 */  mtc1      $at, $f22
/* 363254 E00600F4 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 363258 E00600F8 4481A000 */  mtc1      $at, $f20
.LE00600FC:
/* 36325C E00600FC 0C080000 */  jal       effect_rand_int
/* 363260 E0060100 2404000A */   addiu    $a0, $zero, 0xA
/* 363264 E0060104 2404000A */  addiu     $a0, $zero, 0xA
/* 363268 E0060108 2442FFFB */  addiu     $v0, $v0, -0x5
/* 36326C E006010C 44820000 */  mtc1      $v0, $f0
/* 363270 E0060110 00000000 */  nop
/* 363274 E0060114 46800020 */  cvt.s.w   $f0, $f0
/* 363278 E0060118 0C080000 */  jal       effect_rand_int
/* 36327C E006011C E600FFF0 */   swc1     $f0, -0x10($s0)
/* 363280 E0060120 24040168 */  addiu     $a0, $zero, 0x168
/* 363284 E0060124 24420005 */  addiu     $v0, $v0, 0x5
/* 363288 E0060128 44820000 */  mtc1      $v0, $f0
/* 36328C E006012C 00000000 */  nop
/* 363290 E0060130 46800020 */  cvt.s.w   $f0, $f0
/* 363294 E0060134 E600FFF4 */  swc1      $f0, -0xC($s0)
/* 363298 E0060138 0C080000 */  jal       effect_rand_int
/* 36329C E006013C E616FFF8 */   swc1     $f22, -0x8($s0)
/* 3632A0 E0060140 24040168 */  addiu     $a0, $zero, 0x168
/* 3632A4 E0060144 44820000 */  mtc1      $v0, $f0
/* 3632A8 E0060148 00000000 */  nop
/* 3632AC E006014C 46800020 */  cvt.s.w   $f0, $f0
/* 3632B0 E0060150 0C080000 */  jal       effect_rand_int
/* 3632B4 E0060154 E6000004 */   swc1     $f0, 0x4($s0)
/* 3632B8 E0060158 24040064 */  addiu     $a0, $zero, 0x64
/* 3632BC E006015C 44820000 */  mtc1      $v0, $f0
/* 3632C0 E0060160 00000000 */  nop
/* 3632C4 E0060164 46800020 */  cvt.s.w   $f0, $f0
/* 3632C8 E0060168 0C080000 */  jal       effect_rand_int
/* 3632CC E006016C E600000C */   swc1     $f0, 0xC($s0)
/* 3632D0 E0060170 00540018 */  mult      $v0, $s4
/* 3632D4 E0060174 26520001 */  addiu     $s2, $s2, 0x1
/* 3632D8 E0060178 000217C3 */  sra       $v0, $v0, 31
/* 3632DC E006017C AE00FFFC */  sw        $zero, -0x4($s0)
/* 3632E0 E0060180 E6140000 */  swc1      $f20, 0x0($s0)
/* 3632E4 E0060184 00004010 */  mfhi      $t0
/* 3632E8 E0060188 00081883 */  sra       $v1, $t0, 2
/* 3632EC E006018C 00621823 */  subu      $v1, $v1, $v0
/* 3632F0 E0060190 44830000 */  mtc1      $v1, $f0
/* 3632F4 E0060194 00000000 */  nop
/* 3632F8 E0060198 46800020 */  cvt.s.w   $f0, $f0
/* 3632FC E006019C E6000008 */  swc1      $f0, 0x8($s0)
/* 363300 E00601A0 0253102A */  slt       $v0, $s2, $s3
/* 363304 E00601A4 1440FFD5 */  bnez      $v0, .LE00600FC
/* 363308 E00601A8 26100030 */   addiu    $s0, $s0, 0x30
.LE00601AC:
/* 36330C E00601AC 8FBF003C */  lw        $ra, 0x3C($sp)
/* 363310 E00601B0 8FB40038 */  lw        $s4, 0x38($sp)
/* 363314 E00601B4 8FB30034 */  lw        $s3, 0x34($sp)
/* 363318 E00601B8 8FB20030 */  lw        $s2, 0x30($sp)
/* 36331C E00601BC 8FB1002C */  lw        $s1, 0x2C($sp)
/* 363320 E00601C0 8FB00028 */  lw        $s0, 0x28($sp)
/* 363324 E00601C4 D7B80050 */  ldc1      $f24, 0x50($sp)
/* 363328 E00601C8 D7B60048 */  ldc1      $f22, 0x48($sp)
/* 36332C E00601CC D7B40040 */  ldc1      $f20, 0x40($sp)
/* 363330 E00601D0 03E00008 */  jr        $ra
/* 363334 E00601D4 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
    EffectBlueprint bp;
    EffectInstance* effect;
    BigSnowflakesFXData* data;
    s32 numParts = 9;
    s32 i;

    bp.unk_00 = 0;
    bp.init = big_snowflakes_init;
    bp.update = big_snowflakes_update;
    bp.renderWorld = big_snowflakes_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_BIG_SNOWFLAKES;

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

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

    ASSERT(data != NULL);

    shim_mem_clear(data, numParts * sizeof(*data));
    data->unk_00 = arg0;
    data->unk_04 = arg1;
    data->unk_08 = arg2;
    data->unk_0C = arg3;
    data->unk_28 = 30;
    data->unk_2C = 0;
    data->unk_24 = 0;

    data++;
    for (i = 1; i < numParts; i++, data++) {
        data->unk_04 = effect_rand_int(10) - 5;
        data->unk_08 = effect_rand_int(10) + 5;
        data->unk_0C = 10.0f;
        data->unk_18 = effect_rand_int(360);
        data->unk_20 = effect_rand_int(360);
        data->unk_1C = effect_rand_int(100) / 10;
        data->unk_10 = 0;
        data->unk_14 = 2.0f;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8024F5AC
/* 17DE8C 8024F5AC 27BDFD60 */  addiu     $sp, $sp, -0x2A0
/* 17DE90 8024F5B0 AFB40278 */  sw        $s4, 0x278($sp)
/* 17DE94 8024F5B4 AFBF028C */  sw        $ra, 0x28C($sp)
D_8024F5B8_C0CE38:
/* 17DE98 8024F5B8 AFBE0288 */  sw        $fp, 0x288($sp)
/* 17DE9C 8024F5BC AFB70284 */  sw        $s7, 0x284($sp)
mac_04_Quizmo_StageEffect:
/* 17DEA0 8024F5C0 AFB60280 */  sw        $s6, 0x280($sp)
mac_04_Quizmo_AudienceEffect:
/* 17DEA4 8024F5C4 AFB5027C */  sw        $s5, 0x27C($sp)
mac_04_Quizmo_VannaTEffect:
/* 17DEA8 8024F5C8 AFB30274 */  sw        $s3, 0x274($sp)
/* 17DEAC 8024F5CC AFB20270 */  sw        $s2, 0x270($sp)
mac_04_D_8024F5D0:
/* 17DEB0 8024F5D0 AFB1026C */  sw        $s1, 0x26C($sp)
/* 17DEB4 8024F5D4 AFB00268 */  sw        $s0, 0x268($sp)
/* 17DEB8 8024F5D8 F7B60298 */  sdc1      $f22, 0x298($sp)
/* 17DEBC 8024F5DC F7B40290 */  sdc1      $f20, 0x290($sp)
/* 17DEC0 8024F5E0 AFA40258 */  sw        $a0, 0x258($sp)
D_8024F5E4:
/* 17DEC4 8024F5E4 84820012 */  lh        $v0, 0x12($a0)
/* 17DEC8 8024F5E8 8C930018 */  lw        $s3, 0x18($a0)
/* 17DECC 8024F5EC 18400050 */  blez      $v0, .L8024F730
D_8024F5F0_C0CE70:
/* 17DED0 8024F5F0 0000A02D */   daddu    $s4, $zero, $zero
/* 17DED4 8024F5F4 27A30058 */  addiu     $v1, $sp, 0x58
/* 17DED8 8024F5F8 AFA3025C */  sw        $v1, 0x25C($sp)
/* 17DEDC 8024F5FC 27A30098 */  addiu     $v1, $sp, 0x98
D_8024F600:
/* 17DEE0 8024F600 AFA30260 */  sw        $v1, 0x260($sp)
/* 17DEE4 8024F604 27A300D8 */  addiu     $v1, $sp, 0xD8
/* 17DEE8 8024F608 27BE01D8 */  addiu     $fp, $sp, 0x1D8
/* 17DEEC 8024F60C 27B20158 */  addiu     $s2, $sp, 0x158
/* 17DEF0 8024F610 27B70118 */  addiu     $s7, $sp, 0x118
/* 17DEF4 8024F614 27B60198 */  addiu     $s6, $sp, 0x198
D_8024F618:
/* 17DEF8 8024F618 27B50218 */  addiu     $s5, $sp, 0x218
/* 17DEFC 8024F61C 4480A000 */  mtc1      $zero, $f20
D_8024F620:
/* 17DF00 8024F620 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 17DF04 8024F624 4481B000 */  mtc1      $at, $f22
/* 17DF08 8024F628 26710034 */  addiu     $s1, $s3, 0x34
/* 17DF0C 8024F62C AFA30264 */  sw        $v1, 0x264($sp)
D_8024F630:
/* 17DF10 8024F630 8E620000 */  lw        $v0, 0x0($s3)
D_8024F634:
/* 17DF14 8024F634 50400038 */  beql      $v0, $zero, D_8024F718
/* 17DF18 8024F638 26940001 */   addiu    $s4, $s4, 0x1
/* 17DF1C 8024F63C 8E22FFF0 */  lw        $v0, -0x10($s1)
/* 17DF20 8024F640 1440003B */  bnez      $v0, .L8024F730
/* 17DF24 8024F644 00000000 */   nop
/* 17DF28 8024F648 8E250004 */  lw        $a1, 0x4($s1)
/* 17DF2C 8024F64C 8E260008 */  lw        $a2, 0x8($s1)
D_8024F650_C0CED0:
/* 17DF30 8024F650 8E27000C */  lw        $a3, 0xC($s1)
/* 17DF34 8024F654 8E30FFD0 */  lw        $s0, -0x30($s1)
/* 17DF38 8024F658 0C019E40 */  jal       guTranslateF
/* 17DF3C 8024F65C 27A40018 */   addiu    $a0, $sp, 0x18
/* 17DF40 8024F660 4405A000 */  mfc1      $a1, $f20
/* 17DF44 8024F664 4406B000 */  mfc1      $a2, $f22
/* 17DF48 8024F668 4407A000 */  mfc1      $a3, $f20
/* 17DF4C 8024F66C 8FA4025C */  lw        $a0, 0x25C($sp)
/* 17DF50 8024F670 0C019EC8 */  jal       guRotateF
/* 17DF54 8024F674 E7B40010 */   swc1     $f20, 0x10($sp)
/* 17DF58 8024F678 E7B40010 */  swc1      $f20, 0x10($sp)
/* 17DF5C 8024F67C 8E25FFFC */  lw        $a1, -0x4($s1)
/* 17DF60 8024F680 4406A000 */  mfc1      $a2, $f20
/* 17DF64 8024F684 4407B000 */  mfc1      $a3, $f22
D_8024F688_C0CF08:
/* 17DF68 8024F688 8FA40260 */  lw        $a0, 0x260($sp)
/* 17DF6C 8024F68C 0C019EC8 */  jal       guRotateF
/* 17DF70 8024F690 26940001 */   addiu    $s4, $s4, 0x1
/* 17DF74 8024F694 E7B60010 */  swc1      $f22, 0x10($sp)
/* 17DF78 8024F698 8E25FFF4 */  lw        $a1, -0xC($s1)
/* 17DF7C 8024F69C 4406A000 */  mfc1      $a2, $f20
/* 17DF80 8024F6A0 4407A000 */  mfc1      $a3, $f20
/* 17DF84 8024F6A4 0C019EC8 */  jal       guRotateF
/* 17DF88 8024F6A8 8FA40264 */   lw       $a0, 0x264($sp)
/* 17DF8C 8024F6AC 8E250000 */  lw        $a1, 0x0($s1)
D_8024F6B0:
/* 17DF90 8024F6B0 03C0202D */  daddu     $a0, $fp, $zero
/* 17DF94 8024F6B4 00A0302D */  daddu     $a2, $a1, $zero
/* 17DF98 8024F6B8 0C019DF0 */  jal       guScaleF
D_8024F6BC:
/* 17DF9C 8024F6BC 00A0382D */   daddu    $a3, $a1, $zero
/* 17DFA0 8024F6C0 8FA40264 */  lw        $a0, 0x264($sp)
/* 17DFA4 8024F6C4 8FA5025C */  lw        $a1, 0x25C($sp)
/* 17DFA8 8024F6C8 0C019D80 */  jal       guMtxCatF
/* 17DFAC 8024F6CC 0240302D */   daddu    $a2, $s2, $zero
D_8024F6D0:
/* 17DFB0 8024F6D0 0240202D */  daddu     $a0, $s2, $zero
/* 17DFB4 8024F6D4 8FA50260 */  lw        $a1, 0x260($sp)
/* 17DFB8 8024F6D8 0C019D80 */  jal       guMtxCatF
/* 17DFBC 8024F6DC 02E0302D */   daddu    $a2, $s7, $zero
/* 17DFC0 8024F6E0 03C0202D */  daddu     $a0, $fp, $zero
/* 17DFC4 8024F6E4 02E0282D */  daddu     $a1, $s7, $zero
D_8024F6E8_C0CF68:
/* 17DFC8 8024F6E8 0C019D80 */  jal       guMtxCatF
/* 17DFCC 8024F6EC 0240302D */   daddu    $a2, $s2, $zero
D_8024F6F0:
/* 17DFD0 8024F6F0 0240202D */  daddu     $a0, $s2, $zero
/* 17DFD4 8024F6F4 27A50018 */  addiu     $a1, $sp, 0x18
/* 17DFD8 8024F6F8 0C019D80 */  jal       guMtxCatF
/* 17DFDC 8024F6FC 02C0302D */   daddu    $a2, $s6, $zero
/* 17DFE0 8024F700 02C0202D */  daddu     $a0, $s6, $zero
/* 17DFE4 8024F704 0C019D40 */  jal       guMtxF2L
/* 17DFE8 8024F708 02A0282D */   daddu    $a1, $s5, $zero
/* 17DFEC 8024F70C 0200202D */  daddu     $a0, $s0, $zero
D_8024F710:
/* 17DFF0 8024F710 0C04873A */  jal       draw_entity_model_A
/* 17DFF4 8024F714 02A0282D */   daddu    $a1, $s5, $zero
D_8024F718:
/* 17DFF8 8024F718 8FA30258 */  lw        $v1, 0x258($sp)
/* 17DFFC 8024F71C 2631004C */  addiu     $s1, $s1, 0x4C
D_8024F720_C0CFA0:
/* 17E000 8024F720 84620012 */  lh        $v0, 0x12($v1)
/* 17E004 8024F724 0282102A */  slt       $v0, $s4, $v0
/* 17E008 8024F728 1440FFC1 */  bnez      $v0, D_8024F630
/* 17E00C 8024F72C 2673004C */   addiu    $s3, $s3, 0x4C
.L8024F730:
/* 17E010 8024F730 8FBF028C */  lw        $ra, 0x28C($sp)
/* 17E014 8024F734 8FBE0288 */  lw        $fp, 0x288($sp)
/* 17E018 8024F738 8FB70284 */  lw        $s7, 0x284($sp)
D_8024F73C:
/* 17E01C 8024F73C 8FB60280 */  lw        $s6, 0x280($sp)
/* 17E020 8024F740 8FB5027C */  lw        $s5, 0x27C($sp)
D_8024F744:
/* 17E024 8024F744 8FB40278 */  lw        $s4, 0x278($sp)
D_8024F748:
/* 17E028 8024F748 8FB30274 */  lw        $s3, 0x274($sp)
D_8024F74C:
/* 17E02C 8024F74C 8FB20270 */  lw        $s2, 0x270($sp)
D_8024F750:
/* 17E030 8024F750 8FB1026C */  lw        $s1, 0x26C($sp)
/* 17E034 8024F754 8FB00268 */  lw        $s0, 0x268($sp)
/* 17E038 8024F758 D7B60298 */  ldc1      $f22, 0x298($sp)
/* 17E03C 8024F75C D7B40290 */  ldc1      $f20, 0x290($sp)
/* 17E040 8024F760 03E00008 */  jr        $ra
/* 17E044 8024F764 27BD02A0 */   addiu    $sp, $sp, 0x2A0

### DECOMPILED C INSTRUCTIONS:

void btl_bonk_render(void* data) {
    PopupMessage* popup = data;
    Message* message = popup->message;
    Matrix4f sp18;
    Matrix4f mtxRotX;
    Matrix4f mtxRotY;
    Matrix4f mtxRotZ;
    Matrix4f sp118;
    Matrix4f sp158;
    Matrix4f sp198;
    Matrix4f mtxScale;
    Mtx sp218;
    s32 i;

    for (i = 0; i < popup->messageIndex; i++, message++) {
        if (message->unk_00) {
            if (message->unk_24 != 0) {
                break;
            } else {
                s32 modelIdx = message->entityModelIndex;

                guTranslateF(sp18, message->pos.x, message->pos.y, message->pos.z);
                guRotateF(mtxRotX, 0.0f, 1.0f, 0.0f, 0.0f);
                guRotateF(mtxRotY, message->rotY, 0.0f, 1.0f, 0.0f);
                guRotateF(mtxRotZ, message->rotZ, 0.0f, 0.0f, 1.0f);
                guScaleF(mtxScale, message->scale, message->scale, message->scale);
                guMtxCatF(mtxRotZ, mtxRotX, sp158);
                guMtxCatF(sp158, mtxRotY, sp118);
                guMtxCatF(mtxScale, sp118, sp158);
                guMtxCatF(sp158, sp18, sp198);
                guMtxF2L(sp198, &sp218);
                draw_entity_model_A(modelIdx, &sp218);
            }
        }
    }
}