### RAW ASSEMBLY INSTRUCTIONS:

glabel UseEntryHeading
/* F6920 802D1F70 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* F6924 802D1F74 AFB20020 */  sw        $s2, 0x20($sp)
/* F6928 802D1F78 0080902D */  daddu     $s2, $a0, $zero
/* F692C 802D1F7C AFBF0028 */  sw        $ra, 0x28($sp)
/* F6930 802D1F80 AFB30024 */  sw        $s3, 0x24($sp)
/* F6934 802D1F84 AFB1001C */  sw        $s1, 0x1C($sp)
/* F6938 802D1F88 AFB00018 */  sw        $s0, 0x18($sp)
/* F693C 802D1F8C F7B60038 */  sdc1      $f22, 0x38($sp)
/* F6940 802D1F90 F7B40030 */  sdc1      $f20, 0x30($sp)
/* F6944 802D1F94 0C016AFA */  jal       get_current_map_settings
/* F6948 802D1F98 8E50000C */   lw       $s0, 0xC($s2)
/* F694C 802D1F9C 0240202D */  daddu     $a0, $s2, $zero
/* F6950 802D1FA0 0040882D */  daddu     $s1, $v0, $zero
/* F6954 802D1FA4 8E050000 */  lw        $a1, 0x0($s0)
/* F6958 802D1FA8 0C0B1EAF */  jal       evt_get_variable
/* F695C 802D1FAC 26100004 */   addiu    $s0, $s0, 0x4
/* F6960 802D1FB0 0240202D */  daddu     $a0, $s2, $zero
/* F6964 802D1FB4 8E050000 */  lw        $a1, 0x0($s0)
/* F6968 802D1FB8 0C0B1EAF */  jal       evt_get_variable
/* F696C 802D1FBC 0040982D */   daddu    $s3, $v0, $zero
/* F6970 802D1FC0 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* F6974 802D1FC4 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
/* F6978 802D1FC8 8E050000 */  lw        $a1, 0x0($s0)
/* F697C 802D1FCC 84A3008E */  lh        $v1, 0x8E($a1)
/* F6980 802D1FD0 8E240014 */  lw        $a0, 0x14($s1)
/* F6984 802D1FD4 00031900 */  sll       $v1, $v1, 4
/* F6988 802D1FD8 00641821 */  addu      $v1, $v1, $a0
/* F698C 802D1FDC C4600000 */  lwc1      $f0, 0x0($v1)
/* F6990 802D1FE0 4600020D */  trunc.w.s $f8, $f0
/* F6994 802D1FE4 44074000 */  mfc1      $a3, $f8
/* F6998 802D1FE8 00000000 */  nop
/* F699C 802D1FEC AE470088 */  sw        $a3, 0x88($s2)
/* F69A0 802D1FF0 84A3008E */  lh        $v1, 0x8E($a1)
/* F69A4 802D1FF4 8E240014 */  lw        $a0, 0x14($s1)
/* F69A8 802D1FF8 00031900 */  sll       $v1, $v1, 4
/* F69AC 802D1FFC 00641821 */  addu      $v1, $v1, $a0
/* F69B0 802D2000 C4600004 */  lwc1      $f0, 0x4($v1)
/* F69B4 802D2004 4600020D */  trunc.w.s $f8, $f0
/* F69B8 802D2008 E648008C */  swc1      $f8, 0x8C($s2)
/* F69BC 802D200C 84A3008E */  lh        $v1, 0x8E($a1)
/* F69C0 802D2010 8E240014 */  lw        $a0, 0x14($s1)
/* F69C4 802D2014 00031900 */  sll       $v1, $v1, 4
/* F69C8 802D2018 00641821 */  addu      $v1, $v1, $a0
/* F69CC 802D201C C4600008 */  lwc1      $f0, 0x8($v1)
/* F69D0 802D2020 3C014334 */  lui       $at, (0x43340000 >> 16)
/* F69D4 802D2024 44816000 */  mtc1      $at, $f12
/* F69D8 802D2028 4600020D */  trunc.w.s $f8, $f0
/* F69DC 802D202C 44064000 */  mfc1      $a2, $f8
/* F69E0 802D2030 00000000 */  nop
/* F69E4 802D2034 AE460090 */  sw        $a2, 0x90($s2)
/* F69E8 802D2038 84A3008E */  lh        $v1, 0x8E($a1)
/* F69EC 802D203C 8E240014 */  lw        $a0, 0x14($s1)
/* F69F0 802D2040 00031900 */  sll       $v1, $v1, 4
/* F69F4 802D2044 00641821 */  addu      $v1, $v1, $a0
/* F69F8 802D2048 C460000C */  lwc1      $f0, 0xC($v1)
/* F69FC 802D204C 4487A000 */  mtc1      $a3, $f20
/* F6A00 802D2050 00000000 */  nop
/* F6A04 802D2054 4680A520 */  cvt.s.w   $f20, $f20
/* F6A08 802D2058 460C0300 */  add.s     $f12, $f0, $f12
/* F6A0C 802D205C 4486B000 */  mtc1      $a2, $f22
/* F6A10 802D2060 00000000 */  nop
/* F6A14 802D2064 4680B5A0 */  cvt.s.w   $f22, $f22
/* F6A18 802D2068 0C00A6C9 */  jal       clamp_angle
/* F6A1C 802D206C 0040882D */   daddu    $s1, $v0, $zero
/* F6A20 802D2070 46000306 */  mov.s     $f12, $f0
/* F6A24 802D2074 27A50010 */  addiu     $a1, $sp, 0x10
/* F6A28 802D2078 0C00A88D */  jal       sin_cos_deg
/* F6A2C 802D207C 27A60014 */   addiu    $a2, $sp, 0x14
/* F6A30 802D2080 C7A40010 */  lwc1      $f4, 0x10($sp)
/* F6A34 802D2084 44937000 */  mtc1      $s3, $f14
/* F6A38 802D2088 00000000 */  nop
/* F6A3C 802D208C 468073A0 */  cvt.s.w   $f14, $f14
/* F6A40 802D2090 46047302 */  mul.s     $f12, $f14, $f4
/* F6A44 802D2094 00000000 */  nop
/* F6A48 802D2098 8E020000 */  lw        $v0, 0x0($s0)
/* F6A4C 802D209C 3C013E99 */  lui       $at, (0x3E99999A >> 16)
/* F6A50 802D20A0 3421999A */  ori       $at, $at, (0x3E99999A & 0xFFFF)
/* F6A54 802D20A4 44810000 */  mtc1      $at, $f0
/* F6A58 802D20A8 C4420094 */  lwc1      $f2, 0x94($v0)
/* F6A5C 802D20AC 46001082 */  mul.s     $f2, $f2, $f0
/* F6A60 802D20B0 00000000 */  nop
/* F6A64 802D20B4 C7A00014 */  lwc1      $f0, 0x14($sp)
/* F6A68 802D20B8 46007382 */  mul.s     $f14, $f14, $f0
/* F6A6C 802D20BC 00000000 */  nop
/* F6A70 802D20C0 46001182 */  mul.s     $f6, $f2, $f0
/* F6A74 802D20C4 00000000 */  nop
/* F6A78 802D20C8 46041082 */  mul.s     $f2, $f2, $f4
/* F6A7C 802D20CC 00000000 */  nop
/* F6A80 802D20D0 460CA300 */  add.s     $f12, $f20, $f12
/* F6A84 802D20D4 460EB381 */  sub.s     $f14, $f22, $f14
/* F6A88 802D20D8 46066301 */  sub.s     $f12, $f12, $f6
/* F6A8C 802D20DC 4406A000 */  mfc1      $a2, $f20
/* F6A90 802D20E0 4407B000 */  mfc1      $a3, $f22
/* F6A94 802D20E4 46027381 */  sub.s     $f14, $f14, $f2
/* F6A98 802D20E8 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* F6A9C 802D20EC 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* F6AA0 802D20F0 E60C0028 */  swc1      $f12, 0x28($s0)
/* F6AA4 802D20F4 0C00A7B5 */  jal       dist2D
/* F6AA8 802D20F8 E60E0030 */   swc1     $f14, 0x30($s0)
/* F6AAC 802D20FC 44911000 */  mtc1      $s1, $f2
/* F6AB0 802D2100 00000000 */  nop
/* F6AB4 802D2104 468010A0 */  cvt.s.w   $f2, $f2
/* F6AB8 802D2108 46020003 */  div.s     $f0, $f0, $f2
/* F6ABC 802D210C E6400098 */  swc1      $f0, 0x98($s2)
/* F6AC0 802D2110 8E030000 */  lw        $v1, 0x0($s0)
/* F6AC4 802D2114 3C040400 */  lui       $a0, (0x4000000 >> 16)
/* F6AC8 802D2118 00641825 */  or        $v1, $v1, $a0
/* F6ACC 802D211C AE030000 */  sw        $v1, 0x0($s0)
/* F6AD0 802D2120 8FBF0028 */  lw        $ra, 0x28($sp)
/* F6AD4 802D2124 8FB30024 */  lw        $s3, 0x24($sp)
/* F6AD8 802D2128 8FB20020 */  lw        $s2, 0x20($sp)
/* F6ADC 802D212C 8FB1001C */  lw        $s1, 0x1C($sp)
/* F6AE0 802D2130 8FB00018 */  lw        $s0, 0x18($sp)
/* F6AE4 802D2134 D7B60038 */  ldc1      $f22, 0x38($sp)
/* F6AE8 802D2138 D7B40030 */  ldc1      $f20, 0x30($sp)
/* F6AEC 802D213C 24020002 */  addiu     $v0, $zero, 0x2
/* F6AF0 802D2140 03E00008 */  jr        $ra
/* F6AF4 802D2144 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

ApiStatus UseEntryHeading(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    MapSettings* mapSettings = get_current_map_settings();
    s32 var1 = evt_get_variable(script, *args++);
    s32 var2 = evt_get_variable(script, *args++);
    f32 entryX = script->varTable[1] = (*mapSettings->entryList)[gGameStatusPtr->entryID].x;
    f32 entryY = script->varTable[2] = (*mapSettings->entryList)[gGameStatusPtr->entryID].y;
    f32 entryZ = script->varTable[3] = (*mapSettings->entryList)[gGameStatusPtr->entryID].z;
    f32 cosTheta;
    f32 sinTheta;
    f32 exitTangentFrac;

    sin_cos_deg(clamp_angle((*mapSettings->entryList)[gGameStatusPtr->entryID].yaw + 180.0f), &sinTheta, &cosTheta);

    exitTangentFrac = gGameStatusPtr->exitTangent * 0.3f;
    gPlayerStatus.position.x = (entryX + (var1 * sinTheta)) - (exitTangentFrac * cosTheta);
    gPlayerStatus.position.z = (entryZ - (var1 * cosTheta)) - (exitTangentFrac * sinTheta);

    script->varTableF[5] = dist2D(gPlayerStatus.position.x, gPlayerStatus.position.z, entryX, entryZ) / var2;
    gPlayerStatus.flags |= PS_FLAG_CAMERA_DOESNT_FOLLOW;

    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_enter_map_screen_overlay
/* CECD4 801385D4 3C038015 */  lui       $v1, %hi(CurrentScreenTransition)
/* CECD8 801385D8 8C63C6F0 */  lw        $v1, %lo(CurrentScreenTransition)($v1)
/* CECDC 801385DC 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* CECE0 801385E0 AFB20018 */  sw        $s2, 0x18($sp)
/* CECE4 801385E4 0080902D */  daddu     $s2, $a0, $zero
/* CECE8 801385E8 AFB10014 */  sw        $s1, 0x14($sp)
/* CECEC 801385EC 0000882D */  daddu     $s1, $zero, $zero
/* CECF0 801385F0 AFB00010 */  sw        $s0, 0x10($sp)
/* CECF4 801385F4 24100014 */  addiu     $s0, $zero, 0x14
/* CECF8 801385F8 AFB3001C */  sw        $s3, 0x1C($sp)
/* CECFC 801385FC 0220982D */  daddu     $s3, $s1, $zero
/* CED00 80138600 2C620011 */  sltiu     $v0, $v1, 0x11
/* CED04 80138604 10400030 */  beqz      $v0, .L801386C8
/* CED08 80138608 AFBF0020 */   sw       $ra, 0x20($sp)
/* CED0C 8013860C 00031080 */  sll       $v0, $v1, 2
/* CED10 80138610 3C018015 */  lui       $at, %hi(jtbl_80150F38)
/* CED14 80138614 00220821 */  addu      $at, $at, $v0
/* CED18 80138618 8C220F38 */  lw        $v0, %lo(jtbl_80150F38)($at)
/* CED1C 8013861C 00400008 */  jr        $v0
/* CED20 80138620 00000000 */   nop
glabel .L80138624
/* CED24 80138624 0000202D */  daddu     $a0, $zero, $zero
/* CED28 80138628 240500D0 */  addiu     $a1, $zero, 0xD0
/* CED2C 8013862C 00A0302D */  daddu     $a2, $a1, $zero
/* CED30 80138630 0C04DF84 */  jal       set_screen_overlay_color
/* CED34 80138634 00A0382D */   daddu    $a3, $a1, $zero
/* CED38 80138638 0804E1B2 */  j         .L801386C8
/* CED3C 8013863C 24100032 */   addiu    $s0, $zero, 0x32
glabel .L80138640
/* CED40 80138640 24110001 */  addiu     $s1, $zero, 0x1
/* CED44 80138644 0804E1B2 */  j         .L801386C8
/* CED48 80138648 24100032 */   addiu    $s0, $zero, 0x32
glabel .L8013864C
/* CED4C 8013864C 24110001 */  addiu     $s1, $zero, 0x1
/* CED50 80138650 0804E1B2 */  j         .L801386C8
/* CED54 80138654 24100007 */   addiu    $s0, $zero, 0x7
glabel .L80138658
/* CED58 80138658 0804E1B2 */  j         .L801386C8
/* CED5C 8013865C 24110001 */   addiu    $s1, $zero, 0x1
glabel .L80138660
/* CED60 80138660 0804E1B2 */  j         .L801386C8
/* CED64 80138664 24110004 */   addiu    $s1, $zero, 0x4
glabel .L80138668
/* CED68 80138668 24110005 */  addiu     $s1, $zero, 0x5
/* CED6C 8013866C 0804E1B2 */  j         .L801386C8
/* CED70 80138670 24100007 */   addiu    $s0, $zero, 0x7
glabel .L80138674
/* CED74 80138674 24110004 */  addiu     $s1, $zero, 0x4
/* CED78 80138678 0804E1B2 */  j         .L801386C8
/* CED7C 8013867C 24100007 */   addiu    $s0, $zero, 0x7
glabel .L80138680
/* CED80 80138680 0000202D */  daddu     $a0, $zero, $zero
/* CED84 80138684 0080282D */  daddu     $a1, $a0, $zero
/* CED88 80138688 2406000F */  addiu     $a2, $zero, 0xF
/* CED8C 8013868C 0C04DF93 */  jal       set_screen_overlay_center
/* CED90 80138690 2407001C */   addiu    $a3, $zero, 0x1C
/* CED94 80138694 0000202D */  daddu     $a0, $zero, $zero
/* CED98 80138698 24050001 */  addiu     $a1, $zero, 0x1
/* CED9C 8013869C 24060131 */  addiu     $a2, $zero, 0x131
/* CEDA0 801386A0 0C04DF93 */  jal       set_screen_overlay_center
/* CEDA4 801386A4 2407009C */   addiu    $a3, $zero, 0x9C
/* CEDA8 801386A8 86420000 */  lh        $v0, 0x0($s2)
/* CEDAC 801386AC 2404000C */  addiu     $a0, $zero, 0xC
/* CEDB0 801386B0 44820000 */  mtc1      $v0, $f0
/* CEDB4 801386B4 00000000 */  nop
/* CEDB8 801386B8 46800020 */  cvt.s.w   $f0, $f0
/* CEDBC 801386BC 44050000 */  mfc1      $a1, $f0
/* CEDC0 801386C0 0C04DF62 */  jal       set_screen_overlay_params_front
/* CEDC4 801386C4 24100002 */   addiu    $s0, $zero, 0x2
.L801386C8:
/* CEDC8 801386C8 3C038015 */  lui       $v1, %hi(CurrentScreenTransition)
/* CEDCC 801386CC 8C63C6F0 */  lw        $v1, %lo(CurrentScreenTransition)($v1)
/* CEDD0 801386D0 24020010 */  addiu     $v0, $zero, 0x10
/* CEDD4 801386D4 10620008 */  beq       $v1, $v0, .L801386F8
/* CEDD8 801386D8 00000000 */   nop
/* CEDDC 801386DC 86420000 */  lh        $v0, 0x0($s2)
/* CEDE0 801386E0 44820000 */  mtc1      $v0, $f0
/* CEDE4 801386E4 00000000 */  nop
/* CEDE8 801386E8 46800020 */  cvt.s.w   $f0, $f0
/* CEDEC 801386EC 44050000 */  mfc1      $a1, $f0
/* CEDF0 801386F0 0C04DF62 */  jal       set_screen_overlay_params_front
/* CEDF4 801386F4 0220202D */   daddu    $a0, $s1, $zero
.L801386F8:
/* CEDF8 801386F8 86420000 */  lh        $v0, 0x0($s2)
/* CEDFC 801386FC 96430000 */  lhu       $v1, 0x0($s2)
/* CEE00 80138700 50400001 */  beql      $v0, $zero, .L80138708
/* CEE04 80138704 24130001 */   addiu    $s3, $zero, 0x1
.L80138708:
/* CEE08 80138708 00701023 */  subu      $v0, $v1, $s0
/* CEE0C 8013870C A6420000 */  sh        $v0, 0x0($s2)
/* CEE10 80138710 00021400 */  sll       $v0, $v0, 16
/* CEE14 80138714 04420001 */  bltzl     $v0, .L8013871C
/* CEE18 80138718 A6400000 */   sh       $zero, 0x0($s2)
.L8013871C:
/* CEE1C 8013871C 0260102D */  daddu     $v0, $s3, $zero
/* CEE20 80138720 8FBF0020 */  lw        $ra, 0x20($sp)
/* CEE24 80138724 8FB3001C */  lw        $s3, 0x1C($sp)
/* CEE28 80138728 8FB20018 */  lw        $s2, 0x18($sp)
/* CEE2C 8013872C 8FB10014 */  lw        $s1, 0x14($sp)
/* CEE30 80138730 8FB00010 */  lw        $s0, 0x10($sp)
/* CEE34 80138734 03E00008 */  jr        $ra
/* CEE38 80138738 27BD0028 */   addiu    $sp, $sp, 0x28
/* CEE3C 8013873C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

s16 update_enter_map_screen_overlay(s16* progress) {
    u8 fadeInType = OVERLAY_SCREEN_COLOR;
    s32 fadeRate = STANDARD_FADE_RATE;
    u8 ret = FALSE;

    switch (CurrentScreenTransition) {
        case TRANSITION_END_DEMO_SCENE_WHITE:
            set_screen_overlay_color(SCREEN_LAYER_FRONT, 208, 208, 208);
            fadeRate = FAST_FADE_RATE;
            break;
        case TRANSITION_END_DEMO_SCENE_BLACK:
            fadeInType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = FAST_FADE_RATE;
            break;
        case TRANSITION_BEGIN_OR_END_GAME:
        case TRANSITION_OUTRO_END_SCENE:
        case TRANSITION_SLOW_FADE_TO_WHITE:
        case TRANSITION_MARIO_WHITE:
        case TRANSITION_MARIO_BLACK:
            fadeInType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_STANDARD:
        case TRANSITION_TOY_TRAIN:
        case TRANSITION_BEGIN_OR_END_CHAPTER:
        case TRANSITION_PEACH_CAPTURED:
        case TRANSITION_GET_STAR_CARD:
            fadeInType = OVERLAY_VIEWPORT_COLOR;
            break;
        case TRANSITION_ENTER_WORLD:
        case TRANSITION_END_CHAPTER_INTERRUPTED:
            fadeInType = OVERLAY_VIEWPORT_MARIO;
            break;
        case TRANSITION_AFTER_SAVE_PROMPT:
            fadeInType = OVERLAY_VIEWPORT_STAR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_END_PEACH_INTERLUDE:
            fadeInType = OVERLAY_VIEWPORT_MARIO;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_SLOW_BLUR_MOTION:
            set_screen_overlay_center(SCREEN_LAYER_FRONT, 0, 15, 28);
            set_screen_overlay_center(SCREEN_LAYER_FRONT, 1, 305, 156);
            set_screen_overlay_params_front(OVERLAY_BLUR, *progress);
            fadeRate = VERY_SLOW_FADE_RATE;
            break;
    }

    if (CurrentScreenTransition != TRANSITION_SLOW_BLUR_MOTION) {
        set_screen_overlay_params_front(fadeInType, *progress);
    }

    if (*progress == 0) {
        ret = TRUE;
    }

    *progress -= fadeRate;

    if (*progress < 0) {
        *progress = 0;
    }

    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8004DCB8
/* 290B8 8004DCB8 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 290BC 8004DCBC AFB20018 */  sw        $s2, 0x18($sp)
/* 290C0 8004DCC0 0080902D */  daddu     $s2, $a0, $zero
/* 290C4 8004DCC4 AFB50024 */  sw        $s5, 0x24($sp)
/* 290C8 8004DCC8 00A0A82D */  daddu     $s5, $a1, $zero
/* 290CC 8004DCCC AFB3001C */  sw        $s3, 0x1C($sp)
/* 290D0 8004DCD0 AFBF0028 */  sw        $ra, 0x28($sp)
/* 290D4 8004DCD4 AFB40020 */  sw        $s4, 0x20($sp)
/* 290D8 8004DCD8 AFB10014 */  sw        $s1, 0x14($sp)
/* 290DC 8004DCDC AFB00010 */  sw        $s0, 0x10($sp)
/* 290E0 8004DCE0 8E510000 */  lw        $s1, 0x0($s2)
/* 290E4 8004DCE4 8E540010 */  lw        $s4, 0x10($s2)
/* 290E8 8004DCE8 12200045 */  beqz      $s1, .L8004DE00
/* 290EC 8004DCEC 0000982D */   daddu    $s3, $zero, $zero
/* 290F0 8004DCF0 0C0135E5 */  jal       au_bgm_get_player_with_song_name
/* 290F4 8004DCF4 0220202D */   daddu    $a0, $s1, $zero
/* 290F8 8004DCF8 0040802D */  daddu     $s0, $v0, $zero
/* 290FC 8004DCFC 52000041 */  beql      $s0, $zero, .L8004DE04
/* 29100 8004DD00 24130002 */   addiu    $s3, $zero, 0x2
/* 29104 8004DD04 8E420014 */  lw        $v0, 0x14($s2)
/* 29108 8004DD08 14400032 */  bnez      $v0, .L8004DDD4
/* 2910C 8004DD0C 00000000 */   nop
/* 29110 8004DD10 0C014FD9 */  jal       func_80053F64
/* 29114 8004DD14 0280202D */   daddu    $a0, $s4, $zero
/* 29118 8004DD18 0040402D */  daddu     $t0, $v0, $zero
/* 2911C 8004DD1C 51000039 */  beql      $t0, $zero, .L8004DE04
/* 29120 8004DD20 24130004 */   addiu    $s3, $zero, 0x4
/* 29124 8004DD24 8E02001C */  lw        $v0, 0x1C($s0)
/* 29128 8004DD28 16220037 */  bne       $s1, $v0, .L8004DE08
/* 2912C 8004DD2C 0260102D */   daddu    $v0, $s3, $zero
/* 29130 8004DD30 16A00015 */  bnez      $s5, .L8004DD88
/* 29134 8004DD34 001428C0 */   sll      $a1, $s4, 3
/* 29138 8004DD38 0260382D */  daddu     $a3, $s3, $zero
/* 2913C 8004DD3C 2406025C */  addiu     $a2, $zero, 0x25C
.L8004DD40:
/* 29140 8004DD40 02062821 */  addu      $a1, $s0, $a2
/* 29144 8004DD44 8CA20000 */  lw        $v0, 0x0($a1)
/* 29148 8004DD48 5040000B */  beql      $v0, $zero, .L8004DD78
/* 2914C 8004DD4C 24E70001 */   addiu    $a3, $a3, 0x1
/* 29150 8004DD50 90A30052 */  lbu       $v1, 0x52($a1)
/* 29154 8004DD54 90A40053 */  lbu       $a0, 0x53($a1)
/* 29158 8004DD58 0064102B */  sltu      $v0, $v1, $a0
/* 2915C 8004DD5C 50400006 */  beql      $v0, $zero, .L8004DD78
/* 29160 8004DD60 24E70001 */   addiu    $a3, $a3, 0x1
.L8004DD64:
/* 29164 8004DD64 24630001 */  addiu     $v1, $v1, 0x1
/* 29168 8004DD68 0064102B */  sltu      $v0, $v1, $a0
/* 2916C 8004DD6C 1440FFFD */  bnez      $v0, .L8004DD64
/* 29170 8004DD70 ACA00040 */   sw       $zero, 0x40($a1)
/* 29174 8004DD74 24E70001 */  addiu     $a3, $a3, 0x1
.L8004DD78:
/* 29178 8004DD78 2CE20010 */  sltiu     $v0, $a3, 0x10
/* 2917C 8004DD7C 1440FFF0 */  bnez      $v0, .L8004DD40
/* 29180 8004DD80 24C60060 */   addiu    $a2, $a2, 0x60
/* 29184 8004DD84 001428C0 */  sll       $a1, $s4, 3
.L8004DD88:
/* 29188 8004DD88 0200202D */  daddu     $a0, $s0, $zero
/* 2918C 8004DD8C 24060A9C */  addiu     $a2, $zero, 0xA9C
/* 29190 8004DD90 8E020000 */  lw        $v0, 0x0($s0)
/* 29194 8004DD94 92030234 */  lbu       $v1, 0x234($s0)
/* 29198 8004DD98 00451021 */  addu      $v0, $v0, $a1
/* 2919C 8004DD9C A0430071 */  sb        $v1, 0x71($v0)
/* 291A0 8004DDA0 8E020000 */  lw        $v0, 0x0($s0)
/* 291A4 8004DDA4 24030001 */  addiu     $v1, $zero, 0x1
/* 291A8 8004DDA8 00451021 */  addu      $v0, $v0, $a1
/* 291AC 8004DDAC 0100282D */  daddu     $a1, $t0, $zero
/* 291B0 8004DDB0 A0430070 */  sb        $v1, 0x70($v0)
/* 291B4 8004DDB4 0C0153DD */  jal       au_copy_words
/* 291B8 8004DDB8 AE000020 */   sw       $zero, 0x20($s0)
/* 291BC 8004DDBC 16A00012 */  bnez      $s5, .L8004DE08
/* 291C0 8004DDC0 0260102D */   daddu    $v0, $s3, $zero
/* 291C4 8004DDC4 0C0136AA */  jal       au_bgm_stop_player
/* 291C8 8004DDC8 0200202D */   daddu    $a0, $s0, $zero
/* 291CC 8004DDCC 08013782 */  j         .L8004DE08
/* 291D0 8004DDD0 0260102D */   daddu    $v0, $s3, $zero
.L8004DDD4:
/* 291D4 8004DDD4 8E02001C */  lw        $v0, 0x1C($s0)
/* 291D8 8004DDD8 1622000B */  bne       $s1, $v0, .L8004DE08
/* 291DC 8004DDDC 0260102D */   daddu    $v0, $s3, $zero
/* 291E0 8004DDE0 92020221 */  lbu       $v0, 0x221($s0)
/* 291E4 8004DDE4 10400007 */  beqz      $v0, .L8004DE04
/* 291E8 8004DDE8 24020001 */   addiu    $v0, $zero, 0x1
/* 291EC 8004DDEC A2020220 */  sb        $v0, 0x220($s0)
/* 291F0 8004DDF0 0C014240 */  jal       func_80050900
/* 291F4 8004DDF4 0200202D */   daddu    $a0, $s0, $zero
/* 291F8 8004DDF8 08013782 */  j         .L8004DE08
/* 291FC 8004DDFC 0260102D */   daddu    $v0, $s3, $zero
.L8004DE00:
/* 29200 8004DE00 24130003 */  addiu     $s3, $zero, 0x3
.L8004DE04:
/* 29204 8004DE04 0260102D */  daddu     $v0, $s3, $zero
.L8004DE08:
/* 29208 8004DE08 8FBF0028 */  lw        $ra, 0x28($sp)
/* 2920C 8004DE0C 8FB50024 */  lw        $s5, 0x24($sp)
/* 29210 8004DE10 8FB40020 */  lw        $s4, 0x20($sp)
/* 29214 8004DE14 8FB3001C */  lw        $s3, 0x1C($sp)
/* 29218 8004DE18 8FB20018 */  lw        $s2, 0x18($sp)
/* 2921C 8004DE1C 8FB10014 */  lw        $s1, 0x14($sp)
/* 29220 8004DE20 8FB00010 */  lw        $s0, 0x10($sp)
/* 29224 8004DE24 03E00008 */  jr        $ra
/* 29228 8004DE28 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

AuResult func_8004DCB8(SongUpdateEvent* update, s32 clearChanged) {
    AuResult status;
    BGMPlayer* playerA;
    BGMPlayer* playerB;
    s32 songName;
    s32 variation;
    u32 i;
    u32 j;

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

    if (songName != 0) {
        playerA = au_bgm_get_player_with_song_name(songName);
        if (playerA != NULL) {
            if (update->unk14 == 0) {
                playerB = func_80053F64(variation);
                if (playerB != NULL) {
                    if (songName == playerA->songName) {
                        if (!clearChanged) {
                            for (i = 0; i < ARRAY_COUNT(playerA->tracks); i++) {
                                BGMPlayerTrack* track = &playerA->tracks[i];
                                if (track->bgmReadPos != 0) {
                                    for (j = track->unk_52; j < track->unk_53; j++) {
                                        track->changed.all = 0;
                                    }
                                }
                            }
                        }
                        playerA->globals->unk_globals_6C[variation].unk_5 = playerA->priority;
                        playerA->globals->unk_globals_6C[variation].unk_4 = 1;
                        playerA->fadeSongName = 0;
                        au_copy_words(playerA, playerB, sizeof(*playerA));
                        if (clearChanged == 0) {
                            au_bgm_stop_player(playerA);
                        }
                    }
                } else {
                    status = AU_ERROR_INVALID_SONG_DURATION;
                }
            } else {
                if (songName == playerA->songName) {
                    if (playerA->masterState != BGM_PLAY_STATE_IDLE) {
                        playerA->unk_220 = 1;
                        func_80050900(playerA);
                    }
                }
            }
        } else {
            status = AU_ERROR_SONG_NOT_PLAYING;
        }
    } else {
        status = AU_ERROR_NULL_SONG_NAME;
    }
    return status;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel peach_star_beam_main
/* 3E54C0 E010C000 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 3E54C4 E010C004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 3E54C8 E010C008 4485A000 */  mtc1      $a1, $f20
/* 3E54CC E010C00C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3E54D0 E010C010 4486C000 */  mtc1      $a2, $f24
/* 3E54D4 E010C014 AFB20030 */  sw        $s2, 0x30($sp)
/* 3E54D8 E010C018 0080902D */  daddu     $s2, $a0, $zero
/* 3E54DC E010C01C F7B60040 */  sdc1      $f22, 0x40($sp)
/* 3E54E0 E010C020 4487B000 */  mtc1      $a3, $f22
/* 3E54E4 E010C024 27A40010 */  addiu     $a0, $sp, 0x10
/* 3E54E8 E010C028 AFB1002C */  sw        $s1, 0x2C($sp)
/* 3E54EC E010C02C 8FB10064 */  lw        $s1, 0x64($sp)
/* 3E54F0 E010C030 3C02E011 */  lui       $v0, %hi(peach_star_beam_init)
/* 3E54F4 E010C034 2442C190 */  addiu     $v0, $v0, %lo(peach_star_beam_init)
/* 3E54F8 E010C038 AFA20018 */  sw        $v0, 0x18($sp)
/* 3E54FC E010C03C 3C02E011 */  lui       $v0, %hi(peach_star_beam_update)
/* 3E5500 E010C040 2442C198 */  addiu     $v0, $v0, %lo(peach_star_beam_update)
/* 3E5504 E010C044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 3E5508 E010C048 3C02E011 */  lui       $v0, %hi(peach_star_beam_render)
/* 3E550C E010C04C 2442C354 */  addiu     $v0, $v0, %lo(peach_star_beam_render)
/* 3E5510 E010C050 AFA20020 */  sw        $v0, 0x20($sp)
/* 3E5514 E010C054 24020078 */  addiu     $v0, $zero, 0x78
/* 3E5518 E010C058 AFBF0034 */  sw        $ra, 0x34($sp)
/* 3E551C E010C05C AFB00028 */  sw        $s0, 0x28($sp)
/* 3E5520 E010C060 AFA00010 */  sw        $zero, 0x10($sp)
/* 3E5524 E010C064 AFA00024 */  sw        $zero, 0x24($sp)
/* 3E5528 E010C068 0C080124 */  jal       shim_create_effect_instance
/* 3E552C E010C06C AFA20014 */   sw       $v0, 0x14($sp)
/* 3E5530 E010C070 2404013C */  addiu     $a0, $zero, 0x13C
/* 3E5534 E010C074 24030001 */  addiu     $v1, $zero, 0x1
/* 3E5538 E010C078 0040802D */  daddu     $s0, $v0, $zero
/* 3E553C E010C07C 0C08012C */  jal       shim_general_heap_malloc
/* 3E5540 E010C080 AE030008 */   sw       $v1, 0x8($s0)
/* 3E5544 E010C084 0040202D */  daddu     $a0, $v0, $zero
/* 3E5548 E010C088 14800003 */  bnez      $a0, .LE010C098
/* 3E554C E010C08C AE02000C */   sw       $v0, 0xC($s0)
.LE010C090:
/* 3E5550 E010C090 08043024 */  j         .LE010C090
/* 3E5554 E010C094 00000000 */   nop
.LE010C098:
/* 3E5558 E010C098 AC920000 */  sw        $s2, 0x0($a0)
/* 3E555C E010C09C 1E200004 */  bgtz      $s1, .LE010C0B0
/* 3E5560 E010C0A0 AC800014 */   sw       $zero, 0x14($a0)
/* 3E5564 E010C0A4 240203E8 */  addiu     $v0, $zero, 0x3E8
/* 3E5568 E010C0A8 0804302D */  j         .LE010C0B4
/* 3E556C E010C0AC AC820010 */   sw       $v0, 0x10($a0)
.LE010C0B0:
/* 3E5570 E010C0B0 AC910010 */  sw        $s1, 0x10($a0)
.LE010C0B4:
/* 3E5574 E010C0B4 0000282D */  daddu     $a1, $zero, $zero
/* 3E5578 E010C0B8 240200E0 */  addiu     $v0, $zero, 0xE0
/* 3E557C E010C0BC AC820024 */  sw        $v0, 0x24($a0)
/* 3E5580 E010C0C0 240200FF */  addiu     $v0, $zero, 0xFF
/* 3E5584 E010C0C4 E4940004 */  swc1      $f20, 0x4($a0)
/* 3E5588 E010C0C8 E4980008 */  swc1      $f24, 0x8($a0)
/* 3E558C E010C0CC E496000C */  swc1      $f22, 0xC($a0)
/* 3E5590 E010C0D0 AC82003C */  sw        $v0, 0x3C($a0)
/* 3E5594 E010C0D4 C7A00060 */  lwc1      $f0, 0x60($sp)
/* 3E5598 E010C0D8 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 3E559C E010C0DC 44811000 */  mtc1      $at, $f2
/* 3E55A0 E010C0E0 24070001 */  addiu     $a3, $zero, 0x1
/* 3E55A4 E010C0E4 E4800038 */  swc1      $f0, 0x38($a0)
/* 3E55A8 E010C0E8 3C0142A0 */  lui       $at, (0x42A00000 >> 16)
/* 3E55AC E010C0EC 44810000 */  mtc1      $at, $f0
/* 3E55B0 E010C0F0 2406005C */  addiu     $a2, $zero, 0x5C
/* 3E55B4 E010C0F4 E4800048 */  swc1      $f0, 0x48($a0)
/* 3E55B8 E010C0F8 3C014248 */  lui       $at, (0x42480000 >> 16)
/* 3E55BC E010C0FC 44810000 */  mtc1      $at, $f0
/* 3E55C0 E010C100 24030078 */  addiu     $v1, $zero, 0x78
/* 3E55C4 E010C104 AC820018 */  sw        $v0, 0x18($a0)
/* 3E55C8 E010C108 AC82001C */  sw        $v0, 0x1C($a0)
/* 3E55CC E010C10C AC830020 */  sw        $v1, 0x20($a0)
/* 3E55D0 E010C110 AC820028 */  sw        $v0, 0x28($a0)
/* 3E55D4 E010C114 AC82002C */  sw        $v0, 0x2C($a0)
/* 3E55D8 E010C118 AC820030 */  sw        $v0, 0x30($a0)
/* 3E55DC E010C11C AC820034 */  sw        $v0, 0x34($a0)
/* 3E55E0 E010C120 AC800044 */  sw        $zero, 0x44($a0)
/* 3E55E4 E010C124 E494004C */  swc1      $f20, 0x4C($a0)
/* 3E55E8 E010C128 E4960054 */  swc1      $f22, 0x54($a0)
/* 3E55EC E010C12C 4600C100 */  add.s     $f4, $f24, $f0
/* 3E55F0 E010C130 E4820040 */  swc1      $f2, 0x40($a0)
/* 3E55F4 E010C134 E4800058 */  swc1      $f0, 0x58($a0)
/* 3E55F8 E010C138 E4840050 */  swc1      $f4, 0x50($a0)
.LE010C13C:
/* 3E55FC E010C13C 16400005 */  bnez      $s2, .LE010C154
/* 3E5600 E010C140 00861021 */   addu     $v0, $a0, $a2
/* 3E5604 E010C144 54A00004 */  bnel      $a1, $zero, .LE010C158
/* 3E5608 E010C148 AC470000 */   sw       $a3, 0x0($v0)
/* 3E560C E010C14C 08043056 */  j         .LE010C158
/* 3E5610 E010C150 AC400000 */   sw       $zero, 0x0($v0)
.LE010C154:
/* 3E5614 E010C154 AC470000 */  sw        $a3, 0x0($v0)
.LE010C158:
/* 3E5618 E010C158 24A50001 */  addiu     $a1, $a1, 0x1
/* 3E561C E010C15C 28A20008 */  slti      $v0, $a1, 0x8
/* 3E5620 E010C160 1440FFF6 */  bnez      $v0, .LE010C13C
/* 3E5624 E010C164 24C6001C */   addiu    $a2, $a2, 0x1C
/* 3E5628 E010C168 0200102D */  daddu     $v0, $s0, $zero
/* 3E562C E010C16C 8FBF0034 */  lw        $ra, 0x34($sp)
/* 3E5630 E010C170 8FB20030 */  lw        $s2, 0x30($sp)
/* 3E5634 E010C174 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3E5638 E010C178 8FB00028 */  lw        $s0, 0x28($sp)
/* 3E563C E010C17C D7B80048 */  ldc1      $f24, 0x48($sp)
/* 3E5640 E010C180 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 3E5644 E010C184 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 3E5648 E010C188 03E00008 */  jr        $ra
/* 3E564C E010C18C 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s32 duration) {
    EffectBlueprint bp;
    EffectInstance* effect;
    PeachStarBeamFXData* data;
    s32 numParts = 1;
    s32 i;

    bp.unk_00 = 0;
    bp.init = peach_star_beam_init;
    bp.update = peach_star_beam_update;
    bp.renderWorld = peach_star_beam_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_PEACH_STAR_BEAM;

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

    data->type = type;
    data->lifetime = 0;
    if (duration <= 0) {
        data->timeLeft = 1000;
    } else {
        data->timeLeft = duration;
    }
    data->beamAlpha = 224;
    data->pos.x = x;
    data->pos.y = y;
    data->pos.z = z;
    data->unk_3C = 255;
    data->beamScale = arg4;
    data->circleRadius = 80.0f;
    data->twinkYOffset = 50.0f;
    data->primR = 255;
    data->primG = 255;
    data->primB = 120;
    data->envR = 255;
    data->envG = 255;
    data->envB = 255;
    data->envA = 255;
    data->rotationSpeed = 5.0f;
    data->rotationAngle = 0;
    data->circleCenter.x = x;
    data->circleCenter.y = y + 50.0f;
    data->circleCenter.z = z;

    for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
        PeachStarBeamSpirit* part = &data->spirits[i];

        if (type == 0 && i == 0) {
            part->flags = 0;
        } else {
            part->flags = 1;
        }
    }
    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel create_shop_popup_menu
/* 8E474 800F4FC4 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 8E478 800F4FC8 AFB00010 */  sw        $s0, 0x10($sp)
/* 8E47C 800F4FCC 3C108011 */  lui       $s0, %hi(gPopupMenu)
/* 8E480 800F4FD0 2610D69C */  addiu     $s0, $s0, %lo(gPopupMenu)
/* 8E484 800F4FD4 AFBF0014 */  sw        $ra, 0x14($sp)
/* 8E488 800F4FD8 AE040000 */  sw        $a0, 0x0($s0)
/* 8E48C 800F4FDC A480032C */  sh        $zero, 0x32C($a0)
/* 8E490 800F4FE0 AC80031C */  sw        $zero, 0x31C($a0)
/* 8E494 800F4FE4 0C03A635 */  jal       func_800E98D4
/* 8E498 800F4FE8 AC800320 */   sw       $zero, 0x320($a0)
/* 8E49C 800F4FEC 3C048011 */  lui       $a0, %hi(PopupDipMode)
/* 8E4A0 800F4FF0 2484D699 */  addiu     $a0, $a0, %lo(PopupDipMode)
/* 8E4A4 800F4FF4 3C018011 */  lui       $at, %hi(D_8010D69A)
/* 8E4A8 800F4FF8 A022D69A */  sb        $v0, %lo(D_8010D69A)($at)
/* 8E4AC 800F4FFC A0800000 */  sb        $zero, 0x0($a0)
/* 8E4B0 800F5000 8E100000 */  lw        $s0, 0x0($s0)
/* 8E4B4 800F5004 3C068011 */  lui       $a2, %hi(PopupNotDipping)
/* 8E4B8 800F5008 24C6D698 */  addiu     $a2, $a2, %lo(PopupNotDipping)
/* 8E4BC 800F500C 8E030318 */  lw        $v1, 0x318($s0)
/* 8E4C0 800F5010 24050001 */  addiu     $a1, $zero, 0x1
/* 8E4C4 800F5014 28620064 */  slti      $v0, $v1, 0x64
/* 8E4C8 800F5018 1440000C */  bnez      $v0, .L800F504C
/* 8E4CC 800F501C A0C50000 */   sb       $a1, 0x0($a2)
/* 8E4D0 800F5020 2462FF9C */  addiu     $v0, $v1, -0x64
/* 8E4D4 800F5024 AE020318 */  sw        $v0, 0x318($s0)
/* 8E4D8 800F5028 0040182D */  daddu     $v1, $v0, $zero
/* 8E4DC 800F502C 28620064 */  slti      $v0, $v1, 0x64
/* 8E4E0 800F5030 14400005 */  bnez      $v0, .L800F5048
/* 8E4E4 800F5034 A0850000 */   sb       $a1, 0x0($a0)
/* 8E4E8 800F5038 2462FF9C */  addiu     $v0, $v1, -0x64
/* 8E4EC 800F503C AE020318 */  sw        $v0, 0x318($s0)
/* 8E4F0 800F5040 24020002 */  addiu     $v0, $zero, 0x2
/* 8E4F4 800F5044 A0820000 */  sb        $v0, 0x0($a0)
.L800F5048:
/* 8E4F8 800F5048 A0C00000 */  sb        $zero, 0x0($a2)
.L800F504C:
/* 8E4FC 800F504C 3C058011 */  lui       $a1, %hi(gPopupMenu)
/* 8E500 800F5050 8CA5D69C */  lw        $a1, %lo(gPopupMenu)($a1)
/* 8E504 800F5054 24020001 */  addiu     $v0, $zero, 0x1
/* 8E508 800F5058 3C018011 */  lui       $at, %hi(PopupNotBattle)
/* 8E50C 800F505C A022D68E */  sb        $v0, %lo(PopupNotBattle)($at)
/* 8E510 800F5060 24020006 */  addiu     $v0, $zero, 0x6
/* 8E514 800F5064 3C018011 */  lui       $at, %hi(PopupMenu_MaxDisplayableEntryCount)
/* 8E518 800F5068 A022D68F */  sb        $v0, %lo(PopupMenu_MaxDisplayableEntryCount)($at)
/* 8E51C 800F506C 8CA20328 */  lw        $v0, 0x328($a1)
/* 8E520 800F5070 8CA40324 */  lw        $a0, 0x324($a1)
/* 8E524 800F5074 3C038011 */  lui       $v1, %hi(PopupMenu_SelectedIndex)
/* 8E528 800F5078 2463D648 */  addiu     $v1, $v1, %lo(PopupMenu_SelectedIndex)
/* 8E52C 800F507C 3C018011 */  lui       $at, %hi(gPopupState)
/* 8E530 800F5080 AC20D640 */  sw        $zero, %lo(gPopupState)($at)
/* 8E534 800F5084 AC620000 */  sw        $v0, 0x0($v1)
/* 8E538 800F5088 0044102A */  slt       $v0, $v0, $a0
/* 8E53C 800F508C 14400002 */  bnez      $v0, .L800F5098
/* 8E540 800F5090 2482FFFF */   addiu    $v0, $a0, -0x1
/* 8E544 800F5094 AC620000 */  sw        $v0, 0x0($v1)
.L800F5098:
/* 8E548 800F5098 8C620000 */  lw        $v0, 0x0($v1)
/* 8E54C 800F509C 3C048011 */  lui       $a0, %hi(PopupMenu_DisplayedEntryCount)
/* 8E550 800F50A0 2484D656 */  addiu     $a0, $a0, %lo(PopupMenu_DisplayedEntryCount)
/* 8E554 800F50A4 3C018011 */  lui       $at, %hi(PopupMenu_FirstDisplayIndex)
/* 8E558 800F50A8 A020D654 */  sb        $zero, %lo(PopupMenu_FirstDisplayIndex)($at)
/* 8E55C 800F50AC 3C018011 */  lui       $at, %hi(PopupMenu_PrevSelectedIndex)
/* 8E560 800F50B0 AC22D64C */  sw        $v0, %lo(PopupMenu_PrevSelectedIndex)($at)
/* 8E564 800F50B4 90A20327 */  lbu       $v0, 0x327($a1)
/* 8E568 800F50B8 24030006 */  addiu     $v1, $zero, 0x6
/* 8E56C 800F50BC A0820000 */  sb        $v0, 0x0($a0)
/* 8E570 800F50C0 00021600 */  sll       $v0, $v0, 24
/* 8E574 800F50C4 00021603 */  sra       $v0, $v0, 24
/* 8E578 800F50C8 0062102A */  slt       $v0, $v1, $v0
/* 8E57C 800F50CC 54400001 */  bnel      $v0, $zero, .L800F50D4
/* 8E580 800F50D0 A0830000 */   sb       $v1, 0x0($a0)
.L800F50D4:
/* 8E584 800F50D4 8CA20324 */  lw        $v0, 0x324($a1)
/* 8E588 800F50D8 3C048011 */  lui       $a0, %hi(PopupMenu_LastDisplayIndex)
/* 8E58C 800F50DC 2484D655 */  addiu     $a0, $a0, %lo(PopupMenu_LastDisplayIndex)
/* 8E590 800F50E0 28420006 */  slti      $v0, $v0, 0x6
/* 8E594 800F50E4 10400003 */  beqz      $v0, .L800F50F4
/* 8E598 800F50E8 A0830000 */   sb       $v1, 0x0($a0)
/* 8E59C 800F50EC 90A20327 */  lbu       $v0, 0x327($a1)
/* 8E5A0 800F50F0 A0820000 */  sb        $v0, 0x0($a0)
.L800F50F4:
/* 8E5A4 800F50F4 240200FF */  addiu     $v0, $zero, 0xFF
/* 8E5A8 800F50F8 3C018011 */  lui       $at, %hi(PopupMenu_Alpha)
/* 8E5AC 800F50FC AC22D650 */  sw        $v0, %lo(PopupMenu_Alpha)($at)
/* 8E5B0 800F5100 24020004 */  addiu     $v0, $zero, 0x4
/* 8E5B4 800F5104 3C04800F */  lui       $a0, %hi(popup_menu_update)
/* 8E5B8 800F5108 24841A10 */  addiu     $a0, $a0, %lo(popup_menu_update)
/* 8E5BC 800F510C 3C018011 */  lui       $at, %hi(D_8010D691)
/* 8E5C0 800F5110 A022D691 */  sb        $v0, %lo(D_8010D691)($at)
/* 8E5C4 800F5114 3C018011 */  lui       $at, %hi(D_8010D692)
/* 8E5C8 800F5118 A023D692 */  sb        $v1, %lo(D_8010D692)($at)
/* 8E5CC 800F511C 0C048C8F */  jal       create_worker_frontUI
/* 8E5D0 800F5120 0000282D */   daddu    $a1, $zero, $zero
/* 8E5D4 800F5124 8FBF0014 */  lw        $ra, 0x14($sp)
/* 8E5D8 800F5128 8FB00010 */  lw        $s0, 0x10($sp)
/* 8E5DC 800F512C 3C018011 */  lui       $at, %hi(gPopupWorker)
/* 8E5E0 800F5130 AC22D694 */  sw        $v0, %lo(gPopupWorker)($at)
/* 8E5E4 800F5134 03E00008 */  jr        $ra
/* 8E5E8 800F5138 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void create_shop_popup_menu(PopupMenu* popup) {
    gPopupMenu = popup;

    popup->result = POPUP_RESULT_CHOOSING;
    popup->dipMode = 0;
    popup->titleNumber = 0;
    D_8010D69A = func_800E98D4();
    PopupDipMode = 0;
    PopupNotDipping = TRUE;
    if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) {
        gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP;
        PopupDipMode = 1;
        if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) {
            gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP;
            PopupDipMode = 2;
        }
        PopupNotDipping = FALSE;
    }

    PopupNotBattle = TRUE;
    PopupMenu_MaxDisplayableEntryCount = 6;
    gPopupState = POPUP_STATE_INIT;
    PopupMenu_SelectedIndex = gPopupMenu->initialPos;
    if (PopupMenu_SelectedIndex >= gPopupMenu->numEntries) {
        PopupMenu_SelectedIndex = gPopupMenu->numEntries - 1;
    }
    PopupMenu_FirstDisplayIndex = 0;
    PopupMenu_PrevSelectedIndex = PopupMenu_SelectedIndex;
    PopupMenu_DisplayedEntryCount = gPopupMenu->numEntries;

    if (PopupMenu_DisplayedEntryCount > PopupMenu_MaxDisplayableEntryCount) {
        PopupMenu_DisplayedEntryCount = PopupMenu_MaxDisplayableEntryCount;
    }

    PopupMenu_LastDisplayIndex = PopupMenu_MaxDisplayableEntryCount;
    if (gPopupMenu->numEntries < PopupMenu_MaxDisplayableEntryCount) {
        PopupMenu_LastDisplayIndex = gPopupMenu->numEntries;
    }

    PopupMenu_Alpha = 255;
    D_8010D691 = 4;
    D_8010D692 = 6;
    gPopupWorker = create_worker_frontUI((void (*) (void)) popup_menu_update, NULL);
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel D_8024BBAC
/* 13EEEC 8024BBAC 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 13EEF0 8024BBB0 AFB00018 */  sw        $s0, 0x18($sp)
/* 13EEF4 8024BBB4 3C108027 */  lui       $s0, %hi(gPausePartnersCurrentPartnerIdx)
D_8024BBB8:
/* 13EEF8 8024BBB8 261006A0 */  addiu     $s0, $s0, %lo(gPausePartnersCurrentPartnerIdx)
/* 13EEFC 8024BBBC AFBF002C */  sw        $ra, 0x2C($sp)
.L8024BBC0:
/* 13EF00 8024BBC0 AFB40028 */  sw        $s4, 0x28($sp)
/* 13EF04 8024BBC4 AFB30024 */  sw        $s3, 0x24($sp)
/* 13EF08 8024BBC8 AFB20020 */  sw        $s2, 0x20($sp)
/* 13EF0C 8024BBCC AFB1001C */  sw        $s1, 0x1C($sp)
D_8024BBD0:
/* 13EF10 8024BBD0 8E020000 */  lw        $v0, 0x0($s0)
/* 13EF14 8024BBD4 00A0902D */  daddu     $s2, $a1, $zero
/* 13EF18 8024BBD8 00021080 */  sll       $v0, $v0, 2
/* 13EF1C 8024BBDC 3C018027 */  lui       $at, %hi(gPausePartnersPartnerIdx)
/* 13EF20 8024BBE0 00220821 */  addu      $at, $at, $v0
/* 13EF24 8024BBE4 8C220680 */  lw        $v0, %lo(gPausePartnersPartnerIdx)($at)
D_8024BBE8:
/* 13EF28 8024BBE8 00C0982D */  daddu     $s3, $a2, $zero
/* 13EF2C 8024BBEC 00021080 */  sll       $v0, $v0, 2
/* 13EF30 8024BBF0 3C018025 */  lui       $at, %hi(D_8024F6B0)
/* 13EF34 8024BBF4 00220821 */  addu      $at, $at, $v0
/* 13EF38 8024BBF8 8C22F6B0 */  lw        $v0, %lo(D_8024F6B0)($at)
/* 13EF3C 8024BBFC 00021100 */  sll       $v0, $v0, 4
/* 13EF40 8024BC00 3C118009 */  lui       $s1, %hi(gPartnerPopupProperties)
/* 13EF44 8024BC04 02228821 */  addu      $s1, $s1, $v0
/* 13EF48 8024BC08 8E31EF20 */  lw        $s1, %lo(gPartnerPopupProperties)($s1)
/* 13EF4C 8024BC0C 0C039D59 */  jal       get_player_data
/* 13EF50 8024BC10 00E0A02D */   daddu    $s4, $a3, $zero
/* 13EF54 8024BC14 8E030000 */  lw        $v1, 0x0($s0)
/* 13EF58 8024BC18 00031880 */  sll       $v1, $v1, 2
/* 13EF5C 8024BC1C 3C018027 */  lui       $at, %hi(gPausePartnersPartnerIdx)
D_8024BC20:
/* 13EF60 8024BC20 00230821 */  addu      $at, $at, $v1
D_8024BC24:
/* 13EF64 8024BC24 8C230680 */  lw        $v1, %lo(gPausePartnersPartnerIdx)($at)
/* 13EF68 8024BC28 0000282D */  daddu     $a1, $zero, $zero
/* 13EF6C 8024BC2C 00031880 */  sll       $v1, $v1, 2
/* 13EF70 8024BC30 3C018025 */  lui       $at, %hi(D_8024F6B0)
/* 13EF74 8024BC34 00230821 */  addu      $at, $at, $v1
/* 13EF78 8024BC38 8C23F6B0 */  lw        $v1, %lo(D_8024F6B0)($at)
/* 13EF7C 8024BC3C 000318C0 */  sll       $v1, $v1, 3
/* 13EF80 8024BC40 00431021 */  addu      $v0, $v0, $v1
/* 13EF84 8024BC44 80500015 */  lb        $s0, 0x15($v0)
D_8024BC48_C094C8:
/* 13EF88 8024BC48 0C04991D */  jal       get_msg_width
/* 13EF8C 8024BC4C 0220202D */   daddu    $a0, $s1, $zero
/* 13EF90 8024BC50 0040302D */  daddu     $a2, $v0, $zero
D_8024BC54:
/* 13EF94 8024BC54 24020001 */  addiu     $v0, $zero, 0x1
D_8024BC58:
/* 13EF98 8024BC58 12020005 */  beq       $s0, $v0, .L8024BC70
/* 13EF9C 8024BC5C 24030010 */   addiu    $v1, $zero, 0x10
/* 13EFA0 8024BC60 24020002 */  addiu     $v0, $zero, 0x2
/* 13EFA4 8024BC64 16020002 */  bne       $s0, $v0, .L8024BC70
/* 13EFA8 8024BC68 0000182D */   daddu    $v1, $zero, $zero
/* 13EFAC 8024BC6C 24030014 */  addiu     $v1, $zero, 0x14
.L8024BC70:
/* 13EFB0 8024BC70 54600001 */  bnel      $v1, $zero, .L8024BC78
/* 13EFB4 8024BC74 24C60004 */   addiu    $a2, $a2, 0x4
.L8024BC78:
/* 13EFB8 8024BC78 0220202D */  daddu     $a0, $s1, $zero
/* 13EFBC 8024BC7C 02832823 */  subu      $a1, $s4, $v1
/* 13EFC0 8024BC80 00A62823 */  subu      $a1, $a1, $a2
/* 13EFC4 8024BC84 00052843 */  sra       $a1, $a1, 1
/* 13EFC8 8024BC88 02452821 */  addu      $a1, $s2, $a1
/* 13EFCC 8024BC8C 26660001 */  addiu     $a2, $s3, 0x1
D_8024BC90:
/* 13EFD0 8024BC90 240700FF */  addiu     $a3, $zero, 0xFF
/* 13EFD4 8024BC94 AFA00010 */  sw        $zero, 0x10($sp)
/* 13EFD8 8024BC98 0C04993B */  jal       draw_msg
/* 13EFDC 8024BC9C AFA00014 */   sw       $zero, 0x14($sp)
/* 13EFE0 8024BCA0 24020001 */  addiu     $v0, $zero, 0x1
/* 13EFE4 8024BCA4 1602000A */  bne       $s0, $v0, .L8024BCD0
/* 13EFE8 8024BCA8 24020002 */   addiu    $v0, $zero, 0x2
D_8024BCAC:
/* 13EFEC 8024BCAC 2645005F */  addiu     $a1, $s2, 0x5F
/* 13EFF0 8024BCB0 3C108027 */  lui       $s0, %hi(gPausePartnersIconIDs)
/* 13EFF4 8024BCB4 26100640 */  addiu     $s0, $s0, %lo(gPausePartnersIconIDs)
/* 13EFF8 8024BCB8 8E040008 */  lw        $a0, 0x8($s0)
/* 13EFFC 8024BCBC 0C051261 */  jal       hud_element_set_render_pos
/* 13F000 8024BCC0 2666000A */   addiu    $a2, $s3, 0xA
/* 13F004 8024BCC4 8E040008 */  lw        $a0, 0x8($s0)
D_8024BCC8:
/* 13F008 8024BCC8 08092F44 */  j         .L8024BD10
/* 13F00C 8024BCCC 00000000 */   nop
.L8024BCD0:
/* 13F010 8024BCD0 16020011 */  bne       $s0, $v0, .L8024BD18
D_8024BCD4:
/* 13F014 8024BCD4 2645005B */   addiu    $a1, $s2, 0x5B
/* 13F018 8024BCD8 3C108027 */  lui       $s0, %hi(gPausePartnersIconIDs)
/* 13F01C 8024BCDC 26100640 */  addiu     $s0, $s0, %lo(gPausePartnersIconIDs)
/* 13F020 8024BCE0 2671000A */  addiu     $s1, $s3, 0xA
/* 13F024 8024BCE4 8E040008 */  lw        $a0, 0x8($s0)
/* 13F028 8024BCE8 0C051261 */  jal       hud_element_set_render_pos
/* 13F02C 8024BCEC 0220302D */   daddu    $a2, $s1, $zero
/* 13F030 8024BCF0 8E040008 */  lw        $a0, 0x8($s0)
/* 13F034 8024BCF4 0C0511F8 */  jal       hud_element_draw_without_clipping
dgb_01_D_8024BCF8_C09578:
/* 13F038 8024BCF8 00000000 */   nop
D_8024BCFC:
/* 13F03C 8024BCFC 26450065 */  addiu     $a1, $s2, 0x65
D_8024BD00:
/* 13F040 8024BD00 8E04000C */  lw        $a0, 0xC($s0)
/* 13F044 8024BD04 0C051261 */  jal       hud_element_set_render_pos
/* 13F048 8024BD08 0220302D */   daddu    $a2, $s1, $zero
/* 13F04C 8024BD0C 8E04000C */  lw        $a0, 0xC($s0)
.L8024BD10:
/* 13F050 8024BD10 0C0511F8 */  jal       hud_element_draw_without_clipping
/* 13F054 8024BD14 00000000 */   nop
.L8024BD18:
/* 13F058 8024BD18 8FBF002C */  lw        $ra, 0x2C($sp)
/* 13F05C 8024BD1C 8FB40028 */  lw        $s4, 0x28($sp)
/* 13F060 8024BD20 8FB30024 */  lw        $s3, 0x24($sp)
/* 13F064 8024BD24 8FB20020 */  lw        $s2, 0x20($sp)
D_8024BD28:
/* 13F068 8024BD28 8FB1001C */  lw        $s1, 0x1C($sp)
/* 13F06C 8024BD2C 8FB00018 */  lw        $s0, 0x18($sp)
/* 13F070 8024BD30 03E00008 */  jr        $ra
/* 13F074 8024BD34 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void pause_partners_draw_title(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
    s32 msgID = gPartnerPopupProperties[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].nameMsg;
    s32 level = get_player_data()->partners[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].level;
    s32 msgWidth = get_msg_width(msgID, 0);
    s32 offset = 16;

    if (level != 1) {
        offset = 0;
        if (level == 2) {
            offset = 20;
        }
    }

    if (offset != 0) {
        msgWidth += 4;
    }

    draw_msg(msgID, baseX + ((width - offset - msgWidth) >> 1), baseY + 1, 255, MSG_PAL_WHITE, 0);

    if (level == 1) {
        hud_element_set_render_pos(gPausePartnersIconIDs[2], baseX + 95, baseY + 10);
        hud_element_draw_without_clipping(gPausePartnersIconIDs[2]);
    } else if (level == 2) {
        hud_element_set_render_pos(gPausePartnersIconIDs[2], baseX + 91, baseY + 10);
        hud_element_draw_without_clipping(gPausePartnersIconIDs[2]);
        hud_element_set_render_pos(gPausePartnersIconIDs[3], baseX + 101, baseY + 10);
        hud_element_draw_without_clipping(gPausePartnersIconIDs[3]);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel osPfsDeleteFile
/* 439C0 800685C0 27BDFEA0 */  addiu     $sp, $sp, -0x160
/* 439C4 800685C4 AFB10144 */  sw        $s1, 0x144($sp)
/* 439C8 800685C8 00808821 */  addu      $s1, $a0, $zero
/* 439CC 800685CC 8FA80170 */  lw        $t0, 0x170($sp)
/* 439D0 800685D0 30A5FFFF */  andi      $a1, $a1, 0xFFFF
/* 439D4 800685D4 2CA20001 */  sltiu     $v0, $a1, 0x1
/* 439D8 800685D8 2CC30001 */  sltiu     $v1, $a2, 0x1
/* 439DC 800685DC 00431025 */  or        $v0, $v0, $v1
/* 439E0 800685E0 AFBF0158 */  sw        $ra, 0x158($sp)
/* 439E4 800685E4 AFB50154 */  sw        $s5, 0x154($sp)
/* 439E8 800685E8 AFB40150 */  sw        $s4, 0x150($sp)
/* 439EC 800685EC AFB3014C */  sw        $s3, 0x14C($sp)
/* 439F0 800685F0 AFB20148 */  sw        $s2, 0x148($sp)
/* 439F4 800685F4 10400003 */  beqz      $v0, .L80068604
/* 439F8 800685F8 AFB00140 */   sw       $s0, 0x140($sp)
/* 439FC 800685FC 0801A1D2 */  j         .L80068748
/* 43A00 80068600 24020005 */   addiu    $v0, $zero, 0x5
.L80068604:
/* 43A04 80068604 02202021 */  addu      $a0, $s1, $zero
/* 43A08 80068608 27A20138 */  addiu     $v0, $sp, 0x138
/* 43A0C 8006860C AFA80010 */  sw        $t0, 0x10($sp)
/* 43A10 80068610 0C01A370 */  jal       osPfsFindFile
/* 43A14 80068614 AFA20014 */   sw       $v0, 0x14($sp)
/* 43A18 80068618 1440004B */  bnez      $v0, .L80068748
/* 43A1C 8006861C 00000000 */   nop
/* 43A20 80068620 92220065 */  lbu       $v0, 0x65($s1)
/* 43A24 80068624 10400005 */  beqz      $v0, .L8006863C
/* 43A28 80068628 02202021 */   addu     $a0, $s1, $zero
/* 43A2C 8006862C 0C01A5B4 */  jal       __osPfsSelectBank
/* 43A30 80068630 00002821 */   addu     $a1, $zero, $zero
/* 43A34 80068634 14400044 */  bnez      $v0, .L80068748
/* 43A38 80068638 00000000 */   nop
.L8006863C:
/* 43A3C 8006863C 8E240004 */  lw        $a0, 0x4($s1)
/* 43A40 80068640 8E26005C */  lw        $a2, 0x5C($s1)
/* 43A44 80068644 8FA20138 */  lw        $v0, 0x138($sp)
/* 43A48 80068648 8E250008 */  lw        $a1, 0x8($s1)
/* 43A4C 8006864C 27A70118 */  addiu     $a3, $sp, 0x118
/* 43A50 80068650 00C23021 */  addu      $a2, $a2, $v0
/* 43A54 80068654 0C01A874 */  jal       __osContRamRead
/* 43A58 80068658 30C6FFFF */   andi     $a2, $a2, 0xFFFF
/* 43A5C 8006865C 1440003A */  bnez      $v0, .L80068748
/* 43A60 80068660 00000000 */   nop
/* 43A64 80068664 93B3011E */  lbu       $s3, 0x11E($sp)
/* 43A68 80068668 92220064 */  lbu       $v0, 0x64($s1)
/* 43A6C 8006866C 93B2011F */  lbu       $s2, 0x11F($sp)
/* 43A70 80068670 327000FF */  andi      $s0, $s3, 0xFF
/* 43A74 80068674 0202102B */  sltu      $v0, $s0, $v0
/* 43A78 80068678 10400032 */  beqz      $v0, .L80068744
/* 43A7C 8006867C 27B4013C */   addiu    $s4, $sp, 0x13C
/* 43A80 80068680 24150001 */  addiu     $s5, $zero, 0x1
/* 43A84 80068684 02202021 */  addu      $a0, $s1, $zero
.L80068688:
/* 43A88 80068688 27A50018 */  addiu     $a1, $sp, 0x18
/* 43A8C 8006868C 00003021 */  addu      $a2, $zero, $zero
/* 43A90 80068690 0C01A7A3 */  jal       __osPfsRWInode
/* 43A94 80068694 02003821 */   addu     $a3, $s0, $zero
/* 43A98 80068698 1440002B */  bnez      $v0, .L80068748
/* 43A9C 8006869C 02202021 */   addu     $a0, $s1, $zero
/* 43AA0 800686A0 AFB40010 */  sw        $s4, 0x10($sp)
/* 43AA4 800686A4 27A50018 */  addiu     $a1, $sp, 0x18
/* 43AA8 800686A8 02403021 */  addu      $a2, $s2, $zero
/* 43AAC 800686AC 0C01A1DB */  jal       osPfsReleasePages
/* 43AB0 800686B0 02003821 */   addu     $a3, $s0, $zero
/* 43AB4 800686B4 14400024 */  bnez      $v0, .L80068748
/* 43AB8 800686B8 02202021 */   addu     $a0, $s1, $zero
/* 43ABC 800686BC 27A50018 */  addiu     $a1, $sp, 0x18
/* 43AC0 800686C0 24060001 */  addiu     $a2, $zero, 0x1
/* 43AC4 800686C4 0C01A7A3 */  jal       __osPfsRWInode
/* 43AC8 800686C8 02003821 */   addu     $a3, $s0, $zero
/* 43ACC 800686CC 1440001E */  bnez      $v0, .L80068748
/* 43AD0 800686D0 00000000 */   nop
/* 43AD4 800686D4 97A2013C */  lhu       $v0, 0x13C($sp)
/* 43AD8 800686D8 10550008 */  beq       $v0, $s5, .L800686FC
/* 43ADC 800686DC 00000000 */   nop
/* 43AE0 800686E0 93B3013C */  lbu       $s3, 0x13C($sp)
/* 43AE4 800686E4 92220064 */  lbu       $v0, 0x64($s1)
/* 43AE8 800686E8 93B2013D */  lbu       $s2, 0x13D($sp)
/* 43AEC 800686EC 327000FF */  andi      $s0, $s3, 0xFF
/* 43AF0 800686F0 0202102B */  sltu      $v0, $s0, $v0
/* 43AF4 800686F4 1440FFE4 */  bnez      $v0, .L80068688
/* 43AF8 800686F8 02202021 */   addu     $a0, $s1, $zero
.L800686FC:
/* 43AFC 800686FC 92220064 */  lbu       $v0, 0x64($s1)
/* 43B00 80068700 0262102B */  sltu      $v0, $s3, $v0
/* 43B04 80068704 1040000F */  beqz      $v0, .L80068744
/* 43B08 80068708 27B00118 */   addiu    $s0, $sp, 0x118
/* 43B0C 8006870C 02002021 */  addu      $a0, $s0, $zero
/* 43B10 80068710 0C01925C */  jal       bzero
/* 43B14 80068714 24050020 */   addiu    $a1, $zero, 0x20
/* 43B18 80068718 8E26005C */  lw        $a2, 0x5C($s1)
/* 43B1C 8006871C 8FA20138 */  lw        $v0, 0x138($sp)
/* 43B20 80068720 AFA00010 */  sw        $zero, 0x10($sp)
/* 43B24 80068724 8E240004 */  lw        $a0, 0x4($s1)
/* 43B28 80068728 8E250008 */  lw        $a1, 0x8($s1)
/* 43B2C 8006872C 02003821 */  addu      $a3, $s0, $zero
/* 43B30 80068730 00C23021 */  addu      $a2, $a2, $v0
/* 43B34 80068734 0C01A8F0 */  jal       osContRamWrite
/* 43B38 80068738 30C6FFFF */   andi     $a2, $a2, 0xFFFF
/* 43B3C 8006873C 0801A1D2 */  j         .L80068748
/* 43B40 80068740 00000000 */   nop
.L80068744:
/* 43B44 80068744 24020003 */  addiu     $v0, $zero, 0x3
.L80068748:
/* 43B48 80068748 8FBF0158 */  lw        $ra, 0x158($sp)
/* 43B4C 8006874C 8FB50154 */  lw        $s5, 0x154($sp)
/* 43B50 80068750 8FB40150 */  lw        $s4, 0x150($sp)
/* 43B54 80068754 8FB3014C */  lw        $s3, 0x14C($sp)
/* 43B58 80068758 8FB20148 */  lw        $s2, 0x148($sp)
/* 43B5C 8006875C 8FB10144 */  lw        $s1, 0x144($sp)
/* 43B60 80068760 8FB00140 */  lw        $s0, 0x140($sp)
/* 43B64 80068764 03E00008 */  jr        $ra
/* 43B68 80068768 27BD0160 */   addiu    $sp, $sp, 0x160

### DECOMPILED C INSTRUCTIONS:

s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName) {
    s32 file_no;
    s32 ret;
    __OSInode inode;
    __OSDir dir;
    __OSInodeUnit last_page;
    u8 startpage;
    u8 bank;

    if ((companyCode == 0) || (gameCode == 0)) {
        return PFS_ERR_INVALID;
    }
    if ((ret = osPfsFindFile(pfs, companyCode, gameCode, gameName, extName, &file_no)) != 0) {
        return ret;
    }
    if ((pfs->activebank != 0) && (ret = __osPfsSelectBank(pfs, 0)) != 0) {
        return ret;
    }

    if ((ret = __osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + file_no, (u8*)&dir)) != 0) {
        return ret;
    }

    startpage = dir.start_page.inode_t.page;
    for (bank = dir.start_page.inode_t.bank; bank < pfs->banks;) {
        if ((ret = __osPfsRWInode(pfs, &inode, PFS_READ, bank)) != 0) {
            return ret;
        }
        if ((ret = __osPfsReleasePages(pfs, &inode, startpage, bank, &last_page)) != 0) {
            return ret;
        }
        if ((ret = __osPfsRWInode(pfs, &inode, PFS_WRITE, bank)) != 0) {
            return ret;
        }
        if (last_page.ipage == PFS_EOF) {
            break;
        }
        bank = last_page.inode_t.bank;
        startpage = last_page.inode_t.page;
    }

    if (bank >= pfs->banks) {
        return PFS_ERR_INCONSISTENT;
    }
    bzero(&dir, sizeof(__OSDir));

    ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->dir_table + file_no, (u8*)&dir, 0);

    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel nuGfxTaskMgrInit
/* 7F38 8002CB38 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 7F3C 8002CB3C 24020008 */  addiu     $v0, $zero, 0x8
/* 7F40 8002CB40 3C01800A */  lui       $at, %hi(taskDoneMsg)
/* 7F44 8002CB44 A422C514 */  sh        $v0, %lo(taskDoneMsg)($at)
/* 7F48 8002CB48 24020004 */  addiu     $v0, $zero, 0x4
/* 7F4C 8002CB4C 3C01800A */  lui       $at, %hi(swapBufMsg)
/* 7F50 8002CB50 A422C516 */  sh        $v0, %lo(swapBufMsg)($at)
/* 7F54 8002CB54 3C02800A */  lui       $v0, %hi(nuGfxTaskSpool)
/* 7F58 8002CB58 2442A618 */  addiu     $v0, $v0, %lo(nuGfxTaskSpool)
/* 7F5C 8002CB5C AFBF0038 */  sw        $ra, 0x38($sp)
/* 7F60 8002CB60 AFB70034 */  sw        $s7, 0x34($sp)
/* 7F64 8002CB64 AFB60030 */  sw        $s6, 0x30($sp)
/* 7F68 8002CB68 AFB5002C */  sw        $s5, 0x2C($sp)
/* 7F6C 8002CB6C AFB40028 */  sw        $s4, 0x28($sp)
/* 7F70 8002CB70 AFB30024 */  sw        $s3, 0x24($sp)
/* 7F74 8002CB74 AFB20020 */  sw        $s2, 0x20($sp)
/* 7F78 8002CB78 AFB1001C */  sw        $s1, 0x1C($sp)
/* 7F7C 8002CB7C AFB00018 */  sw        $s0, 0x18($sp)
/* 7F80 8002CB80 AC400000 */  sw        $zero, 0x0($v0)
/* 7F84 8002CB84 0C017D00 */  jal       nuGfxDisplayOff
/* 7F88 8002CB88 0000902D */   daddu    $s2, $zero, $zero
/* 7F8C 8002CB8C 3C10800A */  lui       $s0, %hi(GfxTaskMgrThread)
/* 7F90 8002CB90 2610C518 */  addiu     $s0, $s0, %lo(GfxTaskMgrThread)
/* 7F94 8002CB94 0200202D */  daddu     $a0, $s0, $zero
/* 7F98 8002CB98 24050005 */  addiu     $a1, $zero, 0x5
/* 7F9C 8002CB9C 3C068003 */  lui       $a2, %hi(nuGfxTaskMgr)
/* 7FA0 8002CBA0 24C6CA40 */  addiu     $a2, $a2, %lo(nuGfxTaskMgr)
/* 7FA4 8002CBA4 3C02800A */  lui       $v0, %hi(D_8009E6D0)
/* 7FA8 8002CBA8 2442E6D0 */  addiu     $v0, $v0, %lo(D_8009E6D0)
/* 7FAC 8002CBAC AFA20010 */  sw        $v0, 0x10($sp)
/* 7FB0 8002CBB0 2402003C */  addiu     $v0, $zero, 0x3C
/* 7FB4 8002CBB4 0000382D */  daddu     $a3, $zero, $zero
/* 7FB8 8002CBB8 0C019798 */  jal       osCreateThread
/* 7FBC 8002CBBC AFA20014 */   sw       $v0, 0x14($sp)
/* 7FC0 8002CBC0 0C019808 */  jal       osStartThread
/* 7FC4 8002CBC4 0200202D */   daddu    $a0, $s0, $zero
/* 7FC8 8002CBC8 3C17800E */  lui       $s7, %hi(D_800DAC90)
/* 7FCC 8002CBCC 26F7AC90 */  addiu     $s7, $s7, %lo(D_800DAC90)
/* 7FD0 8002CBD0 24160001 */  addiu     $s6, $zero, 0x1
/* 7FD4 8002CBD4 3C13800E */  lui       $s3, %hi(rspbootUcodeBuffer)
/* 7FD8 8002CBD8 26739780 */  addiu     $s3, $s3, %lo(rspbootUcodeBuffer)
/* 7FDC 8002CBDC 24150100 */  addiu     $s5, $zero, 0x100
/* 7FE0 8002CBE0 24141000 */  addiu     $s4, $zero, 0x1000
/* 7FE4 8002CBE4 3C02800E */  lui       $v0, %hi(nuGfxTask)
/* 7FE8 8002CBE8 24429278 */  addiu     $v0, $v0, %lo(nuGfxTask)
/* 7FEC 8002CBEC 0040802D */  daddu     $s0, $v0, $zero
/* 7FF0 8002CBF0 26110058 */  addiu     $s1, $s0, 0x58
.L8002CBF4:
/* 7FF4 8002CBF4 3C04B000 */  lui       $a0, (0xB0000B70 >> 16)
/* 7FF8 8002CBF8 34840B70 */  ori       $a0, $a0, (0xB0000B70 & 0xFFFF)
/* 7FFC 8002CBFC 3C05B000 */  lui       $a1, (0xB0000C70 >> 16)
/* 8000 8002CC00 34A50C70 */  ori       $a1, $a1, (0xB0000C70 & 0xFFFF)
/* 8004 8002CC04 0260302D */  daddu     $a2, $s3, $zero
/* 8008 8002CC08 AE110000 */  sw        $s1, 0x0($s0)
/* 800C 8002CC0C AE170050 */  sw        $s7, 0x50($s0)
/* 8010 8002CC10 AE160010 */  sw        $s6, 0x10($s0)
/* 8014 8002CC14 0C00A5CF */  jal       dma_copy
/* 8018 8002CC18 AE000014 */   sw       $zero, 0x14($s0)
/* 801C 8002CC1C 24020800 */  addiu     $v0, $zero, 0x800
/* 8020 8002CC20 AE02002C */  sw        $v0, 0x2C($s0)
/* 8024 8002CC24 3C02800E */  lui       $v0, %hi(D_800DA040)
/* 8028 8002CC28 2442A040 */  addiu     $v0, $v0, %lo(D_800DA040)
/* 802C 8002CC2C AE020030 */  sw        $v0, 0x30($s0)
/* 8030 8002CC30 24020400 */  addiu     $v0, $zero, 0x400
/* 8034 8002CC34 AE020034 */  sw        $v0, 0x34($s0)
/* 8038 8002CC38 3C02800C */  lui       $v0, %hi(D_800B91D0)
/* 803C 8002CC3C 244291D0 */  addiu     $v0, $v0, %lo(D_800B91D0)
/* 8040 8002CC40 AE020038 */  sw        $v0, 0x38($s0)
/* 8044 8002CC44 3C02800E */  lui       $v0, %hi(gZoneCollisionData)
/* 8048 8002CC48 244291D0 */  addiu     $v0, $v0, %lo(gZoneCollisionData)
/* 804C 8002CC4C AE02003C */  sw        $v0, 0x3C($s0)
/* 8050 8002CC50 3C02800C */  lui       $v0, %hi(nuYieldBuf)
/* 8054 8002CC54 24428590 */  addiu     $v0, $v0, %lo(nuYieldBuf)
/* 8058 8002CC58 AE020048 */  sw        $v0, 0x48($s0)
/* 805C 8002CC5C 24020C10 */  addiu     $v0, $zero, 0xC10
/* 8060 8002CC60 AE130018 */  sw        $s3, 0x18($s0)
/* 8064 8002CC64 AE15001C */  sw        $s5, 0x1C($s0)
/* 8068 8002CC68 AE140024 */  sw        $s4, 0x24($s0)
/* 806C 8002CC6C AE02004C */  sw        $v0, 0x4C($s0)
/* 8070 8002CC70 26100058 */  addiu     $s0, $s0, 0x58
/* 8074 8002CC74 26520001 */  addiu     $s2, $s2, 0x1
/* 8078 8002CC78 2E42000A */  sltiu     $v0, $s2, 0xA
/* 807C 8002CC7C 1440FFDD */  bnez      $v0, .L8002CBF4
/* 8080 8002CC80 26310058 */   addiu    $s1, $s1, 0x58
/* 8084 8002CC84 3C02800E */  lui       $v0, %hi(nuGfxTask)
/* 8088 8002CC88 24429278 */  addiu     $v0, $v0, %lo(nuGfxTask)
/* 808C 8002CC8C AC420318 */  sw        $v0, 0x318($v0)
/* 8090 8002CC90 8FBF0038 */  lw        $ra, 0x38($sp)
/* 8094 8002CC94 8FB70034 */  lw        $s7, 0x34($sp)
/* 8098 8002CC98 8FB60030 */  lw        $s6, 0x30($sp)
/* 809C 8002CC9C 8FB5002C */  lw        $s5, 0x2C($sp)
/* 80A0 8002CCA0 8FB40028 */  lw        $s4, 0x28($sp)
/* 80A4 8002CCA4 8FB30024 */  lw        $s3, 0x24($sp)
/* 80A8 8002CCA8 8FB20020 */  lw        $s2, 0x20($sp)
/* 80AC 8002CCAC 8FB1001C */  lw        $s1, 0x1C($sp)
/* 80B0 8002CCB0 8FB00018 */  lw        $s0, 0x18($sp)
/* 80B4 8002CCB4 3C01800A */  lui       $at, %hi(nuGfxTask_ptr)
/* 80B8 8002CCB8 AC22C510 */  sw        $v0, %lo(nuGfxTask_ptr)($at)
/* 80BC 8002CCBC 03E00008 */  jr        $ra
/* 80C0 8002CCC0 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void nuGfxTaskMgrInit(void) {
    u32 i;

    taskDoneMsg = NU_SC_GTASKEND_MSG;
    swapBufMsg = NU_SC_SWAPBUFFER_MSG;
    nuGfxTaskSpool = 0;
    nuGfxDisplayOff();
    osCreateThread(&GfxTaskMgrThread, NU_GFX_TASKMGR_THREAD_ID, nuGfxTaskMgr, NULL, &GfxTaskMgrStack[NU_GFX_TASKMGR_STACK_SIZE / sizeof(u64)], NU_GFX_TASKMGR_THREAD_PRI);
    osStartThread(&GfxTaskMgrThread);

    for (i = 0; i < NU_GFX_TASK_NUM; i++) {
        nuGfxTask[i].next = &nuGfxTask[i + 1];
        nuGfxTask[i].msgQ = &D_800DAC90;
        nuGfxTask[i].list.t.type = M_GFXTASK;
        nuGfxTask[i].list.t.flags = 0;
#if VERSION_IQUE
        nuGfxTask[i].list.t.ucode_boot = (u64*) rspbootTextStart;
        nuGfxTask[i].list.t.ucode_boot_size = (u32) rspbootTextEnd - (u32) rspbootTextStart;
#else
        dma_copy((u8* )0xB0000B70, (u8* )0xB0000C70, rspbootUcodeBuffer);
        nuGfxTask[i].list.t.ucode_boot = (u64*) rspbootUcodeBuffer;
        nuGfxTask[i].list.t.ucode_boot_size = 0x100;
#endif
        nuGfxTask[i].list.t.ucode_size = SP_UCODE_SIZE;
        nuGfxTask[i].list.t.ucode_data_size = SP_UCODE_DATA_SIZE;
        nuGfxTask[i].list.t.dram_stack = (u64*) &D_800DA040;
        nuGfxTask[i].list.t.dram_stack_size = SP_DRAM_STACK_SIZE8;
        nuGfxTask[i].list.t.output_buff = (u64*) &D_800B91D0;
        nuGfxTask[i].list.t.output_buff_size = (u64*) &D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)];
        nuGfxTask[i].list.t.yield_data_ptr = (u64*) &nuYieldBuf;
        nuGfxTask[i].list.t.yield_data_size = NU_GFX_YIELD_BUF_SIZE;
    }

    nuGfxTask[NU_GFX_TASK_NUM - 1].next = &nuGfxTask[0];
    nuGfxTask_ptr = &nuGfxTask[0];
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_802B61E4
/* E23444 802B61E4 27BDFFE0 */  addiu     $sp, $sp, -0x20
.L802B61E8:
/* E23448 802B61E8 AFB00018 */  sw        $s0, 0x18($sp)
.L802B61EC:
/* E2344C 802B61EC 3C108011 */  lui       $s0, %hi(gPlayerStatus)
.L802B61F0:
/* E23450 802B61F0 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
.L802B61F4:
/* E23454 802B61F4 AFBF001C */  sw        $ra, 0x1C($sp)
.L802B61F8:
/* E23458 802B61F8 8E030000 */  lw        $v1, 0x0($s0)
.L802B61FC:
/* E2345C 802B61FC 0461002A */  bgez      $v1, .L802B62A8
.L802B6200:
/* E23460 802B6200 3C027FFF */   lui      $v0, (0x7FFFFFFF >> 16)
.L802B6204:
/* E23464 802B6204 3442FFFF */  ori       $v0, $v0, (0x7FFFFFFF & 0xFFFF)
glabel .L802B6208
/* E23468 802B6208 00621024 */  and       $v0, $v1, $v0
/* E2346C 802B620C 8E030004 */  lw        $v1, 0x4($s0)
.L802B6210:
/* E23470 802B6210 2404FFF1 */  addiu     $a0, $zero, -0xF
.L802B6214:
/* E23474 802B6214 AE020000 */  sw        $v0, 0x0($s0)
glabel .L802B6218
/* E23478 802B6218 00441024 */  and       $v0, $v0, $a0
/* E2347C 802B621C A20000B6 */  sb        $zero, 0xB6($s0)
.L802B6220:
/* E23480 802B6220 A6000008 */  sh        $zero, 0x8($s0)
.L802B6224:
/* E23484 802B6224 A60000C0 */  sh        $zero, 0xC0($s0)
glabel .L802B6228
/* E23488 802B6228 A60000C2 */  sh        $zero, 0xC2($s0)
.L802B622C:
/* E2348C 802B622C AE000054 */  sw        $zero, 0x54($s0)
glabel action_update_step_up_peach
/* E23490 802B6230 30632000 */  andi      $v1, $v1, 0x2000
/* E23494 802B6234 14600013 */  bnez      $v1, .L802B6284
glabel .L802B6238
/* E23498 802B6238 AE020000 */   sw       $v0, 0x0($s0)
glabel .L802B623C
/* E2349C 802B623C 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
glabel .L802B6240
/* E234A0 802B6240 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
glabel .L802B6244
/* E234A4 802B6244 9062007E */  lbu       $v0, 0x7E($v1)
glabel .L802B6248
/* E234A8 802B6248 30420010 */  andi      $v0, $v0, 0x10
/* E234AC 802B624C 14400009 */  bnez      $v0, .L802B6274
glabel .L802B6250
/* E234B0 802B6250 3C04000C */   lui      $a0, (0xC000E >> 16)
.L802B6254:
/* E234B4 802B6254 90620080 */  lbu       $v0, 0x80($v1)
glabel .L802B6258
/* E234B8 802B6258 00021080 */  sll       $v0, $v0, 2
.L802B625C:
/* E234BC 802B625C 3C04802B */  lui       $a0, %hi(D_802B6430)
/* E234C0 802B6260 00822021 */  addu      $a0, $a0, $v0
/* E234C4 802B6264 0C037FBF */  jal       suggest_player_anim_allow_backward
.L802B6268:
/* E234C8 802B6268 8C846430 */   lw       $a0, %lo(D_802B6430)($a0)
.L802B626C:
/* E234CC 802B626C 080AD8AA */  j         .L802B62A8
/* E234D0 802B6270 00000000 */   nop
.L802B6274:
/* E234D4 802B6274 0C037FBF */  jal       suggest_player_anim_allow_backward
glabel .L802B6278
/* E234D8 802B6278 3484000E */   ori      $a0, $a0, (0xC000E & 0xFFFF)
/* E234DC 802B627C 080AD8AA */  j         .L802B62A8
.L802B6280:
/* E234E0 802B6280 00000000 */   nop
.L802B6284:
/* E234E4 802B6284 8203000C */  lb        $v1, 0xC($s0)
glabel action_update_run
/* E234E8 802B6288 00031040 */  sll       $v0, $v1, 1
/* E234EC 802B628C 00431021 */  addu      $v0, $v0, $v1
.L802B6290:
/* E234F0 802B6290 000210C0 */  sll       $v0, $v0, 3
glabel func_802B6294
/* E234F4 802B6294 3C04800F */  lui       $a0, %hi(BasicPeachDisguiseAnims)
glabel .L802B6298
/* E234F8 802B6298 00822021 */  addu      $a0, $a0, $v0
/* E234FC 802B629C 8C847C1C */  lw        $a0, %lo(BasicPeachDisguiseAnims)($a0)
/* E23500 802B62A0 0C0398DB */  jal       peach_set_disguise_anim
glabel func_802B62A4
/* E23504 802B62A4 00000000 */   nop
.L802B62A8:
/* E23508 802B62A8 8E020004 */  lw        $v0, 0x4($s0)
/* E2350C 802B62AC 30422000 */  andi      $v0, $v0, 0x2000
jtbl_802B62B0:
/* E23510 802B62B0 1440004C */  bnez      $v0, .L802B63E4
.L802B62B4:
/* E23514 802B62B4 27A40010 */   addiu    $a0, $sp, 0x10
glabel .L802B62B8
/* E23518 802B62B8 24020001 */  addiu     $v0, $zero, 0x1
/* E2351C 802B62BC 820300B6 */  lb        $v1, 0xB6($s0)
/* E23520 802B62C0 920500B6 */  lbu       $a1, 0xB6($s0)
/* E23524 802B62C4 10620022 */  beq       $v1, $v0, PlayerTweesterPhysicsPtr
.L802B62C8:
/* E23528 802B62C8 28620002 */   slti     $v0, $v1, 0x2
glabel action_update_peach_land
/* E2352C 802B62CC 10400005 */  beqz      $v0, .L802B62E4

### DECOMPILED C INSTRUCTIONS:

void action_update_idle_peach(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    PlayerData* playerData = &gPlayerData;
    f32 angle, magnitude;

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
        playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT;
        playerStatus->currentStateTime = 0;
        playerStatus->timeInAir = 0;
        playerStatus->peakJumpTime = 0;
        playerStatus->currentSpeed = 0.0f;
        playerStatus->flags &= ~PS_FLAG_AIRBORNE;

        if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
            if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) {
                suggest_player_anim_allow_backward(IdlePeachAnims[gGameStatusPtr->peachBakingIngredient]);
            } else {
                suggest_player_anim_allow_backward(ANIM_Peach2_SadStill);
            }
        } else {
            peach_set_disguise_anim(BasicPeachDisguiseAnims[gPlayerStatus.peachDisguise].idle);
        }
    }

    if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
        switch (playerStatus->actionSubstate) {
            case SUBSTATE_IDLE_DEFAULT:
                if (!(playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_INPUT_DISABLED))
                    && (playerStatus->peachItemHeld == 0)) {
                    if (playerStatus->currentStateTime > 1800) {
                        // begin first yawm
                        playerStatus->actionSubstate++;
                        suggest_player_anim_allow_backward(ANIM_Peach2_Yawn);
                        return;
                    }
                    playerStatus->currentStateTime++;
                }
                break;
            case SUBSTATE_IDLE_STRETCH:
                // waiting for yawn to finish
                if (playerStatus->animNotifyValue != 0) {
                    playerStatus->actionSubstate++;
                    playerStatus->currentStateTime = 0;
                    suggest_player_anim_allow_backward(ANIM_Peach1_Idle);
                }
                break;
            case SUBSTATE_DELAY_SLEEP:
                // delay before next yawn and sleep
                playerStatus->currentStateTime++;
                if (playerStatus->currentStateTime > 200) {
                    playerStatus->actionSubstate++;
                    suggest_player_anim_allow_backward(ANIM_Peach2_Yawn);
                }
                break;
            case SUBSTATE_IDLE_SLEEP:
                // peach is asleep
                if (playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_INPUT_DISABLED)) {
                    suggest_player_anim_allow_backward(ANIM_Peach1_Idle);
                    playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT;
                } else if (playerStatus->animNotifyValue != 0) {
                    suggest_player_anim_allow_backward(ANIM_Peach2_Sleep);
                }
                break;
        }
    }

    player_input_to_move_vector(&angle, &magnitude);
    phys_update_interact_collider();

    if (magnitude != 0.0f) {
        playerStatus->currentStateTime = 0;
        playerStatus->targetYaw = angle;
        set_action_state(ACTION_STATE_WALK);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel InterpPlayerYaw
/* F62EC 802D193C 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* F62F0 802D1940 AFB10014 */  sw        $s1, 0x14($sp)
/* F62F4 802D1944 0080882D */  daddu     $s1, $a0, $zero
/* F62F8 802D1948 AFB50024 */  sw        $s5, 0x24($sp)
/* F62FC 802D194C 3C158011 */  lui       $s5, %hi(gPlayerStatus)
/* F6300 802D1950 26B5EFC8 */  addiu     $s5, $s5, %lo(gPlayerStatus)
/* F6304 802D1954 AFB60028 */  sw        $s6, 0x28($sp)
/* F6308 802D1958 26360074 */  addiu     $s6, $s1, 0x74
/* F630C 802D195C AFB40020 */  sw        $s4, 0x20($sp)
/* F6310 802D1960 26340078 */  addiu     $s4, $s1, 0x78
/* F6314 802D1964 AFB3001C */  sw        $s3, 0x1C($sp)
/* F6318 802D1968 AFBF002C */  sw        $ra, 0x2C($sp)
/* F631C 802D196C AFB20018 */  sw        $s2, 0x18($sp)
/* F6320 802D1970 AFB00010 */  sw        $s0, 0x10($sp)
/* F6324 802D1974 8E32000C */  lw        $s2, 0xC($s1)
/* F6328 802D1978 10A0002C */  beqz      $a1, .L802D1A2C
/* F632C 802D197C 2633007C */   addiu    $s3, $s1, 0x7C
/* F6330 802D1980 3C10802E */  lui       $s0, %hi(playerNpc)
/* F6334 802D1984 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F6338 802D1988 8E020000 */  lw        $v0, 0x0($s0)
/* F633C 802D198C C6A00080 */  lwc1      $f0, 0x80($s5)
/* F6340 802D1990 E440000C */  swc1      $f0, 0xC($v0)
/* F6344 802D1994 E6200074 */  swc1      $f0, 0x74($s1)
/* F6348 802D1998 8E450000 */  lw        $a1, 0x0($s2)
/* F634C 802D199C 0C0B210B */  jal       evt_get_float_variable
/* F6350 802D19A0 26520004 */   addiu    $s2, $s2, 0x4
/* F6354 802D19A4 C6220074 */  lwc1      $f2, 0x74($s1)
/* F6358 802D19A8 46020001 */  sub.s     $f0, $f0, $f2
/* F635C 802D19AC E6200078 */  swc1      $f0, 0x78($s1)
/* F6360 802D19B0 8E450000 */  lw        $a1, 0x0($s2)
/* F6364 802D19B4 0C0B1EAF */  jal       evt_get_variable
/* F6368 802D19B8 0220202D */   daddu    $a0, $s1, $zero
/* F636C 802D19BC AE22007C */  sw        $v0, 0x7C($s1)
/* F6370 802D19C0 8E020000 */  lw        $v0, 0x0($s0)
/* F6374 802D19C4 3C01C334 */  lui       $at, (0xC3340000 >> 16)
/* F6378 802D19C8 44810000 */  mtc1      $at, $f0
/* F637C 802D19CC A440008E */  sh        $zero, 0x8E($v0)
/* F6380 802D19D0 C6220078 */  lwc1      $f2, 0x78($s1)
/* F6384 802D19D4 4600103C */  c.lt.s    $f2, $f0
/* F6388 802D19D8 00000000 */  nop
/* F638C 802D19DC 45000007 */  bc1f      .L802D19FC
/* F6390 802D19E0 00000000 */   nop
/* F6394 802D19E4 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F6398 802D19E8 44810000 */  mtc1      $at, $f0
/* F639C 802D19EC 00000000 */  nop
/* F63A0 802D19F0 46001000 */  add.s     $f0, $f2, $f0
/* F63A4 802D19F4 E6200078 */  swc1      $f0, 0x78($s1)
/* F63A8 802D19F8 C6220078 */  lwc1      $f2, 0x78($s1)
.L802D19FC:
/* F63AC 802D19FC 3C014334 */  lui       $at, (0x43340000 >> 16)
/* F63B0 802D1A00 44810000 */  mtc1      $at, $f0
/* F63B4 802D1A04 00000000 */  nop
/* F63B8 802D1A08 4602003C */  c.lt.s    $f0, $f2
/* F63BC 802D1A0C 00000000 */  nop
/* F63C0 802D1A10 45000006 */  bc1f      .L802D1A2C
/* F63C4 802D1A14 00000000 */   nop
/* F63C8 802D1A18 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F63CC 802D1A1C 44810000 */  mtc1      $at, $f0
/* F63D0 802D1A20 00000000 */  nop
/* F63D4 802D1A24 46001001 */  sub.s     $f0, $f2, $f0
/* F63D8 802D1A28 E6200078 */  swc1      $f0, 0x78($s1)
.L802D1A2C:
/* F63DC 802D1A2C 8E620000 */  lw        $v0, 0x0($s3)
/* F63E0 802D1A30 1C40000E */  bgtz      $v0, .L802D1A6C
/* F63E4 802D1A34 00000000 */   nop
/* F63E8 802D1A38 3C10802E */  lui       $s0, %hi(playerNpc)
/* F63EC 802D1A3C 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F63F0 802D1A40 8E020000 */  lw        $v0, 0x0($s0)
/* F63F4 802D1A44 C6800000 */  lwc1      $f0, 0x0($s4)
/* F63F8 802D1A48 C44C000C */  lwc1      $f12, 0xC($v0)
/* F63FC 802D1A4C 46006300 */  add.s     $f12, $f12, $f0
/* F6400 802D1A50 0C00A6C9 */  jal       clamp_angle
/* F6404 802D1A54 E44C000C */   swc1     $f12, 0xC($v0)
/* F6408 802D1A58 8E030000 */  lw        $v1, 0x0($s0)
/* F640C 802D1A5C 24020002 */  addiu     $v0, $zero, 0x2
/* F6410 802D1A60 E460000C */  swc1      $f0, 0xC($v1)
/* F6414 802D1A64 080B46B7 */  j         .L802D1ADC
/* F6418 802D1A68 E6A00080 */   swc1     $f0, 0x80($s5)
.L802D1A6C:
/* F641C 802D1A6C 3C10802E */  lui       $s0, %hi(playerNpc)
/* F6420 802D1A70 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F6424 802D1A74 8E030000 */  lw        $v1, 0x0($s0)
/* F6428 802D1A78 9462008E */  lhu       $v0, 0x8E($v1)
/* F642C 802D1A7C 24420001 */  addiu     $v0, $v0, 0x1
/* F6430 802D1A80 A462008E */  sh        $v0, 0x8E($v1)
/* F6434 802D1A84 00021400 */  sll       $v0, $v0, 16
/* F6438 802D1A88 00021403 */  sra       $v0, $v0, 16
/* F643C 802D1A8C C6800000 */  lwc1      $f0, 0x0($s4)
/* F6440 802D1A90 44821000 */  mtc1      $v0, $f2
/* F6444 802D1A94 00000000 */  nop
/* F6448 802D1A98 468010A0 */  cvt.s.w   $f2, $f2
/* F644C 802D1A9C 46020002 */  mul.s     $f0, $f0, $f2
/* F6450 802D1AA0 00000000 */  nop
/* F6454 802D1AA4 C6CC0000 */  lwc1      $f12, 0x0($s6)
/* F6458 802D1AA8 C6620000 */  lwc1      $f2, 0x0($s3)
/* F645C 802D1AAC 468010A0 */  cvt.s.w   $f2, $f2
/* F6460 802D1AB0 46020003 */  div.s     $f0, $f0, $f2
/* F6464 802D1AB4 46006300 */  add.s     $f12, $f12, $f0
/* F6468 802D1AB8 0C00A6C9 */  jal       clamp_angle
/* F646C 802D1ABC E46C000C */   swc1     $f12, 0xC($v1)
/* F6470 802D1AC0 8E020000 */  lw        $v0, 0x0($s0)
/* F6474 802D1AC4 E440000C */  swc1      $f0, 0xC($v0)
/* F6478 802D1AC8 E6A00080 */  swc1      $f0, 0x80($s5)
/* F647C 802D1ACC 8442008E */  lh        $v0, 0x8E($v0)
/* F6480 802D1AD0 8E630000 */  lw        $v1, 0x0($s3)
/* F6484 802D1AD4 0043102A */  slt       $v0, $v0, $v1
/* F6488 802D1AD8 38420001 */  xori      $v0, $v0, 0x1
.L802D1ADC:
/* F648C 802D1ADC 8FBF002C */  lw        $ra, 0x2C($sp)
/* F6490 802D1AE0 8FB60028 */  lw        $s6, 0x28($sp)
/* F6494 802D1AE4 8FB50024 */  lw        $s5, 0x24($sp)
/* F6498 802D1AE8 8FB40020 */  lw        $s4, 0x20($sp)
/* F649C 802D1AEC 8FB3001C */  lw        $s3, 0x1C($sp)
/* F64A0 802D1AF0 8FB20018 */  lw        $s2, 0x18($sp)
/* F64A4 802D1AF4 8FB10014 */  lw        $s1, 0x14($sp)
/* F64A8 802D1AF8 8FB00010 */  lw        $s0, 0x10($sp)
/* F64AC 802D1AFC 03E00008 */  jr        $ra
/* F64B0 802D1B00 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

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

    if (isInitialCall) {
        playerNpc->yaw = playerStatus->targetYaw;
        *initialYaw = playerNpc->yaw;
        *deltaYaw = evt_get_float_variable(script, *args++) - *initialYaw;
        *time = evt_get_variable(script, *args++);
        playerNpc->duration = 0;

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

    if (*time > 0) {
        playerNpc->duration++;
        playerNpc->yaw = *initialYaw + ((*deltaYaw * playerNpc->duration) / *time);
        playerNpc->yaw = clamp_angle(playerNpc->yaw);
        playerStatus->targetYaw = playerNpc->yaw;

        return !(playerNpc->duration < *time);
    } else {
        playerNpc->yaw += *deltaYaw;
        playerNpc->yaw = clamp_angle(playerNpc->yaw);
        playerStatus->targetYaw = playerNpc->yaw;

        return ApiStatus_DONE2;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel npc_reload_all
/* 165B0 8003B1B0 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 165B4 8003B1B4 AFB20018 */  sw        $s2, 0x18($sp)
/* 165B8 8003B1B8 0000902D */  daddu     $s2, $zero, $zero
/* 165BC 8003B1BC AFB40020 */  sw        $s4, 0x20($sp)
/* 165C0 8003B1C0 3C144000 */  lui       $s4, (0x40000000 >> 16)
/* 165C4 8003B1C4 AFB3001C */  sw        $s3, 0x1C($sp)
/* 165C8 8003B1C8 3C130100 */  lui       $s3, (0x1000000 >> 16)
/* 165CC 8003B1CC AFBF0024 */  sw        $ra, 0x24($sp)
/* 165D0 8003B1D0 AFB10014 */  sw        $s1, 0x14($sp)
/* 165D4 8003B1D4 AFB00010 */  sw        $s0, 0x10($sp)
.L8003B1D8:
/* 165D8 8003B1D8 3C03800A */  lui       $v1, %hi(gCurrentNpcListPtr)
/* 165DC 8003B1DC 8C630B90 */  lw        $v1, %lo(gCurrentNpcListPtr)($v1)
/* 165E0 8003B1E0 00121080 */  sll       $v0, $s2, 2
/* 165E4 8003B1E4 00431021 */  addu      $v0, $v0, $v1
/* 165E8 8003B1E8 8C510000 */  lw        $s1, 0x0($v0)
/* 165EC 8003B1EC 52200049 */  beql      $s1, $zero, .L8003B314
/* 165F0 8003B1F0 26520001 */   addiu    $s2, $s2, 0x1
/* 165F4 8003B1F4 8E230000 */  lw        $v1, 0x0($s1)
/* 165F8 8003B1F8 50600046 */  beql      $v1, $zero, .L8003B314
/* 165FC 8003B1FC 26520001 */   addiu    $s2, $s2, 0x1
/* 16600 8003B200 00741024 */  and       $v0, $v1, $s4
/* 16604 8003B204 54400043 */  bnel      $v0, $zero, .L8003B314
/* 16608 8003B208 26520001 */   addiu    $s2, $s2, 0x1
/* 1660C 8003B20C 00731024 */  and       $v0, $v1, $s3
/* 16610 8003B210 14400010 */  bnez      $v0, .L8003B254
/* 16614 8003B214 00741024 */   and      $v0, $v1, $s4
/* 16618 8003B218 3C020400 */  lui       $v0, (0x4000000 >> 16)
/* 1661C 8003B21C 00621024 */  and       $v0, $v1, $v0
/* 16620 8003B220 14400004 */  bnez      $v0, .L8003B234
/* 16624 8003B224 3C048000 */   lui      $a0, (0x80000000 >> 16)
/* 16628 8003B228 8E240028 */  lw        $a0, 0x28($s1)
/* 1662C 8003B22C 0800EC90 */  j         .L8003B240
/* 16630 8003B230 8E2500B0 */   lw       $a1, 0xB0($s1)
.L8003B234:
/* 16634 8003B234 8E220028 */  lw        $v0, 0x28($s1)
/* 16638 8003B238 8E2500B0 */  lw        $a1, 0xB0($s1)
/* 1663C 8003B23C 00442025 */  or        $a0, $v0, $a0
.L8003B240:
/* 16640 8003B240 0C0B783B */  jal       spr_load_npc_sprite
/* 16644 8003B244 00000000 */   nop
/* 16648 8003B248 AE220024 */  sw        $v0, 0x24($s1)
/* 1664C 8003B24C 8E230000 */  lw        $v1, 0x0($s1)
/* 16650 8003B250 00741024 */  and       $v0, $v1, $s4
.L8003B254:
/* 16654 8003B254 5440002F */  bnel      $v0, $zero, .L8003B314
/* 16658 8003B258 26520001 */   addiu    $s2, $s2, 0x1
/* 1665C 8003B25C 00731024 */  and       $v0, $v1, $s3
/* 16660 8003B260 1440001A */  bnez      $v0, .L8003B2CC
/* 16664 8003B264 00000000 */   nop
/* 16668 8003B268 822200B4 */  lb        $v0, 0xB4($s1)
/* 1666C 8003B26C 10400017 */  beqz      $v0, .L8003B2CC
/* 16670 8003B270 00000000 */   nop
/* 16674 8003B274 0C0B7A90 */  jal       spr_get_npc_palettes
/* 16678 8003B278 96240028 */   lhu      $a0, 0x28($s1)
/* 1667C 8003B27C AE2200C4 */  sw        $v0, 0xC4($s1)
/* 16680 8003B280 0040202D */  daddu     $a0, $v0, $zero
/* 16684 8003B284 A22000C1 */  sb        $zero, 0xC1($s1)
/* 16688 8003B288 8C830000 */  lw        $v1, 0x0($a0)
/* 1668C 8003B28C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 16690 8003B290 1062000B */  beq       $v1, $v0, .L8003B2C0
/* 16694 8003B294 0080182D */   daddu    $v1, $a0, $zero
/* 16698 8003B298 0040202D */  daddu     $a0, $v0, $zero
.L8003B29C:
/* 1669C 8003B29C 922200C1 */  lbu       $v0, 0xC1($s1)
/* 166A0 8003B2A0 24420001 */  addiu     $v0, $v0, 0x1
/* 166A4 8003B2A4 A22200C1 */  sb        $v0, 0xC1($s1)
/* 166A8 8003B2A8 00021600 */  sll       $v0, $v0, 24
/* 166AC 8003B2AC 00021583 */  sra       $v0, $v0, 22
/* 166B0 8003B2B0 00431021 */  addu      $v0, $v0, $v1
/* 166B4 8003B2B4 8C420000 */  lw        $v0, 0x0($v0)
/* 166B8 8003B2B8 1444FFF8 */  bne       $v0, $a0, .L8003B29C
/* 166BC 8003B2BC 00000000 */   nop
.L8003B2C0:
/* 166C0 8003B2C0 0C0B7A9B */  jal       spr_get_npc_color_variations
/* 166C4 8003B2C4 96240028 */   lhu      $a0, 0x28($s1)
/* 166C8 8003B2C8 A22200C0 */  sb        $v0, 0xC0($s1)
.L8003B2CC:
/* 166CC 8003B2CC 8E230000 */  lw        $v1, 0x0($s1)
/* 166D0 8003B2D0 00741024 */  and       $v0, $v1, $s4
/* 166D4 8003B2D4 5440000F */  bnel      $v0, $zero, .L8003B314
/* 166D8 8003B2D8 26520001 */   addiu    $s2, $s2, 0x1
/* 166DC 8003B2DC 00731024 */  and       $v0, $v1, $s3
/* 166E0 8003B2E0 5440000C */  bnel      $v0, $zero, .L8003B314
/* 166E4 8003B2E4 26520001 */   addiu    $s2, $s2, 0x1
/* 166E8 8003B2E8 0000802D */  daddu     $s0, $zero, $zero
/* 166EC 8003B2EC 0220202D */  daddu     $a0, $s1, $zero
.L8003B2F0:
/* 166F0 8003B2F0 0C00F187 */  jal       npc_reset_current_decoration
/* 166F4 8003B2F4 0200282D */   daddu    $a1, $s0, $zero
/* 166F8 8003B2F8 26100001 */  addiu     $s0, $s0, 0x1
/* 166FC 8003B2FC 2A020002 */  slti      $v0, $s0, 0x2
/* 16700 8003B300 1440FFFB */  bnez      $v0, .L8003B2F0
/* 16704 8003B304 0220202D */   daddu    $a0, $s1, $zero
/* 16708 8003B308 0C00F4EF */  jal       npc_imgfx_update
/* 1670C 8003B30C 0220202D */   daddu    $a0, $s1, $zero
/* 16710 8003B310 26520001 */  addiu     $s2, $s2, 0x1
.L8003B314:
/* 16714 8003B314 2A420040 */  slti      $v0, $s2, 0x40
/* 16718 8003B318 1440FFAF */  bnez      $v0, .L8003B1D8
/* 1671C 8003B31C 00000000 */   nop
/* 16720 8003B320 8FBF0024 */  lw        $ra, 0x24($sp)
/* 16724 8003B324 8FB40020 */  lw        $s4, 0x20($sp)
/* 16728 8003B328 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1672C 8003B32C 8FB20018 */  lw        $s2, 0x18($sp)
/* 16730 8003B330 8FB10014 */  lw        $s1, 0x14($sp)
/* 16734 8003B334 8FB00010 */  lw        $s0, 0x10($sp)
/* 16738 8003B338 03E00008 */  jr        $ra
/* 1673C 8003B33C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void npc_reload_all(void) {
    s32 i;
    s32 j;

    for (i = 0; i < MAX_NPCS; i++) {
        Npc* npc = (*gCurrentNpcListPtr)[i];
        if (npc != NULL) {
            if (npc->flags && !(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
                    if (!(npc->flags & NPC_FLAG_PARTNER)) {
                        npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, npc->extraAnimList);
                    } else {
                        npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim | SPRITE_ID_TAIL_ALLOCATE, npc->extraAnimList);
                    }
                }
                if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                    if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->palSwapType != 0)) {
                        npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16);
                        npc->paletteCount = 0;
                        while (npc->spritePaletteList[npc->paletteCount] != (PAL_PTR) -1) {
                            npc->paletteCount++;
                        }
                        npc->unk_C0 = spr_get_npc_color_variations(npc->currentAnim >> 16);
                    }
                    if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                        if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
                            for (j = 0; j < 2; j++) {
                                npc_reset_current_decoration(npc, j);
                            }
                            npc_imgfx_update(npc);
                        }
                    }
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel InterpNpcYaw
/* F34B4 802CEB04 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* F34B8 802CEB08 AFB20018 */  sw        $s2, 0x18($sp)
/* F34BC 802CEB0C 0080902D */  daddu     $s2, $a0, $zero
/* F34C0 802CEB10 AFB50024 */  sw        $s5, 0x24($sp)
/* F34C4 802CEB14 26550074 */  addiu     $s5, $s2, 0x74
/* F34C8 802CEB18 AFB40020 */  sw        $s4, 0x20($sp)
/* F34CC 802CEB1C 26540078 */  addiu     $s4, $s2, 0x78
/* F34D0 802CEB20 AFB3001C */  sw        $s3, 0x1C($sp)
/* F34D4 802CEB24 AFBF0028 */  sw        $ra, 0x28($sp)
/* F34D8 802CEB28 AFB10014 */  sw        $s1, 0x14($sp)
/* F34DC 802CEB2C AFB00010 */  sw        $s0, 0x10($sp)
/* F34E0 802CEB30 8E51000C */  lw        $s1, 0xC($s2)
/* F34E4 802CEB34 10A0003B */  beqz      $a1, .L802CEC24
/* F34E8 802CEB38 2653007C */   addiu    $s3, $s2, 0x7C
/* F34EC 802CEB3C 8E250000 */  lw        $a1, 0x0($s1)
/* F34F0 802CEB40 0C0B1EAF */  jal       evt_get_variable
/* F34F4 802CEB44 26310004 */   addiu    $s1, $s1, 0x4
/* F34F8 802CEB48 0240202D */  daddu     $a0, $s2, $zero
/* F34FC 802CEB4C 0C0B36B0 */  jal       resolve_npc
/* F3500 802CEB50 0040282D */   daddu    $a1, $v0, $zero
/* F3504 802CEB54 0040802D */  daddu     $s0, $v0, $zero
/* F3508 802CEB58 12000052 */  beqz      $s0, .L802CECA4
/* F350C 802CEB5C 24020002 */   addiu    $v0, $zero, 0x2
/* F3510 802CEB60 C600000C */  lwc1      $f0, 0xC($s0)
/* F3514 802CEB64 E6400074 */  swc1      $f0, 0x74($s2)
/* F3518 802CEB68 8E250000 */  lw        $a1, 0x0($s1)
/* F351C 802CEB6C 0C0B1EAF */  jal       evt_get_variable
/* F3520 802CEB70 0240202D */   daddu    $a0, $s2, $zero
/* F3524 802CEB74 C6420074 */  lwc1      $f2, 0x74($s2)
/* F3528 802CEB78 44820000 */  mtc1      $v0, $f0
/* F352C 802CEB7C 00000000 */  nop
/* F3530 802CEB80 46800020 */  cvt.s.w   $f0, $f0
/* F3534 802CEB84 46020001 */  sub.s     $f0, $f0, $f2
/* F3538 802CEB88 26310004 */  addiu     $s1, $s1, 0x4
/* F353C 802CEB8C AE500070 */  sw        $s0, 0x70($s2)
/* F3540 802CEB90 E6400078 */  swc1      $f0, 0x78($s2)
/* F3544 802CEB94 8E250000 */  lw        $a1, 0x0($s1)
/* F3548 802CEB98 0C0B1EAF */  jal       evt_get_variable
/* F354C 802CEB9C 0240202D */   daddu    $a0, $s2, $zero
/* F3550 802CEBA0 14400005 */  bnez      $v0, .L802CEBB8
/* F3554 802CEBA4 AE42007C */   sw       $v0, 0x7C($s2)
/* F3558 802CEBA8 C600000C */  lwc1      $f0, 0xC($s0)
/* F355C 802CEBAC C6420078 */  lwc1      $f2, 0x78($s2)
/* F3560 802CEBB0 080B3B0F */  j         .L802CEC3C
/* F3564 802CEBB4 46020000 */   add.s    $f0, $f0, $f2
.L802CEBB8:
/* F3568 802CEBB8 A600008E */  sh        $zero, 0x8E($s0)
/* F356C 802CEBBC C6420078 */  lwc1      $f2, 0x78($s2)
/* F3570 802CEBC0 3C01C334 */  lui       $at, (0xC3340000 >> 16)
/* F3574 802CEBC4 44810000 */  mtc1      $at, $f0
/* F3578 802CEBC8 00000000 */  nop
/* F357C 802CEBCC 4600103C */  c.lt.s    $f2, $f0
/* F3580 802CEBD0 00000000 */  nop
/* F3584 802CEBD4 45000007 */  bc1f      .L802CEBF4
/* F3588 802CEBD8 00000000 */   nop
/* F358C 802CEBDC 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F3590 802CEBE0 44810000 */  mtc1      $at, $f0
/* F3594 802CEBE4 00000000 */  nop
/* F3598 802CEBE8 46001000 */  add.s     $f0, $f2, $f0
/* F359C 802CEBEC E6400078 */  swc1      $f0, 0x78($s2)
/* F35A0 802CEBF0 C6420078 */  lwc1      $f2, 0x78($s2)
.L802CEBF4:
/* F35A4 802CEBF4 3C014334 */  lui       $at, (0x43340000 >> 16)
/* F35A8 802CEBF8 44810000 */  mtc1      $at, $f0
/* F35AC 802CEBFC 00000000 */  nop
/* F35B0 802CEC00 4602003C */  c.lt.s    $f0, $f2
/* F35B4 802CEC04 00000000 */  nop
/* F35B8 802CEC08 45000006 */  bc1f      .L802CEC24
/* F35BC 802CEC0C 00000000 */   nop
/* F35C0 802CEC10 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* F35C4 802CEC14 44810000 */  mtc1      $at, $f0
/* F35C8 802CEC18 00000000 */  nop
/* F35CC 802CEC1C 46001001 */  sub.s     $f0, $f2, $f0
/* F35D0 802CEC20 E6400078 */  swc1      $f0, 0x78($s2)
.L802CEC24:
/* F35D4 802CEC24 8E620000 */  lw        $v0, 0x0($s3)
/* F35D8 802CEC28 1C400007 */  bgtz      $v0, .L802CEC48
/* F35DC 802CEC2C 8E500070 */   lw       $s0, 0x70($s2)
/* F35E0 802CEC30 C600000C */  lwc1      $f0, 0xC($s0)
/* F35E4 802CEC34 C6820000 */  lwc1      $f2, 0x0($s4)
/* F35E8 802CEC38 46020000 */  add.s     $f0, $f0, $f2
.L802CEC3C:
/* F35EC 802CEC3C 24020002 */  addiu     $v0, $zero, 0x2
/* F35F0 802CEC40 080B3B29 */  j         .L802CECA4
/* F35F4 802CEC44 E600000C */   swc1     $f0, 0xC($s0)
.L802CEC48:
/* F35F8 802CEC48 9602008E */  lhu       $v0, 0x8E($s0)
/* F35FC 802CEC4C 24420001 */  addiu     $v0, $v0, 0x1
/* F3600 802CEC50 A602008E */  sh        $v0, 0x8E($s0)
/* F3604 802CEC54 00021400 */  sll       $v0, $v0, 16
/* F3608 802CEC58 00021403 */  sra       $v0, $v0, 16
/* F360C 802CEC5C C6800000 */  lwc1      $f0, 0x0($s4)
/* F3610 802CEC60 44821000 */  mtc1      $v0, $f2
/* F3614 802CEC64 00000000 */  nop
/* F3618 802CEC68 468010A0 */  cvt.s.w   $f2, $f2
/* F361C 802CEC6C 46020002 */  mul.s     $f0, $f0, $f2
/* F3620 802CEC70 00000000 */  nop
/* F3624 802CEC74 C6AC0000 */  lwc1      $f12, 0x0($s5)
/* F3628 802CEC78 C6620000 */  lwc1      $f2, 0x0($s3)
/* F362C 802CEC7C 468010A0 */  cvt.s.w   $f2, $f2
/* F3630 802CEC80 46020003 */  div.s     $f0, $f0, $f2
/* F3634 802CEC84 46006300 */  add.s     $f12, $f12, $f0
/* F3638 802CEC88 0C00A6C9 */  jal       clamp_angle
/* F363C 802CEC8C E60C000C */   swc1     $f12, 0xC($s0)
/* F3640 802CEC90 8602008E */  lh        $v0, 0x8E($s0)
/* F3644 802CEC94 E600000C */  swc1      $f0, 0xC($s0)
/* F3648 802CEC98 8E630000 */  lw        $v1, 0x0($s3)
/* F364C 802CEC9C 0043102A */  slt       $v0, $v0, $v1
/* F3650 802CECA0 38420001 */  xori      $v0, $v0, 0x1
.L802CECA4:
/* F3654 802CECA4 8FBF0028 */  lw        $ra, 0x28($sp)
/* F3658 802CECA8 8FB50024 */  lw        $s5, 0x24($sp)
/* F365C 802CECAC 8FB40020 */  lw        $s4, 0x20($sp)
/* F3660 802CECB0 8FB3001C */  lw        $s3, 0x1C($sp)
/* F3664 802CECB4 8FB20018 */  lw        $s2, 0x18($sp)
/* F3668 802CECB8 8FB10014 */  lw        $s1, 0x14($sp)
/* F366C 802CECBC 8FB00010 */  lw        $s0, 0x10($sp)
/* F3670 802CECC0 03E00008 */  jr        $ra
/* F3674 802CECC4 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

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

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

        npc = resolve_npc(script, npcID);
        if (npc == NULL) {
            return ApiStatus_DONE2;
        }

        *initialYaw = npc->yaw;
        *deltaYaw = evt_get_variable(script, *args++) - *initialYaw;
        script->functionTempPtr[0] = npc;
        *turnTime = evt_get_variable(script, *args++);

        if (*turnTime == 0) {
            npc->yaw += *deltaYaw;
            return ApiStatus_DONE2;
        }

        npc->duration = 0;

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

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

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


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8011B1D8
/* B18D8 8011B1D8 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* B18DC 8011B1DC AFB50024 */  sw        $s5, 0x24($sp)
/* B18E0 8011B1E0 0080A82D */  daddu     $s5, $a0, $zero
/* B18E4 8011B1E4 AFBF0030 */  sw        $ra, 0x30($sp)
/* B18E8 8011B1E8 AFB7002C */  sw        $s7, 0x2C($sp)
/* B18EC 8011B1EC AFB60028 */  sw        $s6, 0x28($sp)
/* B18F0 8011B1F0 AFB40020 */  sw        $s4, 0x20($sp)
/* B18F4 8011B1F4 AFB3001C */  sw        $s3, 0x1C($sp)
/* B18F8 8011B1F8 AFB20018 */  sw        $s2, 0x18($sp)
/* B18FC 8011B1FC AFB10014 */  sw        $s1, 0x14($sp)
/* B1900 8011B200 AFB00010 */  sw        $s0, 0x10($sp)
/* B1904 8011B204 8EA30000 */  lw        $v1, 0x0($s5)
/* B1908 8011B208 24020002 */  addiu     $v0, $zero, 0x2
/* B190C 8011B20C 14620007 */  bne       $v1, $v0, .L8011B22C
/* B1910 8011B210 24020005 */   addiu    $v0, $zero, 0x5
/* B1914 8011B214 3C028015 */  lui       $v0, %hi(D_80153226)
/* B1918 8011B218 94423226 */  lhu       $v0, %lo(D_80153226)($v0)
/* B191C 8011B21C 3C018015 */  lui       $at, %hi(D_80153376)
/* B1920 8011B220 A4223376 */  sh        $v0, %lo(D_80153376)($at)
/* B1924 8011B224 08046CD4 */  j         .L8011B350
/* B1928 8011B228 00000000 */   nop
.L8011B22C:
/* B192C 8011B22C 14620019 */  bne       $v1, $v0, .L8011B294
/* B1930 8011B230 02A0202D */   daddu    $a0, $s5, $zero
/* B1934 8011B234 0C0456C3 */  jal       get_model_property
/* B1938 8011B238 24050060 */   addiu    $a1, $zero, 0x60
/* B193C 8011B23C 10400015 */  beqz      $v0, .L8011B294
/* B1940 8011B240 00000000 */   nop
/* B1944 8011B244 8C420008 */  lw        $v0, 0x8($v0)
/* B1948 8011B248 10400012 */  beqz      $v0, .L8011B294
/* B194C 8011B24C 00000000 */   nop
/* B1950 8011B250 0C04572A */  jal       mdl_get_child_count
/* B1954 8011B254 02A0202D */   daddu    $a0, $s5, $zero
/* B1958 8011B258 3C038015 */  lui       $v1, %hi(mdl_treeIterPos)
/* B195C 8011B25C 24633224 */  addiu     $v1, $v1, %lo(mdl_treeIterPos)
/* B1960 8011B260 8C640000 */  lw        $a0, 0x0($v1)
/* B1964 8011B264 00822021 */  addu      $a0, $a0, $v0
/* B1968 8011B268 AC640000 */  sw        $a0, 0x0($v1)
/* B196C 8011B26C 94620002 */  lhu       $v0, 0x2($v1)
/* B1970 8011B270 3C018015 */  lui       $at, %hi(D_80153376)
/* B1974 8011B274 A4223376 */  sh        $v0, %lo(D_80153376)($at)
/* B1978 8011B278 08046CD4 */  j         .L8011B350
/* B197C 8011B27C 00000000 */   nop
.L8011B280:
/* B1980 8011B280 AED00000 */  sw        $s0, 0x0($s6)
/* B1984 8011B284 3C018015 */  lui       $at, %hi(D_80153374)
/* B1988 8011B288 A4323374 */  sh        $s2, %lo(D_80153374)($at)
/* B198C 8011B28C 08046CD4 */  j         .L8011B350
/* B1990 8011B290 00000000 */   nop
.L8011B294:
/* B1994 8011B294 8EA20010 */  lw        $v0, 0x10($s5)
/* B1998 8011B298 1040002D */  beqz      $v0, .L8011B350
/* B199C 8011B29C 00000000 */   nop
/* B19A0 8011B2A0 8C53000C */  lw        $s3, 0xC($v0)
/* B19A4 8011B2A4 1260002A */  beqz      $s3, .L8011B350
/* B19A8 8011B2A8 00000000 */   nop
/* B19AC 8011B2AC 1A600028 */  blez      $s3, .L8011B350
/* B19B0 8011B2B0 0000882D */   daddu    $s1, $zero, $zero
/* B19B4 8011B2B4 3C148015 */  lui       $s4, %hi(mdl_treeIterPos)
/* B19B8 8011B2B8 26943224 */  addiu     $s4, $s4, %lo(mdl_treeIterPos)
/* B19BC 8011B2BC 24170005 */  addiu     $s7, $zero, 0x5
/* B19C0 8011B2C0 3C168015 */  lui       $s6, %hi(D_80153370)
/* B19C4 8011B2C4 26D63370 */  addiu     $s6, $s6, %lo(D_80153370)
.L8011B2C8:
/* B19C8 8011B2C8 8EA20010 */  lw        $v0, 0x10($s5)
/* B19CC 8011B2CC 8C430010 */  lw        $v1, 0x10($v0)
/* B19D0 8011B2D0 00111080 */  sll       $v0, $s1, 2
/* B19D4 8011B2D4 00431021 */  addu      $v0, $v0, $v1
/* B19D8 8011B2D8 8C500000 */  lw        $s0, 0x0($v0)
/* B19DC 8011B2DC 8E020000 */  lw        $v0, 0x0($s0)
/* B19E0 8011B2E0 96920002 */  lhu       $s2, 0x2($s4)
/* B19E4 8011B2E4 1457000B */  bne       $v0, $s7, .L8011B314
/* B19E8 8011B2E8 0200202D */   daddu    $a0, $s0, $zero
/* B19EC 8011B2EC 0C0456C3 */  jal       get_model_property
/* B19F0 8011B2F0 24050060 */   addiu    $a1, $zero, 0x60
/* B19F4 8011B2F4 10400007 */  beqz      $v0, .L8011B314
/* B19F8 8011B2F8 00000000 */   nop
/* B19FC 8011B2FC 8C420008 */  lw        $v0, 0x8($v0)
/* B1A00 8011B300 10400004 */  beqz      $v0, .L8011B314
/* B1A04 8011B304 00000000 */   nop
/* B1A08 8011B308 0C04572A */  jal       mdl_get_child_count
/* B1A0C 8011B30C 0200202D */   daddu    $a0, $s0, $zero
/* B1A10 8011B310 02429021 */  addu      $s2, $s2, $v0
.L8011B314:
/* B1A14 8011B314 0C046C76 */  jal       func_8011B1D8
/* B1A18 8011B318 0200202D */   daddu    $a0, $s0, $zero
/* B1A1C 8011B31C 8EC20000 */  lw        $v0, 0x0($s6)
/* B1A20 8011B320 1440000B */  bnez      $v0, .L8011B350
/* B1A24 8011B324 00000000 */   nop
/* B1A28 8011B328 3C028015 */  lui       $v0, %hi(D_8015336E)
/* B1A2C 8011B32C 9442336E */  lhu       $v0, %lo(D_8015336E)($v0)
/* B1A30 8011B330 8E830000 */  lw        $v1, 0x0($s4)
/* B1A34 8011B334 1043FFD2 */  beq       $v0, $v1, .L8011B280
/* B1A38 8011B338 24620001 */   addiu    $v0, $v1, 0x1
/* B1A3C 8011B33C AE820000 */  sw        $v0, 0x0($s4)
/* B1A40 8011B340 26310001 */  addiu     $s1, $s1, 0x1
/* B1A44 8011B344 0233102A */  slt       $v0, $s1, $s3
/* B1A48 8011B348 1440FFDF */  bnez      $v0, .L8011B2C8
/* B1A4C 8011B34C 00000000 */   nop
.L8011B350:
/* B1A50 8011B350 8FBF0030 */  lw        $ra, 0x30($sp)
/* B1A54 8011B354 8FB7002C */  lw        $s7, 0x2C($sp)
/* B1A58 8011B358 8FB60028 */  lw        $s6, 0x28($sp)
/* B1A5C 8011B35C 8FB50024 */  lw        $s5, 0x24($sp)
/* B1A60 8011B360 8FB40020 */  lw        $s4, 0x20($sp)
/* B1A64 8011B364 8FB3001C */  lw        $s3, 0x1C($sp)
/* B1A68 8011B368 8FB20018 */  lw        $s2, 0x18($sp)
/* B1A6C 8011B36C 8FB10014 */  lw        $s1, 0x14($sp)
/* B1A70 8011B370 8FB00010 */  lw        $s0, 0x10($sp)
/* B1A74 8011B374 03E00008 */  jr        $ra
/* B1A78 8011B378 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void func_8011B1D8(ModelNode* node) {
    ModelNode* childNode;
    ModelNodeProperty* prop;
    s32 numChildren;
    s32 i;
    u16 childCount;

    if (node->type == SHAPE_TYPE_MODEL) {
        D_80153376 = D_80153226;
        return;
    }

    if (node->type == SHAPE_TYPE_GROUP) {
        prop = get_model_property(node, MODEL_PROP_KEY_GROUP_TYPE);
        if (prop != NULL && prop->data.s != 0) {
            mdl_treeIterPos += mdl_get_child_count(node);
            D_80153376 = mdl_treeIterPos;
            return;
        }
    }

    if (node->groupData != NULL) {
        numChildren = node->groupData->numChildren;
        if (numChildren != 0) {
            for (i = 0; i < numChildren; i++) {
                childNode = node->groupData->childList[i];
                childCount = mdl_treeIterPos;
                if (childNode->type == SHAPE_TYPE_GROUP) {
                    prop = get_model_property(childNode, MODEL_PROP_KEY_GROUP_TYPE);
                    if (prop != NULL && prop->data.s != 0) {
                        childCount += mdl_get_child_count(childNode);
                    }
                }
                func_8011B1D8(childNode);

                if (D_80153370 != NULL) {
                    break;
                }

                if (D_8015336E == mdl_treeIterPos) {
                    D_80153370 = childNode;
                    D_80153374 = childCount;
                    break;
                }

                mdl_treeIterPos++;
            }
        }
    }
}