### RAW ASSEMBLY INSTRUCTIONS:

glabel __osContRamRead
/* 455D0 8006A1D0 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 455D4 8006A1D4 AFB40038 */  sw        $s4, 0x38($sp)
/* 455D8 8006A1D8 0080A021 */  addu      $s4, $a0, $zero
/* 455DC 8006A1DC AFB30034 */  sw        $s3, 0x34($sp)
/* 455E0 8006A1E0 00A09821 */  addu      $s3, $a1, $zero
/* 455E4 8006A1E4 AFB5003C */  sw        $s5, 0x3C($sp)
/* 455E8 8006A1E8 24150002 */  addiu     $s5, $zero, 0x2
/* 455EC 8006A1EC AFB00028 */  sw        $s0, 0x28($sp)
/* 455F0 8006A1F0 00C08021 */  addu      $s0, $a2, $zero
/* 455F4 8006A1F4 AFBF004C */  sw        $ra, 0x4C($sp)
/* 455F8 8006A1F8 AFBE0048 */  sw        $fp, 0x48($sp)
/* 455FC 8006A1FC AFB70044 */  sw        $s7, 0x44($sp)
/* 45600 8006A200 AFB60040 */  sw        $s6, 0x40($sp)
/* 45604 8006A204 AFB20030 */  sw        $s2, 0x30($sp)
/* 45608 8006A208 AFB1002C */  sw        $s1, 0x2C($sp)
/* 4560C 8006A20C 0C019771 */  jal       __osSiGetAccess
/* 45610 8006A210 AFA70014 */   sw       $a3, 0x14($sp)
/* 45614 8006A214 24170002 */  addiu     $s7, $zero, 0x2
/* 45618 8006A218 3216FFFF */  andi      $s6, $s0, 0xFFFF
/* 4561C 8006A21C 00108140 */  sll       $s0, $s0, 5
/* 45620 8006A220 3C1E800E */  lui       $fp, %hi(__osPfsPifRam)
/* 45624 8006A224 27DEA000 */  addiu     $fp, $fp, %lo(__osPfsPifRam)
/* 45628 8006A228 AFB0001C */  sw        $s0, 0x1C($sp)
.L8006A22C:
/* 4562C 8006A22C 3C02800A */  lui       $v0, %hi(__osContLastCmd)
/* 45630 8006A230 9042A61C */  lbu       $v0, %lo(__osContLastCmd)($v0)
/* 45634 8006A234 3C10800E */  lui       $s0, %hi(__osPfsPifRam)
/* 45638 8006A238 14570005 */  bne       $v0, $s7, .L8006A250
/* 4563C 8006A23C 2610A000 */   addiu    $s0, $s0, %lo(__osPfsPifRam)
/* 45640 8006A240 3C028009 */  lui       $v0, %hi(D_800958E0)
/* 45644 8006A244 8C4258E0 */  lw        $v0, %lo(D_800958E0)($v0)
/* 45648 8006A248 50530019 */  beql      $v0, $s3, .L8006A2B0
/* 4564C 8006A24C 02708021 */   addu     $s0, $s3, $s0
.L8006A250:
/* 45650 8006A250 3C01800A */  lui       $at, %hi(__osContLastCmd)
/* 45654 8006A254 A037A61C */  sb        $s7, %lo(__osContLastCmd)($at)
/* 45658 8006A258 3C018009 */  lui       $at, %hi(D_800958E0)
/* 4565C 8006A25C AC3358E0 */  sw        $s3, %lo(D_800958E0)($at)
/* 45660 8006A260 1A600006 */  blez      $s3, .L8006A27C
/* 45664 8006A264 00001821 */   addu     $v1, $zero, $zero
.L8006A268:
/* 45668 8006A268 A2000000 */  sb        $zero, 0x0($s0)
/* 4566C 8006A26C 24630001 */  addiu     $v1, $v1, 0x1
/* 45670 8006A270 0073102A */  slt       $v0, $v1, $s3
/* 45674 8006A274 1440FFFC */  bnez      $v0, .L8006A268
/* 45678 8006A278 26100001 */   addiu    $s0, $s0, 0x1
.L8006A27C:
/* 4567C 8006A27C 24020001 */  addiu     $v0, $zero, 0x1
/* 45680 8006A280 3C01800E */  lui       $at, %hi(D_800DA03C)
/* 45684 8006A284 AC22A03C */  sw        $v0, %lo(D_800DA03C)($at)
/* 45688 8006A288 240800FF */  addiu     $t0, $zero, 0xFF
/* 4568C 8006A28C 24020003 */  addiu     $v0, $zero, 0x3
/* 45690 8006A290 A2020001 */  sb        $v0, 0x1($s0)
/* 45694 8006A294 24020021 */  addiu     $v0, $zero, 0x21
/* 45698 8006A298 A2080000 */  sb        $t0, 0x0($s0)
/* 4569C 8006A29C A2020002 */  sb        $v0, 0x2($s0)
/* 456A0 8006A2A0 240200FE */  addiu     $v0, $zero, 0xFE
/* 456A4 8006A2A4 A2170003 */  sb        $s7, 0x3($s0)
/* 456A8 8006A2A8 A2080026 */  sb        $t0, 0x26($s0)
/* 456AC 8006A2AC A2020027 */  sb        $v0, 0x27($s0)
.L8006A2B0:
/* 456B0 8006A2B0 02C02021 */  addu      $a0, $s6, $zero
/* 456B4 8006A2B4 001610C2 */  srl       $v0, $s6, 3
/* 456B8 8006A2B8 0C01B218 */  jal       __osContAddressCrc
/* 456BC 8006A2BC A2020004 */   sb       $v0, 0x4($s0)
/* 456C0 8006A2C0 8FA8001C */  lw        $t0, 0x1C($sp)
/* 456C4 8006A2C4 24040001 */  addiu     $a0, $zero, 0x1
/* 456C8 8006A2C8 03C02821 */  addu      $a1, $fp, $zero
/* 456CC 8006A2CC 00481025 */  or        $v0, $v0, $t0
/* 456D0 8006A2D0 0C019730 */  jal       __osSiRawStartDma
/* 456D4 8006A2D4 A2020005 */   sb       $v0, 0x5($s0)
/* 456D8 8006A2D8 02802021 */  addu      $a0, $s4, $zero
/* 456DC 8006A2DC 00002821 */  addu      $a1, $zero, $zero
/* 456E0 8006A2E0 0C0195BC */  jal       osRecvMesg
/* 456E4 8006A2E4 24060001 */   addiu    $a2, $zero, 0x1
/* 456E8 8006A2E8 00002021 */  addu      $a0, $zero, $zero
/* 456EC 8006A2EC 0C019730 */  jal       __osSiRawStartDma
/* 456F0 8006A2F0 03C02821 */   addu     $a1, $fp, $zero
/* 456F4 8006A2F4 02802021 */  addu      $a0, $s4, $zero
/* 456F8 8006A2F8 00002821 */  addu      $a1, $zero, $zero
/* 456FC 8006A2FC 0C0195BC */  jal       osRecvMesg
/* 45700 8006A300 24060001 */   addiu    $a2, $zero, 0x1
/* 45704 8006A304 92020002 */  lbu       $v0, 0x2($s0)
/* 45708 8006A308 304200C0 */  andi      $v0, $v0, 0xC0
/* 4570C 8006A30C 00028902 */  srl       $s1, $v0, 4
/* 45710 8006A310 56200015 */  bnel      $s1, $zero, .L8006A368
/* 45714 8006A314 24110001 */   addiu    $s1, $zero, 0x1
/* 45718 8006A318 26120006 */  addiu     $s2, $s0, 0x6
/* 4571C 8006A31C 0C01B233 */  jal       __osContDataCrc
/* 45720 8006A320 02402021 */   addu     $a0, $s2, $zero
/* 45724 8006A324 92030026 */  lbu       $v1, 0x26($s0)
/* 45728 8006A328 304200FF */  andi      $v0, $v0, 0xFF
/* 4572C 8006A32C 10430008 */  beq       $v0, $v1, .L8006A350
/* 45730 8006A330 02802021 */   addu     $a0, $s4, $zero
/* 45734 8006A334 0C01A530 */  jal       __osPfsGetStatus
/* 45738 8006A338 02602821 */   addu     $a1, $s3, $zero
/* 4573C 8006A33C 00408821 */  addu      $s1, $v0, $zero
/* 45740 8006A340 1620000E */  bnez      $s1, .L8006A37C
/* 45744 8006A344 00000000 */   nop
/* 45748 8006A348 0801A8DA */  j         .L8006A368
/* 4574C 8006A34C 24110004 */   addiu    $s1, $zero, 0x4
.L8006A350:
/* 45750 8006A350 8FA50014 */  lw        $a1, 0x14($sp)
/* 45754 8006A354 02402021 */  addu      $a0, $s2, $zero
/* 45758 8006A358 0C019194 */  jal       bcopy
/* 4575C 8006A35C 24060020 */   addiu    $a2, $zero, 0x20
/* 45760 8006A360 0801A8DB */  j         .L8006A36C
/* 45764 8006A364 24020004 */   addiu    $v0, $zero, 0x4
.L8006A368:
/* 45768 8006A368 24020004 */  addiu     $v0, $zero, 0x4
.L8006A36C:
/* 4576C 8006A36C 16220003 */  bne       $s1, $v0, .L8006A37C
/* 45770 8006A370 02A01021 */   addu     $v0, $s5, $zero
/* 45774 8006A374 0441FFAD */  bgez      $v0, .L8006A22C
/* 45778 8006A378 26B5FFFF */   addiu    $s5, $s5, -0x1
.L8006A37C:
/* 4577C 8006A37C 0C01978C */  jal       __osSiRelAccess
/* 45780 8006A380 00000000 */   nop
/* 45784 8006A384 02201021 */  addu      $v0, $s1, $zero
/* 45788 8006A388 8FBF004C */  lw        $ra, 0x4C($sp)
/* 4578C 8006A38C 8FBE0048 */  lw        $fp, 0x48($sp)
/* 45790 8006A390 8FB70044 */  lw        $s7, 0x44($sp)
/* 45794 8006A394 8FB60040 */  lw        $s6, 0x40($sp)
/* 45798 8006A398 8FB5003C */  lw        $s5, 0x3C($sp)
/* 4579C 8006A39C 8FB40038 */  lw        $s4, 0x38($sp)
/* 457A0 8006A3A0 8FB30034 */  lw        $s3, 0x34($sp)
/* 457A4 8006A3A4 8FB20030 */  lw        $s2, 0x30($sp)
/* 457A8 8006A3A8 8FB1002C */  lw        $s1, 0x2C($sp)
/* 457AC 8006A3AC 8FB00028 */  lw        $s0, 0x28($sp)
/* 457B0 8006A3B0 03E00008 */  jr        $ra
/* 457B4 8006A3B4 27BD0050 */   addiu    $sp, $sp, 0x50
/* 457B8 8006A3B8 00000000 */  nop
/* 457BC 8006A3BC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer) {
    s32 ret;
    u8* ptr;
    s32 i;
    int retry = 2;

    __osSiGetAccess();
    do {
        ptr = (u8 *)(&__osPfsPifRam);

        if (__osContLastCmd != CONT_CMD_READ_MEMPACK || __osPfsLastChannel != channel) {
            __osContLastCmd = CONT_CMD_READ_MEMPACK;
            __osPfsLastChannel = channel;

            for (i = 0; i < channel; i++) {
                *ptr++ = 0;
            }

            __osPfsPifRam.pifstatus = CONT_CMD_EXE;
            ((__OSContRamReadFormat *)ptr)->dummy = 0xff;
            ((__OSContRamReadFormat *)ptr)->txsize = 3;
            ((__OSContRamReadFormat *)ptr)->rxsize = 33;
            ((__OSContRamReadFormat *)ptr)->cmd = CONT_CMD_READ_MEMPACK;
            ((__OSContRamReadFormat *)ptr)->datacrc = 0xff;
            ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END;
        } else {
            ptr += channel;
        }
        ((__OSContRamReadFormat *)ptr)->addrh = address >> 3;
        ((__OSContRamReadFormat *)ptr)->addrl = (address << 5) | __osContAddressCrc(address) ;
        __osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
        osRecvMesg(mq, NULL, OS_MESG_BLOCK);
        __osSiRawStartDma(OS_READ, &__osPfsPifRam);
        osRecvMesg(mq, NULL, OS_MESG_BLOCK);

        ret = (((__OSContRamReadFormat *)ptr)->rxsize & 0xC0) >> 4;
        if (ret == 0) {
            if (__osContDataCrc(((__OSContRamReadFormat *)ptr)->data) != ((__OSContRamReadFormat *)ptr)->datacrc) {
                ret = __osPfsGetStatus(mq, channel);
                if (ret != 0) {
                    break;
                } else {
                    ret = PFS_ERR_CONTRFAIL;
                }
            } else {
                bcopy(((__OSContRamReadFormat *)ptr)->data, buffer, BLOCKSIZE);
            }
        } else {
            ret = PFS_ERR_NOPACK;
        }
    } while (ret == PFS_ERR_CONTRFAIL && retry-- >= 0);

    __osSiRelAccess();
    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8004DE2C
/* 2922C 8004DE2C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 29230 8004DE30 AFB3001C */  sw        $s3, 0x1C($sp)
/* 29234 8004DE34 0080982D */  daddu     $s3, $a0, $zero
/* 29238 8004DE38 AFB20018 */  sw        $s2, 0x18($sp)
/* 2923C 8004DE3C AFBF0024 */  sw        $ra, 0x24($sp)
/* 29240 8004DE40 AFB40020 */  sw        $s4, 0x20($sp)
/* 29244 8004DE44 AFB10014 */  sw        $s1, 0x14($sp)
/* 29248 8004DE48 AFB00010 */  sw        $s0, 0x10($sp)
/* 2924C 8004DE4C 8E740000 */  lw        $s4, 0x0($s3)
/* 29250 8004DE50 8E700010 */  lw        $s0, 0x10($s3)
/* 29254 8004DE54 12800055 */  beqz      $s4, .L8004DFAC
/* 29258 8004DE58 0000902D */   daddu    $s2, $zero, $zero
/* 2925C 8004DE5C 8E620014 */  lw        $v0, 0x14($s3)
/* 29260 8004DE60 14400045 */  bnez      $v0, .L8004DF78
/* 29264 8004DE64 00000000 */   nop
/* 29268 8004DE68 0C014FD9 */  jal       func_80053F64
/* 2926C 8004DE6C 0200202D */   daddu    $a0, $s0, $zero
/* 29270 8004DE70 0040882D */  daddu     $s1, $v0, $zero
/* 29274 8004DE74 1220003E */  beqz      $s1, .L8004DF70
/* 29278 8004DE78 001010C0 */   sll      $v0, $s0, 3
/* 2927C 8004DE7C 8E230000 */  lw        $v1, 0x0($s1)
/* 29280 8004DE80 00622021 */  addu      $a0, $v1, $v0
/* 29284 8004DE84 90830070 */  lbu       $v1, 0x70($a0)
/* 29288 8004DE88 24020001 */  addiu     $v0, $zero, 0x1
/* 2928C 8004DE8C 54620048 */  bnel      $v1, $v0, .L8004DFB0
/* 29290 8004DE90 24120004 */   addiu    $s2, $zero, 0x4
/* 29294 8004DE94 90840071 */  lbu       $a0, 0x71($a0)
/* 29298 8004DE98 0C015092 */  jal       func_80054248
/* 2929C 8004DE9C 00000000 */   nop
/* 292A0 8004DEA0 0040802D */  daddu     $s0, $v0, $zero
/* 292A4 8004DEA4 52000042 */  beql      $s0, $zero, .L8004DFB0
/* 292A8 8004DEA8 24120006 */   addiu    $s2, $zero, 0x6
/* 292AC 8004DEAC 0C0136CA */  jal       func_8004DB28
/* 292B0 8004DEB0 0200202D */   daddu    $a0, $s0, $zero
/* 292B4 8004DEB4 1440003E */  bnez      $v0, .L8004DFB0
/* 292B8 8004DEB8 24120007 */   addiu    $s2, $zero, 0x7
/* 292BC 8004DEBC 8E240028 */  lw        $a0, 0x28($s1)
/* 292C0 8004DEC0 0C014F96 */  jal       func_80053E58
/* 292C4 8004DEC4 8E250064 */   lw       $a1, 0x64($s1)
/* 292C8 8004DEC8 8E650004 */  lw        $a1, 0x4($s3)
/* 292CC 8004DECC 10A00008 */  beqz      $a1, .L8004DEF0
/* 292D0 8004DED0 0040902D */   daddu    $s2, $v0, $zero
/* 292D4 8004DED4 28A22711 */  slti      $v0, $a1, 0x2711
/* 292D8 8004DED8 14400003 */  bnez      $v0, .L8004DEE8
/* 292DC 8004DEDC 28A200FA */   slti     $v0, $a1, 0xFA
/* 292E0 8004DEE0 080137BC */  j         .L8004DEF0
/* 292E4 8004DEE4 24052710 */   addiu    $a1, $zero, 0x2710
.L8004DEE8:
/* 292E8 8004DEE8 54400001 */  bnel      $v0, $zero, .L8004DEF0
/* 292EC 8004DEEC 240500FA */   addiu    $a1, $zero, 0xFA
.L8004DEF0:
/* 292F0 8004DEF0 8E630008 */  lw        $v1, 0x8($s3)
/* 292F4 8004DEF4 28620080 */  slti      $v0, $v1, 0x80
/* 292F8 8004DEF8 50400001 */  beql      $v0, $zero, .L8004DF00
/* 292FC 8004DEFC 2403007F */   addiu    $v1, $zero, 0x7F
.L8004DF00:
/* 29300 8004DF00 10600002 */  beqz      $v1, .L8004DF0C
/* 29304 8004DF04 00031200 */   sll      $v0, $v1, 8
/* 29308 8004DF08 344300FF */  ori       $v1, $v0, 0xFF
.L8004DF0C:
/* 2930C 8004DF0C 8E64000C */  lw        $a0, 0xC($s3)
/* 29310 8004DF10 28820080 */  slti      $v0, $a0, 0x80
/* 29314 8004DF14 50400001 */  beql      $v0, $zero, .L8004DF1C
/* 29318 8004DF18 2404007F */   addiu    $a0, $zero, 0x7F
.L8004DF1C:
/* 2931C 8004DF1C 10800003 */  beqz      $a0, .L8004DF2C
/* 29320 8004DF20 00041200 */   sll      $v0, $a0, 8
/* 29324 8004DF24 080137CC */  j         .L8004DF30
/* 29328 8004DF28 344400FF */   ori      $a0, $v0, 0xFF
.L8004DF2C:
/* 2932C 8004DF2C 24047FFF */  addiu     $a0, $zero, 0x7FFF
.L8004DF30:
/* 29330 8004DF30 8E020000 */  lw        $v0, 0x0($s0)
/* 29334 8004DF34 AC500074 */  sw        $s0, 0x74($v0)
/* 29338 8004DF38 8E020000 */  lw        $v0, 0x0($s0)
/* 2933C 8004DF3C AC510078 */  sw        $s1, 0x78($v0)
/* 29340 8004DF40 8E020000 */  lw        $v0, 0x0($s0)
/* 29344 8004DF44 AC54007C */  sw        $s4, 0x7C($v0)
/* 29348 8004DF48 8E020000 */  lw        $v0, 0x0($s0)
/* 2934C 8004DF4C AC450084 */  sw        $a1, 0x84($v0)
/* 29350 8004DF50 8E020000 */  lw        $v0, 0x0($s0)
/* 29354 8004DF54 AC430088 */  sw        $v1, 0x88($v0)
/* 29358 8004DF58 8E020000 */  lw        $v0, 0x0($s0)
/* 2935C 8004DF5C AC44008C */  sw        $a0, 0x8C($v0)
/* 29360 8004DF60 8E030000 */  lw        $v1, 0x0($s0)
glabel func_8004DF64
/* 29364 8004DF64 24020001 */  addiu     $v0, $zero, 0x1
/* 29368 8004DF68 080137EC */  j         .L8004DFB0
/* 2936C 8004DF6C AC620080 */   sw       $v0, 0x80($v1)
.L8004DF70:
/* 29370 8004DF70 080137EC */  j         .L8004DFB0
/* 29374 8004DF74 24120004 */   addiu    $s2, $zero, 0x4
.L8004DF78:
/* 29378 8004DF78 0C0135E5 */  jal       au_bgm_get_player_with_song_name
/* 2937C 8004DF7C 0280202D */   daddu    $a0, $s4, $zero
/* 29380 8004DF80 0040802D */  daddu     $s0, $v0, $zero
/* 29384 8004DF84 1200000B */  beqz      $s0, .L8004DFB4
/* 29388 8004DF88 0240102D */   daddu    $v0, $s2, $zero
/* 2938C 8004DF8C 8E02001C */  lw        $v0, 0x1C($s0)
/* 29390 8004DF90 16820008 */  bne       $s4, $v0, .L8004DFB4
/* 29394 8004DF94 0240102D */   daddu    $v0, $s2, $zero
/* 29398 8004DF98 92020220 */  lbu       $v0, 0x220($s0)
/* 2939C 8004DF9C 54400004 */  bnel      $v0, $zero, .L8004DFB0
/* 293A0 8004DFA0 A2000220 */   sb       $zero, 0x220($s0)
/* 293A4 8004DFA4 080137ED */  j         .L8004DFB4
/* 293A8 8004DFA8 0240102D */   daddu    $v0, $s2, $zero
.L8004DFAC:
/* 293AC 8004DFAC 24120003 */  addiu     $s2, $zero, 0x3
.L8004DFB0:
/* 293B0 8004DFB0 0240102D */  daddu     $v0, $s2, $zero
.L8004DFB4:
/* 293B4 8004DFB4 8FBF0024 */  lw        $ra, 0x24($sp)
/* 293B8 8004DFB8 8FB40020 */  lw        $s4, 0x20($sp)
/* 293BC 8004DFBC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 293C0 8004DFC0 8FB20018 */  lw        $s2, 0x18($sp)
/* 293C4 8004DFC4 8FB10014 */  lw        $s1, 0x14($sp)
/* 293C8 8004DFC8 8FB00010 */  lw        $s0, 0x10($sp)
/* 293CC 8004DFCC 03E00008 */  jr        $ra
/* 293D0 8004DFD0 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

AuResult func_8004DE2C(SongUpdateEvent* update) {
    AuResult status;
    BGMPlayer* playerA;
    BGMPlayer* playerB;
    s32 variation;
    s32 songName;
    s32 volume0;
    s32 volume1;
    s32 duration;

    songName = update->songName;
    variation = update->variation;
    status = AU_RESULT_OK;

    if (songName != 0) {
        if (update->unk14 == 0) {
            playerA = func_80053F64(variation);
            if (playerA != NULL && playerA->globals->unk_globals_6C[variation].unk_4 == 1) {
                playerB = func_80054248(playerA->globals->unk_globals_6C[variation].unk_5);
                if (playerB != NULL) {
                    if (func_8004DB28(playerB) == 0) {
                        status = func_80053E58(playerA->songID, playerA->bgmFile);
                        duration = update->duration;
                        if (duration != 0) {
                            if (duration > SND_MAX_DURATION) {
                                duration = SND_MAX_DURATION;
                            } else if (duration < SND_MIN_DURATION) {
                                duration = SND_MIN_DURATION;
                            }
                        }
                        volume0 = update->startVolume;
                        if (volume0 > BGM_MAX_VOLUME) {
                            volume0 = BGM_MAX_VOLUME;
                        }
                        if (volume0 != 0) {
                            volume0 = (volume0 << 8) | 0xFF;
                        }
                        volume1 = update->finalVolume;
                        if (volume1 > BGM_MAX_VOLUME) {
                            volume1 = BGM_MAX_VOLUME;
                        }
                        if (volume1 != 0) {
                            volume1 = (volume1 << 8) | 0xFF;
                        } else {
                            volume1 = 0x7FFF;
                        }
                        playerB->globals->unk_74 = playerB;
                        playerB->globals->unk_78 = playerA;
                        playerB->globals->unkSongName = songName;
                        playerB->globals->unkFadeTime = duration;
                        playerB->globals->unkFadeStart = volume0;
                        playerB->globals->unkFadeEnd = volume1;
                        playerB->globals->unk_80 = 1;
                    } else {
                        status = AU_ERROR_7;
                    }
                } else {
                    status = AU_ERROR_6;
                }
            } else {
               status = AU_ERROR_INVALID_SONG_DURATION;
            }
        } else {
            playerB = au_bgm_get_player_with_song_name(songName);
            if (playerB != NULL) {
                if (songName == playerB->songName) {
                    if (playerB->unk_220 != 0) {
                        playerB->unk_220 = 0;
                    }
                }
            }
        }
    } else {
        status = AU_ERROR_NULL_SONG_NAME;
    }
    return status;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel GetNextPathPos
/* F9ED4 802D5524 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* F9ED8 802D5528 AFB1002C */  sw        $s1, 0x2C($sp)
/* F9EDC 802D552C 0080882D */  daddu     $s1, $a0, $zero
/* F9EE0 802D5530 AFBF0030 */  sw        $ra, 0x30($sp)
/* F9EE4 802D5534 AFB00028 */  sw        $s0, 0x28($sp)
/* F9EE8 802D5538 8E3000C0 */  lw        $s0, 0xC0($s1)
/* F9EEC 802D553C 8E030018 */  lw        $v1, 0x18($s0)
/* F9EF0 802D5540 24020001 */  addiu     $v0, $zero, 0x1
/* F9EF4 802D5544 10620017 */  beq       $v1, $v0, .L802D55A4
/* F9EF8 802D5548 28620002 */   slti     $v0, $v1, 0x2
/* F9EFC 802D554C 10400005 */  beqz      $v0, .L802D5564
/* F9F00 802D5550 24020004 */   addiu    $v0, $zero, 0x4
/* F9F04 802D5554 10600009 */  beqz      $v1, .L802D557C
/* F9F08 802D5558 00000000 */   nop
/* F9F0C 802D555C 080B55A3 */  j         .L802D568C
/* F9F10 802D5560 00000000 */   nop
.L802D5564:
/* F9F14 802D5564 10620022 */  beq       $v1, $v0, .L802D55F0
/* F9F18 802D5568 2402000A */   addiu    $v0, $zero, 0xA
/* F9F1C 802D556C 10620032 */  beq       $v1, $v0, .L802D5638
/* F9F20 802D5570 00000000 */   nop
/* F9F24 802D5574 080B55A3 */  j         .L802D568C
/* F9F28 802D5578 00000000 */   nop
.L802D557C:
/* F9F2C 802D557C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F9F30 802D5580 44810000 */  mtc1      $at, $f0
/* F9F34 802D5584 C6020014 */  lwc1      $f2, 0x14($s0)
/* F9F38 802D5588 468010A0 */  cvt.s.w   $f2, $f2
/* F9F3C 802D558C 46020003 */  div.s     $f0, $f0, $f2
/* F9F40 802D5590 C6020010 */  lwc1      $f2, 0x10($s0)
/* F9F44 802D5594 468010A0 */  cvt.s.w   $f2, $f2
/* F9F48 802D5598 46020302 */  mul.s     $f12, $f0, $f2
/* F9F4C 802D559C 080B55A4 */  j         .L802D5690
/* F9F50 802D55A0 00000000 */   nop
.L802D55A4:
/* F9F54 802D55A4 8E020014 */  lw        $v0, 0x14($s0)
/* F9F58 802D55A8 00420018 */  mult      $v0, $v0
/* F9F5C 802D55AC 00001812 */  mflo      $v1
/* F9F60 802D55B0 8E020010 */  lw        $v0, 0x10($s0)
/* F9F64 802D55B4 00000000 */  nop
/* F9F68 802D55B8 00420018 */  mult      $v0, $v0
/* F9F6C 802D55BC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F9F70 802D55C0 44810000 */  mtc1      $at, $f0
/* F9F74 802D55C4 44831000 */  mtc1      $v1, $f2
/* F9F78 802D55C8 00000000 */  nop
/* F9F7C 802D55CC 468010A0 */  cvt.s.w   $f2, $f2
/* F9F80 802D55D0 00001012 */  mflo      $v0
/* F9F84 802D55D4 46020003 */  div.s     $f0, $f0, $f2
/* F9F88 802D55D8 44821000 */  mtc1      $v0, $f2
/* F9F8C 802D55DC 00000000 */  nop
/* F9F90 802D55E0 468010A0 */  cvt.s.w   $f2, $f2
/* F9F94 802D55E4 46020302 */  mul.s     $f12, $f0, $f2
/* F9F98 802D55E8 080B55A4 */  j         .L802D5690
/* F9F9C 802D55EC 00000000 */   nop
.L802D55F0:
/* F9FA0 802D55F0 8E020014 */  lw        $v0, 0x14($s0)
/* F9FA4 802D55F4 00420018 */  mult      $v0, $v0
/* F9FA8 802D55F8 8E030010 */  lw        $v1, 0x10($s0)
/* F9FAC 802D55FC 00431023 */  subu      $v0, $v0, $v1
/* F9FB0 802D5600 44820000 */  mtc1      $v0, $f0
/* F9FB4 802D5604 00000000 */  nop
/* F9FB8 802D5608 46800020 */  cvt.s.w   $f0, $f0
/* F9FBC 802D560C 46000002 */  mul.s     $f0, $f0, $f0
/* F9FC0 802D5610 00000000 */  nop
/* F9FC4 802D5614 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F9FC8 802D5618 44812000 */  mtc1      $at, $f4
/* F9FCC 802D561C 00004012 */  mflo      $t0
/* F9FD0 802D5620 44881000 */  mtc1      $t0, $f2
/* F9FD4 802D5624 00000000 */  nop
/* F9FD8 802D5628 468010A0 */  cvt.s.w   $f2, $f2
/* F9FDC 802D562C 46020003 */  div.s     $f0, $f0, $f2
/* F9FE0 802D5630 080B55A4 */  j         .L802D5690
/* F9FE4 802D5634 46002301 */   sub.s    $f12, $f4, $f0
.L802D5638:
/* F9FE8 802D5638 3C014049 */  lui       $at, (0x40490FD8 >> 16)
/* F9FEC 802D563C 34210FD8 */  ori       $at, $at, (0x40490FD8 & 0xFFFF)
/* F9FF0 802D5640 44816000 */  mtc1      $at, $f12
/* F9FF4 802D5644 C6000014 */  lwc1      $f0, 0x14($s0)
/* F9FF8 802D5648 46800020 */  cvt.s.w   $f0, $f0
/* F9FFC 802D564C 46006303 */  div.s     $f12, $f12, $f0
/* FA000 802D5650 C6000010 */  lwc1      $f0, 0x10($s0)
/* FA004 802D5654 46800020 */  cvt.s.w   $f0, $f0
/* FA008 802D5658 46006302 */  mul.s     $f12, $f12, $f0
/* FA00C 802D565C 0C00A874 */  jal       cos_rad
/* FA010 802D5660 00000000 */   nop
/* FA014 802D5664 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* FA018 802D5668 44811000 */  mtc1      $at, $f2
/* FA01C 802D566C 00000000 */  nop
/* FA020 802D5670 46001081 */  sub.s     $f2, $f2, $f0
/* FA024 802D5674 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* FA028 802D5678 44810000 */  mtc1      $at, $f0
/* FA02C 802D567C 00000000 */  nop
/* FA030 802D5680 46001302 */  mul.s     $f12, $f2, $f0
/* FA034 802D5684 080B55A4 */  j         .L802D5690
/* FA038 802D5688 00000000 */   nop
.L802D568C:
/* FA03C 802D568C 44806000 */  mtc1      $zero, $f12
.L802D5690:
/* FA040 802D5690 8E020008 */  lw        $v0, 0x8($s0)
/* FA044 802D5694 AFA20010 */  sw        $v0, 0x10($sp)
/* FA048 802D5698 8E02000C */  lw        $v0, 0xC($s0)
/* FA04C 802D569C AFA20014 */  sw        $v0, 0x14($sp)
/* FA050 802D56A0 8E060000 */  lw        $a2, 0x0($s0)
/* FA054 802D56A4 8E070004 */  lw        $a3, 0x4($s0)
/* FA058 802D56A8 0C0B549C */  jal       get_path_position
/* FA05C 802D56AC 27A50018 */   addiu    $a1, $sp, 0x18
/* FA060 802D56B0 C7A00018 */  lwc1      $f0, 0x18($sp)
/* FA064 802D56B4 3C014480 */  lui       $at, (0x44800000 >> 16)
/* FA068 802D56B8 44812000 */  mtc1      $at, $f4
/* FA06C 802D56BC 00000000 */  nop
/* FA070 802D56C0 46040002 */  mul.s     $f0, $f0, $f4
/* FA074 802D56C4 00000000 */  nop
/* FA078 802D56C8 3C01CD5B */  lui       $at, (0xCD5B5858 >> 16)
/* FA07C 802D56CC 34215858 */  ori       $at, $at, (0xCD5B5858 & 0xFFFF)
/* FA080 802D56D0 44811000 */  mtc1      $at, $f2
/* FA084 802D56D4 00000000 */  nop
/* FA088 802D56D8 46020000 */  add.s     $f0, $f0, $f2
/* FA08C 802D56DC 4600018D */  trunc.w.s $f6, $f0
/* FA090 802D56E0 E6260088 */  swc1      $f6, 0x88($s1)
/* FA094 802D56E4 C7A0001C */  lwc1      $f0, 0x1C($sp)
/* FA098 802D56E8 46040002 */  mul.s     $f0, $f0, $f4
/* FA09C 802D56EC 00000000 */  nop
/* FA0A0 802D56F0 46020000 */  add.s     $f0, $f0, $f2
/* FA0A4 802D56F4 4600018D */  trunc.w.s $f6, $f0
/* FA0A8 802D56F8 E626008C */  swc1      $f6, 0x8C($s1)
/* FA0AC 802D56FC C7A00020 */  lwc1      $f0, 0x20($sp)
/* FA0B0 802D5700 46040002 */  mul.s     $f0, $f0, $f4
/* FA0B4 802D5704 00000000 */  nop
/* FA0B8 802D5708 46020000 */  add.s     $f0, $f0, $f2
/* FA0BC 802D570C 4600018D */  trunc.w.s $f6, $f0
/* FA0C0 802D5710 E6260090 */  swc1      $f6, 0x90($s1)
/* FA0C4 802D5714 8E030010 */  lw        $v1, 0x10($s0)
/* FA0C8 802D5718 8E020014 */  lw        $v0, 0x14($s0)
/* FA0CC 802D571C 0062102A */  slt       $v0, $v1, $v0
/* FA0D0 802D5720 10400005 */  beqz      $v0, .L802D5738
/* FA0D4 802D5724 24620001 */   addiu    $v0, $v1, 0x1
/* FA0D8 802D5728 AE020010 */  sw        $v0, 0x10($s0)
/* FA0DC 802D572C 24020001 */  addiu     $v0, $zero, 0x1
/* FA0E0 802D5730 080B55D6 */  j         .L802D5758
/* FA0E4 802D5734 AE220084 */   sw       $v0, 0x84($s1)
.L802D5738:
/* FA0E8 802D5738 8E040004 */  lw        $a0, 0x4($s0)
/* FA0EC 802D573C 0C00AB4B */  jal       heap_free
/* FA0F0 802D5740 00000000 */   nop
/* FA0F4 802D5744 0C00AB4B */  jal       heap_free
/* FA0F8 802D5748 8E04000C */   lw       $a0, 0xC($s0)
/* FA0FC 802D574C 0C00AB4B */  jal       heap_free
/* FA100 802D5750 8E2400C0 */   lw       $a0, 0xC0($s1)
/* FA104 802D5754 AE200084 */  sw        $zero, 0x84($s1)
.L802D5758:
/* FA108 802D5758 8FBF0030 */  lw        $ra, 0x30($sp)
/* FA10C 802D575C 8FB1002C */  lw        $s1, 0x2C($sp)
/* FA110 802D5760 8FB00028 */  lw        $s0, 0x28($sp)
/* FA114 802D5764 24020002 */  addiu     $v0, $zero, 0x2
/* FA118 802D5768 03E00008 */  jr        $ra
/* FA11C 802D576C 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

ApiStatus GetNextPathPos(Evt* script, s32 isInitialCall) {
    Path* path = script->varTablePtr[0xF];
    Vec3f pos;
    f32 alpha;
    f32 diff;

    switch (path->easingType) {
        case EASING_LINEAR:
            alpha = 1.0f / path->timeLeft * path->timeElapsed;
            break;
        case EASING_QUADRATIC_IN:
            alpha = 1.0f / SQ(path->timeLeft) * SQ(path->timeElapsed);
            break;
        case EASING_QUADRATIC_OUT:
            diff = path->timeLeft - path->timeElapsed;
            alpha = 1.0f - (SQ(diff) / SQ(path->timeLeft));
            break;
        case EASING_COS_IN_OUT:
            alpha = (1.0f - cos_rad((PI / path->timeLeft) * path->timeElapsed)) * 0.5f;
            break;
        default:
            alpha = 0.0f;
            break;
    }

    get_path_position(alpha, &pos, path->numVectors, path->lengths, path->staticVectorList, path->vectors);
    script->varTable[1] = (pos.x * 1024.0f) + -2.3e8f;
    script->varTable[2] = (pos.y * 1024.0f) + -2.3e8f;
    script->varTable[3] = (pos.z * 1024.0f) + -2.3e8f;

    if (path->timeElapsed < path->timeLeft) {
        path->timeElapsed = path->timeElapsed + 1;
        script->varTable[0] = 1;
    } else {
        heap_free(path->lengths);
        heap_free(path->vectors);
        heap_free(script->varTablePtr[15]);
        script->varTable[0] = 0;
    }

    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ShowSleepBubble
/* FC9D8 802D8028 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* FC9DC 802D802C AFB1002C */  sw        $s1, 0x2C($sp)
/* FC9E0 802D8030 0080882D */  daddu     $s1, $a0, $zero
/* FC9E4 802D8034 AFBF003C */  sw        $ra, 0x3C($sp)
/* FC9E8 802D8038 AFB40038 */  sw        $s4, 0x38($sp)
/* FC9EC 802D803C AFB30034 */  sw        $s3, 0x34($sp)
/* FC9F0 802D8040 AFB20030 */  sw        $s2, 0x30($sp)
/* FC9F4 802D8044 AFB00028 */  sw        $s0, 0x28($sp)
/* FC9F8 802D8048 F7BA0058 */  sdc1      $f26, 0x58($sp)
/* FC9FC 802D804C F7B80050 */  sdc1      $f24, 0x50($sp)
/* FCA00 802D8050 F7B60048 */  sdc1      $f22, 0x48($sp)
/* FCA04 802D8054 F7B40040 */  sdc1      $f20, 0x40($sp)
/* FCA08 802D8058 8E30000C */  lw        $s0, 0xC($s1)
/* FCA0C 802D805C 8E050000 */  lw        $a1, 0x0($s0)
/* FCA10 802D8060 0C0B1EAF */  jal       evt_get_variable
/* FCA14 802D8064 26100004 */   addiu    $s0, $s0, 0x4
/* FCA18 802D8068 8E050000 */  lw        $a1, 0x0($s0)
/* FCA1C 802D806C 26100004 */  addiu     $s0, $s0, 0x4
/* FCA20 802D8070 0220202D */  daddu     $a0, $s1, $zero
/* FCA24 802D8074 0C0B1EAF */  jal       evt_get_variable
/* FCA28 802D8078 0040982D */   daddu    $s3, $v0, $zero
/* FCA2C 802D807C 8E050000 */  lw        $a1, 0x0($s0)
/* FCA30 802D8080 26100004 */  addiu     $s0, $s0, 0x4
/* FCA34 802D8084 0220202D */  daddu     $a0, $s1, $zero
/* FCA38 802D8088 0C0B210B */  jal       evt_get_float_variable
/* FCA3C 802D808C 0040A02D */   daddu    $s4, $v0, $zero
/* FCA40 802D8090 8E050000 */  lw        $a1, 0x0($s0)
/* FCA44 802D8094 26100004 */  addiu     $s0, $s0, 0x4
/* FCA48 802D8098 0220202D */  daddu     $a0, $s1, $zero
/* FCA4C 802D809C 0C0B1EAF */  jal       evt_get_variable
/* FCA50 802D80A0 46000686 */   mov.s    $f26, $f0
/* FCA54 802D80A4 8E050000 */  lw        $a1, 0x0($s0)
/* FCA58 802D80A8 26100004 */  addiu     $s0, $s0, 0x4
/* FCA5C 802D80AC 0220202D */  daddu     $a0, $s1, $zero
/* FCA60 802D80B0 0C0B210B */  jal       evt_get_float_variable
/* FCA64 802D80B4 0040902D */   daddu    $s2, $v0, $zero
/* FCA68 802D80B8 8E050000 */  lw        $a1, 0x0($s0)
/* FCA6C 802D80BC 26100004 */  addiu     $s0, $s0, 0x4
/* FCA70 802D80C0 0220202D */  daddu     $a0, $s1, $zero
/* FCA74 802D80C4 0C0B210B */  jal       evt_get_float_variable
/* FCA78 802D80C8 46000606 */   mov.s    $f24, $f0
/* FCA7C 802D80CC 8E050000 */  lw        $a1, 0x0($s0)
/* FCA80 802D80D0 26100004 */  addiu     $s0, $s0, 0x4
/* FCA84 802D80D4 0220202D */  daddu     $a0, $s1, $zero
/* FCA88 802D80D8 0C0B210B */  jal       evt_get_float_variable
/* FCA8C 802D80DC 46000586 */   mov.s    $f22, $f0
/* FCA90 802D80E0 8E050000 */  lw        $a1, 0x0($s0)
/* FCA94 802D80E4 26100004 */  addiu     $s0, $s0, 0x4
/* FCA98 802D80E8 0220202D */  daddu     $a0, $s1, $zero
/* FCA9C 802D80EC 0C0B210B */  jal       evt_get_float_variable
/* FCAA0 802D80F0 46000506 */   mov.s    $f20, $f0
/* FCAA4 802D80F4 8E100000 */  lw        $s0, 0x0($s0)
/* FCAA8 802D80F8 12400006 */  beqz      $s2, .L802D8114
/* FCAAC 802D80FC 46000086 */   mov.s    $f2, $f0
/* FCAB0 802D8100 24020001 */  addiu     $v0, $zero, 0x1
/* FCAB4 802D8104 12420014 */  beq       $s2, $v0, .L802D8158
/* FCAB8 802D8108 4600C186 */   mov.s    $f6, $f24
/* FCABC 802D810C 080B6076 */  j         .L802D81D8
/* FCAC0 802D8110 4600B006 */   mov.s    $f0, $f22
.L802D8114:
/* FCAC4 802D8114 3C055555 */  lui       $a1, (0x55555556 >> 16)
/* FCAC8 802D8118 3C048011 */  lui       $a0, %hi(gPlayerStatus)
/* FCACC 802D811C 2484EFC8 */  addiu     $a0, $a0, %lo(gPlayerStatus)
/* FCAD0 802D8120 948200B0 */  lhu       $v0, 0xB0($a0)
/* FCAD4 802D8124 34A55556 */  ori       $a1, $a1, (0x55555556 & 0xFFFF)
/* FCAD8 802D8128 00021400 */  sll       $v0, $v0, 16
/* FCADC 802D812C 00021C03 */  sra       $v1, $v0, 16
/* FCAE0 802D8130 00650018 */  mult      $v1, $a1
/* FCAE4 802D8134 C4860028 */  lwc1      $f6, 0x28($a0)
/* FCAE8 802D8138 C4880030 */  lwc1      $f8, 0x30($a0)
/* FCAEC 802D813C C482002C */  lwc1      $f2, 0x2C($a0)
/* FCAF0 802D8140 00031840 */  sll       $v1, $v1, 1
/* FCAF4 802D8144 00004010 */  mfhi      $t0
/* FCAF8 802D8148 000217C3 */  sra       $v0, $v0, 31
/* FCAFC 802D814C 01021023 */  subu      $v0, $t0, $v0
/* FCB00 802D8150 080B6069 */  j         .L802D81A4
/* FCB04 802D8154 00650018 */   mult     $v1, $a1
.L802D8158:
/* FCB08 802D8158 0220202D */  daddu     $a0, $s1, $zero
/* FCB0C 802D815C 0C0B36B0 */  jal       resolve_npc
/* FCB10 802D8160 0260282D */   daddu    $a1, $s3, $zero
/* FCB14 802D8164 0040282D */  daddu     $a1, $v0, $zero
/* FCB18 802D8168 10A0002A */  beqz      $a1, .L802D8214
/* FCB1C 802D816C 3C045555 */   lui      $a0, (0x55555556 >> 16)
/* FCB20 802D8170 94A200A8 */  lhu       $v0, 0xA8($a1)
/* FCB24 802D8174 34845556 */  ori       $a0, $a0, (0x55555556 & 0xFFFF)
/* FCB28 802D8178 00021400 */  sll       $v0, $v0, 16
/* FCB2C 802D817C 00021C03 */  sra       $v1, $v0, 16
/* FCB30 802D8180 00640018 */  mult      $v1, $a0
/* FCB34 802D8184 C4A60038 */  lwc1      $f6, 0x38($a1)
/* FCB38 802D8188 C4A80040 */  lwc1      $f8, 0x40($a1)
/* FCB3C 802D818C C4A2003C */  lwc1      $f2, 0x3C($a1)
/* FCB40 802D8190 00031840 */  sll       $v1, $v1, 1
/* FCB44 802D8194 00004010 */  mfhi      $t0
/* FCB48 802D8198 000217C3 */  sra       $v0, $v0, 31
/* FCB4C 802D819C 01021023 */  subu      $v0, $t0, $v0
/* FCB50 802D81A0 00640018 */  mult      $v1, $a0
.L802D81A4:
/* FCB54 802D81A4 00021400 */  sll       $v0, $v0, 16
/* FCB58 802D81A8 00021403 */  sra       $v0, $v0, 16
/* FCB5C 802D81AC 44822000 */  mtc1      $v0, $f4
/* FCB60 802D81B0 00000000 */  nop
/* FCB64 802D81B4 46802120 */  cvt.s.w   $f4, $f4
/* FCB68 802D81B8 00031FC3 */  sra       $v1, $v1, 31
/* FCB6C 802D81BC 00004010 */  mfhi      $t0
/* FCB70 802D81C0 01031823 */  subu      $v1, $t0, $v1
/* FCB74 802D81C4 44830000 */  mtc1      $v1, $f0
/* FCB78 802D81C8 00000000 */  nop
/* FCB7C 802D81CC 46800020 */  cvt.s.w   $f0, $f0
/* FCB80 802D81D0 080B6078 */  j         .L802D81E0
/* FCB84 802D81D4 46001000 */   add.s    $f0, $f2, $f0
.L802D81D8:
/* FCB88 802D81D8 4600A206 */  mov.s     $f8, $f20
/* FCB8C 802D81DC 46001106 */  mov.s     $f4, $f2
.L802D81E0:
/* FCB90 802D81E0 0280202D */  daddu     $a0, $s4, $zero
/* FCB94 802D81E4 44053000 */  mfc1      $a1, $f6
/* FCB98 802D81E8 44060000 */  mfc1      $a2, $f0
/* FCB9C 802D81EC 44074000 */  mfc1      $a3, $f8
/* FCBA0 802D81F0 27A20020 */  addiu     $v0, $sp, 0x20
/* FCBA4 802D81F4 E7A40010 */  swc1      $f4, 0x10($sp)
/* FCBA8 802D81F8 E7BA0014 */  swc1      $f26, 0x14($sp)
/* FCBAC 802D81FC 0C01C1FC */  jal       fx_sleep_bubble
/* FCBB0 802D8200 AFA20018 */   sw       $v0, 0x18($sp)
/* FCBB4 802D8204 0220202D */  daddu     $a0, $s1, $zero
/* FCBB8 802D8208 8FA60020 */  lw        $a2, 0x20($sp)
/* FCBBC 802D820C 0C0B2026 */  jal       evt_set_variable
/* FCBC0 802D8210 0200282D */   daddu    $a1, $s0, $zero
.L802D8214:
/* FCBC4 802D8214 24020002 */  addiu     $v0, $zero, 0x2
/* FCBC8 802D8218 8FBF003C */  lw        $ra, 0x3C($sp)
/* FCBCC 802D821C 8FB40038 */  lw        $s4, 0x38($sp)
/* FCBD0 802D8220 8FB30034 */  lw        $s3, 0x34($sp)
/* FCBD4 802D8224 8FB20030 */  lw        $s2, 0x30($sp)
/* FCBD8 802D8228 8FB1002C */  lw        $s1, 0x2C($sp)
/* FCBDC 802D822C 8FB00028 */  lw        $s0, 0x28($sp)
/* FCBE0 802D8230 D7BA0058 */  ldc1      $f26, 0x58($sp)
/* FCBE4 802D8234 D7B80050 */  ldc1      $f24, 0x50($sp)
/* FCBE8 802D8238 D7B60048 */  ldc1      $f22, 0x48($sp)
/* FCBEC 802D823C D7B40040 */  ldc1      $f20, 0x40($sp)
/* FCBF0 802D8240 03E00008 */  jr        $ra
/* FCBF4 802D8244 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

ApiStatus ShowSleepBubble(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    s32 npcID = evt_get_variable(script, *args++);
    s32 type = evt_get_variable(script, *args++);
    f32 pitch = evt_get_float_variable(script, *args++);
    s32 emoterType = evt_get_variable(script, *args++);
    f32 posX = evt_get_float_variable(script, *args++);
    f32 posY = evt_get_float_variable(script, *args++);
    f32 posZ = evt_get_float_variable(script, *args++);
    f32 radius = evt_get_float_variable(script, *args++);
    s32 outVar = *args++;

    Npc* npc;
    f32 x, y, z, r;
    EffectInstance* effectHandle;

    switch (emoterType) {
        case EMOTER_PLAYER:
            x = gPlayerStatus.position.x;
            y = gPlayerStatus.position.y + (gPlayerStatus.colliderHeight * 2) / 3;
            z = gPlayerStatus.position.z;
            r = gPlayerStatus.colliderHeight / 3;
            break;
        case EMOTER_NPC:
            npc = resolve_npc(script, npcID);
            if (npc == NULL) {
                return ApiStatus_DONE2;
            }
            x = npc->pos.x;
            y = npc->pos.y + (npc->collisionHeight * 2) / 3;
            z = npc->pos.z;
            r = npc->collisionHeight / 3;
            break;
        default:
            x = posX;
            y = posY;
            z = posZ;
            r = radius;
            break;
    }

    fx_sleep_bubble(type, x, y, z, r, pitch, &effectHandle);
    evt_set_variable(script, outVar, (s32)effectHandle);
    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel cloud_trail_main
/* 32EE30 E0016000 27BDFF90 */  addiu     $sp, $sp, -0x70
/* 32EE34 E0016004 F7B80058 */  sdc1      $f24, 0x58($sp)
/* 32EE38 E0016008 4485C000 */  mtc1      $a1, $f24
/* 32EE3C E001600C AFB5003C */  sw        $s5, 0x3C($sp)
/* 32EE40 E0016010 0080A82D */  daddu     $s5, $a0, $zero
/* 32EE44 E0016014 F7BA0060 */  sdc1      $f26, 0x60($sp)
/* 32EE48 E0016018 4486D000 */  mtc1      $a2, $f26
/* 32EE4C E001601C 27A40010 */  addiu     $a0, $sp, 0x10
/* 32EE50 E0016020 F7BC0068 */  sdc1      $f28, 0x68($sp)
/* 32EE54 E0016024 4487E000 */  mtc1      $a3, $f28
/* 32EE58 E0016028 3C02E001 */  lui       $v0, %hi(cloud_trail_init)
/* 32EE5C E001602C 24426220 */  addiu     $v0, $v0, %lo(cloud_trail_init)
/* 32EE60 E0016030 AFA20018 */  sw        $v0, 0x18($sp)
/* 32EE64 E0016034 3C02E001 */  lui       $v0, %hi(cloud_trail_update)
/* 32EE68 E0016038 24426228 */  addiu     $v0, $v0, %lo(cloud_trail_update)
/* 32EE6C E001603C AFA2001C */  sw        $v0, 0x1C($sp)
/* 32EE70 E0016040 3C02E001 */  lui       $v0, %hi(cloud_trail_render)
/* 32EE74 E0016044 24426410 */  addiu     $v0, $v0, %lo(cloud_trail_render)
/* 32EE78 E0016048 AFA20020 */  sw        $v0, 0x20($sp)
/* 32EE7C E001604C 2402000B */  addiu     $v0, $zero, 0xB
/* 32EE80 E0016050 AFBF0044 */  sw        $ra, 0x44($sp)
/* 32EE84 E0016054 AFB60040 */  sw        $s6, 0x40($sp)
/* 32EE88 E0016058 AFB40038 */  sw        $s4, 0x38($sp)
/* 32EE8C E001605C AFB30034 */  sw        $s3, 0x34($sp)
/* 32EE90 E0016060 AFB20030 */  sw        $s2, 0x30($sp)
/* 32EE94 E0016064 AFB1002C */  sw        $s1, 0x2C($sp)
/* 32EE98 E0016068 AFB00028 */  sw        $s0, 0x28($sp)
/* 32EE9C E001606C F7B60050 */  sdc1      $f22, 0x50($sp)
/* 32EEA0 E0016070 F7B40048 */  sdc1      $f20, 0x48($sp)
/* 32EEA4 E0016074 AFA00010 */  sw        $zero, 0x10($sp)
/* 32EEA8 E0016078 AFA00024 */  sw        $zero, 0x24($sp)
/* 32EEAC E001607C 0C080124 */  jal       shim_create_effect_instance
/* 32EEB0 E0016080 AFA20014 */   sw       $v0, 0x14($sp)
/* 32EEB4 E0016084 24040050 */  addiu     $a0, $zero, 0x50
/* 32EEB8 E0016088 24130001 */  addiu     $s3, $zero, 0x1
/* 32EEBC E001608C 0040802D */  daddu     $s0, $v0, $zero
/* 32EEC0 E0016090 0C08012C */  jal       shim_general_heap_malloc
/* 32EEC4 E0016094 AE130008 */   sw       $s3, 0x8($s0)
/* 32EEC8 E0016098 0040882D */  daddu     $s1, $v0, $zero
/* 32EECC E001609C 16200003 */  bnez      $s1, .LE00160AC
/* 32EED0 E00160A0 AE11000C */   sw       $s1, 0xC($s0)
.LE00160A4:
/* 32EED4 E00160A4 08005829 */  j         .LE00160A4
/* 32EED8 E00160A8 00000000 */   nop
.LE00160AC:
/* 32EEDC E00160AC 0220202D */  daddu     $a0, $s1, $zero
/* 32EEE0 E00160B0 00132880 */  sll       $a1, $s3, 2
/* 32EEE4 E00160B4 00B32821 */  addu      $a1, $a1, $s3
/* 32EEE8 E00160B8 0C080130 */  jal       shim_mem_clear
/* 32EEEC E00160BC 00052900 */   sll      $a1, $a1, 4
/* 32EEF0 E00160C0 0000902D */  daddu     $s2, $zero, $zero
/* 32EEF4 E00160C4 0253102A */  slt       $v0, $s2, $s3
/* 32EEF8 E00160C8 10400046 */  beqz      $v0, .LE00161E4
/* 32EEFC E00160CC 24160001 */   addiu    $s6, $zero, 0x1
/* 32EF00 E00160D0 241400FF */  addiu     $s4, $zero, 0xFF
/* 32EF04 E00160D4 26300008 */  addiu     $s0, $s1, 0x8
/* 32EF08 E00160D8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 32EF0C E00160DC 4481B000 */  mtc1      $at, $f22
/* 32EF10 E00160E0 3C01E001 */  lui       $at, (0xE0016720 >> 16)
/* 32EF14 E00160E4 D4346720 */  ldc1      $f20, (0xE0016720 & 0xFFFF)($at)
.LE00160E8:
/* 32EF18 E00160E8 2404000A */  addiu     $a0, $zero, 0xA
/* 32EF1C E00160EC AE360000 */  sw        $s6, 0x0($s1)
/* 32EF20 E00160F0 A615FFFC */  sh        $s5, -0x4($s0)
/* 32EF24 E00160F4 AE000038 */  sw        $zero, 0x38($s0)
/* 32EF28 E00160F8 AE00003C */  sw        $zero, 0x3C($s0)
/* 32EF2C E00160FC E6180004 */  swc1      $f24, 0x4($s0)
/* 32EF30 E0016100 E61A0008 */  swc1      $f26, 0x8($s0)
/* 32EF34 E0016104 E61C000C */  swc1      $f28, 0xC($s0)
/* 32EF38 E0016108 E6160014 */  swc1      $f22, 0x14($s0)
/* 32EF3C E001610C E6160018 */  swc1      $f22, 0x18($s0)
/* 32EF40 E0016110 E616001C */  swc1      $f22, 0x1C($s0)
/* 32EF44 E0016114 0C080138 */  jal       shim_rand_int
/* 32EF48 E0016118 A2140000 */   sb       $s4, 0x0($s0)
/* 32EF4C E001611C 44820000 */  mtc1      $v0, $f0
/* 32EF50 E0016120 00000000 */  nop
/* 32EF54 E0016124 46800021 */  cvt.d.w   $f0, $f0
/* 32EF58 E0016128 46340002 */  mul.d     $f0, $f0, $f20
/* 32EF5C E001612C 00000000 */  nop
/* 32EF60 E0016130 3C01E001 */  lui       $at, (0xE0016728 >> 16)
/* 32EF64 E0016134 D4226728 */  ldc1      $f2, (0xE0016728 & 0xFFFF)($at)
/* 32EF68 E0016138 46220000 */  add.d     $f0, $f0, $f2
/* 32EF6C E001613C 2404000A */  addiu     $a0, $zero, 0xA
/* 32EF70 E0016140 46200020 */  cvt.s.d   $f0, $f0
/* 32EF74 E0016144 0C080138 */  jal       shim_rand_int
/* 32EF78 E0016148 E6000020 */   swc1     $f0, 0x20($s0)
/* 32EF7C E001614C 44820000 */  mtc1      $v0, $f0
/* 32EF80 E0016150 00000000 */  nop
/* 32EF84 E0016154 46800021 */  cvt.d.w   $f0, $f0
/* 32EF88 E0016158 46340002 */  mul.d     $f0, $f0, $f20
/* 32EF8C E001615C 00000000 */  nop
/* 32EF90 E0016160 3C013FF8 */  lui       $at, (0x3FF80000 >> 16)
/* 32EF94 E0016164 44811800 */  mtc1      $at, $f3
/* 32EF98 E0016168 44801000 */  mtc1      $zero, $f2
/* 32EF9C E001616C 26520001 */  addiu     $s2, $s2, 0x1
/* 32EFA0 E0016170 46220000 */  add.d     $f0, $f0, $f2
/* 32EFA4 E0016174 26310050 */  addiu     $s1, $s1, 0x50
/* 32EFA8 E0016178 2404003C */  addiu     $a0, $zero, 0x3C
/* 32EFAC E001617C 46200020 */  cvt.s.d   $f0, $f0
/* 32EFB0 E0016180 0C080000 */  jal       effect_rand_int
/* 32EFB4 E0016184 E6000024 */   swc1     $f0, 0x24($s0)
/* 32EFB8 E0016188 24040168 */  addiu     $a0, $zero, 0x168
/* 32EFBC E001618C 44820000 */  mtc1      $v0, $f0
/* 32EFC0 E0016190 00000000 */  nop
/* 32EFC4 E0016194 46800020 */  cvt.s.w   $f0, $f0
/* 32EFC8 E0016198 E6000028 */  swc1      $f0, 0x28($s0)
/* 32EFCC E001619C 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 32EFD0 E00161A0 44810000 */  mtc1      $at, $f0
/* 32EFD4 E00161A4 3C01BF00 */  lui       $at, (0xBF000000 >> 16)
/* 32EFD8 E00161A8 44811000 */  mtc1      $at, $f2
/* 32EFDC E00161AC 2402000F */  addiu     $v0, $zero, 0xF
/* 32EFE0 E00161B0 A615FFFC */  sh        $s5, -0x4($s0)
/* 32EFE4 E00161B4 A602FFFE */  sh        $v0, -0x2($s0)
/* 32EFE8 E00161B8 E6000030 */  swc1      $f0, 0x30($s0)
/* 32EFEC E00161BC 0C080000 */  jal       effect_rand_int
/* 32EFF0 E00161C0 E6020034 */   swc1     $f2, 0x34($s0)
/* 32EFF4 E00161C4 44820000 */  mtc1      $v0, $f0
/* 32EFF8 E00161C8 00000000 */  nop
/* 32EFFC E00161CC 46800020 */  cvt.s.w   $f0, $f0
/* 32F000 E00161D0 E6000010 */  swc1      $f0, 0x10($s0)
/* 32F004 E00161D4 A2140000 */  sb        $s4, 0x0($s0)
/* 32F008 E00161D8 0253102A */  slt       $v0, $s2, $s3
/* 32F00C E00161DC 1440FFC2 */  bnez      $v0, .LE00160E8
/* 32F010 E00161E0 26100050 */   addiu    $s0, $s0, 0x50
.LE00161E4:
/* 32F014 E00161E4 8FBF0044 */  lw        $ra, 0x44($sp)
/* 32F018 E00161E8 8FB60040 */  lw        $s6, 0x40($sp)
/* 32F01C E00161EC 8FB5003C */  lw        $s5, 0x3C($sp)
/* 32F020 E00161F0 8FB40038 */  lw        $s4, 0x38($sp)
/* 32F024 E00161F4 8FB30034 */  lw        $s3, 0x34($sp)
/* 32F028 E00161F8 8FB20030 */  lw        $s2, 0x30($sp)
/* 32F02C E00161FC 8FB1002C */  lw        $s1, 0x2C($sp)
/* 32F030 E0016200 8FB00028 */  lw        $s0, 0x28($sp)
/* 32F034 E0016204 D7BC0068 */  ldc1      $f28, 0x68($sp)
/* 32F038 E0016208 D7BA0060 */  ldc1      $f26, 0x60($sp)
/* 32F03C E001620C D7B80058 */  ldc1      $f24, 0x58($sp)
/* 32F040 E0016210 D7B60050 */  ldc1      $f22, 0x50($sp)
/* 32F044 E0016214 D7B40048 */  ldc1      $f20, 0x48($sp)
/* 32F048 E0016218 03E00008 */  jr        $ra
/* 32F04C E001621C 27BD0070 */   addiu    $sp, $sp, 0x70

### DECOMPILED C INSTRUCTIONS:

void cloud_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
    EffectBlueprint bp;
    EffectInstance* effect;
    CloudTrailFXData* part;
    s32 numParts = 1;
    s32 i;

    bp.unk_00 = 0;
    bp.init = cloud_trail_init;
    bp.update = cloud_trail_update;
    bp.renderWorld = cloud_trail_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_CLOUD_TRAIL;

    effect = shim_create_effect_instance(&bp);
    effect->numParts = 1;
    part = shim_general_heap_malloc(numParts * sizeof(*part));
    effect->data.cloudTrail = part;

    ASSERT(effect->data.cloudTrail != NULL);

    shim_mem_clear(part, numParts * sizeof(*part));

    for (i = 0; i < numParts; i++, part++) {
        part->alive = 1;
        part->unk_04 = arg0;
        part->unk_40 = 0;
        part->unk_44 = 0;
        part->unk_0C = arg1;
        part->unk_10 = arg2;
        part->unk_14 = arg3;
        part->unk_1C = 1.0f;
        part->unk_20 = 1.0f;
        part->unk_24 = 1.0f;
        part->alpha = -1;
        part->unk_28 = (shim_rand_int(10) * 0.03) + 1.4;
        part->unk_2C = (shim_rand_int(10) * 0.03) + 1.5;
        part->unk_30 = effect_rand_int(60);
        part->unk_04 = arg0;
        part->lifetime = 15;
        part->unk_38 = 2.0f;
        part->unk_3C = -0.5f;
        part->unk_18 = effect_rand_int(360);
        part->alpha = -1;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802549F4
/* 1832D4 802549F4 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 1832D8 802549F8 AFB20018 */  sw        $s2, 0x18($sp)
/* 1832DC 802549FC 0080902D */  daddu     $s2, $a0, $zero
/* 1832E0 80254A00 AFBF0020 */  sw        $ra, 0x20($sp)
/* 1832E4 80254A04 AFB3001C */  sw        $s3, 0x1C($sp)
/* 1832E8 80254A08 AFB10014 */  sw        $s1, 0x14($sp)
/* 1832EC 80254A0C AFB00010 */  sw        $s0, 0x10($sp)
/* 1832F0 80254A10 8E4401F4 */  lw        $a0, 0x1F4($s2)
/* 1832F4 80254A14 8C820000 */  lw        $v0, 0x0($a0)
/* 1832F8 80254A18 8C9300C0 */  lw        $s3, 0xC0($a0)
/* 1832FC 80254A1C 30420001 */  andi      $v0, $v0, 0x1
/* 183300 80254A20 14400084 */  bnez      $v0, .L80254C34
/* 183304 80254A24 00000000 */   nop
/* 183308 80254A28 8C820094 */  lw        $v0, 0x94($a0)
/* 18330C 80254A2C 10400081 */  beqz      $v0, .L80254C34
/* 183310 80254A30 00000000 */   nop
/* 183314 80254A34 827107D9 */  lb        $s1, 0x7D9($s3)
/* 183318 80254A38 C4800058 */  lwc1      $f0, 0x58($a0)
/* 18331C 80254A3C 00111840 */  sll       $v1, $s1, 1
/* 183320 80254A40 02631821 */  addu      $v1, $s3, $v1
/* 183324 80254A44 4600010D */  trunc.w.s $f4, $f0
/* 183328 80254A48 44022000 */  mfc1      $v0, $f4
/* 18332C 80254A4C 00000000 */  nop
/* 183330 80254A50 A46207FC */  sh        $v0, 0x7FC($v1)
/* 183334 80254A54 C480005C */  lwc1      $f0, 0x5C($a0)
/* 183338 80254A58 4600010D */  trunc.w.s $f4, $f0
/* 18333C 80254A5C 44022000 */  mfc1      $v0, $f4
/* 183340 80254A60 00000000 */  nop
/* 183344 80254A64 A462081C */  sh        $v0, 0x81C($v1)
/* 183348 80254A68 C4800060 */  lwc1      $f0, 0x60($a0)
/* 18334C 80254A6C 4600010D */  trunc.w.s $f4, $f0
/* 183350 80254A70 44022000 */  mfc1      $v0, $f4
/* 183354 80254A74 00000000 */  nop
/* 183358 80254A78 A462083C */  sh        $v0, 0x83C($v1)
/* 18335C 80254A7C C640018C */  lwc1      $f0, 0x18C($s2)
/* 183360 80254A80 4600010D */  trunc.w.s $f4, $f0
/* 183364 80254A84 44022000 */  mfc1      $v0, $f4
/* 183368 80254A88 00000000 */  nop
/* 18336C 80254A8C A46207DC */  sh        $v0, 0x7DC($v1)
/* 183370 80254A90 86420168 */  lh        $v0, 0x168($s2)
/* 183374 80254A94 C6420188 */  lwc1      $f2, 0x188($s2)
/* 183378 80254A98 44820000 */  mtc1      $v0, $f0
/* 18337C 80254A9C 00000000 */  nop
/* 183380 80254AA0 46800020 */  cvt.s.w   $f0, $f0
/* 183384 80254AA4 46020002 */  mul.s     $f0, $f0, $f2
/* 183388 80254AA8 00000000 */  nop
/* 18338C 80254AAC 02718021 */  addu      $s0, $s3, $s1
/* 183390 80254AB0 4600010D */  trunc.w.s $f4, $f0
/* 183394 80254AB4 44022000 */  mfc1      $v0, $f4
/* 183398 80254AB8 00000000 */  nop
/* 18339C 80254ABC A202085C */  sb        $v0, 0x85C($s0)
/* 1833A0 80254AC0 8642016A */  lh        $v0, 0x16A($s2)
/* 1833A4 80254AC4 C6420188 */  lwc1      $f2, 0x188($s2)
/* 1833A8 80254AC8 44820000 */  mtc1      $v0, $f0
/* 1833AC 80254ACC 00000000 */  nop
/* 1833B0 80254AD0 46800020 */  cvt.s.w   $f0, $f0
/* 1833B4 80254AD4 46020002 */  mul.s     $f0, $f0, $f2
/* 1833B8 80254AD8 00000000 */  nop
/* 1833BC 80254ADC 4600010D */  trunc.w.s $f4, $f0
/* 1833C0 80254AE0 44022000 */  mfc1      $v0, $f4
/* 1833C4 80254AE4 00000000 */  nop
/* 1833C8 80254AE8 A202086C */  sb        $v0, 0x86C($s0)
/* 1833CC 80254AEC C64C015C */  lwc1      $f12, 0x15C($s2)
/* 1833D0 80254AF0 0C00A6C9 */  jal       clamp_angle
/* 1833D4 80254AF4 2610087C */   addiu    $s0, $s0, 0x87C
/* 1833D8 80254AF8 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 1833DC 80254AFC 44811000 */  mtc1      $at, $f2
/* 1833E0 80254B00 00000000 */  nop
/* 1833E4 80254B04 46020002 */  mul.s     $f0, $f0, $f2
/* 1833E8 80254B08 00000000 */  nop
/* 1833EC 80254B0C 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 1833F0 80254B10 44811000 */  mtc1      $at, $f2
/* 1833F4 80254B14 00000000 */  nop
/* 1833F8 80254B18 4600103E */  c.le.s    $f2, $f0
/* 1833FC 80254B1C 00000000 */  nop
/* 183400 80254B20 45030005 */  bc1tl     .L80254B38
/* 183404 80254B24 46020001 */   sub.s    $f0, $f0, $f2
/* 183408 80254B28 4600010D */  trunc.w.s $f4, $f0
/* 18340C 80254B2C 44032000 */  mfc1      $v1, $f4
/* 183410 80254B30 080952D4 */  j         .L80254B50
/* 183414 80254B34 A2030000 */   sb       $v1, 0x0($s0)
.L80254B38:
/* 183418 80254B38 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 18341C 80254B3C 4600010D */  trunc.w.s $f4, $f0
/* 183420 80254B40 44032000 */  mfc1      $v1, $f4
D_80254B44:
/* 183424 80254B44 00000000 */  nop
/* 183428 80254B48 00621825 */  or        $v1, $v1, $v0
/* 18342C 80254B4C A2030000 */  sb        $v1, 0x0($s0)
.L80254B50:
/* 183430 80254B50 0C00A6C9 */  jal       clamp_angle
/* 183434 80254B54 C64C0160 */   lwc1     $f12, 0x160($s2)
/* 183438 80254B58 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 18343C 80254B5C 44811000 */  mtc1      $at, $f2
/* 183440 80254B60 00000000 */  nop
/* 183444 80254B64 46020002 */  mul.s     $f0, $f0, $f2
/* 183448 80254B68 00000000 */  nop
/* 18344C 80254B6C 02711021 */  addu      $v0, $s3, $s1
/* 183450 80254B70 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 183454 80254B74 44811000 */  mtc1      $at, $f2
/* 183458 80254B78 00000000 */  nop
/* 18345C 80254B7C 4600103E */  c.le.s    $f2, $f0
/* 183460 80254B80 00000000 */  nop
/* 183464 80254B84 45010005 */  bc1t      .L80254B9C
/* 183468 80254B88 2444088C */   addiu    $a0, $v0, 0x88C
/* 18346C 80254B8C 4600010D */  trunc.w.s $f4, $f0
/* 183470 80254B90 44032000 */  mfc1      $v1, $f4
D_80254B94:
/* 183474 80254B94 080952EE */  j         .L80254BB8
/* 183478 80254B98 A0830000 */   sb       $v1, 0x0($a0)
.L80254B9C:
/* 18347C 80254B9C 46020001 */  sub.s     $f0, $f0, $f2
nok_02_D_80254BA0:
/* 183480 80254BA0 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 183484 80254BA4 4600010D */  trunc.w.s $f4, $f0
/* 183488 80254BA8 44032000 */  mfc1      $v1, $f4
/* 18348C 80254BAC 00000000 */  nop
/* 183490 80254BB0 00621825 */  or        $v1, $v1, $v0
D_80254BB4:
/* 183494 80254BB4 A0830000 */  sb        $v1, 0x0($a0)
.L80254BB8:
/* 183498 80254BB8 0C00A6C9 */  jal       clamp_angle
/* 18349C 80254BBC C64C0164 */   lwc1     $f12, 0x164($s2)
/* 1834A0 80254BC0 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 1834A4 80254BC4 44811000 */  mtc1      $at, $f2
/* 1834A8 80254BC8 00000000 */  nop
/* 1834AC 80254BCC 46020002 */  mul.s     $f0, $f0, $f2
/* 1834B0 80254BD0 00000000 */  nop
/* 1834B4 80254BD4 02711021 */  addu      $v0, $s3, $s1
/* 1834B8 80254BD8 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 1834BC 80254BDC 44811000 */  mtc1      $at, $f2
/* 1834C0 80254BE0 00000000 */  nop
/* 1834C4 80254BE4 4600103E */  c.le.s    $f2, $f0
/* 1834C8 80254BE8 00000000 */  nop
/* 1834CC 80254BEC 45010005 */  bc1t      .L80254C04
/* 1834D0 80254BF0 2444089C */   addiu    $a0, $v0, 0x89C
/* 1834D4 80254BF4 4600010D */  trunc.w.s $f4, $f0
/* 1834D8 80254BF8 44032000 */  mfc1      $v1, $f4
/* 1834DC 80254BFC 08095308 */  j         .L80254C20
/* 1834E0 80254C00 A0830000 */   sb       $v1, 0x0($a0)
.L80254C04:
/* 1834E4 80254C04 46020001 */  sub.s     $f0, $f0, $f2
/* 1834E8 80254C08 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 1834EC 80254C0C 4600010D */  trunc.w.s $f4, $f0
/* 1834F0 80254C10 44032000 */  mfc1      $v1, $f4
/* 1834F4 80254C14 00000000 */  nop
/* 1834F8 80254C18 00621825 */  or        $v1, $v1, $v0
/* 1834FC 80254C1C A0830000 */  sb        $v1, 0x0($a0)
.L80254C20:
/* 183500 80254C20 26310001 */  addiu     $s1, $s1, 0x1
/* 183504 80254C24 2A220010 */  slti      $v0, $s1, 0x10
/* 183508 80254C28 50400001 */  beql      $v0, $zero, .L80254C30
/* 18350C 80254C2C 0000882D */   daddu    $s1, $zero, $zero
.L80254C30:
/* 183510 80254C30 A27107D9 */  sb        $s1, 0x7D9($s3)
.L80254C34:
/* 183514 80254C34 8FBF0020 */  lw        $ra, 0x20($sp)
/* 183518 80254C38 8FB3001C */  lw        $s3, 0x1C($sp)
/* 18351C 80254C3C 8FB20018 */  lw        $s2, 0x18($sp)
/* 183520 80254C40 8FB10014 */  lw        $s1, 0x14($sp)
/* 183524 80254C44 8FB00010 */  lw        $s0, 0x10($sp)
/* 183528 80254C48 03E00008 */  jr        $ra
/* 18352C 80254C4C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void func_802549F4(Actor* actor) {
    ActorPart* partsTable = actor->partsTable;
    DecorationTable* decorationTable = partsTable->decorationTable;

    if (!(partsTable->flags & ACTOR_PART_FLAG_INVISIBLE) && partsTable->idleAnimations != NULL) {
        s32 i = decorationTable->unk_7D9;

        decorationTable->posX[i] = partsTable->currentPos.x;
        decorationTable->posY[i] = partsTable->currentPos.y;
        decorationTable->posZ[i] = partsTable->currentPos.z;
        decorationTable->yaw[i] = actor->yaw;

        decorationTable->rotationPivotOffsetX[i] = actor->rotationPivotOffset.x * actor->scalingFactor;
        decorationTable->rotationPivotOffsetY[i] = actor->rotationPivotOffset.y * actor->scalingFactor;

        decorationTable->rotX[i] = clamp_angle(actor->rotation.x) * 0.5f;
        decorationTable->rotY[i] = clamp_angle(actor->rotation.y) * 0.5f;
        decorationTable->rotZ[i] = clamp_angle(actor->rotation.z) * 0.5f;

        i++;
        if (i >= ARRAY_COUNT(decorationTable->posX)) {
            i = 0;
        }
        decorationTable->unk_7D9 = i;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80114B58
/* AB258 80114B58 3C028015 */  lui       $v0, %hi(mdl_nextTextureAddress)
/* AB25C 80114B5C 8C423368 */  lw        $v0, %lo(mdl_nextTextureAddress)($v0)
/* AB260 80114B60 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* AB264 80114B64 AFB1002C */  sw        $s1, 0x2C($sp)
/* AB268 80114B68 0080882D */  daddu     $s1, $a0, $zero
/* AB26C 80114B6C AFB20030 */  sw        $s2, 0x30($sp)
/* AB270 80114B70 00A0902D */  daddu     $s2, $a1, $zero
/* AB274 80114B74 AFB70044 */  sw        $s7, 0x44($sp)
/* AB278 80114B78 00C0B82D */  daddu     $s7, $a2, $zero
/* AB27C 80114B7C AFB40038 */  sw        $s4, 0x38($sp)
/* AB280 80114B80 AFBF0048 */  sw        $ra, 0x48($sp)
/* AB284 80114B84 AFB60040 */  sw        $s6, 0x40($sp)
/* AB288 80114B88 AFB5003C */  sw        $s5, 0x3C($sp)
/* AB28C 80114B8C AFB30034 */  sw        $s3, 0x34($sp)
/* AB290 80114B90 AFB00028 */  sw        $s0, 0x28($sp)
/* AB294 80114B94 AE420034 */  sw        $v0, 0x34($s2)
/* AB298 80114B98 8FB30060 */  lw        $s3, 0x60($sp)
/* AB29C 80114B9C 8FB50064 */  lw        $s5, 0x64($sp)
/* AB2A0 80114BA0 8FB60068 */  lw        $s6, 0x68($sp)
/* AB2A4 80114BA4 12600004 */  beqz      $s3, .L80114BB8
/* AB2A8 80114BA8 00E0A02D */   daddu    $s4, $a3, $zero
/* AB2AC 80114BAC 00541021 */  addu      $v0, $v0, $s4
/* AB2B0 80114BB0 080452EF */  j         .L80114BBC
/* AB2B4 80114BB4 AE420038 */   sw       $v0, 0x38($s2)
.L80114BB8:
/* AB2B8 80114BB8 AE400038 */  sw        $zero, 0x38($s2)
.L80114BBC:
/* AB2BC 80114BBC 0220202D */  daddu     $a0, $s1, $zero
/* AB2C0 80114BC0 3C108015 */  lui       $s0, %hi(mdl_nextTextureAddress)
/* AB2C4 80114BC4 26103368 */  addiu     $s0, $s0, %lo(mdl_nextTextureAddress)
/* AB2C8 80114BC8 02342821 */  addu      $a1, $s1, $s4
/* AB2CC 80114BCC 8E060000 */  lw        $a2, 0x0($s0)
/* AB2D0 80114BD0 0C00A5CF */  jal       dma_copy
/* AB2D4 80114BD4 00B32821 */   addu     $a1, $a1, $s3
/* AB2D8 80114BD8 02931021 */  addu      $v0, $s4, $s3
/* AB2DC 80114BDC 8E030000 */  lw        $v1, 0x0($s0)
/* AB2E0 80114BE0 02228821 */  addu      $s1, $s1, $v0
/* AB2E4 80114BE4 00621021 */  addu      $v0, $v1, $v0
/* AB2E8 80114BE8 12A00013 */  beqz      $s5, .L80114C38
/* AB2EC 80114BEC AE020000 */   sw       $v0, 0x0($s0)
/* AB2F0 80114BF0 12C00004 */  beqz      $s6, .L80114C04
/* AB2F4 80114BF4 AE42003C */   sw       $v0, 0x3C($s2)
/* AB2F8 80114BF8 00551021 */  addu      $v0, $v0, $s5
/* AB2FC 80114BFC 08045302 */  j         .L80114C08
/* AB300 80114C00 AE420040 */   sw       $v0, 0x40($s2)
.L80114C04:
/* AB304 80114C04 AE400040 */  sw        $zero, 0x40($s2)
.L80114C08:
/* AB308 80114C08 0220202D */  daddu     $a0, $s1, $zero
/* AB30C 80114C0C 3C108015 */  lui       $s0, %hi(mdl_nextTextureAddress)
/* AB310 80114C10 26103368 */  addiu     $s0, $s0, %lo(mdl_nextTextureAddress)
/* AB314 80114C14 00952821 */  addu      $a1, $a0, $s5
/* AB318 80114C18 8E060000 */  lw        $a2, 0x0($s0)
/* AB31C 80114C1C 0C00A5CF */  jal       dma_copy
/* AB320 80114C20 00B62821 */   addu     $a1, $a1, $s6
/* AB324 80114C24 8E020000 */  lw        $v0, 0x0($s0)
/* AB328 80114C28 02B61821 */  addu      $v1, $s5, $s6
/* AB32C 80114C2C 00431021 */  addu      $v0, $v0, $v1
/* AB330 80114C30 08045310 */  j         .L80114C40
/* AB334 80114C34 AE020000 */   sw       $v0, 0x0($s0)
.L80114C38:
/* AB338 80114C38 AE400040 */  sw        $zero, 0x40($s2)
/* AB33C 80114C3C AE40003C */  sw        $zero, 0x3C($s2)
.L80114C40:
/* AB340 80114C40 26450004 */  addiu     $a1, $s2, 0x4
/* AB344 80114C44 02E0202D */  daddu     $a0, $s7, $zero
/* AB348 80114C48 02E51025 */  or        $v0, $s7, $a1
/* AB34C 80114C4C 3C038015 */  lui       $v1, %hi(mdl_nextTextureAddress)
/* AB350 80114C50 8C633368 */  lw        $v1, %lo(mdl_nextTextureAddress)($v1)
/* AB354 80114C54 30420003 */  andi      $v0, $v0, 0x3
/* AB358 80114C58 10400017 */  beqz      $v0, .L80114CB8
/* AB35C 80114C5C AE430000 */   sw       $v1, 0x0($s2)
/* AB360 80114C60 26E20030 */  addiu     $v0, $s7, 0x30
.L80114C64:
/* AB364 80114C64 88880000 */  lwl       $t0, 0x0($a0)
/* AB368 80114C68 98880003 */  lwr       $t0, 0x3($a0)
/* AB36C 80114C6C 88890004 */  lwl       $t1, 0x4($a0)
/* AB370 80114C70 98890007 */  lwr       $t1, 0x7($a0)
/* AB374 80114C74 888A0008 */  lwl       $t2, 0x8($a0)
/* AB378 80114C78 988A000B */  lwr       $t2, 0xB($a0)
/* AB37C 80114C7C 888B000C */  lwl       $t3, 0xC($a0)
/* AB380 80114C80 988B000F */  lwr       $t3, 0xF($a0)
/* AB384 80114C84 A8A80000 */  swl       $t0, 0x0($a1)
/* AB388 80114C88 B8A80003 */  swr       $t0, 0x3($a1)
/* AB38C 80114C8C A8A90004 */  swl       $t1, 0x4($a1)
/* AB390 80114C90 B8A90007 */  swr       $t1, 0x7($a1)
/* AB394 80114C94 A8AA0008 */  swl       $t2, 0x8($a1)
/* AB398 80114C98 B8AA000B */  swr       $t2, 0xB($a1)
/* AB39C 80114C9C A8AB000C */  swl       $t3, 0xC($a1)
/* AB3A0 80114CA0 B8AB000F */  swr       $t3, 0xF($a1)
/* AB3A4 80114CA4 24840010 */  addiu     $a0, $a0, 0x10
/* AB3A8 80114CA8 1482FFEE */  bne       $a0, $v0, .L80114C64
/* AB3AC 80114CAC 24A50010 */   addiu    $a1, $a1, 0x10
/* AB3B0 80114CB0 0804533A */  j         .L80114CE8
/* AB3B4 80114CB4 00000000 */   nop
.L80114CB8:
/* AB3B8 80114CB8 26E20030 */  addiu     $v0, $s7, 0x30
.L80114CBC:
/* AB3BC 80114CBC 8C880000 */  lw        $t0, 0x0($a0)
/* AB3C0 80114CC0 8C890004 */  lw        $t1, 0x4($a0)
/* AB3C4 80114CC4 8C8A0008 */  lw        $t2, 0x8($a0)
/* AB3C8 80114CC8 8C8B000C */  lw        $t3, 0xC($a0)
/* AB3CC 80114CCC ACA80000 */  sw        $t0, 0x0($a1)
/* AB3D0 80114CD0 ACA90004 */  sw        $t1, 0x4($a1)
/* AB3D4 80114CD4 ACAA0008 */  sw        $t2, 0x8($a1)
/* AB3D8 80114CD8 ACAB000C */  sw        $t3, 0xC($a1)
/* AB3DC 80114CDC 24840010 */  addiu     $a0, $a0, 0x10
/* AB3E0 80114CE0 1482FFF6 */  bne       $a0, $v0, .L80114CBC
/* AB3E4 80114CE4 24A50010 */   addiu    $a1, $a1, 0x10
.L80114CE8:
/* AB3E8 80114CE8 8E42003C */  lw        $v0, 0x3C($s2)
/* AB3EC 80114CEC 02E0202D */  daddu     $a0, $s7, $zero
/* AB3F0 80114CF0 AFA20010 */  sw        $v0, 0x10($sp)
/* AB3F4 80114CF4 8E420040 */  lw        $v0, 0x40($s2)
/* AB3F8 80114CF8 3C108015 */  lui       $s0, %hi(mdl_nextTextureAddress)
/* AB3FC 80114CFC 26103368 */  addiu     $s0, $s0, %lo(mdl_nextTextureAddress)
/* AB400 80114D00 AFA00018 */  sw        $zero, 0x18($sp)
/* AB404 80114D04 AFA0001C */  sw        $zero, 0x1C($sp)
/* AB408 80114D08 AFA00020 */  sw        $zero, 0x20($sp)
/* AB40C 80114D0C AFA00024 */  sw        $zero, 0x24($sp)
/* AB410 80114D10 AFA20014 */  sw        $v0, 0x14($sp)
/* AB414 80114D14 8E460034 */  lw        $a2, 0x34($s2)
/* AB418 80114D18 8E470038 */  lw        $a3, 0x38($s2)
/* AB41C 80114D1C 0C04603A */  jal       func_801180E8
/* AB420 80114D20 0200282D */   daddu    $a1, $s0, $zero
/* AB424 80114D24 8E020000 */  lw        $v0, 0x0($s0)
/* AB428 80114D28 0040182D */  daddu     $v1, $v0, $zero
/* AB42C 80114D2C 24420008 */  addiu     $v0, $v0, 0x8
/* AB430 80114D30 AE020000 */  sw        $v0, 0x0($s0)
/* AB434 80114D34 3C02DF00 */  lui       $v0, (0xDF000000 >> 16)
/* AB438 80114D38 AC620000 */  sw        $v0, 0x0($v1)
/* AB43C 80114D3C AC600004 */  sw        $zero, 0x4($v1)
/* AB440 80114D40 8FBF0048 */  lw        $ra, 0x48($sp)
/* AB444 80114D44 8FB70044 */  lw        $s7, 0x44($sp)
/* AB448 80114D48 8FB60040 */  lw        $s6, 0x40($sp)
/* AB44C 80114D4C 8FB5003C */  lw        $s5, 0x3C($sp)
/* AB450 80114D50 8FB40038 */  lw        $s4, 0x38($sp)
/* AB454 80114D54 8FB30034 */  lw        $s3, 0x34($sp)
/* AB458 80114D58 8FB20030 */  lw        $s2, 0x30($sp)
/* AB45C 80114D5C 8FB1002C */  lw        $s1, 0x2C($sp)
/* AB460 80114D60 8FB00028 */  lw        $s0, 0x28($sp)
/* AB464 80114D64 03E00008 */  jr        $ra
/* AB468 80114D68 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void func_80114B58(u32 romOffset, TextureHandle* handle, TextureHeader* header, s32 mainSize, s32 mainPalSize, s32 auxSize, s32 auxPalSize) {
    Gfx** temp;

    handle->raster = (IMG_PTR) mdl_nextTextureAddress;
    if (mainPalSize != 0) {
        handle->palette = (PAL_PTR) (mdl_nextTextureAddress + mainSize);
    } else {
        handle->palette = NULL;
    }
    dma_copy((u8*) romOffset, (u8*) (romOffset + mainSize + mainPalSize), mdl_nextTextureAddress);
    romOffset += mainSize + mainPalSize;
    mdl_nextTextureAddress += mainSize + mainPalSize;
    if (auxSize != 0) {
        handle->auxRaster = (IMG_PTR) mdl_nextTextureAddress;
        if (auxPalSize != 0) {
            handle->auxPalette = (PAL_PTR) (mdl_nextTextureAddress + auxSize);
        } else {
            handle->auxPalette = NULL;
        }
        dma_copy((u8*) romOffset, (u8*) (romOffset + auxSize + auxPalSize), mdl_nextTextureAddress);
        mdl_nextTextureAddress += auxSize + auxPalSize;
    } else {
        handle->auxPalette = NULL;
        handle->auxRaster = NULL;
    }

    handle->gfx = (Gfx*) mdl_nextTextureAddress;
    memcpy(&handle->header, header, sizeof(*header));
    func_801180E8(header, (Gfx**)&mdl_nextTextureAddress, handle->raster, handle->palette, handle->auxRaster, handle->auxPalette, 0, 0, 0, 0);

    temp = (Gfx**) &mdl_nextTextureAddress;
    gSPEndDisplayList((*temp)++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel flower_splash_main
/* 32C988 E00101E8 27BDFF80 */  addiu     $sp, $sp, -0x80
/* 32C98C E00101EC F7BA0068 */  sdc1      $f26, 0x68($sp)
/* 32C990 E00101F0 46006686 */  mov.s     $f26, $f12
/* 32C994 E00101F4 F7BC0070 */  sdc1      $f28, 0x70($sp)
/* 32C998 E00101F8 46007706 */  mov.s     $f28, $f14
/* 32C99C E00101FC 27A40010 */  addiu     $a0, $sp, 0x10
/* 32C9A0 E0010200 F7BE0078 */  sdc1      $f30, 0x78($sp)
/* 32C9A4 E0010204 4486F000 */  mtc1      $a2, $f30
/* 32C9A8 E0010208 3C02E001 */  lui       $v0, %hi(flower_splash_init)
/* 32C9AC E001020C 244203EC */  addiu     $v0, $v0, %lo(flower_splash_init)
/* 32C9B0 E0010210 AFA20018 */  sw        $v0, 0x18($sp)
/* 32C9B4 E0010214 3C02E001 */  lui       $v0, %hi(flower_splash_update)
/* 32C9B8 E0010218 244203F4 */  addiu     $v0, $v0, %lo(flower_splash_update)
/* 32C9BC E001021C AFA2001C */  sw        $v0, 0x1C($sp)
/* 32C9C0 E0010220 3C02E001 */  lui       $v0, %hi(flower_splash_render)
/* 32C9C4 E0010224 244204B0 */  addiu     $v0, $v0, %lo(flower_splash_render)
/* 32C9C8 E0010228 AFA20020 */  sw        $v0, 0x20($sp)
/* 32C9CC E001022C 24020008 */  addiu     $v0, $zero, 0x8
/* 32C9D0 E0010230 AFBF0048 */  sw        $ra, 0x48($sp)
/* 32C9D4 E0010234 AFB70044 */  sw        $s7, 0x44($sp)
/* 32C9D8 E0010238 AFB60040 */  sw        $s6, 0x40($sp)
/* 32C9DC E001023C AFB5003C */  sw        $s5, 0x3C($sp)
/* 32C9E0 E0010240 AFB40038 */  sw        $s4, 0x38($sp)
/* 32C9E4 E0010244 AFB30034 */  sw        $s3, 0x34($sp)
/* 32C9E8 E0010248 AFB20030 */  sw        $s2, 0x30($sp)
/* 32C9EC E001024C AFB1002C */  sw        $s1, 0x2C($sp)
/* 32C9F0 E0010250 AFB00028 */  sw        $s0, 0x28($sp)
/* 32C9F4 E0010254 F7B80060 */  sdc1      $f24, 0x60($sp)
/* 32C9F8 E0010258 F7B60058 */  sdc1      $f22, 0x58($sp)
/* 32C9FC E001025C F7B40050 */  sdc1      $f20, 0x50($sp)
/* 32CA00 E0010260 AFA7008C */  sw        $a3, 0x8C($sp)
/* 32CA04 E0010264 AFA00010 */  sw        $zero, 0x10($sp)
/* 32CA08 E0010268 AFA00024 */  sw        $zero, 0x24($sp)
/* 32CA0C E001026C 0C080124 */  jal       shim_create_effect_instance
/* 32CA10 E0010270 AFA20014 */   sw       $v0, 0x14($sp)
/* 32CA14 E0010274 240402F8 */  addiu     $a0, $zero, 0x2F8
/* 32CA18 E0010278 24140005 */  addiu     $s4, $zero, 0x5
/* 32CA1C E001027C 0040802D */  daddu     $s0, $v0, $zero
/* 32CA20 E0010280 0C08012C */  jal       shim_general_heap_malloc
/* 32CA24 E0010284 AE140008 */   sw       $s4, 0x8($s0)
/* 32CA28 E0010288 0040882D */  daddu     $s1, $v0, $zero
/* 32CA2C E001028C 16200003 */  bnez      $s1, .LE001029C
/* 32CA30 E0010290 AE11000C */   sw       $s1, 0xC($s0)
.LE0010294:
/* 32CA34 E0010294 080040A5 */  j         .LE0010294
/* 32CA38 E0010298 00000000 */   nop
.LE001029C:
/* 32CA3C E001029C 0220202D */  daddu     $a0, $s1, $zero
/* 32CA40 E00102A0 00142880 */  sll       $a1, $s4, 2
/* 32CA44 E00102A4 00B42821 */  addu      $a1, $a1, $s4
/* 32CA48 E00102A8 00052880 */  sll       $a1, $a1, 2
/* 32CA4C E00102AC 00B42823 */  subu      $a1, $a1, $s4
/* 32CA50 E00102B0 0C080130 */  jal       shim_mem_clear
/* 32CA54 E00102B4 000528C0 */   sll      $a1, $a1, 3
/* 32CA58 E00102B8 1280003B */  beqz      $s4, .LE00103A8
/* 32CA5C E00102BC 0000902D */   daddu    $s2, $zero, $zero
/* 32CA60 E00102C0 24170001 */  addiu     $s7, $zero, 0x1
/* 32CA64 E00102C4 241600FF */  addiu     $s6, $zero, 0xFF
/* 32CA68 E00102C8 2415003C */  addiu     $s5, $zero, 0x3C
/* 32CA6C E00102CC 26300094 */  addiu     $s0, $s1, 0x94
/* 32CA70 E00102D0 0240982D */  daddu     $s3, $s2, $zero
/* 32CA74 E00102D4 3C013E99 */  lui       $at, (0x3E999999 >> 16)
/* 32CA78 E00102D8 34219999 */  ori       $at, $at, (0x3E999999 & 0xFFFF)
/* 32CA7C E00102DC 4481C000 */  mtc1      $at, $f24
/* 32CA80 E00102E0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 32CA84 E00102E4 4481B000 */  mtc1      $at, $f22
.LE00102E8:
/* 32CA88 E00102E8 44930000 */  mtc1      $s3, $f0
/* 32CA8C E00102EC 00000000 */  nop
/* 32CA90 E00102F0 46800020 */  cvt.s.w   $f0, $f0
/* 32CA94 E00102F4 26730048 */  addiu     $s3, $s3, 0x48
/* 32CA98 E00102F8 C7A6008C */  lwc1      $f6, 0x8C($sp)
/* 32CA9C E00102FC 3C01BDA3 */  lui       $at, (0xBDA3D70A >> 16)
/* 32CAA0 E0010300 3421D70A */  ori       $at, $at, (0xBDA3D70A & 0xFFFF)
/* 32CAA4 E0010304 44811000 */  mtc1      $at, $f2
/* 32CAA8 E0010308 3C01C079 */  lui       $at, (0xC079999A >> 16)
/* 32CAAC E001030C 3421999A */  ori       $at, $at, (0xC079999A & 0xFFFF)
/* 32CAB0 E0010310 44812000 */  mtc1      $at, $f4
/* 32CAB4 E0010314 46003000 */  add.s     $f0, $f6, $f0
/* 32CAB8 E0010318 26520001 */  addiu     $s2, $s2, 0x1
/* 32CABC E001031C AE370000 */  sw        $s7, 0x0($s1)
/* 32CAC0 E0010320 E600FF94 */  swc1      $f0, -0x6C($s0)
/* 32CAC4 E0010324 46000306 */  mov.s     $f12, $f0
/* 32CAC8 E0010328 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 32CACC E001032C 44810000 */  mtc1      $at, $f0
/* 32CAD0 E0010330 26310098 */  addiu     $s1, $s1, 0x98
/* 32CAD4 E0010334 E618FFE0 */  swc1      $f24, -0x20($s0)
/* 32CAD8 E0010338 AE00FFE4 */  sw        $zero, -0x1C($s0)
/* 32CADC E001033C AE00FFE8 */  sw        $zero, -0x18($s0)
/* 32CAE0 E0010340 E61AFF78 */  swc1      $f26, -0x88($s0)
/* 32CAE4 E0010344 E61CFF7C */  swc1      $f28, -0x84($s0)
/* 32CAE8 E0010348 E61EFF80 */  swc1      $f30, -0x80($s0)
/* 32CAEC E001034C E616FF84 */  swc1      $f22, -0x7C($s0)
/* 32CAF0 E0010350 E616FF88 */  swc1      $f22, -0x78($s0)
/* 32CAF4 E0010354 E616FF8C */  swc1      $f22, -0x74($s0)
/* 32CAF8 E0010358 A216FF74 */  sb        $s6, -0x8C($s0)
/* 32CAFC E001035C A615FF72 */  sh        $s5, -0x8E($s0)
/* 32CB00 E0010360 AE00FF90 */  sw        $zero, -0x70($s0)
/* 32CB04 E0010364 AE00FF98 */  sw        $zero, -0x68($s0)
/* 32CB08 E0010368 AE00FFF4 */  sw        $zero, -0xC($s0)
/* 32CB0C E001036C AE00FFF8 */  sw        $zero, -0x8($s0)
/* 32CB10 E0010370 E602FFF0 */  swc1      $f2, -0x10($s0)
/* 32CB14 E0010374 E604FFDC */  swc1      $f4, -0x24($s0)
/* 32CB18 E0010378 0C08013C */  jal       shim_clamp_angle
/* 32CB1C E001037C E600FFEC */   swc1     $f0, -0x14($s0)
/* 32CB20 E0010380 46000506 */  mov.s     $f20, $f0
/* 32CB24 E0010384 0C080140 */  jal       shim_sin_deg
/* 32CB28 E0010388 4600A306 */   mov.s    $f12, $f20
/* 32CB2C E001038C 4600A306 */  mov.s     $f12, $f20
/* 32CB30 E0010390 0C080144 */  jal       shim_cos_deg
/* 32CB34 E0010394 E600FFFC */   swc1     $f0, -0x4($s0)
/* 32CB38 E0010398 E6000000 */  swc1      $f0, 0x0($s0)
/* 32CB3C E001039C 0254102A */  slt       $v0, $s2, $s4
/* 32CB40 E00103A0 1440FFD1 */  bnez      $v0, .LE00102E8
/* 32CB44 E00103A4 26100098 */   addiu    $s0, $s0, 0x98
.LE00103A8:
/* 32CB48 E00103A8 8FBF0048 */  lw        $ra, 0x48($sp)
/* 32CB4C E00103AC 8FB70044 */  lw        $s7, 0x44($sp)
/* 32CB50 E00103B0 8FB60040 */  lw        $s6, 0x40($sp)
/* 32CB54 E00103B4 8FB5003C */  lw        $s5, 0x3C($sp)
/* 32CB58 E00103B8 8FB40038 */  lw        $s4, 0x38($sp)
/* 32CB5C E00103BC 8FB30034 */  lw        $s3, 0x34($sp)
/* 32CB60 E00103C0 8FB20030 */  lw        $s2, 0x30($sp)
/* 32CB64 E00103C4 8FB1002C */  lw        $s1, 0x2C($sp)
/* 32CB68 E00103C8 8FB00028 */  lw        $s0, 0x28($sp)
/* 32CB6C E00103CC D7BE0078 */  ldc1      $f30, 0x78($sp)
/* 32CB70 E00103D0 D7BC0070 */  ldc1      $f28, 0x70($sp)
/* 32CB74 E00103D4 D7BA0068 */  ldc1      $f26, 0x68($sp)
/* 32CB78 E00103D8 D7B80060 */  ldc1      $f24, 0x60($sp)
/* 32CB7C E00103DC D7B60058 */  ldc1      $f22, 0x58($sp)
/* 32CB80 E00103E0 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 32CB84 E00103E4 03E00008 */  jr        $ra
/* 32CB88 E00103E8 27BD0080 */   addiu    $sp, $sp, 0x80

### DECOMPILED C INSTRUCTIONS:

void flower_splash_main(f32 posX, f32 posY, f32 posZ, f32 angle) {
    EffectBlueprint bp;
    EffectInstance* effect;
    FlowerFXData* part;
    s32 numParts = 5;
    f32 partAngle;
    s32 i;

    bp.init = flower_splash_init;
    bp.update = flower_splash_update;
    bp.renderWorld = flower_splash_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_FLOWER_SPLASH;

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

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

    shim_mem_clear(part, numParts * sizeof(*part));

    for (i = 0; i < numParts; i++, part++) {
        part->alive = TRUE;
        part->rot.y = angle + (i * 72);
        part->velocityScaleB = 0.29999998f;
        part->visibilityAmt = 0.0f;
        part->unk_7C = 0.0f;

        part->pos.x = posX;
        part->pos.y = posY;
        part->pos.z = posZ;

        part->scale.x = 1.0f;
        part->scale.y = 1.0f;
        part->scale.z = 1.0f;

        part->primAlpha = 255;
        part->timeLeft = 60;

        part->rot.x = 0.0f;
        part->rot.z = 0.0f;

        part->integrator[0] = 1.75f;
        part->integrator[1] = -0.08f;
        part->integrator[2] = 0.0f;
        part->integrator[3] = 0.0f;

        part->velocityScaleA = -3.9f;
        partAngle = shim_clamp_angle(part->rot.y);
        part->velocity.x = shim_sin_deg(partAngle);
        part->velocity.z = shim_cos_deg(partAngle);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel merlin_house_stars_update
/* 3A5674 E00A6124 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 3A5678 E00A6128 AFBF0010 */  sw        $ra, 0x10($sp)
/* 3A567C E00A612C 8C830000 */  lw        $v1, 0x0($a0)
/* 3A5680 E00A6130 8C85000C */  lw        $a1, 0xC($a0)
/* 3A5684 E00A6134 30620010 */  andi      $v0, $v1, 0x10
/* 3A5688 E00A6138 10400005 */  beqz      $v0, .LE00A6150
/* 3A568C E00A613C 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3A5690 E00A6140 00621024 */  and       $v0, $v1, $v0
/* 3A5694 E00A6144 AC820000 */  sw        $v0, 0x0($a0)
/* 3A5698 E00A6148 2402001E */  addiu     $v0, $zero, 0x1E
/* 3A569C E00A614C ACA20004 */  sw        $v0, 0x4($a1)
.LE00A6150:
/* 3A56A0 E00A6150 8CA30004 */  lw        $v1, 0x4($a1)
/* 3A56A4 E00A6154 28620064 */  slti      $v0, $v1, 0x64
/* 3A56A8 E00A6158 10400002 */  beqz      $v0, .LE00A6164
/* 3A56AC E00A615C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3A56B0 E00A6160 ACA20004 */  sw        $v0, 0x4($a1)
.LE00A6164:
/* 3A56B4 E00A6164 8CA20008 */  lw        $v0, 0x8($a1)
/* 3A56B8 E00A6168 8CA30004 */  lw        $v1, 0x4($a1)
/* 3A56BC E00A616C 24420001 */  addiu     $v0, $v0, 0x1
/* 3A56C0 E00A6170 04610005 */  bgez      $v1, .LE00A6188
/* 3A56C4 E00A6174 ACA20008 */   sw       $v0, 0x8($a1)
/* 3A56C8 E00A6178 0C080128 */  jal       shim_remove_effect
/* 3A56CC E00A617C 00000000 */   nop
/* 3A56D0 E00A6180 080298D3 */  j         .LE00A634C
/* 3A56D4 E00A6184 00000000 */   nop
.LE00A6188:
/* 3A56D8 E00A6188 C4A2001C */  lwc1      $f2, 0x1C($a1)
/* 3A56DC E00A618C C4A0002C */  lwc1      $f0, 0x2C($a1)
/* 3A56E0 E00A6190 C4A60020 */  lwc1      $f6, 0x20($a1)
/* 3A56E4 E00A6194 C4A40024 */  lwc1      $f4, 0x24($a1)
/* 3A56E8 E00A6198 46001080 */  add.s     $f2, $f2, $f0
/* 3A56EC E00A619C C4A00030 */  lwc1      $f0, 0x30($a1)
/* 3A56F0 E00A61A0 8CA40008 */  lw        $a0, 0x8($a1)
/* 3A56F4 E00A61A4 46003180 */  add.s     $f6, $f6, $f0
/* 3A56F8 E00A61A8 C4A00034 */  lwc1      $f0, 0x34($a1)
/* 3A56FC E00A61AC 8CA30004 */  lw        $v1, 0x4($a1)
/* 3A5700 E00A61B0 46002100 */  add.s     $f4, $f4, $f0
/* 3A5704 E00A61B4 C4A00028 */  lwc1      $f0, 0x28($a1)
/* 3A5708 E00A61B8 E4A2001C */  swc1      $f2, 0x1C($a1)
/* 3A570C E00A61BC C4A20038 */  lwc1      $f2, 0x38($a1)
/* 3A5710 E00A61C0 28820011 */  slti      $v0, $a0, 0x11
/* 3A5714 E00A61C4 46020000 */  add.s     $f0, $f0, $f2
/* 3A5718 E00A61C8 E4A60020 */  swc1      $f6, 0x20($a1)
/* 3A571C E00A61CC E4A40024 */  swc1      $f4, 0x24($a1)
/* 3A5720 E00A61D0 10400004 */  beqz      $v0, .LE00A61E4
/* 3A5724 E00A61D4 E4A00028 */   swc1     $f0, 0x28($a1)
/* 3A5728 E00A61D8 00041100 */  sll       $v0, $a0, 4
/* 3A572C E00A61DC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3A5730 E00A61E0 ACA20018 */  sw        $v0, 0x18($a1)
.LE00A61E4:
/* 3A5734 E00A61E4 28620010 */  slti      $v0, $v1, 0x10
/* 3A5738 E00A61E8 10400002 */  beqz      $v0, .LE00A61F4
/* 3A573C E00A61EC 00031100 */   sll      $v0, $v1, 4
/* 3A5740 E00A61F0 ACA20018 */  sw        $v0, 0x18($a1)
.LE00A61F4:
/* 3A5744 E00A61F4 C4A2001C */  lwc1      $f2, 0x1C($a1)
/* 3A5748 E00A61F8 44800000 */  mtc1      $zero, $f0
/* 3A574C E00A61FC 00000000 */  nop
/* 3A5750 E00A6200 4600103C */  c.lt.s    $f2, $f0
/* 3A5754 E00A6204 00000000 */  nop
/* 3A5758 E00A6208 45000005 */  bc1f      .LE00A6220
/* 3A575C E00A620C 00000000 */   nop
/* 3A5760 E00A6210 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A5764 E00A6214 44810000 */  mtc1      $at, $f0
/* 3A5768 E00A6218 08029890 */  j         .LE00A6240
/* 3A576C E00A621C 46001000 */   add.s    $f0, $f2, $f0
.LE00A6220:
/* 3A5770 E00A6220 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A5774 E00A6224 44810000 */  mtc1      $at, $f0
/* 3A5778 E00A6228 00000000 */  nop
/* 3A577C E00A622C 4602003C */  c.lt.s    $f0, $f2
/* 3A5780 E00A6230 00000000 */  nop
/* 3A5784 E00A6234 45000003 */  bc1f      .LE00A6244
/* 3A5788 E00A6238 00000000 */   nop
/* 3A578C E00A623C 46001001 */  sub.s     $f0, $f2, $f0
.LE00A6240:
/* 3A5790 E00A6240 E4A0001C */  swc1      $f0, 0x1C($a1)
.LE00A6244:
/* 3A5794 E00A6244 C4A00020 */  lwc1      $f0, 0x20($a1)
/* 3A5798 E00A6248 C4A20030 */  lwc1      $f2, 0x30($a1)
/* 3A579C E00A624C 46020080 */  add.s     $f2, $f0, $f2
/* 3A57A0 E00A6250 44800000 */  mtc1      $zero, $f0
/* 3A57A4 E00A6254 00000000 */  nop
/* 3A57A8 E00A6258 4600103C */  c.lt.s    $f2, $f0
/* 3A57AC E00A625C 00000000 */  nop
/* 3A57B0 E00A6260 45000005 */  bc1f      .LE00A6278
/* 3A57B4 E00A6264 E4A20020 */   swc1     $f2, 0x20($a1)
/* 3A57B8 E00A6268 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A57BC E00A626C 44810000 */  mtc1      $at, $f0
/* 3A57C0 E00A6270 080298A6 */  j         .LE00A6298
/* 3A57C4 E00A6274 46001000 */   add.s    $f0, $f2, $f0
.LE00A6278:
/* 3A57C8 E00A6278 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A57CC E00A627C 44810000 */  mtc1      $at, $f0
/* 3A57D0 E00A6280 00000000 */  nop
/* 3A57D4 E00A6284 4602003C */  c.lt.s    $f0, $f2
/* 3A57D8 E00A6288 00000000 */  nop
/* 3A57DC E00A628C 45000003 */  bc1f      .LE00A629C
/* 3A57E0 E00A6290 00000000 */   nop
/* 3A57E4 E00A6294 46001001 */  sub.s     $f0, $f2, $f0
.LE00A6298:
/* 3A57E8 E00A6298 E4A00020 */  swc1      $f0, 0x20($a1)
.LE00A629C:
/* 3A57EC E00A629C C4A00024 */  lwc1      $f0, 0x24($a1)
/* 3A57F0 E00A62A0 C4A20034 */  lwc1      $f2, 0x34($a1)
/* 3A57F4 E00A62A4 46020080 */  add.s     $f2, $f0, $f2
/* 3A57F8 E00A62A8 44800000 */  mtc1      $zero, $f0
/* 3A57FC E00A62AC 00000000 */  nop
/* 3A5800 E00A62B0 4600103C */  c.lt.s    $f2, $f0
/* 3A5804 E00A62B4 00000000 */  nop
/* 3A5808 E00A62B8 45000005 */  bc1f      .LE00A62D0
/* 3A580C E00A62BC E4A20024 */   swc1     $f2, 0x24($a1)
/* 3A5810 E00A62C0 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A5814 E00A62C4 44810000 */  mtc1      $at, $f0
/* 3A5818 E00A62C8 080298BC */  j         .LE00A62F0
/* 3A581C E00A62CC 46001000 */   add.s    $f0, $f2, $f0
.LE00A62D0:
/* 3A5820 E00A62D0 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A5824 E00A62D4 44810000 */  mtc1      $at, $f0
/* 3A5828 E00A62D8 00000000 */  nop
/* 3A582C E00A62DC 4602003C */  c.lt.s    $f0, $f2
/* 3A5830 E00A62E0 00000000 */  nop
/* 3A5834 E00A62E4 45000003 */  bc1f      .LE00A62F4
/* 3A5838 E00A62E8 00000000 */   nop
/* 3A583C E00A62EC 46001001 */  sub.s     $f0, $f2, $f0
.LE00A62F0:
/* 3A5840 E00A62F0 E4A00024 */  swc1      $f0, 0x24($a1)
.LE00A62F4:
/* 3A5844 E00A62F4 C4A00028 */  lwc1      $f0, 0x28($a1)
/* 3A5848 E00A62F8 C4A20038 */  lwc1      $f2, 0x38($a1)
/* 3A584C E00A62FC 46020080 */  add.s     $f2, $f0, $f2
/* 3A5850 E00A6300 44800000 */  mtc1      $zero, $f0
/* 3A5854 E00A6304 00000000 */  nop
/* 3A5858 E00A6308 4600103C */  c.lt.s    $f2, $f0
/* 3A585C E00A630C 00000000 */  nop
/* 3A5860 E00A6310 45000005 */  bc1f      .LE00A6328
/* 3A5864 E00A6314 E4A20028 */   swc1     $f2, 0x28($a1)
/* 3A5868 E00A6318 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A586C E00A631C 44810000 */  mtc1      $at, $f0
/* 3A5870 E00A6320 080298D2 */  j         .LE00A6348
/* 3A5874 E00A6324 46001000 */   add.s    $f0, $f2, $f0
.LE00A6328:
/* 3A5878 E00A6328 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 3A587C E00A632C 44810000 */  mtc1      $at, $f0
/* 3A5880 E00A6330 00000000 */  nop
/* 3A5884 E00A6334 4602003C */  c.lt.s    $f0, $f2
/* 3A5888 E00A6338 00000000 */  nop
/* 3A588C E00A633C 45000003 */  bc1f      .LE00A634C
/* 3A5890 E00A6340 00000000 */   nop
/* 3A5894 E00A6344 46001001 */  sub.s     $f0, $f2, $f0
.LE00A6348:
/* 3A5898 E00A6348 E4A00028 */  swc1      $f0, 0x28($a1)
.LE00A634C:
/* 3A589C E00A634C 8FBF0010 */  lw        $ra, 0x10($sp)
/* 3A58A0 E00A6350 03E00008 */  jr        $ra
/* 3A58A4 E00A6354 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void merlin_house_stars_update(EffectInstance* effect) {
    MerlinHouseStarsFXData* data = effect->data.merlinHouseStars;
    s32 unk_04;

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

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

    data->unk_08++;

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

    data->unk_1C += data->unk_2C;
    data->unk_20 += data->unk_30;
    data->unk_24 += data->unk_34;
    data->unk_28 += data->unk_38;

    unk_04 = data->unk_04;

    if (data->unk_08 < 17) {
        data->unk_18 = data->unk_08 * 16 - 1;
    }

    if (unk_04 < 16) {
        data->unk_18 = unk_04 * 16;
    }

    if (data->unk_1C < 0.0f) {
        data->unk_1C += 128.0f;
    } else if (data->unk_1C > 128.0f) {
        data->unk_1C -= 128.0f;
    }

    data->unk_20 += data->unk_30;
    if (data->unk_20 < 0.0f) {
        data->unk_20 += 128.0f;
    } else if (data->unk_20 > 128.0f) {
        data->unk_20 -= 128.0f;
    }

    data->unk_24 += data->unk_34;
    if (data->unk_24 < 0.0f) {
        data->unk_24 += 128.0f;
    } else if (data->unk_24 > 128.0f) {
        data->unk_24 -= 128.0f;
    }

    data->unk_28 += data->unk_38;
    if (data->unk_28 < 0.0f) {
        data->unk_28 += 128.0f;
    } else if (data->unk_28 > 128.0f) {
        data->unk_28 -= 128.0f;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel FacePlayerTowardPoint
/* F7234 802D2884 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* F7238 802D2888 AFB20018 */  sw        $s2, 0x18($sp)
/* F723C 802D288C 0080902D */  daddu     $s2, $a0, $zero
/* F7240 802D2890 AFB3001C */  sw        $s3, 0x1C($sp)
/* F7244 802D2894 3C138011 */  lui       $s3, %hi(gPlayerStatus)
/* F7248 802D2898 2673EFC8 */  addiu     $s3, $s3, %lo(gPlayerStatus)
/* F724C 802D289C AFB50024 */  sw        $s5, 0x24($sp)
/* F7250 802D28A0 26550074 */  addiu     $s5, $s2, 0x74
/* F7254 802D28A4 AFB10014 */  sw        $s1, 0x14($sp)
/* F7258 802D28A8 26510078 */  addiu     $s1, $s2, 0x78
/* F725C 802D28AC AFB40020 */  sw        $s4, 0x20($sp)
/* F7260 802D28B0 AFBF0028 */  sw        $ra, 0x28($sp)
/* F7264 802D28B4 AFB00010 */  sw        $s0, 0x10($sp)
/* F7268 802D28B8 F7B40030 */  sdc1      $f20, 0x30($sp)
/* F726C 802D28BC 8E50000C */  lw        $s0, 0xC($s2)
/* F7270 802D28C0 10A00043 */  beqz      $a1, .L802D29D0
/* F7274 802D28C4 2654007C */   addiu    $s4, $s2, 0x7C
/* F7278 802D28C8 8E050000 */  lw        $a1, 0x0($s0)
/* F727C 802D28CC 0C0B210B */  jal       evt_get_float_variable
/* F7280 802D28D0 26100004 */   addiu    $s0, $s0, 0x4
/* F7284 802D28D4 0240202D */  daddu     $a0, $s2, $zero
/* F7288 802D28D8 8E050000 */  lw        $a1, 0x0($s0)
/* F728C 802D28DC 0C0B210B */  jal       evt_get_float_variable
/* F7290 802D28E0 46000506 */   mov.s    $f20, $f0
/* F7294 802D28E4 3C02802E */  lui       $v0, %hi(playerNpc)
/* F7298 802D28E8 8C429D20 */  lw        $v0, %lo(playerNpc)($v0)
/* F729C 802D28EC C6620080 */  lwc1      $f2, 0x80($s3)
/* F72A0 802D28F0 26100004 */  addiu     $s0, $s0, 0x4
/* F72A4 802D28F4 E442000C */  swc1      $f2, 0xC($v0)
/* F72A8 802D28F8 E6420074 */  swc1      $f2, 0x74($s2)
/* F72AC 802D28FC C66C0028 */  lwc1      $f12, 0x28($s3)
/* F72B0 802D2900 46146032 */  c.eq.s    $f12, $f20
/* F72B4 802D2904 00000000 */  nop
/* F72B8 802D2908 45000006 */  bc1f      .L802D2924
/* F72BC 802D290C 46000086 */   mov.s    $f2, $f0
/* F72C0 802D2910 C6600030 */  lwc1      $f0, 0x30($s3)
/* F72C4 802D2914 46020032 */  c.eq.s    $f0, $f2
/* F72C8 802D2918 00000000 */  nop
/* F72CC 802D291C 45010008 */  bc1t      .L802D2940
/* F72D0 802D2920 00000000 */   nop
.L802D2924:
/* F72D4 802D2924 C66E0030 */  lwc1      $f14, 0x30($s3)
/* F72D8 802D2928 4406A000 */  mfc1      $a2, $f20
/* F72DC 802D292C 44071000 */  mfc1      $a3, $f2
/* F72E0 802D2930 0C00A720 */  jal       atan2
/* F72E4 802D2934 00000000 */   nop
/* F72E8 802D2938 080B4A51 */  j         .L802D2944
/* F72EC 802D293C 46000086 */   mov.s    $f2, $f0
.L802D2940:
/* F72F0 802D2940 C6620080 */  lwc1      $f2, 0x80($s3)
.L802D2944:
/* F72F4 802D2944 C6A00000 */  lwc1      $f0, 0x0($s5)
/* F72F8 802D2948 46001001 */  sub.s     $f0, $f2, $f0
/* F72FC 802D294C E6200000 */  swc1      $f0, 0x0($s1)
/* F7300 802D2950 8E050000 */  lw        $a1, 0x0($s0)
/* F7304 802D2954 0C0B1EAF */  jal       evt_get_variable
/* F7308 802D2958 0240202D */   daddu    $a0, $s2, $zero
/* F730C 802D295C AE820000 */  sw        $v0, 0x0($s4)
/* F7310 802D2960 3C02802E */  lui       $v0, %hi(playerNpc)
/* F7314 802D2964 8C429D20 */  lw        $v0, %lo(playerNpc)($v0)
/* F7318 802D2968 3C01C334 */  lui       $at, (0xC3340000 >> 16)
/* F731C 802D296C 44810000 */  mtc1      $at, $f0
/* F7320 802D2970 A440008E */  sh        $zero, 0x8E($v0)
/* F7324 802D2974 C6220000 */  lwc1      $f2, 0x0($s1)
/* F7328 802D2978 4600103C */  c.lt.s    $f2, $f0
/* F732C 802D297C 00000000 */  nop
/* F7330 802D2980 45000007 */  bc1f      .L802D29A0
/* F7334 802D2984 00000000 */   nop
/* F7338 802D2988 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F733C 802D298C 44810000 */  mtc1      $at, $f0
/* F7340 802D2990 00000000 */  nop
/* F7344 802D2994 46001000 */  add.s     $f0, $f2, $f0
/* F7348 802D2998 E6200000 */  swc1      $f0, 0x0($s1)
/* F734C 802D299C C6220000 */  lwc1      $f2, 0x0($s1)
.L802D29A0:
/* F7350 802D29A0 3C014334 */  lui       $at, (0x43340000 >> 16)
/* F7354 802D29A4 44810000 */  mtc1      $at, $f0
/* F7358 802D29A8 00000000 */  nop
/* F735C 802D29AC 4602003C */  c.lt.s    $f0, $f2
/* F7360 802D29B0 00000000 */  nop
/* F7364 802D29B4 45000006 */  bc1f      .L802D29D0
/* F7368 802D29B8 00000000 */   nop
/* F736C 802D29BC 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F7370 802D29C0 44810000 */  mtc1      $at, $f0
/* F7374 802D29C4 00000000 */  nop
/* F7378 802D29C8 46001001 */  sub.s     $f0, $f2, $f0
/* F737C 802D29CC E6200000 */  swc1      $f0, 0x0($s1)
.L802D29D0:
/* F7380 802D29D0 8E820000 */  lw        $v0, 0x0($s4)
/* F7384 802D29D4 1C40000E */  bgtz      $v0, .L802D2A10
/* F7388 802D29D8 00000000 */   nop
/* F738C 802D29DC 3C10802E */  lui       $s0, %hi(playerNpc)
/* F7390 802D29E0 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F7394 802D29E4 8E020000 */  lw        $v0, 0x0($s0)
/* F7398 802D29E8 C6200000 */  lwc1      $f0, 0x0($s1)
/* F739C 802D29EC C44C000C */  lwc1      $f12, 0xC($v0)
/* F73A0 802D29F0 46006300 */  add.s     $f12, $f12, $f0
/* F73A4 802D29F4 0C00A6C9 */  jal       clamp_angle
/* F73A8 802D29F8 E44C000C */   swc1     $f12, 0xC($v0)
/* F73AC 802D29FC 8E030000 */  lw        $v1, 0x0($s0)
/* F73B0 802D2A00 24020002 */  addiu     $v0, $zero, 0x2
/* F73B4 802D2A04 E460000C */  swc1      $f0, 0xC($v1)
/* F73B8 802D2A08 080B4AA0 */  j         .L802D2A80
/* F73BC 802D2A0C E6600080 */   swc1     $f0, 0x80($s3)
.L802D2A10:
/* F73C0 802D2A10 3C10802E */  lui       $s0, %hi(playerNpc)
/* F73C4 802D2A14 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F73C8 802D2A18 8E030000 */  lw        $v1, 0x0($s0)
/* F73CC 802D2A1C 9462008E */  lhu       $v0, 0x8E($v1)
/* F73D0 802D2A20 24420001 */  addiu     $v0, $v0, 0x1
/* F73D4 802D2A24 A462008E */  sh        $v0, 0x8E($v1)
/* F73D8 802D2A28 00021400 */  sll       $v0, $v0, 16
/* F73DC 802D2A2C 00021403 */  sra       $v0, $v0, 16
/* F73E0 802D2A30 C6200000 */  lwc1      $f0, 0x0($s1)
/* F73E4 802D2A34 44821000 */  mtc1      $v0, $f2
/* F73E8 802D2A38 00000000 */  nop
/* F73EC 802D2A3C 468010A0 */  cvt.s.w   $f2, $f2
/* F73F0 802D2A40 46020002 */  mul.s     $f0, $f0, $f2
/* F73F4 802D2A44 00000000 */  nop
/* F73F8 802D2A48 C6AC0000 */  lwc1      $f12, 0x0($s5)
/* F73FC 802D2A4C C6820000 */  lwc1      $f2, 0x0($s4)
/* F7400 802D2A50 468010A0 */  cvt.s.w   $f2, $f2
/* F7404 802D2A54 46020003 */  div.s     $f0, $f0, $f2
/* F7408 802D2A58 46006300 */  add.s     $f12, $f12, $f0
/* F740C 802D2A5C 0C00A6C9 */  jal       clamp_angle
/* F7410 802D2A60 E46C000C */   swc1     $f12, 0xC($v1)
/* F7414 802D2A64 8E020000 */  lw        $v0, 0x0($s0)
/* F7418 802D2A68 E440000C */  swc1      $f0, 0xC($v0)
/* F741C 802D2A6C E6600080 */  swc1      $f0, 0x80($s3)
/* F7420 802D2A70 8442008E */  lh        $v0, 0x8E($v0)
/* F7424 802D2A74 8E830000 */  lw        $v1, 0x0($s4)
/* F7428 802D2A78 0043102A */  slt       $v0, $v0, $v1
/* F742C 802D2A7C 38420001 */  xori      $v0, $v0, 0x1
.L802D2A80:
/* F7430 802D2A80 8FBF0028 */  lw        $ra, 0x28($sp)
/* F7434 802D2A84 8FB50024 */  lw        $s5, 0x24($sp)
/* F7438 802D2A88 8FB40020 */  lw        $s4, 0x20($sp)
/* F743C 802D2A8C 8FB3001C */  lw        $s3, 0x1C($sp)
/* F7440 802D2A90 8FB20018 */  lw        $s2, 0x18($sp)
/* F7444 802D2A94 8FB10014 */  lw        $s1, 0x14($sp)
/* F7448 802D2A98 8FB00010 */  lw        $s0, 0x10($sp)
/* F744C 802D2A9C D7B40030 */  ldc1      $f20, 0x30($sp)
/* F7450 802D2AA0 03E00008 */  jr        $ra
/* F7454 802D2AA4 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

ApiStatus FacePlayerTowardPoint(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32* initialYaw = &script->functionTempF[1];
    f32* deltaYaw = &script->functionTempF[2];
    s32* duration = &script->functionTemp[3];

    if (isInitialCall) {
        f32 targetX = evt_get_float_variable(script, *args++);
        f32 targetY = evt_get_float_variable(script, *args++);
        f32 targetYaw;

        *initialYaw = playerNpc->yaw = playerStatus->targetYaw;

        if (playerStatus->position.x != targetX || playerStatus->position.z != targetY) {
            targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetY);
        } else {
            targetYaw = playerStatus->targetYaw;
        }

        *deltaYaw = targetYaw - *initialYaw;
        *duration = evt_get_variable(script, *args++);
        playerNpc->duration = 0;

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

    if (*duration > 0) {
        playerNpc->duration++;
        playerNpc->yaw = *initialYaw + ((*deltaYaw * playerNpc->duration) / *duration);
        playerStatus->targetYaw = playerNpc->yaw = clamp_angle(playerNpc->yaw);
        if (playerNpc->duration < *duration) {
            return ApiStatus_BLOCK;
        } else {
            return ApiStatus_DONE1;
        }
    }

    playerNpc->yaw += *deltaYaw;
    playerStatus->targetYaw = playerNpc->yaw = clamp_angle(playerNpc->yaw);
    return ApiStatus_DONE2;
}