### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_interact_prompt
/* E202F8 802B71E8 3C028011 */  lui       $v0, %hi(gPlayerStatus + 0x4)
/* E202FC 802B71EC 8C42EFCC */  lw        $v0, %lo(gPlayerStatus + 0x4)($v0)
/* E20300 802B71F0 27BDFF28 */  addiu     $sp, $sp, -0xD8
/* E20304 802B71F4 AFBF00D0 */  sw        $ra, 0xD0($sp)
/* E20308 802B71F8 AFB500CC */  sw        $s5, 0xCC($sp)
/* E2030C 802B71FC AFB400C8 */  sw        $s4, 0xC8($sp)
/* E20310 802B7200 AFB300C4 */  sw        $s3, 0xC4($sp)
/* E20314 802B7204 AFB200C0 */  sw        $s2, 0xC0($sp)
.L802B7208:
/* E20318 802B7208 AFB100BC */  sw        $s1, 0xBC($sp)
/* E2031C 802B720C 30420010 */  andi      $v0, $v0, 0x10
/* E20320 802B7210 10400086 */  beqz      $v0, interact_speech_update
/* E20324 802B7214 AFB000B8 */   sw       $s0, 0xB8($sp)
/* E20328 802B7218 27B00038 */  addiu     $s0, $sp, 0x38
/* E2032C 802B721C 3C14802B */  lui       $s4, %hi(D_802B7CB8)
/* E20330 802B7220 26947CB8 */  addiu     $s4, $s4, %lo(D_802B7CB8)
/* E20334 802B7224 8E820000 */  lw        $v0, 0x0($s4)
/* E20338 802B7228 0200202D */  daddu     $a0, $s0, $zero
/* E2033C 802B722C 8C450010 */  lw        $a1, 0x10($v0)
/* E20340 802B7230 3C150001 */  lui       $s5, (0x11630 >> 16)
/* E20344 802B7234 00A0302D */  daddu     $a2, $a1, $zero
/* E20348 802B7238 0C019DF0 */  jal       guScaleF
/* E2034C 802B723C 00A0382D */   daddu    $a3, $a1, $zero
/* E20350 802B7240 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* E20354 802B7244 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* E20358 802B7248 27B10078 */  addiu     $s1, $sp, 0x78
/* E2035C 802B724C 00031080 */  sll       $v0, $v1, 2
/* E20360 802B7250 00431021 */  addu      $v0, $v0, $v1
/* E20364 802B7254 00021080 */  sll       $v0, $v0, 2
/* E20368 802B7258 00431023 */  subu      $v0, $v0, $v1
/* E2036C 802B725C 000218C0 */  sll       $v1, $v0, 3
/* E20370 802B7260 00431021 */  addu      $v0, $v0, $v1
/* E20374 802B7264 000210C0 */  sll       $v0, $v0, 3
/* E20378 802B7268 8E830000 */  lw        $v1, 0x0($s4)
/* E2037C 802B726C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* E20380 802B7270 00220821 */  addu      $at, $at, $v0
/* E20384 802B7274 C4221DEC */  lwc1      $f2, %lo(gCameras + 0x6C)($at)
/* E20388 802B7278 C464000C */  lwc1      $f4, 0xC($v1)
/* E2038C 802B727C 44800000 */  mtc1      $zero, $f0
/* E20390 802B7280 46022101 */  sub.s     $f4, $f4, $f2
/* E20394 802B7284 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* E20398 802B7288 44060000 */  mfc1      $a2, $f0
/* E2039C 802B728C 44052000 */  mfc1      $a1, $f4
/* E203A0 802B7290 0220202D */  daddu     $a0, $s1, $zero
/* E203A4 802B7294 0C019EC8 */  jal       guRotateF
/* E203A8 802B7298 AFA60010 */   sw       $a2, 0x10($sp)
/* E203AC 802B729C 0200202D */  daddu     $a0, $s0, $zero
/* E203B0 802B72A0 0220282D */  daddu     $a1, $s1, $zero
.L802B72A4:
/* E203B4 802B72A4 0C019D80 */  jal       guMtxCatF
/* E203B8 802B72A8 0200302D */   daddu    $a2, $s0, $zero
/* E203BC 802B72AC 8E820000 */  lw        $v0, 0x0($s4)
/* E203C0 802B72B0 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* E203C4 802B72B4 8C450000 */  lw        $a1, 0x0($v0)
/* E203C8 802B72B8 8C460004 */  lw        $a2, 0x4($v0)
/* E203CC 802B72BC 8C470008 */  lw        $a3, 0x8($v0)
glabel ispy_notification_setup
/* E203D0 802B72C0 0C019E40 */  jal       guTranslateF
/* E203D4 802B72C4 0220202D */   daddu    $a0, $s1, $zero
/* E203D8 802B72C8 0200202D */  daddu     $a0, $s0, $zero
/* E203DC 802B72CC 0220282D */  daddu     $a1, $s1, $zero
/* E203E0 802B72D0 0C019D80 */  jal       guMtxCatF
/* E203E4 802B72D4 0220302D */   daddu    $a2, $s1, $zero
/* E203E8 802B72D8 0220202D */  daddu     $a0, $s1, $zero
/* E203EC 802B72DC 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* E203F0 802B72E0 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* E203F4 802B72E4 3C13800A */  lui       $s3, %hi(gDisplayContext)
/* E203F8 802B72E8 2673A674 */  addiu     $s3, $s3, %lo(gDisplayContext)
/* E203FC 802B72EC 96050000 */  lhu       $a1, 0x0($s0)
/* E20400 802B72F0 8E620000 */  lw        $v0, 0x0($s3)
/* E20404 802B72F4 00052980 */  sll       $a1, $a1, 6
/* E20408 802B72F8 00B52821 */  addu      $a1, $a1, $s5
/* E2040C 802B72FC 0C019D40 */  jal       guMtxF2L
/* E20410 802B7300 00452821 */   addu     $a1, $v0, $a1
/* E20414 802B7304 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* E20418 802B7308 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* E2041C 802B730C 0000202D */  daddu     $a0, $zero, $zero
/* E20420 802B7310 0080282D */  daddu     $a1, $a0, $zero
/* E20424 802B7314 0080302D */  daddu     $a2, $a0, $zero
/* E20428 802B7318 3C12800A */  lui       $s2, %hi(gMainGfxPos)
/* E2042C 802B731C 2652A66C */  addiu     $s2, $s2, %lo(gMainGfxPos)
/* E20430 802B7320 0080382D */  daddu     $a3, $a0, $zero
/* E20434 802B7324 8E480000 */  lw        $t0, 0x0($s2)
/* E20438 802B7328 96020000 */  lhu       $v0, 0x0($s0)
/* E2043C 802B732C 0100482D */  daddu     $t1, $t0, $zero
/* E20440 802B7330 25080008 */  addiu     $t0, $t0, 0x8
/* E20444 802B7334 AE480000 */  sw        $t0, 0x0($s2)
/* E20448 802B7338 AD230000 */  sw        $v1, 0x0($t1)
/* E2044C 802B733C 24430001 */  addiu     $v1, $v0, 0x1
/* E20450 802B7340 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* E20454 802B7344 00021180 */  sll       $v0, $v0, 6
/* E20458 802B7348 A6030000 */  sh        $v1, 0x0($s0)
/* E2045C 802B734C 8E630000 */  lw        $v1, 0x0($s3)
/* E20460 802B7350 00551021 */  addu      $v0, $v0, $s5
/* E20464 802B7354 00621821 */  addu      $v1, $v1, $v0
/* E20468 802B7358 25020008 */  addiu     $v0, $t0, 0x8
glabel ispy_notification_update
/* E2046C 802B735C AD230004 */  sw        $v1, 0x4($t1)
/* E20470 802B7360 AE420000 */  sw        $v0, 0x0($s2)
/* E20474 802B7364 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* E20478 802B7368 AD020000 */  sw        $v0, 0x0($t0)
/* E2047C 802B736C 3C02802B */  lui       $v0, %hi(D_802B7C40)
/* E20480 802B7370 24427C40 */  addiu     $v0, $v0, %lo(D_802B7C40)
/* E20484 802B7374 AD020004 */  sw        $v0, 0x4($t0)
/* E20488 802B7378 3C02802B */  lui       $v0, %hi(D_802B7A20)
/* E2048C 802B737C 24427A20 */  addiu     $v0, $v0, %lo(D_802B7A20)
/* E20490 802B7380 AFA20020 */  sw        $v0, 0x20($sp)
/* E20494 802B7384 3C02802B */  lui       $v0, %hi(D_802B7C20)
/* E20498 802B7388 24427C20 */  addiu     $v0, $v0, %lo(D_802B7C20)
/* E2049C 802B738C AFA20024 */  sw        $v0, 0x24($sp)
.L802B7390:
/* E204A0 802B7390 24020020 */  addiu     $v0, $zero, 0x20
/* E204A4 802B7394 A7A20028 */  sh        $v0, 0x28($sp)
/* E204A8 802B7398 A7A2002A */  sh        $v0, 0x2A($sp)
/* E204AC 802B739C 2402FFF0 */  addiu     $v0, $zero, -0x10
/* E204B0 802B73A0 A7A2002C */  sh        $v0, 0x2C($sp)
/* E204B4 802B73A4 2402001A */  addiu     $v0, $zero, 0x1A
/* E204B8 802B73A8 A7A2002E */  sh        $v0, 0x2E($sp)
/* E204BC 802B73AC 240200FF */  addiu     $v0, $zero, 0xFF
/* E204C0 802B73B0 A3A20030 */  sb        $v0, 0x30($sp)
/* E204C4 802B73B4 24020440 */  addiu     $v0, $zero, 0x440
/* E204C8 802B73B8 AFA00010 */  sw        $zero, 0x10($sp)
/* E204CC 802B73BC AFA00014 */  sw        $zero, 0x14($sp)
glabel .L802B73C0
/* E204D0 802B73C0 0C04EAA7 */  jal       imgfx_update
/* E204D4 802B73C4 AFA20018 */   sw       $v0, 0x18($sp)
glabel .L802B73C8
/* E204D8 802B73C8 0000202D */  daddu     $a0, $zero, $zero
/* E204DC 802B73CC 8E820000 */  lw        $v0, 0x0($s4)
glabel .L802B73D0
/* E204E0 802B73D0 24050006 */  addiu     $a1, $zero, 0x6
/* E204E4 802B73D4 90460024 */  lbu       $a2, 0x24($v0)
glabel .L802B73D8
/* E204E8 802B73D8 240200FF */  addiu     $v0, $zero, 0xFF
/* E204EC 802B73DC AFA20014 */  sw        $v0, 0x14($sp)
glabel .L802B73E0
/* E204F0 802B73E0 24020448 */  addiu     $v0, $zero, 0x448
/* E204F4 802B73E4 AFA20018 */  sw        $v0, 0x18($sp)
glabel .L802B73E8
/* E204F8 802B73E8 00C0382D */  daddu     $a3, $a2, $zero
/* E204FC 802B73EC 0C04EAA7 */  jal       imgfx_update
.L802B73F0:
/* E20500 802B73F0 AFA60010 */   sw       $a2, 0x10($sp)
/* E20504 802B73F4 0000202D */  daddu     $a0, $zero, $zero
.L802B73F8:
/* E20508 802B73F8 27A50020 */  addiu     $a1, $sp, 0x20
.L802B73FC:
/* E2050C 802B73FC 0080302D */  daddu     $a2, $a0, $zero
/* E20510 802B7400 0C04EBDC */  jal       imgfx_appendGfx_component
/* E20514 802B7404 0220382D */   daddu    $a3, $s1, $zero
.L802B7408:
/* E20518 802B7408 3C04D838 */  lui       $a0, (0xD8380002 >> 16)
/* E2051C 802B740C 8E420000 */  lw        $v0, 0x0($s2)
.L802B7410:
/* E20520 802B7410 34840002 */  ori       $a0, $a0, (0xD8380002 & 0xFFFF)
/* E20524 802B7414 0040182D */  daddu     $v1, $v0, $zero
/* E20528 802B7418 24420008 */  addiu     $v0, $v0, 0x8
/* E2052C 802B741C AE420000 */  sw        $v0, 0x0($s2)
/* E20530 802B7420 24020040 */  addiu     $v0, $zero, 0x40
/* E20534 802B7424 AC640000 */  sw        $a0, 0x0($v1)
/* E20538 802B7428 AC620004 */  sw        $v0, 0x4($v1)
glabel interact_speech_update
/* E2053C 802B742C 8FBF00D0 */  lw        $ra, 0xD0($sp)
/* E20540 802B7430 8FB500CC */  lw        $s5, 0xCC($sp)
/* E20544 802B7434 8FB400C8 */  lw        $s4, 0xC8($sp)
.L802B7438:
/* E20548 802B7438 8FB300C4 */  lw        $s3, 0xC4($sp)
/* E2054C 802B743C 8FB200C0 */  lw        $s2, 0xC0($sp)
.L802B7440:
/* E20550 802B7440 8FB100BC */  lw        $s1, 0xBC($sp)
.L802B7444:
/* E20554 802B7444 8FB000B8 */  lw        $s0, 0xB8($sp)
/* E20558 802B7448 03E00008 */  jr        $ra
/* E2055C 802B744C 27BD00D8 */   addiu    $sp, $sp, 0xD8

### DECOMPILED C INSTRUCTIONS:

void appendGfx_interact_prompt(void) {
    ImgFXTexture ifxImg;
    Matrix4f sp38, sp78;

    if (gPlayerStatus.animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) {
        guScaleF(sp38, InspectIconPtr->scale, InspectIconPtr->scale, InspectIconPtr->scale);
        guRotateF(sp78, InspectIconPtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
        guMtxCatF(sp38, sp78, sp38);
        guTranslateF(sp78, InspectIconPtr->pos.x, InspectIconPtr->pos.y, InspectIconPtr->pos.z);
        guMtxCatF(sp38, sp78, sp78);
        guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                  G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, &inspect_icon_gfx);

        ifxImg.raster  = inspect_icon_img;
        ifxImg.palette = inspect_icon_pal;
        ifxImg.width   = inspect_icon_img_width;
        ifxImg.height  = inspect_icon_img_height;
        ifxImg.xOffset = -16;
        ifxImg.yOffset = 26;
        ifxImg.alpha = 255;
        imgfx_update(0, IMGFX_CLEAR, 0, 0, 0, 0, IMGFX_FLAG_400 | IMGFX_FLAG_40);
        imgfx_update(0, IMGFX_SET_COLOR,
                    InspectIconPtr->brightness, InspectIconPtr->brightness, InspectIconPtr->brightness, 255,
                    IMGFX_FLAG_400 | IMGFX_FLAG_40 | IMGFX_FLAG_8);
        imgfx_appendGfx_component(0, &ifxImg, 0, sp78);

        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_speech_bubble
/* E21078 802B71C8 3C028011 */  lui       $v0, %hi(gPlayerStatus + 0x4)
/* E2107C 802B71CC 8C42EFCC */  lw        $v0, %lo(gPlayerStatus + 0x4)($v0)
/* E21080 802B71D0 27BDFF28 */  addiu     $sp, $sp, -0xD8
glabel appendGfx_pulse_stone_icon
/* E21084 802B71D4 AFBF00D0 */  sw        $ra, 0xD0($sp)
/* E21088 802B71D8 AFB500CC */  sw        $s5, 0xCC($sp)
/* E2108C 802B71DC AFB400C8 */  sw        $s4, 0xC8($sp)
/* E21090 802B71E0 AFB300C4 */  sw        $s3, 0xC4($sp)
/* E21094 802B71E4 AFB200C0 */  sw        $s2, 0xC0($sp)
glabel appendGfx_interact_prompt
/* E21098 802B71E8 AFB100BC */  sw        $s1, 0xBC($sp)
/* E2109C 802B71EC 30420020 */  andi      $v0, $v0, 0x20
/* E210A0 802B71F0 10400085 */  beqz      $v0, .L802B7408
/* E210A4 802B71F4 AFB000B8 */   sw       $s0, 0xB8($sp)
/* E210A8 802B71F8 27B00038 */  addiu     $s0, $sp, 0x38
/* E210AC 802B71FC 3C14802B */  lui       $s4, %hi(D_802B79A8)
/* E210B0 802B7200 269479A8 */  addiu     $s4, $s4, %lo(D_802B79A8)
/* E210B4 802B7204 8E820000 */  lw        $v0, 0x0($s4)
.L802B7208:
/* E210B8 802B7208 0200202D */  daddu     $a0, $s0, $zero
/* E210BC 802B720C 8C450014 */  lw        $a1, 0x14($v0)
/* E210C0 802B7210 3C150001 */  lui       $s5, (0x11630 >> 16)
/* E210C4 802B7214 00A0302D */  daddu     $a2, $a1, $zero
/* E210C8 802B7218 0C019DF0 */  jal       guScaleF
/* E210CC 802B721C 00A0382D */   daddu    $a3, $a1, $zero
/* E210D0 802B7220 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* E210D4 802B7224 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* E210D8 802B7228 27B10078 */  addiu     $s1, $sp, 0x78
/* E210DC 802B722C 00031080 */  sll       $v0, $v1, 2
/* E210E0 802B7230 00431021 */  addu      $v0, $v0, $v1
/* E210E4 802B7234 00021080 */  sll       $v0, $v0, 2
/* E210E8 802B7238 00431023 */  subu      $v0, $v0, $v1
/* E210EC 802B723C 000218C0 */  sll       $v1, $v0, 3
/* E210F0 802B7240 00431021 */  addu      $v0, $v0, $v1
/* E210F4 802B7244 000210C0 */  sll       $v0, $v0, 3
/* E210F8 802B7248 8E830000 */  lw        $v1, 0x0($s4)
/* E210FC 802B724C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* E21100 802B7250 00220821 */  addu      $at, $at, $v0
/* E21104 802B7254 C4221DEC */  lwc1      $f2, %lo(gCameras + 0x6C)($at)
/* E21108 802B7258 C4640010 */  lwc1      $f4, 0x10($v1)
/* E2110C 802B725C 44800000 */  mtc1      $zero, $f0
/* E21110 802B7260 46022101 */  sub.s     $f4, $f4, $f2
/* E21114 802B7264 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* E21118 802B7268 44060000 */  mfc1      $a2, $f0
/* E2111C 802B726C 44052000 */  mfc1      $a1, $f4
/* E21120 802B7270 0220202D */  daddu     $a0, $s1, $zero
/* E21124 802B7274 0C019EC8 */  jal       guRotateF
/* E21128 802B7278 AFA60010 */   sw       $a2, 0x10($sp)
/* E2112C 802B727C 0200202D */  daddu     $a0, $s0, $zero
/* E21130 802B7280 0220282D */  daddu     $a1, $s1, $zero
/* E21134 802B7284 0C019D80 */  jal       guMtxCatF
/* E21138 802B7288 0200302D */   daddu    $a2, $s0, $zero
/* E2113C 802B728C 8E820000 */  lw        $v0, 0x0($s4)
/* E21140 802B7290 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* E21144 802B7294 8C450004 */  lw        $a1, 0x4($v0)
/* E21148 802B7298 8C460008 */  lw        $a2, 0x8($v0)
/* E2114C 802B729C 8C47000C */  lw        $a3, 0xC($v0)
/* E21150 802B72A0 0C019E40 */  jal       guTranslateF
.L802B72A4:
/* E21154 802B72A4 0220202D */   daddu    $a0, $s1, $zero
/* E21158 802B72A8 0200202D */  daddu     $a0, $s0, $zero
/* E2115C 802B72AC 0220282D */  daddu     $a1, $s1, $zero
/* E21160 802B72B0 0C019D80 */  jal       guMtxCatF
/* E21164 802B72B4 0220302D */   daddu    $a2, $s1, $zero
/* E21168 802B72B8 0220202D */  daddu     $a0, $s1, $zero
/* E2116C 802B72BC 3C108007 */  lui       $s0, %hi(gMatrixListPos)
glabel ispy_notification_setup
/* E21170 802B72C0 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* E21174 802B72C4 3C13800A */  lui       $s3, %hi(gDisplayContext)
/* E21178 802B72C8 2673A674 */  addiu     $s3, $s3, %lo(gDisplayContext)
/* E2117C 802B72CC 96050000 */  lhu       $a1, 0x0($s0)
/* E21180 802B72D0 8E620000 */  lw        $v0, 0x0($s3)
/* E21184 802B72D4 00052980 */  sll       $a1, $a1, 6
/* E21188 802B72D8 00B52821 */  addu      $a1, $a1, $s5
/* E2118C 802B72DC 0C019D40 */  jal       guMtxF2L
/* E21190 802B72E0 00452821 */   addu     $a1, $v0, $a1
/* E21194 802B72E4 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* E21198 802B72E8 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* E2119C 802B72EC 0000202D */  daddu     $a0, $zero, $zero
/* E211A0 802B72F0 0080282D */  daddu     $a1, $a0, $zero
/* E211A4 802B72F4 0080302D */  daddu     $a2, $a0, $zero
/* E211A8 802B72F8 3C12800A */  lui       $s2, %hi(gMainGfxPos)
/* E211AC 802B72FC 2652A66C */  addiu     $s2, $s2, %lo(gMainGfxPos)
/* E211B0 802B7300 0080382D */  daddu     $a3, $a0, $zero
/* E211B4 802B7304 8E480000 */  lw        $t0, 0x0($s2)
/* E211B8 802B7308 96020000 */  lhu       $v0, 0x0($s0)
/* E211BC 802B730C 0100482D */  daddu     $t1, $t0, $zero
/* E211C0 802B7310 25080008 */  addiu     $t0, $t0, 0x8
/* E211C4 802B7314 AE480000 */  sw        $t0, 0x0($s2)
/* E211C8 802B7318 AD230000 */  sw        $v1, 0x0($t1)
/* E211CC 802B731C 24430001 */  addiu     $v1, $v0, 0x1
/* E211D0 802B7320 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* E211D4 802B7324 00021180 */  sll       $v0, $v0, 6
/* E211D8 802B7328 00551021 */  addu      $v0, $v0, $s5
/* E211DC 802B732C A6030000 */  sh        $v1, 0x0($s0)
/* E211E0 802B7330 8E630000 */  lw        $v1, 0x0($s3)
/* E211E4 802B7334 24100440 */  addiu     $s0, $zero, 0x440
/* E211E8 802B7338 00621821 */  addu      $v1, $v1, $v0
/* E211EC 802B733C 25020008 */  addiu     $v0, $t0, 0x8
/* E211F0 802B7340 AD230004 */  sw        $v1, 0x4($t1)
/* E211F4 802B7344 AE420000 */  sw        $v0, 0x0($s2)
/* E211F8 802B7348 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* E211FC 802B734C AD020000 */  sw        $v0, 0x0($t0)
/* E21200 802B7350 3C02802B */  lui       $v0, %hi(D_802B7930)
/* E21204 802B7354 24427930 */  addiu     $v0, $v0, %lo(D_802B7930)
/* E21208 802B7358 AD020004 */  sw        $v0, 0x4($t0)
glabel ispy_notification_update
/* E2120C 802B735C 3C02802B */  lui       $v0, %hi(D_802B7710)
/* E21210 802B7360 24427710 */  addiu     $v0, $v0, %lo(D_802B7710)
/* E21214 802B7364 AFA20020 */  sw        $v0, 0x20($sp)
/* E21218 802B7368 3C02802B */  lui       $v0, %hi(D_802B7910)
/* E2121C 802B736C 24427910 */  addiu     $v0, $v0, %lo(D_802B7910)
/* E21220 802B7370 AFA20024 */  sw        $v0, 0x24($sp)
/* E21224 802B7374 24020020 */  addiu     $v0, $zero, 0x20
/* E21228 802B7378 A7A20028 */  sh        $v0, 0x28($sp)
/* E2122C 802B737C A7A2002A */  sh        $v0, 0x2A($sp)
/* E21230 802B7380 2402FFF0 */  addiu     $v0, $zero, -0x10
/* E21234 802B7384 A7A2002C */  sh        $v0, 0x2C($sp)
/* E21238 802B7388 2402001A */  addiu     $v0, $zero, 0x1A
/* E2123C 802B738C A7A2002E */  sh        $v0, 0x2E($sp)
.L802B7390:
/* E21240 802B7390 240200FF */  addiu     $v0, $zero, 0xFF
/* E21244 802B7394 A3A20030 */  sb        $v0, 0x30($sp)
/* E21248 802B7398 AFA00010 */  sw        $zero, 0x10($sp)
/* E2124C 802B739C AFA00014 */  sw        $zero, 0x14($sp)
/* E21250 802B73A0 0C04EAA7 */  jal       imgfx_update
/* E21254 802B73A4 AFB00018 */   sw       $s0, 0x18($sp)
/* E21258 802B73A8 0000202D */  daddu     $a0, $zero, $zero
/* E2125C 802B73AC 8E820000 */  lw        $v0, 0x0($s4)
/* E21260 802B73B0 24050006 */  addiu     $a1, $zero, 0x6
/* E21264 802B73B4 9046002B */  lbu       $a2, 0x2B($v0)
/* E21268 802B73B8 240200FF */  addiu     $v0, $zero, 0xFF
/* E2126C 802B73BC AFA20014 */  sw        $v0, 0x14($sp)
glabel .L802B73C0
/* E21270 802B73C0 AFB00018 */  sw        $s0, 0x18($sp)
/* E21274 802B73C4 00C0382D */  daddu     $a3, $a2, $zero
glabel .L802B73C8
/* E21278 802B73C8 0C04EAA7 */  jal       imgfx_update
/* E2127C 802B73CC AFA60010 */   sw       $a2, 0x10($sp)
glabel .L802B73D0
/* E21280 802B73D0 0000202D */  daddu     $a0, $zero, $zero
/* E21284 802B73D4 27A50020 */  addiu     $a1, $sp, 0x20
glabel .L802B73D8
/* E21288 802B73D8 24060040 */  addiu     $a2, $zero, 0x40
/* E2128C 802B73DC 0C04EBDC */  jal       imgfx_appendGfx_component
glabel .L802B73E0
/* E21290 802B73E0 0220382D */   daddu    $a3, $s1, $zero
/* E21294 802B73E4 3C04D838 */  lui       $a0, (0xD8380002 >> 16)
glabel .L802B73E8
/* E21298 802B73E8 8E420000 */  lw        $v0, 0x0($s2)
/* E2129C 802B73EC 34840002 */  ori       $a0, $a0, (0xD8380002 & 0xFFFF)
.L802B73F0:
/* E212A0 802B73F0 0040182D */  daddu     $v1, $v0, $zero
/* E212A4 802B73F4 24420008 */  addiu     $v0, $v0, 0x8
.L802B73F8:
/* E212A8 802B73F8 AE420000 */  sw        $v0, 0x0($s2)
.L802B73FC:
/* E212AC 802B73FC 24020040 */  addiu     $v0, $zero, 0x40
/* E212B0 802B7400 AC640000 */  sw        $a0, 0x0($v1)
/* E212B4 802B7404 AC620004 */  sw        $v0, 0x4($v1)
.L802B7408:
/* E212B8 802B7408 8FBF00D0 */  lw        $ra, 0xD0($sp)
/* E212BC 802B740C 8FB500CC */  lw        $s5, 0xCC($sp)
.L802B7410:
/* E212C0 802B7410 8FB400C8 */  lw        $s4, 0xC8($sp)
/* E212C4 802B7414 8FB300C4 */  lw        $s3, 0xC4($sp)
/* E212C8 802B7418 8FB200C0 */  lw        $s2, 0xC0($sp)
/* E212CC 802B741C 8FB100BC */  lw        $s1, 0xBC($sp)
/* E212D0 802B7420 8FB000B8 */  lw        $s0, 0xB8($sp)
/* E212D4 802B7424 03E00008 */  jr        $ra
/* E212D8 802B7428 27BD00D8 */   addiu    $sp, $sp, 0xD8

### DECOMPILED C INSTRUCTIONS:

void appendGfx_speech_bubble(void) {
    ImgFXTexture ifxImg;
    Matrix4f mtxTemp, mtxTransform;

    if (gPlayerStatus.animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) {
        guScaleF(mtxTemp, SpeechBubblePtr->scale, SpeechBubblePtr->scale, SpeechBubblePtr->scale);
        guRotateF(mtxTransform, SpeechBubblePtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
        guMtxCatF(mtxTemp, mtxTransform, mtxTemp);
        guTranslateF(mtxTransform, SpeechBubblePtr->pos.x, SpeechBubblePtr->pos.y, SpeechBubblePtr->pos.z);
        guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
        guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                  G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, &speech_bubble_gfx);

        ifxImg.raster  = speech_bubble_img;
        ifxImg.palette = speech_bubble_pal;
        ifxImg.width   = speech_bubble_img_width;
        ifxImg.height  = speech_bubble_img_height;
        ifxImg.xOffset = -16;
        ifxImg.yOffset = 26;
        ifxImg.alpha = 255;
        imgfx_update(0, IMGFX_CLEAR, 0, 0, 0, 0, IMGFX_FLAG_400 | IMGFX_FLAG_40);
        imgfx_update(0, IMGFX_SET_COLOR,
                    SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, 255, 0x440);
        imgfx_appendGfx_component(0, &ifxImg, IMGFX_FLAG_40, mtxTransform);

        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel spawn_default_surface_effects
/* 18B88 8003D788 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 18B8C 8003D78C AFB00030 */  sw        $s0, 0x30($sp)
/* 18B90 8003D790 0080802D */  daddu     $s0, $a0, $zero
/* 18B94 8003D794 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 18B98 8003D798 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 18B9C 8003D79C AFBF0038 */  sw        $ra, 0x38($sp)
/* 18BA0 8003D7A0 AFB10034 */  sw        $s1, 0x34($sp)
/* 18BA4 8003D7A4 84620086 */  lh        $v0, 0x86($v1)
/* 18BA8 8003D7A8 24110005 */  addiu     $s1, $zero, 0x5
/* 18BAC 8003D7AC 14510004 */  bne       $v0, $s1, .L8003D7C0
/* 18BB0 8003D7B0 0000302D */   daddu    $a2, $zero, $zero
/* 18BB4 8003D7B4 8462008C */  lh        $v0, 0x8C($v1)
/* 18BB8 8003D7B8 38420002 */  xori      $v0, $v0, 0x2
/* 18BBC 8003D7BC 2C460001 */  sltiu     $a2, $v0, 0x1
.L8003D7C0:
/* 18BC0 8003D7C0 24020002 */  addiu     $v0, $zero, 0x2
/* 18BC4 8003D7C4 14A20026 */  bne       $a1, $v0, .L8003D860
/* 18BC8 8003D7C8 00000000 */   nop
/* 18BCC 8003D7CC C602003C */  lwc1      $f2, 0x3C($s0)
/* 18BD0 8003D7D0 44800000 */  mtc1      $zero, $f0
/* 18BD4 8003D7D4 C6040040 */  lwc1      $f4, 0x40($s0)
/* 18BD8 8003D7D8 46001080 */  add.s     $f2, $f2, $f0
/* 18BDC 8003D7DC C6000038 */  lwc1      $f0, 0x38($s0)
/* 18BE0 8003D7E0 14C00011 */  bnez      $a2, .L8003D828
/* 18BE4 8003D7E4 24040003 */   addiu    $a0, $zero, 0x3
/* 18BE8 8003D7E8 3C108007 */  lui       $s0, %hi(D_80077C10)
/* 18BEC 8003D7EC 26107C10 */  addiu     $s0, $s0, %lo(D_80077C10)
/* 18BF0 8003D7F0 44050000 */  mfc1      $a1, $f0
/* 18BF4 8003D7F4 44061000 */  mfc1      $a2, $f2
/* 18BF8 8003D7F8 44072000 */  mfc1      $a3, $f4
/* 18BFC 8003D7FC C6000000 */  lwc1      $f0, 0x0($s0)
/* 18C00 8003D800 0000202D */  daddu     $a0, $zero, $zero
/* 18C04 8003D804 0C01BEB4 */  jal       fx_landing_dust
/* 18C08 8003D808 E7A00010 */   swc1     $f0, 0x10($sp)
/* 18C0C 8003D80C C6000000 */  lwc1      $f0, 0x0($s0)
/* 18C10 8003D810 3C01420C */  lui       $at, (0x420C0000 >> 16)
/* 18C14 8003D814 44816000 */  mtc1      $at, $f12
/* 18C18 8003D818 0C00A6C9 */  jal       clamp_angle
/* 18C1C 8003D81C 460C0300 */   add.s    $f12, $f0, $f12
/* 18C20 8003D820 0800F689 */  j         .L8003DA24
/* 18C24 8003D824 E6000000 */   swc1     $f0, 0x0($s0)
.L8003D828:
/* 18C28 8003D828 44050000 */  mfc1      $a1, $f0
/* 18C2C 8003D82C 44061000 */  mfc1      $a2, $f2
/* 18C30 8003D830 44072000 */  mfc1      $a3, $f4
/* 18C34 8003D834 3C014150 */  lui       $at, (0x41500000 >> 16)
/* 18C38 8003D838 44810000 */  mtc1      $at, $f0
/* 18C3C 8003D83C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 18C40 8003D840 44811000 */  mtc1      $at, $f2
/* 18C44 8003D844 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 18C48 8003D848 44812000 */  mtc1      $at, $f4
/* 18C4C 8003D84C 2402001E */  addiu     $v0, $zero, 0x1E
/* 18C50 8003D850 AFB1001C */  sw        $s1, 0x1C($sp)
/* 18C54 8003D854 AFA20020 */  sw        $v0, 0x20($sp)
/* 18C58 8003D858 0800F686 */  j         .L8003DA18
/* 18C5C 8003D85C E7A00010 */   swc1     $f0, 0x10($sp)
.L8003D860:
/* 18C60 8003D860 10A00070 */  beqz      $a1, .L8003DA24
/* 18C64 8003D864 00000000 */   nop
/* 18C68 8003D868 3C048007 */  lui       $a0, %hi(D_80077C14)
/* 18C6C 8003D86C 24847C14 */  addiu     $a0, $a0, %lo(D_80077C14)
/* 18C70 8003D870 94820000 */  lhu       $v0, 0x0($a0)
/* 18C74 8003D874 24430001 */  addiu     $v1, $v0, 0x1
/* 18C78 8003D878 00021400 */  sll       $v0, $v0, 16
/* 18C7C 8003D87C 00021403 */  sra       $v0, $v0, 16
/* 18C80 8003D880 28420004 */  slti      $v0, $v0, 0x4
/* 18C84 8003D884 14400067 */  bnez      $v0, .L8003DA24
/* 18C88 8003D888 A4830000 */   sh       $v1, 0x0($a0)
/* 18C8C 8003D88C 14C00034 */  bnez      $a2, .L8003D960
/* 18C90 8003D890 A4800000 */   sh       $zero, 0x0($a0)
/* 18C94 8003D894 C60C000C */  lwc1      $f12, 0xC($s0)
/* 18C98 8003D898 0C00A6C9 */  jal       clamp_angle
/* 18C9C 8003D89C 46006307 */   neg.s    $f12, $f12
/* 18CA0 8003D8A0 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 18CA4 8003D8A4 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 18CA8 8003D8A8 44811000 */  mtc1      $at, $f2
/* 18CAC 8003D8AC 00000000 */  nop
/* 18CB0 8003D8B0 46020002 */  mul.s     $f0, $f0, $f2
/* 18CB4 8003D8B4 00000000 */  nop
/* 18CB8 8003D8B8 27A50028 */  addiu     $a1, $sp, 0x28
/* 18CBC 8003D8BC 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 18CC0 8003D8C0 44816000 */  mtc1      $at, $f12
/* 18CC4 8003D8C4 27A6002C */  addiu     $a2, $sp, 0x2C
/* 18CC8 8003D8C8 0C00A82D */  jal       sin_cos_rad
/* 18CCC 8003D8CC 460C0303 */   div.s    $f12, $f0, $f12
/* 18CD0 8003D8D0 860200A6 */  lh        $v0, 0xA6($s0)
/* 18CD4 8003D8D4 C7AA0028 */  lwc1      $f10, 0x28($sp)
/* 18CD8 8003D8D8 44821000 */  mtc1      $v0, $f2
/* 18CDC 8003D8DC 00000000 */  nop
/* 18CE0 8003D8E0 468010A0 */  cvt.s.w   $f2, $f2
/* 18CE4 8003D8E4 460A1182 */  mul.s     $f6, $f2, $f10
/* 18CE8 8003D8E8 00000000 */  nop
/* 18CEC 8003D8EC C7A8002C */  lwc1      $f8, 0x2C($sp)
/* 18CF0 8003D8F0 46081082 */  mul.s     $f2, $f2, $f8
/* 18CF4 8003D8F4 00000000 */  nop
/* 18CF8 8003D8F8 3C013E4C */  lui       $at, (0x3E4CCCCD >> 16)
/* 18CFC 8003D8FC 3421CCCD */  ori       $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 18D00 8003D900 44810000 */  mtc1      $at, $f0
/* 18D04 8003D904 00000000 */  nop
/* 18D08 8003D908 46003182 */  mul.s     $f6, $f6, $f0
/* 18D0C 8003D90C 00000000 */  nop
/* 18D10 8003D910 46001082 */  mul.s     $f2, $f2, $f0
/* 18D14 8003D914 00000000 */  nop
/* 18D18 8003D918 C604003C */  lwc1      $f4, 0x3C($s0)
/* 18D1C 8003D91C 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* 18D20 8003D920 44810000 */  mtc1      $at, $f0
/* 18D24 8003D924 00000000 */  nop
/* 18D28 8003D928 46002100 */  add.s     $f4, $f4, $f0
/* 18D2C 8003D92C C6000038 */  lwc1      $f0, 0x38($s0)
/* 18D30 8003D930 46060000 */  add.s     $f0, $f0, $f6
/* 18D34 8003D934 44050000 */  mfc1      $a1, $f0
/* 18D38 8003D938 C6000040 */  lwc1      $f0, 0x40($s0)
/* 18D3C 8003D93C 46020000 */  add.s     $f0, $f0, $f2
/* 18D40 8003D940 44062000 */  mfc1      $a2, $f4
/* 18D44 8003D944 44070000 */  mfc1      $a3, $f0
/* 18D48 8003D948 0000202D */  daddu     $a0, $zero, $zero
/* 18D4C 8003D94C E7AA0010 */  swc1      $f10, 0x10($sp)
/* 18D50 8003D950 0C01BECC */  jal       fx_walking_dust
/* 18D54 8003D954 E7A80014 */   swc1     $f8, 0x14($sp)
/* 18D58 8003D958 0800F689 */  j         .L8003DA24
/* 18D5C 8003D95C 00000000 */   nop
.L8003D960:
/* 18D60 8003D960 0C00A6C9 */  jal       clamp_angle
/* 18D64 8003D964 C60C000C */   lwc1     $f12, 0xC($s0)
/* 18D68 8003D968 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 18D6C 8003D96C 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 18D70 8003D970 44811000 */  mtc1      $at, $f2
/* 18D74 8003D974 00000000 */  nop
/* 18D78 8003D978 46020002 */  mul.s     $f0, $f0, $f2
/* 18D7C 8003D97C 00000000 */  nop
/* 18D80 8003D980 27A50028 */  addiu     $a1, $sp, 0x28
/* 18D84 8003D984 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 18D88 8003D988 44816000 */  mtc1      $at, $f12
/* 18D8C 8003D98C 27A6002C */  addiu     $a2, $sp, 0x2C
/* 18D90 8003D990 0C00A82D */  jal       sin_cos_rad
/* 18D94 8003D994 460C0303 */   div.s    $f12, $f0, $f12
/* 18D98 8003D998 C602003C */  lwc1      $f2, 0x3C($s0)
/* 18D9C 8003D99C 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* 18DA0 8003D9A0 44810000 */  mtc1      $at, $f0
/* 18DA4 8003D9A4 860200A6 */  lh        $v0, 0xA6($s0)
/* 18DA8 8003D9A8 46001080 */  add.s     $f2, $f2, $f0
/* 18DAC 8003D9AC C7A40028 */  lwc1      $f4, 0x28($sp)
/* 18DB0 8003D9B0 44820000 */  mtc1      $v0, $f0
/* 18DB4 8003D9B4 00000000 */  nop
/* 18DB8 8003D9B8 46800020 */  cvt.s.w   $f0, $f0
/* 18DBC 8003D9BC 46040102 */  mul.s     $f4, $f0, $f4
/* 18DC0 8003D9C0 00000000 */  nop
/* 18DC4 8003D9C4 44061000 */  mfc1      $a2, $f2
/* 18DC8 8003D9C8 C7A2002C */  lwc1      $f2, 0x2C($sp)
/* 18DCC 8003D9CC 46020002 */  mul.s     $f0, $f0, $f2
/* 18DD0 8003D9D0 00000000 */  nop
/* 18DD4 8003D9D4 24040003 */  addiu     $a0, $zero, 0x3
/* 18DD8 8003D9D8 C6060038 */  lwc1      $f6, 0x38($s0)
/* 18DDC 8003D9DC C6080040 */  lwc1      $f8, 0x40($s0)
/* 18DE0 8003D9E0 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 18DE4 8003D9E4 44811000 */  mtc1      $at, $f2
/* 18DE8 8003D9E8 46043180 */  add.s     $f6, $f6, $f4
/* 18DEC 8003D9EC E7A20010 */  swc1      $f2, 0x10($sp)
/* 18DF0 8003D9F0 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 18DF4 8003D9F4 44811000 */  mtc1      $at, $f2
/* 18DF8 8003D9F8 46004200 */  add.s     $f8, $f8, $f0
/* 18DFC 8003D9FC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 18E00 8003DA00 44812000 */  mtc1      $at, $f4
/* 18E04 8003DA04 44053000 */  mfc1      $a1, $f6
/* 18E08 8003DA08 44074000 */  mfc1      $a3, $f8
/* 18E0C 8003DA0C 2402001E */  addiu     $v0, $zero, 0x1E
/* 18E10 8003DA10 AFB1001C */  sw        $s1, 0x1C($sp)
/* 18E14 8003DA14 AFA20020 */  sw        $v0, 0x20($sp)
.L8003DA18:
/* 18E18 8003DA18 E7A20014 */  swc1      $f2, 0x14($sp)
/* 18E1C 8003DA1C 0C01C8D4 */  jal       fx_misc_particles
/* 18E20 8003DA20 E7A40018 */   swc1     $f4, 0x18($sp)
.L8003DA24:
/* 18E24 8003DA24 8FBF0038 */  lw        $ra, 0x38($sp)
/* 18E28 8003DA28 8FB10034 */  lw        $s1, 0x34($sp)
/* 18E2C 8003DA2C 8FB00030 */  lw        $s0, 0x30($sp)
/* 18E30 8003DA30 03E00008 */  jr        $ra
/* 18E34 8003DA34 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void spawn_default_surface_effects(Npc* npc, SurfaceInteractMode mode) {
    s32 mapIsStarWay;
    f32 sinTheta;
    f32 cosTheta;

    mapIsStarWay = FALSE;
    if (gGameStatusPtr->areaID == AREA_HOS) {
        mapIsStarWay = gGameStatusPtr->mapID == 2; //TODO hard-coded map ID
    }
    if (mode == SURFACE_INTERACT_LAND) {
        f32 x = npc->pos.x;
        f32 y = npc->pos.y + 0.0f;
        f32 z = npc->pos.z;

        if (!mapIsStarWay) {
            fx_landing_dust(0, x, y, z, D_80077C10);
            D_80077C10 = clamp_angle(D_80077C10 + 35.0f);
        } else {
            fx_misc_particles(3, x, y, z,  13.0f, 10.0f, 1.0f, 5, 30);
        }
    } else if (mode != SURFACE_INTERACT_WALK) {
        if (D_80077C14++ >= 4) {
            D_80077C14 = 0;
            if (!mapIsStarWay) {
                sin_cos_rad(DEG_TO_RAD(clamp_angle(-npc->yaw)), &sinTheta, &cosTheta);
                fx_walking_dust(0, npc->pos.x + (npc->collisionDiameter * sinTheta * 0.2f), npc->pos.y + 1.5f,
                               npc->pos.z + (npc->collisionDiameter * cosTheta * 0.2f), sinTheta, cosTheta);
            } else {
                sin_cos_rad(DEG_TO_RAD(clamp_angle(npc->yaw)), &sinTheta, &cosTheta);
                fx_misc_particles(3, npc->pos.x + (npc->collisionDiameter * sinTheta), npc->pos.y + 1.5f,
                              npc->pos.z + (npc->collisionDiameter * cosTheta), 5.0f, 10.0f, 1.0f, 5, 30);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_80252924
/* 181204 80252924 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 181208 80252928 AFB20018 */  sw        $s2, 0x18($sp)
/* 18120C 8025292C 0080902D */  daddu     $s2, $a0, $zero
/* 181210 80252930 AFBF0020 */  sw        $ra, 0x20($sp)
/* 181214 80252934 AFB3001C */  sw        $s3, 0x1C($sp)
/* 181218 80252938 AFB10014 */  sw        $s1, 0x14($sp)
/* 18121C 8025293C AFB00010 */  sw        $s0, 0x10($sp)
/* 181220 80252940 8E50000C */  lw        $s0, 0xC($s2)
/* 181224 80252944 3C11800E */  lui       $s1, %hi(gBattleStatus)
dgb_01_D_80252948_C101C8:
/* 181228 80252948 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
/* 18122C 8025294C 8E130000 */  lw        $s3, 0x0($s0)
jtbl_80252950:
/* 181230 80252950 26100004 */  addiu     $s0, $s0, 0x4
/* 181234 80252954 8E020000 */  lw        $v0, 0x0($s0)
/* 181238 80252958 26100004 */  addiu     $s0, $s0, 0x4
/* 18123C 8025295C AE20018C */  sw        $zero, 0x18C($s1)
/* 181240 80252960 AE220188 */  sw        $v0, 0x188($s1)
/* 181244 80252964 8E020000 */  lw        $v0, 0x0($s0)
/* 181248 80252968 26100004 */  addiu     $s0, $s0, 0x4
/* 18124C 8025296C AE220190 */  sw        $v0, 0x190($s1)
jtbl_80252970:
/* 181250 80252970 8E050000 */  lw        $a1, 0x0($s0)
dgb_01_D_80252974_C101F4:
/* 181254 80252974 0C0B1EAF */  jal       evt_get_variable
/* 181258 80252978 26100004 */   addiu    $s0, $s0, 0x4
/* 18125C 8025297C 8E230190 */  lw        $v1, 0x190($s1)
/* 181260 80252980 0240202D */  daddu     $a0, $s2, $zero
/* 181264 80252984 00621825 */  or        $v1, $v1, $v0
/* 181268 80252988 AE230190 */  sw        $v1, 0x190($s1)
/* 18126C 8025298C 8E050000 */  lw        $a1, 0x0($s0)
/* 181270 80252990 0C0B1EAF */  jal       evt_get_variable
/* 181274 80252994 26100004 */   addiu    $s0, $s0, 0x4
/* 181278 80252998 A622017E */  sh        $v0, 0x17E($s1)
/* 18127C 8025299C 8E100000 */  lw        $s0, 0x0($s0)
dgb_01_D_802529A0_C10220:
/* 181280 802529A0 24020030 */  addiu     $v0, $zero, 0x30
/* 181284 802529A4 32030030 */  andi      $v1, $s0, 0x30
/* 181288 802529A8 54620004 */  bnel      $v1, $v0, .L802529BC
/* 18128C 802529AC 32020010 */   andi     $v0, $s0, 0x10
jtbl_802529B0:
/* 181290 802529B0 8E220000 */  lw        $v0, 0x0($s1)
D_802529B4:
/* 181294 802529B4 08094A7F */  j         .L802529FC
/* 181298 802529B8 34420030 */   ori      $v0, $v0, 0x30
.L802529BC:
/* 18129C 802529BC 10400004 */  beqz      $v0, mac_05_Quizmo_Worker
/* 1812A0 802529C0 2403FFDF */   addiu    $v1, $zero, -0x21
/* 1812A4 802529C4 8E220000 */  lw        $v0, 0x0($s1)
D_802529C8:
/* 1812A8 802529C8 08094A7E */  j         dgb_01_D_802529F8_C10278
dgb_01_D_802529CC_C1024C:
/* 1812AC 802529CC 34420010 */   ori      $v0, $v0, 0x10
mac_05_Quizmo_Worker:
/* 1812B0 802529D0 32020020 */  andi      $v0, $s0, 0x20
/* 1812B4 802529D4 10400005 */  beqz      $v0, .L802529EC
/* 1812B8 802529D8 2403FFEF */   addiu    $v1, $zero, -0x11
/* 1812BC 802529DC 8E220000 */  lw        $v0, 0x0($s1)
/* 1812C0 802529E0 00431024 */  and       $v0, $v0, $v1
/* 1812C4 802529E4 08094A7F */  j         .L802529FC
mac_05_Quizmo_AnswerResult:
/* 1812C8 802529E8 34420020 */   ori      $v0, $v0, 0x20
.L802529EC:
/* 1812CC 802529EC 8E220000 */  lw        $v0, 0x0($s1)
mac_05_Quizmo_StageEffect:
/* 1812D0 802529F0 00431024 */  and       $v0, $v0, $v1
mac_05_Quizmo_AudienceEffect:
/* 1812D4 802529F4 2403FFDF */  addiu     $v1, $zero, -0x21
dgb_01_D_802529F8_C10278:
/* 1812D8 802529F8 00431024 */  and       $v0, $v0, $v1
.L802529FC:
/* 1812DC 802529FC AE220000 */  sw        $v0, 0x0($s1)
mac_05_D_80252A00:
/* 1812E0 80252A00 32020040 */  andi      $v0, $s0, 0x40
/* 1812E4 80252A04 10400007 */  beqz      $v0, dgb_01_D_80252A24_C102A4
/* 1812E8 80252A08 2404FFBF */   addiu    $a0, $zero, -0x41
/* 1812EC 80252A0C 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1812F0 80252A10 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1812F4 80252A14 8C620000 */  lw        $v0, 0x0($v1)
/* 1812F8 80252A18 34420040 */  ori       $v0, $v0, 0x40
/* 1812FC 80252A1C 08094A8E */  j         .L80252A38
/* 181300 80252A20 AC620000 */   sw       $v0, 0x0($v1)
dgb_01_D_80252A24_C102A4:
/* 181304 80252A24 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 181308 80252A28 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 18130C 80252A2C 8C430000 */  lw        $v1, 0x0($v0)
/* 181310 80252A30 00641824 */  and       $v1, $v1, $a0
/* 181314 80252A34 AC430000 */  sw        $v1, 0x0($v0)
.L80252A38:
/* 181318 80252A38 32020200 */  andi      $v0, $s0, 0x200
/* 18131C 80252A3C 10400007 */  beqz      $v0, .L80252A5C
/* 181320 80252A40 2404FDFF */   addiu    $a0, $zero, -0x201
/* 181324 80252A44 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 181328 80252A48 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 18132C 80252A4C 8C620000 */  lw        $v0, 0x0($v1)
dgb_01_D_80252A50_C102D0:
/* 181330 80252A50 34420200 */  ori       $v0, $v0, 0x200
/* 181334 80252A54 08094A9C */  j         .L80252A70
/* 181338 80252A58 AC620000 */   sw       $v0, 0x0($v1)
.L80252A5C:
/* 18133C 80252A5C 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 181340 80252A60 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 181344 80252A64 8C430000 */  lw        $v1, 0x0($v0)
/* 181348 80252A68 00641824 */  and       $v1, $v1, $a0
/* 18134C 80252A6C AC430000 */  sw        $v1, 0x0($v0)
.L80252A70:
/* 181350 80252A70 32020080 */  andi      $v0, $s0, 0x80
/* 181354 80252A74 10400007 */  beqz      $v0, .L80252A94
/* 181358 80252A78 2404FF7F */   addiu    $a0, $zero, -0x81
dgb_01_D_80252A7C_C102FC:
/* 18135C 80252A7C 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 181360 80252A80 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 181364 80252A84 8C620000 */  lw        $v0, 0x0($v1)
/* 181368 80252A88 34420080 */  ori       $v0, $v0, 0x80
/* 18136C 80252A8C 08094AAA */  j         dgb_01_D_80252AA8_C10328
/* 181370 80252A90 AC620000 */   sw       $v0, 0x0($v1)
.L80252A94:
/* 181374 80252A94 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 181378 80252A98 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 18137C 80252A9C 8C430000 */  lw        $v1, 0x0($v0)
/* 181380 80252AA0 00641824 */  and       $v1, $v1, $a0
/* 181384 80252AA4 AC430000 */  sw        $v1, 0x0($v0)
dgb_01_D_80252AA8_C10328:
/* 181388 80252AA8 0C09A75B */  jal       get_actor
/* 18138C 80252AAC 8E440148 */   lw       $a0, 0x148($s2)
/* 181390 80252AB0 94430428 */  lhu       $v1, 0x428($v0)
/* 181394 80252AB4 A62301A0 */  sh        $v1, 0x1A0($s1)
/* 181398 80252AB8 92230193 */  lbu       $v1, 0x193($s1)
/* 18139C 80252ABC 90420426 */  lbu       $v0, 0x426($v0)
/* 1813A0 80252AC0 A2230194 */  sb        $v1, 0x194($s1)
/* 1813A4 80252AC4 306300FF */  andi      $v1, $v1, 0xFF
/* 1813A8 80252AC8 A22201A2 */  sb        $v0, 0x1A2($s1)
/* 1813AC 80252ACC 240200FF */  addiu     $v0, $zero, 0xFF
/* 1813B0 80252AD0 50620001 */  beql      $v1, $v0, .L80252AD8
dgb_01_D_80252AD4_C10354:
/* 1813B4 80252AD4 A2200194 */   sb       $zero, 0x194($s1)
.L80252AD8:
/* 1813B8 80252AD8 8E220190 */  lw        $v0, 0x190($s1)
/* 1813BC 80252ADC 30420F00 */  andi      $v0, $v0, 0xF00
/* 1813C0 80252AE0 00021203 */  sra       $v0, $v0, 8
/* 1813C4 80252AE4 0C0945BA */  jal       func_802516E8
/* 1813C8 80252AE8 A2220195 */   sb       $v0, 0x195($s1)
/* 1813CC 80252AEC 0440000B */  bltz      $v0, .L80252B1C
/* 1813D0 80252AF0 0240202D */   daddu    $a0, $s2, $zero
/* 1813D4 80252AF4 0260282D */  daddu     $a1, $s3, $zero
/* 1813D8 80252AF8 0C0B2026 */  jal       evt_set_variable
/* 1813DC 80252AFC 0040302D */   daddu    $a2, $v0, $zero
dgb_01_D_80252B00_C10380:
/* 1813E0 80252B00 0C0B1069 */  jal       does_script_exist_by_ref
/* 1813E4 80252B04 0240202D */   daddu    $a0, $s2, $zero
/* 1813E8 80252B08 0040182D */  daddu     $v1, $v0, $zero
/* 1813EC 80252B0C 10600004 */  beqz      $v1, .L80252B20
/* 1813F0 80252B10 240200FF */   addiu    $v0, $zero, 0xFF
/* 1813F4 80252B14 08094AC8 */  j         .L80252B20
/* 1813F8 80252B18 24020002 */   addiu    $v0, $zero, 0x2
.L80252B1C:
/* 1813FC 80252B1C 240200FF */  addiu     $v0, $zero, 0xFF
.L80252B20:
/* 181400 80252B20 8FBF0020 */  lw        $ra, 0x20($sp)
/* 181404 80252B24 8FB3001C */  lw        $s3, 0x1C($sp)
/* 181408 80252B28 8FB20018 */  lw        $s2, 0x18($sp)
dgb_01_D_80252B2C_C103AC:
/* 18140C 80252B2C 8FB10014 */  lw        $s1, 0x14($sp)
/* 181410 80252B30 8FB00010 */  lw        $s0, 0x10($sp)
/* 181414 80252B34 03E00008 */  jr        $ra
/* 181418 80252B38 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus ItemSpookEnemy(Evt* script, s32 isInitialCall) {
    BattleStatus* battleStatus = &gBattleStatus;
    Bytecode* args = script->ptrReadPos;
    s32 hitResultVarOut = *args++;
    Actor* actor;
    HitResult hitResult;
    s32 flags;

    battleStatus->currentAttackElement = *args++;
    battleStatus->currentAttackEventSuppression = 0;
    battleStatus->currentAttackStatus = *args++;
    battleStatus->currentAttackStatus |= evt_get_variable(script, *args++);
    battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
    flags = *args++;

    if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) {
        gBattleStatus.flags1 |= BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE;
    } else if (flags & BS_FLAGS1_10) {
        gBattleStatus.flags1 |= BS_FLAGS1_10;
        gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
    } else if (flags & BS_FLAGS1_SP_EVT_ACTIVE) {
        gBattleStatus.flags1 &= ~BS_FLAGS1_10;
        gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_10;
        gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
    }

    if (flags & BS_FLAGS1_40) {
        gBattleStatus.flags1 |= BS_FLAGS1_40;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_40;
    }

    if (flags & BS_FLAGS1_200) {
        gBattleStatus.flags1 |= BS_FLAGS1_200;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_200;
    }

    if (flags & BS_FLAGS1_80) {
        gBattleStatus.flags1 |= BS_FLAGS1_80;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_80;
    }

    actor = get_actor(script->owner1.actorID);
    battleStatus->currentTargetID = actor->targetActorID;
    battleStatus->currentTargetPart = actor->targetPartIndex;
    battleStatus->statusChance = battleStatus->currentAttackStatus;

    if (battleStatus->statusChance == STATUS_KEY_NEVER) {
        battleStatus->statusChance = 0;
    }

    battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;

    hitResult = calc_item_damage_enemy();
    if (hitResult < 0) {
        return ApiStatus_FINISH;
    }

    evt_set_variable(script, hitResultVarOut, hitResult);
    if (!does_script_exist_by_ref(script)) {
        return ApiStatus_FINISH;
    }

    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8005DB00
/* 38F00 8005DB00 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 38F04 8005DB04 AFB20018 */  sw        $s2, 0x18($sp)
/* 38F08 8005DB08 0080902D */  daddu     $s2, $a0, $zero
/* 38F0C 8005DB0C AFBF0020 */  sw        $ra, 0x20($sp)
/* 38F10 8005DB10 AFB3001C */  sw        $s3, 0x1C($sp)
/* 38F14 8005DB14 AFB10014 */  sw        $s1, 0x14($sp)
/* 38F18 8005DB18 AFB00010 */  sw        $s0, 0x10($sp)
/* 38F1C 8005DB1C 8E420148 */  lw        $v0, 0x148($s2)
/* 38F20 8005DB20 84440008 */  lh        $a0, 0x8($v0)
/* 38F24 8005DB24 0C00EABB */  jal       get_npc_unsafe
/* 38F28 8005DB28 00A0802D */   daddu    $s0, $a1, $zero
/* 38F2C 8005DB2C 3C138011 */  lui       $s3, %hi(gPlayerStatus)
/* 38F30 8005DB30 2673EFC8 */  addiu     $s3, $s3, %lo(gPlayerStatus)
/* 38F34 8005DB34 12000002 */  beqz      $s0, .L8005DB40
/* 38F38 8005DB38 0040882D */   daddu    $s1, $v0, $zero
/* 38F3C 8005DB3C AE400070 */  sw        $zero, 0x70($s2)
.L8005DB40:
/* 38F40 8005DB40 8E440070 */  lw        $a0, 0x70($s2)
/* 38F44 8005DB44 10800005 */  beqz      $a0, .L8005DB5C
/* 38F48 8005DB48 24020001 */   addiu    $v0, $zero, 0x1
/* 38F4C 8005DB4C 1082001F */  beq       $a0, $v0, .L8005DBCC
/* 38F50 8005DB50 0000102D */   daddu    $v0, $zero, $zero
/* 38F54 8005DB54 0801774E */  j         .L8005DD38
/* 38F58 8005DB58 00000000 */   nop
.L8005DB5C:
/* 38F5C 8005DB5C 0240202D */  daddu     $a0, $s2, $zero
/* 38F60 8005DB60 3C05FE36 */  lui       $a1, (0xFE363C80 >> 16)
/* 38F64 8005DB64 0C0B210B */  jal       evt_get_float_variable
/* 38F68 8005DB68 34A53C80 */   ori      $a1, $a1, (0xFE363C80 & 0xFFFF)
/* 38F6C 8005DB6C 0240202D */  daddu     $a0, $s2, $zero
/* 38F70 8005DB70 3C05FE36 */  lui       $a1, (0xFE363C81 >> 16)
/* 38F74 8005DB74 34A53C81 */  ori       $a1, $a1, (0xFE363C81 & 0xFFFF)
/* 38F78 8005DB78 0C0B1EAF */  jal       evt_get_variable
/* 38F7C 8005DB7C E6200010 */   swc1     $f0, 0x10($s1)
/* 38F80 8005DB80 0240202D */  daddu     $a0, $s2, $zero
/* 38F84 8005DB84 3C05FE36 */  lui       $a1, (0xFE363C82 >> 16)
/* 38F88 8005DB88 34A53C82 */  ori       $a1, $a1, (0xFE363C82 & 0xFFFF)
/* 38F8C 8005DB8C 0C0B1EAF */  jal       evt_get_variable
/* 38F90 8005DB90 A622008E */   sh       $v0, 0x8E($s1)
/* 38F94 8005DB94 0240202D */  daddu     $a0, $s2, $zero
/* 38F98 8005DB98 3C05FE36 */  lui       $a1, (0xFE363C83 >> 16)
/* 38F9C 8005DB9C 34A53C83 */  ori       $a1, $a1, (0xFE363C83 & 0xFFFF)
/* 38FA0 8005DBA0 0C0B1EAF */  jal       evt_get_variable
/* 38FA4 8005DBA4 AE420074 */   sw       $v0, 0x74($s2)
/* 38FA8 8005DBA8 00021FC2 */  srl       $v1, $v0, 31
/* 38FAC 8005DBAC 00621821 */  addu      $v1, $v1, $v0
/* 38FB0 8005DBB0 8E4200AC */  lw        $v0, 0xAC($s2)
/* 38FB4 8005DBB4 00031843 */  sra       $v1, $v1, 1
/* 38FB8 8005DBB8 AE430078 */  sw        $v1, 0x78($s2)
/* 38FBC 8005DBBC AE220028 */  sw        $v0, 0x28($s1)
/* 38FC0 8005DBC0 24020001 */  addiu     $v0, $zero, 0x1
/* 38FC4 8005DBC4 0801774D */  j         .L8005DD34
/* 38FC8 8005DBC8 AE420070 */   sw       $v0, 0x70($s2)
.L8005DBCC:
/* 38FCC 8005DBCC 3C028011 */  lui       $v0, %hi(gPartnerStatus)
/* 38FD0 8005DBD0 2442EBB0 */  addiu     $v0, $v0, %lo(gPartnerStatus)
/* 38FD4 8005DBD4 80430003 */  lb        $v1, 0x3($v0)
/* 38FD8 8005DBD8 24020009 */  addiu     $v0, $zero, 0x9
/* 38FDC 8005DBDC 10620056 */  beq       $v1, $v0, .L8005DD38
/* 38FE0 8005DBE0 0000102D */   daddu    $v0, $zero, $zero
/* 38FE4 8005DBE4 8622008E */  lh        $v0, 0x8E($s1)
/* 38FE8 8005DBE8 10400005 */  beqz      $v0, .L8005DC00
/* 38FEC 8005DBEC 00000000 */   nop
/* 38FF0 8005DBF0 1044002C */  beq       $v0, $a0, .L8005DCA4
/* 38FF4 8005DBF4 0000102D */   daddu    $v0, $zero, $zero
/* 38FF8 8005DBF8 0801774E */  j         .L8005DD38
/* 38FFC 8005DBFC 00000000 */   nop
.L8005DC00:
/* 39000 8005DC00 C6620028 */  lwc1      $f2, 0x28($s3)
/* 39004 8005DC04 C6200038 */  lwc1      $f0, 0x38($s1)
/* 39008 8005DC08 46001081 */  sub.s     $f2, $f2, $f0
/* 3900C 8005DC0C 46021082 */  mul.s     $f2, $f2, $f2
/* 39010 8005DC10 00000000 */  nop
/* 39014 8005DC14 C666002C */  lwc1      $f6, 0x2C($s3)
/* 39018 8005DC18 C620003C */  lwc1      $f0, 0x3C($s1)
/* 3901C 8005DC1C 46003181 */  sub.s     $f6, $f6, $f0
/* 39020 8005DC20 46063182 */  mul.s     $f6, $f6, $f6
/* 39024 8005DC24 00000000 */  nop
/* 39028 8005DC28 C6240040 */  lwc1      $f4, 0x40($s1)
/* 3902C 8005DC2C C6600030 */  lwc1      $f0, 0x30($s3)
/* 39030 8005DC30 46040001 */  sub.s     $f0, $f0, $f4
/* 39034 8005DC34 46000002 */  mul.s     $f0, $f0, $f0
/* 39038 8005DC38 00000000 */  nop
/* 3903C 8005DC3C 46061080 */  add.s     $f2, $f2, $f6
/* 39040 8005DC40 46001300 */  add.s     $f12, $f2, $f0
/* 39044 8005DC44 46006104 */  sqrt.s    $f4, $f12
/* 39048 8005DC48 46042032 */  c.eq.s    $f4, $f4
/* 3904C 8005DC4C 00000000 */  nop
/* 39050 8005DC50 45010004 */  bc1t      .L8005DC64
/* 39054 8005DC54 00000000 */   nop
/* 39058 8005DC58 0C0187BC */  jal       sqrtf
/* 3905C 8005DC5C 00000000 */   nop
/* 39060 8005DC60 46000106 */  mov.s     $f4, $f0
.L8005DC64:
/* 39064 8005DC64 C6200010 */  lwc1      $f0, 0x10($s1)
/* 39068 8005DC68 4600203E */  c.le.s    $f4, $f0
/* 3906C 8005DC6C 00000000 */  nop
/* 39070 8005DC70 45000031 */  bc1f      .L8005DD38
/* 39074 8005DC74 0000102D */   daddu    $v0, $zero, $zero
/* 39078 8005DC78 C62C0038 */  lwc1      $f12, 0x38($s1)
/* 3907C 8005DC7C C62E0040 */  lwc1      $f14, 0x40($s1)
/* 39080 8005DC80 8E660028 */  lw        $a2, 0x28($s3)
/* 39084 8005DC84 0C00A720 */  jal       atan2
/* 39088 8005DC88 8E670030 */   lw       $a3, 0x30($s3)
/* 3908C 8005DC8C 8E430074 */  lw        $v1, 0x74($s2)
/* 39090 8005DC90 2402FFFF */  addiu     $v0, $zero, -0x1
/* 39094 8005DC94 10620016 */  beq       $v1, $v0, .L8005DCF0
/* 39098 8005DC98 00000000 */   nop
/* 3909C 8005DC9C 0801773E */  j         .L8005DCF8
/* 390A0 8005DCA0 00000000 */   nop
.L8005DCA4:
/* 390A4 8005DCA4 C62C0038 */  lwc1      $f12, 0x38($s1)
/* 390A8 8005DCA8 C62E0040 */  lwc1      $f14, 0x40($s1)
/* 390AC 8005DCAC 8E660028 */  lw        $a2, 0x28($s3)
/* 390B0 8005DCB0 0C00A7B5 */  jal       dist2D
/* 390B4 8005DCB4 8E670030 */   lw       $a3, 0x30($s3)
/* 390B8 8005DCB8 C6220010 */  lwc1      $f2, 0x10($s1)
/* 390BC 8005DCBC 4602003E */  c.le.s    $f0, $f2
/* 390C0 8005DCC0 00000000 */  nop
/* 390C4 8005DCC4 4500001C */  bc1f      .L8005DD38
/* 390C8 8005DCC8 0000102D */   daddu    $v0, $zero, $zero
/* 390CC 8005DCCC C62C0038 */  lwc1      $f12, 0x38($s1)
/* 390D0 8005DCD0 C62E0040 */  lwc1      $f14, 0x40($s1)
/* 390D4 8005DCD4 8E660028 */  lw        $a2, 0x28($s3)
/* 390D8 8005DCD8 0C00A720 */  jal       atan2
/* 390DC 8005DCDC 8E670030 */   lw       $a3, 0x30($s3)
/* 390E0 8005DCE0 8E430074 */  lw        $v1, 0x74($s2)
/* 390E4 8005DCE4 2402FFFF */  addiu     $v0, $zero, -0x1
/* 390E8 8005DCE8 14620003 */  bne       $v1, $v0, .L8005DCF8
/* 390EC 8005DCEC 00000000 */   nop
.L8005DCF0:
/* 390F0 8005DCF0 08017741 */  j         .L8005DD04
/* 390F4 8005DCF4 C62C000C */   lwc1     $f12, 0xC($s1)
.L8005DCF8:
/* 390F8 8005DCF8 44836000 */  mtc1      $v1, $f12
/* 390FC 8005DCFC 00000000 */  nop
/* 39100 8005DD00 46806320 */  cvt.s.w   $f12, $f12
.L8005DD04:
/* 39104 8005DD04 0C00A70A */  jal       get_clamped_angle_diff
/* 39108 8005DD08 46000386 */   mov.s    $f14, $f0
/* 3910C 8005DD0C C6420078 */  lwc1      $f2, 0x78($s2)
/* 39110 8005DD10 468010A0 */  cvt.s.w   $f2, $f2
/* 39114 8005DD14 46000005 */  abs.s     $f0, $f0
/* 39118 8005DD18 4602003C */  c.lt.s    $f0, $f2
/* 3911C 8005DD1C 00000000 */  nop
/* 39120 8005DD20 45000004 */  bc1f      .L8005DD34
/* 39124 8005DD24 24020001 */   addiu    $v0, $zero, 0x1
/* 39128 8005DD28 AE420084 */  sw        $v0, 0x84($s2)
/* 3912C 8005DD2C 0801774E */  j         .L8005DD38
/* 39130 8005DD30 24020002 */   addiu    $v0, $zero, 0x2
.L8005DD34:
/* 39134 8005DD34 0000102D */  daddu     $v0, $zero, $zero
.L8005DD38:
/* 39138 8005DD38 8FBF0020 */  lw        $ra, 0x20($sp)
/* 3913C 8005DD3C 8FB3001C */  lw        $s3, 0x1C($sp)
/* 39140 8005DD40 8FB20018 */  lw        $s2, 0x18($sp)
/* 39144 8005DD44 8FB10014 */  lw        $s1, 0x14($sp)
/* 39148 8005DD48 8FB00010 */  lw        $s0, 0x10($sp)
/* 3914C 8005DD4C 03E00008 */  jr        $ra
/* 39150 8005DD50 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus func_8005DB00(Evt* script, s32 isInitialCall) {
    Npc* npc;
    f32 targetDir, npcYaw;
    PlayerStatus* playerStatus;
    PartnerStatus* partnerStatus;

    npc = get_npc_unsafe(script->owner1.enemy->npcID);
    playerStatus = &gPlayerStatus;
    partnerStatus = &gPartnerStatus;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
    }

    switch (script->functionTemp[0]) {
        case 0:
            npc->planarFlyDist = evt_get_float_variable(script, LVar0);
            npc->duration = evt_get_variable(script, LVar1);
            script->functionTemp[1] = evt_get_variable(script, LVar2);
            script->functionTemp[2] = evt_get_variable(script, LVar3) / 2;
            npc->currentAnim = script->varTable[10];
            script->functionTemp[0] = 1;
            break;
        case 1:
            if (partnerStatus->actingPartner != PARTNER_BOW) {
                if (npc->duration != 0 && npc->duration != script->functionTemp[0]) {
                    return ApiStatus_BLOCK;
                }

                if (npc->duration == 0) {
                    if (sqrtf(SQ((playerStatus->position.x - npc->pos.x)) +
                            SQ((playerStatus->position.y - npc->pos.y)) +
                            SQ((playerStatus->position.z - npc->pos.z))) <= npc->planarFlyDist) {
                        targetDir = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z);
                        npcYaw = script->functionTemp[1] == -1 ? npc->yaw : script->functionTemp[1];

                        if (fabsf(get_clamped_angle_diff(npcYaw, targetDir)) < script->functionTemp[2]) {
                            script->varTable[0] = 1;
                            return ApiStatus_DONE2;
                        }
                    }
                } else {
                    if (dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) <= npc->planarFlyDist) {
                        targetDir = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z);
                        npcYaw = script->functionTemp[1] == -1 ? npc->yaw : script->functionTemp[1];

                        if (fabsf(get_clamped_angle_diff(npcYaw, targetDir)) < script->functionTemp[2]) {
                            script->varTable[0] = 1;
                            return ApiStatus_DONE2;
                        }
                    }
                }
            }
            break;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel phys_update_action_state
/* 7EEDC 800E5A2C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 7EEE0 800E5A30 3C04800B */  lui       $a0, %hi(gCameras)
/* 7EEE4 800E5A34 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* 7EEE8 800E5A38 AFB40020 */  sw        $s4, 0x20($sp)
/* 7EEEC 800E5A3C 3C148011 */  lui       $s4, %hi(gPartnerStatus)
/* 7EEF0 800E5A40 2694EBB0 */  addiu     $s4, $s4, %lo(gPartnerStatus)
/* 7EEF4 800E5A44 AFB00010 */  sw        $s0, 0x10($sp)
/* 7EEF8 800E5A48 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* 7EEFC 800E5A4C 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* 7EF00 800E5A50 AFB10014 */  sw        $s1, 0x14($sp)
/* 7EF04 800E5A54 3C118011 */  lui       $s1, %hi(gPlayerSpinState)
/* 7EF08 800E5A58 2631F250 */  addiu     $s1, $s1, %lo(gPlayerSpinState)
/* 7EF0C 800E5A5C AFBF0024 */  sw        $ra, 0x24($sp)
/* 7EF10 800E5A60 AFB3001C */  sw        $s3, 0x1C($sp)
/* 7EF14 800E5A64 AFB20018 */  sw        $s2, 0x18($sp)
/* 7EF18 800E5A68 8E030000 */  lw        $v1, 0x0($s0)
/* 7EF1C 800E5A6C 3C020004 */  lui       $v0, (0x40000 >> 16)
/* 7EF20 800E5A70 00621024 */  and       $v0, $v1, $v0
/* 7EF24 800E5A74 14400004 */  bnez      $v0, .L800E5A88
/* 7EF28 800E5A78 3C02DFFF */   lui      $v0, (0xDFFFFFFF >> 16)
/* 7EF2C 800E5A7C 3442FFFF */  ori       $v0, $v0, (0xDFFFFFFF & 0xFFFF)
/* 7EF30 800E5A80 00621024 */  and       $v0, $v1, $v0
/* 7EF34 800E5A84 AE020000 */  sw        $v0, 0x0($s0)
.L800E5A88:
/* 7EF38 800E5A88 8E020004 */  lw        $v0, 0x4($s0)
/* 7EF3C 800E5A8C 30421000 */  andi      $v0, $v0, 0x1000
/* 7EF40 800E5A90 10400005 */  beqz      $v0, .L800E5AA8
/* 7EF44 800E5A94 00000000 */   nop
/* 7EF48 800E5A98 0C03971E */  jal       phys_peach_update
/* 7EF4C 800E5A9C 00000000 */   nop
/* 7EF50 800E5AA0 08039716 */  j         .L800E5C58
/* 7EF54 800E5AA4 00000000 */   nop
.L800E5AA8:
/* 7EF58 800E5AA8 820200C5 */  lb        $v0, 0xC5($s0)
/* 7EF5C 800E5AAC 920300C5 */  lbu       $v1, 0xC5($s0)
/* 7EF60 800E5AB0 10400008 */  beqz      $v0, .L800E5AD4
/* 7EF64 800E5AB4 2462FFFF */   addiu    $v0, $v1, -0x1
/* 7EF68 800E5AB8 A20200C5 */  sb        $v0, 0xC5($s0)
/* 7EF6C 800E5ABC 00021600 */  sll       $v0, $v0, 24
/* 7EF70 800E5AC0 14400004 */  bnez      $v0, .L800E5AD4
/* 7EF74 800E5AC4 00000000 */   nop
/* 7EF78 800E5AC8 94820002 */  lhu       $v0, 0x2($a0)
/* 7EF7C 800E5ACC 34420004 */  ori       $v0, $v0, 0x4
/* 7EF80 800E5AD0 A4820002 */  sh        $v0, 0x2($a0)
.L800E5AD4:
/* 7EF84 800E5AD4 860200C0 */  lh        $v0, 0xC0($s0)
/* 7EF88 800E5AD8 10400011 */  beqz      $v0, .L800E5B20
/* 7EF8C 800E5ADC 960300C0 */   lhu      $v1, 0xC0($s0)
/* 7EF90 800E5AE0 C6000070 */  lwc1      $f0, 0x70($s0)
/* 7EF94 800E5AE4 44801000 */  mtc1      $zero, $f2
/* 7EF98 800E5AE8 00000000 */  nop
/* 7EF9C 800E5AEC 4602003E */  c.le.s    $f0, $f2
/* 7EFA0 800E5AF0 00000000 */  nop
/* 7EFA4 800E5AF4 45000008 */  bc1f      .L800E5B18
/* 7EFA8 800E5AF8 00000000 */   nop
/* 7EFAC 800E5AFC 3C01800F */  lui       $at, %hi(D_800F7B90)
/* 7EFB0 800E5B00 C4207B90 */  lwc1      $f0, %lo(D_800F7B90)($at)
/* 7EFB4 800E5B04 4600103C */  c.lt.s    $f2, $f0
/* 7EFB8 800E5B08 00000000 */  nop
/* 7EFBC 800E5B0C 45030001 */  bc1tl     .L800E5B14
/* 7EFC0 800E5B10 A60300C2 */   sh       $v1, 0xC2($s0)
.L800E5B14:
/* 7EFC4 800E5B14 C6000070 */  lwc1      $f0, 0x70($s0)
.L800E5B18:
/* 7EFC8 800E5B18 3C01800F */  lui       $at, %hi(D_800F7B90)
/* 7EFCC 800E5B1C E4207B90 */  swc1      $f0, %lo(D_800F7B90)($at)
.L800E5B20:
/* 7EFD0 800E5B20 0C03893E */  jal       func_800E24F8
/* 7EFD4 800E5B24 00000000 */   nop
/* 7EFD8 800E5B28 82220000 */  lb        $v0, 0x0($s1)
/* 7EFDC 800E5B2C 92230000 */  lbu       $v1, 0x0($s1)
/* 7EFE0 800E5B30 1040000E */  beqz      $v0, .L800E5B6C
/* 7EFE4 800E5B34 2462FFFF */   addiu    $v0, $v1, -0x1
/* 7EFE8 800E5B38 A2220000 */  sb        $v0, 0x0($s1)
/* 7EFEC 800E5B3C 00021600 */  sll       $v0, $v0, 24
/* 7EFF0 800E5B40 1440000B */  bnez      $v0, .L800E5B70
/* 7EFF4 800E5B44 3C138000 */   lui      $s3, (0x80000000 >> 16)
/* 7EFF8 800E5B48 3C03FFFE */  lui       $v1, (0xFFFEFFFF >> 16)
/* 7EFFC 800E5B4C 3463FFFF */  ori       $v1, $v1, (0xFFFEFFFF & 0xFFFF)
/* 7F000 800E5B50 8E020004 */  lw        $v0, 0x4($s0)
/* 7F004 800E5B54 8E240030 */  lw        $a0, 0x30($s1)
/* 7F008 800E5B58 00431024 */  and       $v0, $v0, $v1
/* 7F00C 800E5B5C 10800004 */  beqz      $a0, .L800E5B70
/* 7F010 800E5B60 AE020004 */   sw       $v0, 0x4($s0)
/* 7F014 800E5B64 0C05271B */  jal       sfx_stop_sound
/* 7F018 800E5B68 00000000 */   nop
.L800E5B6C:
/* 7F01C 800E5B6C 3C138000 */  lui       $s3, (0x80000000 >> 16)
.L800E5B70:
/* 7F020 800E5B70 3C11800F */  lui       $s1, %hi(PlayerActionsTable)
/* 7F024 800E5B74 26317C8C */  addiu     $s1, $s1, %lo(PlayerActionsTable)
/* 7F028 800E5B78 3C128011 */  lui       $s2, %hi(D_8010C924)
/* 7F02C 800E5B7C 2652C924 */  addiu     $s2, $s2, %lo(D_8010C924)
.L800E5B80:
/* 7F030 800E5B80 820200B4 */  lb        $v0, 0xB4($s0)
/* 7F034 800E5B84 2C420003 */  sltiu     $v0, $v0, 0x3
/* 7F038 800E5B88 10400015 */  beqz      $v0, .L800E5BE0
/* 7F03C 800E5B8C 00000000 */   nop
/* 7F040 800E5B90 8E020000 */  lw        $v0, 0x0($s0)
/* 7F044 800E5B94 30422000 */  andi      $v0, $v0, 0x2000
/* 7F048 800E5B98 14400004 */  bnez      $v0, .L800E5BAC
/* 7F04C 800E5B9C 0000182D */   daddu    $v1, $zero, $zero
/* 7F050 800E5BA0 0C010C77 */  jal       check_conversation_trigger
/* 7F054 800E5BA4 00000000 */   nop
/* 7F058 800E5BA8 0040182D */  daddu     $v1, $v0, $zero
.L800E5BAC:
/* 7F05C 800E5BAC 82820000 */  lb        $v0, 0x0($s4)
/* 7F060 800E5BB0 14400009 */  bnez      $v0, .L800E5BD8
/* 7F064 800E5BB4 00000000 */   nop
/* 7F068 800E5BB8 8E020000 */  lw        $v0, 0x0($s0)
/* 7F06C 800E5BBC 30420020 */  andi      $v0, $v0, 0x20
/* 7F070 800E5BC0 14400005 */  bnez      $v0, .L800E5BD8
/* 7F074 800E5BC4 00000000 */   nop
/* 7F078 800E5BC8 10600003 */  beqz      $v1, .L800E5BD8
/* 7F07C 800E5BCC 00000000 */   nop
/* 7F080 800E5BD0 0C039769 */  jal       set_action_state
/* 7F084 800E5BD4 2404000C */   addiu    $a0, $zero, 0xC
.L800E5BD8:
/* 7F088 800E5BD8 0C03989A */  jal       check_input_spin
/* 7F08C 800E5BDC 00000000 */   nop
.L800E5BE0:
/* 7F090 800E5BE0 8E020000 */  lw        $v0, 0x0($s0)
/* 7F094 800E5BE4 00531024 */  and       $v0, $v0, $s3
/* 7F098 800E5BE8 10400011 */  beqz      $v0, .L800E5C30
/* 7F09C 800E5BEC 00000000 */   nop
/* 7F0A0 800E5BF0 820200B4 */  lb        $v0, 0xB4($s0)
/* 7F0A4 800E5BF4 00021100 */  sll       $v0, $v0, 4
/* 7F0A8 800E5BF8 00511021 */  addu      $v0, $v0, $s1
/* 7F0AC 800E5BFC 8C440004 */  lw        $a0, 0x4($v0)
/* 7F0B0 800E5C00 1080000B */  beqz      $a0, .L800E5C30
/* 7F0B4 800E5C04 00000000 */   nop
/* 7F0B8 800E5C08 8E420000 */  lw        $v0, 0x0($s2)
/* 7F0BC 800E5C0C 10820008 */  beq       $a0, $v0, .L800E5C30
/* 7F0C0 800E5C10 3C06802B */   lui      $a2, (0x802B6000 >> 16)
/* 7F0C4 800E5C14 820200B4 */  lb        $v0, 0xB4($s0)
/* 7F0C8 800E5C18 00021100 */  sll       $v0, $v0, 4
/* 7F0CC 800E5C1C 00511021 */  addu      $v0, $v0, $s1
/* 7F0D0 800E5C20 8C450008 */  lw        $a1, 0x8($v0)
/* 7F0D4 800E5C24 34C66000 */  ori       $a2, $a2, (0x802B6000 & 0xFFFF)
/* 7F0D8 800E5C28 0C00A5CF */  jal       dma_copy
/* 7F0DC 800E5C2C AE440000 */   sw       $a0, 0x0($s2)
.L800E5C30:
/* 7F0E0 800E5C30 820200B4 */  lb        $v0, 0xB4($s0)
/* 7F0E4 800E5C34 00021100 */  sll       $v0, $v0, 4
/* 7F0E8 800E5C38 00511021 */  addu      $v0, $v0, $s1
/* 7F0EC 800E5C3C 8C420000 */  lw        $v0, 0x0($v0)
/* 7F0F0 800E5C40 0040F809 */  jalr      $v0
/* 7F0F4 800E5C44 00000000 */   nop
/* 7F0F8 800E5C48 8E020000 */  lw        $v0, 0x0($s0)
/* 7F0FC 800E5C4C 00531024 */  and       $v0, $v0, $s3
/* 7F100 800E5C50 1440FFCB */  bnez      $v0, .L800E5B80
/* 7F104 800E5C54 00000000 */   nop
.L800E5C58:
/* 7F108 800E5C58 8FBF0024 */  lw        $ra, 0x24($sp)
/* 7F10C 800E5C5C 8FB40020 */  lw        $s4, 0x20($sp)
/* 7F110 800E5C60 8FB3001C */  lw        $s3, 0x1C($sp)
/* 7F114 800E5C64 8FB20018 */  lw        $s2, 0x18($sp)
/* 7F118 800E5C68 8FB10014 */  lw        $s1, 0x14($sp)
/* 7F11C 800E5C6C 8FB00010 */  lw        $s0, 0x10($sp)
/* 7F120 800E5C70 03E00008 */  jr        $ra
/* 7F124 800E5C74 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void phys_update_action_state(void) {
    Camera* cameras = gCameras;
    PartnerStatus* partnerStatus = &gPartnerStatus;
    PlayerStatus* playerStatus = &gPlayerStatus;
    PlayerSpinState* playerSpinState = &gPlayerSpinState;

    if (!(playerStatus->flags & PS_FLAG_ENTERING_BATTLE)) {
        playerStatus->flags &= ~PS_FLAG_TIME_STOPPED;
    }

    if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
        phys_peach_update();
        return;
    }

    if (playerStatus->camResetDelay != 0) {
        playerStatus->camResetDelay--;
        if (playerStatus->camResetDelay == 0) {
            gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAG_4;
        }
    }

    // if midair, look for velocity inflection
    if (playerStatus->timeInAir != 0) {
        if (playerStatus->gravityIntegrator[0] <= 0.0f && LastMidairPlayerVelY > 0.0f) {
            playerStatus->peakJumpTime = playerStatus->timeInAir;
        }
        LastMidairPlayerVelY = playerStatus->gravityIntegrator[0];
    }

    func_800E24F8();
    if (playerSpinState->stopSoundTimer != 0) {
        playerSpinState->stopSoundTimer--;
        if (playerSpinState->stopSoundTimer == 0) {
            playerStatus->animFlags &= ~PA_FLAG_SPINNING;
            if (playerSpinState->spinSoundID != 0) {
                sfx_stop_sound(playerSpinState->spinSoundID);
            }
        }
    }

    do {
        s32 actionState = playerStatus->actionState;

        if (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN) {
            s32 cond;

            if (!(playerStatus->flags & PS_FLAG_INPUT_DISABLED)) {
                cond = check_conversation_trigger();
            } else {
                cond = FALSE;
            }

            if ((partnerStatus->partnerActionState == PARTNER_ACTION_NONE) && !(playerStatus->flags & PS_FLAG_PAUSED) && cond) {
                set_action_state(ACTION_STATE_TALK);
            }
            check_input_spin();
        }

        if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
            void* dmaStart = PlayerActionsTable[playerStatus->actionState].dmaStart;

            if (dmaStart != NULL && dmaStart != D_8010C924) {
                D_8010C924 = dmaStart;
                dma_copy(dmaStart, PlayerActionsTable[playerStatus->actionState].dmaEnd, PLAYER_ACTION_VRAM_DEF);
            }
        }
        PlayerActionsTable[playerStatus->actionState].update();
    } while (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ShowConsumableChoicePopup
/* FAFEC 802D663C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* FAFF0 802D6640 AFB00010 */  sw        $s0, 0x10($sp)
/* FAFF4 802D6644 0080802D */  daddu     $s0, $a0, $zero
/* FAFF8 802D6648 AFB3001C */  sw        $s3, 0x1C($sp)
/* FAFFC 802D664C 3C138011 */  lui       $s3, %hi(gPlayerData)
/* FB000 802D6650 2673F290 */  addiu     $s3, $s3, %lo(gPlayerData)
/* FB004 802D6654 AFB10014 */  sw        $s1, 0x14($sp)
/* FB008 802D6658 3C11802E */  lui       $s1, %hi(D_802DB830)
/* FB00C 802D665C 2631B830 */  addiu     $s1, $s1, %lo(D_802DB830)
/* FB010 802D6660 AFBF0020 */  sw        $ra, 0x20($sp)
/* FB014 802D6664 AFB20018 */  sw        $s2, 0x18($sp)
/* FB018 802D6668 8E12014C */  lw        $s2, 0x14C($s0)
/* FB01C 802D666C 54A00001 */  bnel      $a1, $zero, .L802D6674
/* FB020 802D6670 AE000070 */   sw       $zero, 0x70($s0)
.L802D6674:
/* FB024 802D6674 8E030070 */  lw        $v1, 0x70($s0)
/* FB028 802D6678 10600005 */  beqz      $v1, .L802D6690
/* FB02C 802D667C 24020001 */   addiu    $v0, $zero, 0x1
/* FB030 802D6680 1062004B */  beq       $v1, $v0, .L802D67B0
/* FB034 802D6684 0000102D */   daddu    $v0, $zero, $zero
/* FB038 802D6688 080B5A0F */  j         .L802D683C
/* FB03C 802D668C 00000000 */   nop
.L802D6690:
/* FB040 802D6690 0C03805E */  jal       disable_player_input
/* FB044 802D6694 00000000 */   nop
/* FB048 802D6698 0C038045 */  jal       disable_player_static_collisions
/* FB04C 802D669C 00000000 */   nop
/* FB050 802D66A0 0C03BD8A */  jal       partner_disable_input
/* FB054 802D66A4 00000000 */   nop
/* FB058 802D66A8 0C03A5EE */  jal       close_status_bar
/* FB05C 802D66AC 00000000 */   nop
/* FB060 802D66B0 0000482D */  daddu     $t1, $zero, $zero
/* FB064 802D66B4 0120402D */  daddu     $t0, $t1, $zero
/* FB068 802D66B8 3C0C8008 */  lui       $t4, %hi(gItemTable)
/* FB06C 802D66BC 258C78E0 */  addiu     $t4, $t4, %lo(gItemTable)
/* FB070 802D66C0 3C0B8009 */  lui       $t3, %hi(gItemHudScripts)
/* FB074 802D66C4 256BA680 */  addiu     $t3, $t3, %lo(gItemHudScripts)
/* FB078 802D66C8 240A0001 */  addiu     $t2, $zero, 0x1
/* FB07C 802D66CC 0260382D */  daddu     $a3, $s3, $zero
/* FB080 802D66D0 3C03800A */  lui       $v1, %hi(gOverrideFlags)
/* FB084 802D66D4 2463A650 */  addiu     $v1, $v1, %lo(gOverrideFlags)
/* FB088 802D66D8 8C620000 */  lw        $v0, 0x0($v1)
/* FB08C 802D66DC 0220302D */  daddu     $a2, $s1, $zero
/* FB090 802D66E0 34420040 */  ori       $v0, $v0, 0x40
/* FB094 802D66E4 AC620000 */  sw        $v0, 0x0($v1)
.L802D66E8:
/* FB098 802D66E8 84E401B4 */  lh        $a0, 0x1B4($a3)
/* FB09C 802D66EC 5080001F */  beql      $a0, $zero, .L802D676C
/* FB0A0 802D66F0 25080001 */   addiu    $t0, $t0, 0x1
/* FB0A4 802D66F4 8E430028 */  lw        $v1, 0x28($s2)
/* FB0A8 802D66F8 8C620000 */  lw        $v0, 0x0($v1)
/* FB0AC 802D66FC 18400008 */  blez      $v0, .L802D6720
/* FB0B0 802D6700 0000282D */   daddu    $a1, $zero, $zero
.L802D6704:
/* FB0B4 802D6704 54820003 */  bnel      $a0, $v0, .L802D6714
/* FB0B8 802D6708 24630004 */   addiu    $v1, $v1, 0x4
/* FB0BC 802D670C 080B59C8 */  j         .L802D6720
/* FB0C0 802D6710 24050001 */   addiu    $a1, $zero, 0x1
.L802D6714:
/* FB0C4 802D6714 8C620000 */  lw        $v0, 0x0($v1)
/* FB0C8 802D6718 1C40FFFA */  bgtz      $v0, .L802D6704
/* FB0CC 802D671C 00000000 */   nop
.L802D6720:
/* FB0D0 802D6720 50A00012 */  beql      $a1, $zero, .L802D676C
/* FB0D4 802D6724 25080001 */   addiu    $t0, $t0, 0x1
/* FB0D8 802D6728 84E301B4 */  lh        $v1, 0x1B4($a3)
/* FB0DC 802D672C 00031940 */  sll       $v1, $v1, 5
/* FB0E0 802D6730 006C1821 */  addu      $v1, $v1, $t4
/* FB0E4 802D6734 84620004 */  lh        $v0, 0x4($v1)
/* FB0E8 802D6738 000210C0 */  sll       $v0, $v0, 3
/* FB0EC 802D673C 004B1021 */  addu      $v0, $v0, $t3
/* FB0F0 802D6740 8C420000 */  lw        $v0, 0x0($v0)
/* FB0F4 802D6744 ACC80108 */  sw        $t0, 0x108($a2)
/* FB0F8 802D6748 ACCA018C */  sw        $t2, 0x18C($a2)
/* FB0FC 802D674C ACC20000 */  sw        $v0, 0x0($a2)
/* FB100 802D6750 8C620000 */  lw        $v0, 0x0($v1)
/* FB104 802D6754 ACC20084 */  sw        $v0, 0x84($a2)
/* FB108 802D6758 8C620014 */  lw        $v0, 0x14($v1)
/* FB10C 802D675C 25290001 */  addiu     $t1, $t1, 0x1
/* FB110 802D6760 ACC20294 */  sw        $v0, 0x294($a2)
/* FB114 802D6764 24C60004 */  addiu     $a2, $a2, 0x4
/* FB118 802D6768 25080001 */  addiu     $t0, $t0, 0x1
.L802D676C:
/* FB11C 802D676C 2902000A */  slti      $v0, $t0, 0xA
/* FB120 802D6770 1440FFDD */  bnez      $v0, .L802D66E8
/* FB124 802D6774 24E70002 */   addiu    $a3, $a3, 0x2
/* FB128 802D6778 15200004 */  bnez      $t1, .L802D678C
/* FB12C 802D677C 2402000C */   addiu    $v0, $zero, 0xC
/* FB130 802D6780 AE000084 */  sw        $zero, 0x84($s0)
/* FB134 802D6784 080B5A0F */  j         .L802D683C
/* FB138 802D6788 24020001 */   addiu    $v0, $zero, 0x1
.L802D678C:
/* FB13C 802D678C 0220202D */  daddu     $a0, $s1, $zero
/* FB140 802D6790 AE220318 */  sw        $v0, 0x318($s1)
/* FB144 802D6794 AE290324 */  sw        $t1, 0x324($s1)
/* FB148 802D6798 0C03D390 */  jal       create_standard_popup_menu
/* FB14C 802D679C AE200328 */   sw       $zero, 0x328($s1)
/* FB150 802D67A0 24020001 */  addiu     $v0, $zero, 0x1
/* FB154 802D67A4 AE000074 */  sw        $zero, 0x74($s0)
/* FB158 802D67A8 080B5A0E */  j         .L802D6838
/* FB15C 802D67AC AE020070 */   sw       $v0, 0x70($s0)
.L802D67B0:
/* FB160 802D67B0 8E020074 */  lw        $v0, 0x74($s0)
/* FB164 802D67B4 14400008 */  bnez      $v0, .L802D67D8
/* FB168 802D67B8 24420001 */   addiu    $v0, $v0, 0x1
/* FB16C 802D67BC 8622032C */  lh        $v0, 0x32C($s1)
/* FB170 802D67C0 1040001D */  beqz      $v0, .L802D6838
/* FB174 802D67C4 AE020078 */   sw       $v0, 0x78($s0)
/* FB178 802D67C8 0C03C4EC */  jal       hide_popup_menu
/* FB17C 802D67CC 00000000 */   nop
/* FB180 802D67D0 8E020074 */  lw        $v0, 0x74($s0)
/* FB184 802D67D4 24420001 */  addiu     $v0, $v0, 0x1
.L802D67D8:
/* FB188 802D67D8 AE020074 */  sw        $v0, 0x74($s0)
/* FB18C 802D67DC 2842000F */  slti      $v0, $v0, 0xF
/* FB190 802D67E0 14400016 */  bnez      $v0, .L802D683C
/* FB194 802D67E4 0000102D */   daddu    $v0, $zero, $zero
/* FB198 802D67E8 0C03C54E */  jal       destroy_popup_menu
/* FB19C 802D67EC 00000000 */   nop
/* FB1A0 802D67F0 8E030078 */  lw        $v1, 0x78($s0)
/* FB1A4 802D67F4 240200FF */  addiu     $v0, $zero, 0xFF
/* FB1A8 802D67F8 54620005 */  bnel      $v1, $v0, .L802D6810
/* FB1AC 802D67FC 2462FFFF */   addiu    $v0, $v1, -0x1
/* FB1B0 802D6800 2402FFFF */  addiu     $v0, $zero, -0x1
/* FB1B4 802D6804 AE020084 */  sw        $v0, 0x84($s0)
/* FB1B8 802D6808 080B5A0F */  j         .L802D683C
/* FB1BC 802D680C 24020001 */   addiu    $v0, $zero, 0x1
.L802D6810:
/* FB1C0 802D6810 00021080 */  sll       $v0, $v0, 2
/* FB1C4 802D6814 00511021 */  addu      $v0, $v0, $s1
/* FB1C8 802D6818 8C430108 */  lw        $v1, 0x108($v0)
/* FB1CC 802D681C 00031040 */  sll       $v0, $v1, 1
/* FB1D0 802D6820 00531021 */  addu      $v0, $v0, $s3
/* FB1D4 802D6824 AE030088 */  sw        $v1, 0x88($s0)
/* FB1D8 802D6828 844301B4 */  lh        $v1, 0x1B4($v0)
/* FB1DC 802D682C 24020001 */  addiu     $v0, $zero, 0x1
/* FB1E0 802D6830 080B5A0F */  j         .L802D683C
/* FB1E4 802D6834 AE030084 */   sw       $v1, 0x84($s0)
.L802D6838:
/* FB1E8 802D6838 0000102D */  daddu     $v0, $zero, $zero
.L802D683C:
/* FB1EC 802D683C 8FBF0020 */  lw        $ra, 0x20($sp)
/* FB1F0 802D6840 8FB3001C */  lw        $s3, 0x1C($sp)
/* FB1F4 802D6844 8FB20018 */  lw        $s2, 0x18($sp)
/* FB1F8 802D6848 8FB10014 */  lw        $s1, 0x14($sp)
/* FB1FC 802D684C 8FB00010 */  lw        $s0, 0x10($sp)
/* FB200 802D6850 03E00008 */  jr        $ra
/* FB204 802D6854 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus ShowConsumableChoicePopup(Evt* script, s32 isInitialCall) {
    PlayerData* playerData = &gPlayerData;
    PopupMenu* menu = &D_802DB830;
    Trigger* trigger = script->owner2.trigger;
    s32 numEntries;
    s32 t; // TODO required in both places to match
    s32 i;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
    }

    t = script->functionTemp[0];
    switch (t) {
        case 0:
            disable_player_input();
            disable_player_static_collisions();
            partner_disable_input();
            close_status_bar();
            numEntries = 0;

            gOverrideFlags |= GLOBAL_OVERRIDES_40;

            for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
                s16 invItem = playerData->invItems[i];

                if (invItem != ITEM_NONE) {
                    s32 found = FALSE;
                    s32* itemIt = trigger->itemList;

                    while (*itemIt > 0) {
                        if (invItem == *itemIt) {
                            found = TRUE;
                            break;
                        }
                        itemIt++;
                    }

                    if (found) {
                        ItemData* item = &gItemTable[playerData->invItems[i]];

                        menu->ptrIcon[numEntries] = gItemHudScripts[item->hudElemID].enabled;
                        menu->userIndex[numEntries] = i;
                        menu->enabled[numEntries] = TRUE;
                        menu->nameMsg[numEntries] = item->nameMsg;
                        menu->descMsg[numEntries] = item->shortDescMsg;
                        numEntries++;
                    }
                }
            }

            if (numEntries == 0) {
                script->varTable[0] = 0;
                return ApiStatus_DONE1;
            }
            menu->popupType = POPUP_MENU_USEKEY;
            menu->numEntries = numEntries;
            menu->initialPos = 0;
            create_standard_popup_menu(menu);
            script->functionTemp[1] = 0;
            script->functionTemp[0] = 1;
            break;
        case 1:
            if (script->functionTemp[1] == 0) {
                script->functionTemp[2] = menu->result;
                if (script->functionTemp[2] == 0) {
                    break;
                }
                hide_popup_menu();
            }

            script->functionTemp[1]++;
            if (script->functionTemp[1] >= 15) {
                destroy_popup_menu();

                if (script->functionTemp[2] == 0xFF) {
                    script->varTable[0] = -1;
                    return ApiStatus_DONE1;
                } else {
                    t = menu->userIndex[script->functionTemp[2] - 1];

                    script->varTable[1] = t;
                    script->varTable[0] = playerData->invItems[t];
                    return ApiStatus_DONE1;
                }
            }
            break;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel set_goal_pos_to_part
/* 198034 80269754 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 198038 80269758 AFB20018 */  sw        $s2, 0x18($sp)
/* 19803C 8026975C 0080902D */  daddu     $s2, $a0, $zero
/* 198040 80269760 00A0202D */  daddu     $a0, $a1, $zero
/* 198044 80269764 AFB3001C */  sw        $s3, 0x1C($sp)
/* 198048 80269768 00C0982D */  daddu     $s3, $a2, $zero
/* 19804C 8026976C AFB00010 */  sw        $s0, 0x10($sp)
/* 198050 80269770 30900700 */  andi      $s0, $a0, 0x700
/* 198054 80269774 AFBF0020 */  sw        $ra, 0x20($sp)
/* 198058 80269778 0C09A75B */  jal       get_actor
/* 19805C 8026977C AFB10014 */   sw       $s1, 0x14($sp)
/* 198060 80269780 0040882D */  daddu     $s1, $v0, $zero
/* 198064 80269784 24020100 */  addiu     $v0, $zero, 0x100
/* 198068 80269788 12020035 */  beq       $s0, $v0, .L80269860
/* 19806C 8026978C 2A020101 */   slti     $v0, $s0, 0x101
/* 198070 80269790 50400005 */  beql      $v0, $zero, .L802697A8
/* 198074 80269794 24020200 */   addiu    $v0, $zero, 0x200
/* 198078 80269798 12000007 */  beqz      $s0, .L802697B8
/* 19807C 8026979C 0220202D */   daddu    $a0, $s1, $zero
/* 198080 802697A0 0809A66F */  j         .L802699BC
/* 198084 802697A4 00000000 */   nop
.L802697A8:
/* 198088 802697A8 1202002E */  beq       $s0, $v0, .L80269864
/* 19808C 802697AC 0220202D */   daddu    $a0, $s1, $zero
/* 198090 802697B0 0809A66F */  j         .L802699BC
/* 198094 802697B4 00000000 */   nop
.L802697B8:
/* 198098 802697B8 0C099117 */  jal       get_actor_part
/* 19809C 802697BC 0000282D */   daddu    $a1, $zero, $zero
/* 1980A0 802697C0 0040202D */  daddu     $a0, $v0, $zero
/* 1980A4 802697C4 84820014 */  lh        $v0, 0x14($a0)
/* 1980A8 802697C8 C6200188 */  lwc1      $f0, 0x188($s1)
/* 1980AC 802697CC 44821000 */  mtc1      $v0, $f2
/* 1980B0 802697D0 00000000 */  nop
/* 1980B4 802697D4 468010A0 */  cvt.s.w   $f2, $f2
/* 1980B8 802697D8 46001082 */  mul.s     $f2, $f2, $f0
/* 1980BC 802697DC 00000000 */  nop
/* 1980C0 802697E0 C6200144 */  lwc1      $f0, 0x144($s1)
/* 1980C4 802697E4 46020000 */  add.s     $f0, $f0, $f2
/* 1980C8 802697E8 E640000C */  swc1      $f0, 0xC($s2)
/* 1980CC 802697EC 84820016 */  lh        $v0, 0x16($a0)
/* 1980D0 802697F0 C6200188 */  lwc1      $f0, 0x188($s1)
/* 1980D4 802697F4 44821000 */  mtc1      $v0, $f2
/* 1980D8 802697F8 00000000 */  nop
/* 1980DC 802697FC 468010A0 */  cvt.s.w   $f2, $f2
/* 1980E0 80269800 46001082 */  mul.s     $f2, $f2, $f0
/* 1980E4 80269804 00000000 */  nop
/* 1980E8 80269808 C6200148 */  lwc1      $f0, 0x148($s1)
/* 1980EC 8026980C 46020000 */  add.s     $f0, $f0, $f2
/* 1980F0 80269810 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 1980F4 80269814 44811000 */  mtc1      $at, $f2
/* 1980F8 80269818 E6400010 */  swc1      $f0, 0x10($s2)
/* 1980FC 8026981C C620014C */  lwc1      $f0, 0x14C($s1)
/* 198100 80269820 46020000 */  add.s     $f0, $f0, $f2
/* 198104 80269824 E6400014 */  swc1      $f0, 0x14($s2)
/* 198108 80269828 82230214 */  lb        $v1, 0x214($s1)
/* 19810C 8026982C 2402000C */  addiu     $v0, $zero, 0xC
/* 198110 80269830 14620062 */  bne       $v1, $v0, .L802699BC
/* 198114 80269834 00000000 */   nop
/* 198118 80269838 C6200188 */  lwc1      $f0, 0x188($s1)
/* 19811C 8026983C 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 198120 80269840 44811000 */  mtc1      $at, $f2
/* 198124 80269844 00000000 */  nop
/* 198128 80269848 46020002 */  mul.s     $f0, $f0, $f2
/* 19812C 8026984C 00000000 */  nop
/* 198130 80269850 C6420010 */  lwc1      $f2, 0x10($s2)
/* 198134 80269854 46001081 */  sub.s     $f2, $f2, $f0
/* 198138 80269858 0809A66F */  j         .L802699BC
/* 19813C 8026985C E6420010 */   swc1     $f2, 0x10($s2)
.L80269860:
/* 198140 80269860 0220202D */  daddu     $a0, $s1, $zero
.L80269864:
/* 198144 80269864 0C099117 */  jal       get_actor_part
/* 198148 80269868 0260282D */   daddu    $a1, $s3, $zero
/* 19814C 8026986C 0040202D */  daddu     $a0, $v0, $zero
/* 198150 80269870 8C820000 */  lw        $v0, 0x0($a0)
/* 198154 80269874 3C030010 */  lui       $v1, (0x100000 >> 16)
/* 198158 80269878 00431024 */  and       $v0, $v0, $v1
/* 19815C 8026987C 1440002A */  bnez      $v0, .L80269928
/* 198160 80269880 00000000 */   nop
/* 198164 80269884 84820014 */  lh        $v0, 0x14($a0)
/* 198168 80269888 8483006C */  lh        $v1, 0x6C($a0)
/* 19816C 8026988C C6200188 */  lwc1      $f0, 0x188($s1)
/* 198170 80269890 00431021 */  addu      $v0, $v0, $v1
/* 198174 80269894 44821000 */  mtc1      $v0, $f2
/* 198178 80269898 00000000 */  nop
/* 19817C 8026989C 468010A0 */  cvt.s.w   $f2, $f2
/* 198180 802698A0 46001082 */  mul.s     $f2, $f2, $f0
/* 198184 802698A4 00000000 */  nop
/* 198188 802698A8 C6200144 */  lwc1      $f0, 0x144($s1)
/* 19818C 802698AC 46020000 */  add.s     $f0, $f0, $f2
/* 198190 802698B0 E640000C */  swc1      $f0, 0xC($s2)
/* 198194 802698B4 8E220000 */  lw        $v0, 0x0($s1)
/* 198198 802698B8 30420800 */  andi      $v0, $v0, 0x800
/* 19819C 802698BC 14400006 */  bnez      $v0, .L802698D8
/* 1981A0 802698C0 00000000 */   nop
/* 1981A4 802698C4 84820016 */  lh        $v0, 0x16($a0)
/* 1981A8 802698C8 8483006E */  lh        $v1, 0x6E($a0)
/* 1981AC 802698CC C6200188 */  lwc1      $f0, 0x188($s1)
/* 1981B0 802698D0 0809A63B */  j         .L802698EC
/* 1981B4 802698D4 00431021 */   addu     $v0, $v0, $v1
.L802698D8:
/* 1981B8 802698D8 84820016 */  lh        $v0, 0x16($a0)
/* 1981BC 802698DC 8483006E */  lh        $v1, 0x6E($a0)
/* 1981C0 802698E0 C6200188 */  lwc1      $f0, 0x188($s1)
/* 1981C4 802698E4 00021023 */  negu      $v0, $v0
/* 1981C8 802698E8 00431023 */  subu      $v0, $v0, $v1
.L802698EC:
/* 1981CC 802698EC 44821000 */  mtc1      $v0, $f2
/* 1981D0 802698F0 00000000 */  nop
/* 1981D4 802698F4 468010A0 */  cvt.s.w   $f2, $f2
/* 1981D8 802698F8 46001082 */  mul.s     $f2, $f2, $f0
/* 1981DC 802698FC 00000000 */  nop
/* 1981E0 80269900 C6200148 */  lwc1      $f0, 0x148($s1)
/* 1981E4 80269904 46020000 */  add.s     $f0, $f0, $f2
/* 1981E8 80269908 E6400010 */  swc1      $f0, 0x10($s2)
/* 1981EC 8026990C 84820018 */  lh        $v0, 0x18($a0)
/* 1981F0 80269910 C620014C */  lwc1      $f0, 0x14C($s1)
/* 1981F4 80269914 44821000 */  mtc1      $v0, $f2
/* 1981F8 80269918 00000000 */  nop
/* 1981FC 8026991C 468010A0 */  cvt.s.w   $f2, $f2
/* 198200 80269920 0809A66A */  j         .L802699A8
/* 198204 80269924 46020000 */   add.s    $f0, $f0, $f2
.L80269928:
/* 198208 80269928 8482006C */  lh        $v0, 0x6C($a0)
/* 19820C 8026992C C480002C */  lwc1      $f0, 0x2C($a0)
/* 198210 80269930 44821000 */  mtc1      $v0, $f2
/* 198214 80269934 00000000 */  nop
/* 198218 80269938 468010A0 */  cvt.s.w   $f2, $f2
/* 19821C 8026993C 46020000 */  add.s     $f0, $f0, $f2
/* 198220 80269940 E640000C */  swc1      $f0, 0xC($s2)
/* 198224 80269944 8E220000 */  lw        $v0, 0x0($s1)
/* 198228 80269948 30420800 */  andi      $v0, $v0, 0x800
/* 19822C 8026994C 1440000B */  bnez      $v0, .L8026997C
/* 198230 80269950 00000000 */   nop
/* 198234 80269954 8482006E */  lh        $v0, 0x6E($a0)
/* 198238 80269958 C6200188 */  lwc1      $f0, 0x188($s1)
/* 19823C 8026995C 44821000 */  mtc1      $v0, $f2
/* 198240 80269960 00000000 */  nop
/* 198244 80269964 468010A0 */  cvt.s.w   $f2, $f2
/* 198248 80269968 46001082 */  mul.s     $f2, $f2, $f0
/* 19824C 8026996C 00000000 */  nop
/* 198250 80269970 C4800030 */  lwc1      $f0, 0x30($a0)
/* 198254 80269974 0809A668 */  j         .L802699A0
/* 198258 80269978 46020000 */   add.s    $f0, $f0, $f2
.L8026997C:
/* 19825C 8026997C 8482006E */  lh        $v0, 0x6E($a0)
/* 198260 80269980 C6200188 */  lwc1      $f0, 0x188($s1)
/* 198264 80269984 44821000 */  mtc1      $v0, $f2
/* 198268 80269988 00000000 */  nop
/* 19826C 8026998C 468010A0 */  cvt.s.w   $f2, $f2
/* 198270 80269990 46001082 */  mul.s     $f2, $f2, $f0
/* 198274 80269994 00000000 */  nop
/* 198278 80269998 C4800030 */  lwc1      $f0, 0x30($a0)
/* 19827C 8026999C 46020001 */  sub.s     $f0, $f0, $f2
.L802699A0:
/* 198280 802699A0 E6400010 */  swc1      $f0, 0x10($s2)
/* 198284 802699A4 C4800034 */  lwc1      $f0, 0x34($a0)
.L802699A8:
/* 198288 802699A8 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 19828C 802699AC 44811000 */  mtc1      $at, $f2
/* 198290 802699B0 00000000 */  nop
/* 198294 802699B4 46020000 */  add.s     $f0, $f0, $f2
/* 198298 802699B8 E6400014 */  swc1      $f0, 0x14($s2)
.L802699BC:
/* 19829C 802699BC 8FBF0020 */  lw        $ra, 0x20($sp)
/* 1982A0 802699C0 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1982A4 802699C4 8FB20018 */  lw        $s2, 0x18($sp)
/* 1982A8 802699C8 8FB10014 */  lw        $s1, 0x14($sp)
/* 1982AC 802699CC 8FB00010 */  lw        $s0, 0x10($sp)
/* 1982B0 802699D0 03E00008 */  jr        $ra
/* 1982B4 802699D4 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void set_goal_pos_to_part(ActorState* state, s32 actorID, s32 partID) {
    s32 actorClass = actorID & ACTOR_CLASS_MASK;
    Actor* actor = get_actor(actorID);
    ActorPart* part;

    switch (actorClass) {
        case ACTOR_CLASS_PLAYER:
            part = get_actor_part(actor, 0);
            state->goalPos.x = actor->currentPos.x + part->partOffset.x * actor->scalingFactor;
            state->goalPos.y = actor->currentPos.y + part->partOffset.y * actor->scalingFactor;
            state->goalPos.z = actor->currentPos.z + 10.0f;
            if (actor->stoneStatus == STATUS_KEY_STONE) {
                state->goalPos.y -= actor->scalingFactor * 5.0f;
            }
            break;
        case ACTOR_CLASS_PARTNER:
        case ACTOR_CLASS_ENEMY:
            part = get_actor_part(actor, partID);
            if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) {
                state->goalPos.x = actor->currentPos.x + (part->partOffset.x + part->targetOffset.x) * actor->scalingFactor;
                if (!(actor->flags & ACTOR_PART_FLAG_800)) {
                    state->goalPos.y = actor->currentPos.y + (part->partOffset.y + part->targetOffset.y) * actor->scalingFactor;
                } else {
                    state->goalPos.y = actor->currentPos.y + (-part->partOffset.y - part->targetOffset.y) * actor->scalingFactor;
                }
                state->goalPos.z = actor->currentPos.z + part->partOffset.z + 10.0f;
            } else {
                state->goalPos.x = part->absolutePosition.x + part->targetOffset.x;
                if (!(actor->flags & ACTOR_PART_FLAG_800)) {
                    state->goalPos.y = part->absolutePosition.y + part->targetOffset.y * actor->scalingFactor;
                } else {
                    state->goalPos.y = part->absolutePosition.y - part->targetOffset.y * actor->scalingFactor;
                }
                state->goalPos.z = part->absolutePosition.z + 10.0f;
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel VirtualEntityJumpTo
/* F8608 802D3C58 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* F860C 802D3C5C AFB20018 */  sw        $s2, 0x18($sp)
/* F8610 802D3C60 0080902D */  daddu     $s2, $a0, $zero
/* F8614 802D3C64 AFBF001C */  sw        $ra, 0x1C($sp)
/* F8618 802D3C68 AFB10014 */  sw        $s1, 0x14($sp)
/* F861C 802D3C6C AFB00010 */  sw        $s0, 0x10($sp)
/* F8620 802D3C70 F7BC0040 */  sdc1      $f28, 0x40($sp)
/* F8624 802D3C74 F7BA0038 */  sdc1      $f26, 0x38($sp)
/* F8628 802D3C78 F7B80030 */  sdc1      $f24, 0x30($sp)
/* F862C 802D3C7C F7B60028 */  sdc1      $f22, 0x28($sp)
/* F8630 802D3C80 F7B40020 */  sdc1      $f20, 0x20($sp)
/* F8634 802D3C84 8E51000C */  lw        $s1, 0xC($s2)
/* F8638 802D3C88 54A00001 */  bnel      $a1, $zero, .L802D3C90
/* F863C 802D3C8C AE400070 */   sw       $zero, 0x70($s2)
.L802D3C90:
/* F8640 802D3C90 8E420070 */  lw        $v0, 0x70($s2)
/* F8644 802D3C94 14400058 */  bnez      $v0, .L802D3DF8
/* F8648 802D3C98 00000000 */   nop
/* F864C 802D3C9C 8E250000 */  lw        $a1, 0x0($s1)
/* F8650 802D3CA0 26310004 */  addiu     $s1, $s1, 0x4
/* F8654 802D3CA4 0C0B1EAF */  jal       evt_get_variable
/* F8658 802D3CA8 0240202D */   daddu    $a0, $s2, $zero
/* F865C 802D3CAC 8E250000 */  lw        $a1, 0x0($s1)
/* F8660 802D3CB0 26310004 */  addiu     $s1, $s1, 0x4
/* F8664 802D3CB4 0240202D */  daddu     $a0, $s2, $zero
/* F8668 802D3CB8 0C0B1EAF */  jal       evt_get_variable
/* F866C 802D3CBC 0040802D */   daddu    $s0, $v0, $zero
/* F8670 802D3CC0 4482D000 */  mtc1      $v0, $f26
/* F8674 802D3CC4 00000000 */  nop
/* F8678 802D3CC8 4680D6A0 */  cvt.s.w   $f26, $f26
/* F867C 802D3CCC 8E250000 */  lw        $a1, 0x0($s1)
/* F8680 802D3CD0 26310004 */  addiu     $s1, $s1, 0x4
/* F8684 802D3CD4 0C0B1EAF */  jal       evt_get_variable
/* F8688 802D3CD8 0240202D */   daddu    $a0, $s2, $zero
/* F868C 802D3CDC 4482E000 */  mtc1      $v0, $f28
/* F8690 802D3CE0 00000000 */  nop
/* F8694 802D3CE4 4680E720 */  cvt.s.w   $f28, $f28
/* F8698 802D3CE8 8E250000 */  lw        $a1, 0x0($s1)
/* F869C 802D3CEC 26310004 */  addiu     $s1, $s1, 0x4
/* F86A0 802D3CF0 0C0B1EAF */  jal       evt_get_variable
/* F86A4 802D3CF4 0240202D */   daddu    $a0, $s2, $zero
/* F86A8 802D3CF8 4482C000 */  mtc1      $v0, $f24
/* F86AC 802D3CFC 00000000 */  nop
/* F86B0 802D3D00 4680C620 */  cvt.s.w   $f24, $f24
/* F86B4 802D3D04 8E250000 */  lw        $a1, 0x0($s1)
/* F86B8 802D3D08 0C0B1EAF */  jal       evt_get_variable
/* F86BC 802D3D0C 0240202D */   daddu    $a0, $s2, $zero
/* F86C0 802D3D10 3C04802E */  lui       $a0, %hi(gCurrentVirtualEntityListPtr)
/* F86C4 802D3D14 8C84B7C0 */  lw        $a0, %lo(gCurrentVirtualEntityListPtr)($a0)
/* F86C8 802D3D18 00101880 */  sll       $v1, $s0, 2
/* F86CC 802D3D1C 00641821 */  addu      $v1, $v1, $a0
/* F86D0 802D3D20 8C710000 */  lw        $s1, 0x0($v1)
/* F86D4 802D3D24 AE500074 */  sw        $s0, 0x74($s2)
/* F86D8 802D3D28 E63A0028 */  swc1      $f26, 0x28($s1)
/* F86DC 802D3D2C C63A0004 */  lwc1      $f26, 0x4($s1)
/* F86E0 802D3D30 E63C002C */  swc1      $f28, 0x2C($s1)
/* F86E4 802D3D34 C63C0008 */  lwc1      $f28, 0x8($s1)
/* F86E8 802D3D38 E6380030 */  swc1      $f24, 0x30($s1)
/* F86EC 802D3D3C C638000C */  lwc1      $f24, 0xC($s1)
/* F86F0 802D3D40 C6360028 */  lwc1      $f22, 0x28($s1)
/* F86F4 802D3D44 C6340030 */  lwc1      $f20, 0x30($s1)
/* F86F8 802D3D48 44820000 */  mtc1      $v0, $f0
/* F86FC 802D3D4C 00000000 */  nop
/* F8700 802D3D50 46800020 */  cvt.s.w   $f0, $f0
/* F8704 802D3D54 E6200048 */  swc1      $f0, 0x48($s1)
/* F8708 802D3D58 C620002C */  lwc1      $f0, 0x2C($s1)
/* F870C 802D3D5C 4600D306 */  mov.s     $f12, $f26
/* F8710 802D3D60 4600C386 */  mov.s     $f14, $f24
/* F8714 802D3D64 4406B000 */  mfc1      $a2, $f22
/* F8718 802D3D68 4407A000 */  mfc1      $a3, $f20
/* F871C 802D3D6C 0C00A720 */  jal       atan2
/* F8720 802D3D70 461C0701 */   sub.s    $f28, $f0, $f28
/* F8724 802D3D74 4600D306 */  mov.s     $f12, $f26
/* F8728 802D3D78 4406B000 */  mfc1      $a2, $f22
/* F872C 802D3D7C 4407A000 */  mfc1      $a3, $f20
/* F8730 802D3D80 4600C386 */  mov.s     $f14, $f24
/* F8734 802D3D84 0C00A7B5 */  jal       dist2D
/* F8738 802D3D88 E6200038 */   swc1     $f0, 0x38($s1)
/* F873C 802D3D8C C6260048 */  lwc1      $f6, 0x48($s1)
/* F8740 802D3D90 44801000 */  mtc1      $zero, $f2
/* F8744 802D3D94 46000106 */  mov.s     $f4, $f0
/* F8748 802D3D98 46023032 */  c.eq.s    $f6, $f2
/* F874C 802D3D9C 00000000 */  nop
/* F8750 802D3DA0 45000005 */  bc1f      .L802D3DB8
/* F8754 802D3DA4 E6240034 */   swc1     $f4, 0x34($s1)
/* F8758 802D3DA8 C620003C */  lwc1      $f0, 0x3C($s1)
/* F875C 802D3DAC 46002003 */  div.s     $f0, $f4, $f0
/* F8760 802D3DB0 080B4F70 */  j         .L802D3DC0
/* F8764 802D3DB4 E6200048 */   swc1     $f0, 0x48($s1)
.L802D3DB8:
/* F8768 802D3DB8 46062003 */  div.s     $f0, $f4, $f6
/* F876C 802D3DBC E620003C */  swc1      $f0, 0x3C($s1)
.L802D3DC0:
/* F8770 802D3DC0 C6200040 */  lwc1      $f0, 0x40($s1)
/* F8774 802D3DC4 C6220048 */  lwc1      $f2, 0x48($s1)
/* F8778 802D3DC8 46020002 */  mul.s     $f0, $f0, $f2
/* F877C 802D3DCC 00000000 */  nop
/* F8780 802D3DD0 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* F8784 802D3DD4 44812000 */  mtc1      $at, $f4
/* F8788 802D3DD8 00000000 */  nop
/* F878C 802D3DDC 46040002 */  mul.s     $f0, $f0, $f4
/* F8790 802D3DE0 00000000 */  nop
/* F8794 802D3DE4 4602E083 */  div.s     $f2, $f28, $f2
/* F8798 802D3DE8 46020000 */  add.s     $f0, $f0, $f2
/* F879C 802D3DEC 24020001 */  addiu     $v0, $zero, 0x1
/* F87A0 802D3DF0 E6200044 */  swc1      $f0, 0x44($s1)
/* F87A4 802D3DF4 AE420070 */  sw        $v0, 0x70($s2)
.L802D3DF8:
/* F87A8 802D3DF8 8E420074 */  lw        $v0, 0x74($s2)
/* F87AC 802D3DFC 3C03802E */  lui       $v1, %hi(gCurrentVirtualEntityListPtr)
/* F87B0 802D3E00 8C63B7C0 */  lw        $v1, %lo(gCurrentVirtualEntityListPtr)($v1)
/* F87B4 802D3E04 00021080 */  sll       $v0, $v0, 2
/* F87B8 802D3E08 00431021 */  addu      $v0, $v0, $v1
/* F87BC 802D3E0C 8C510000 */  lw        $s1, 0x0($v0)
/* F87C0 802D3E10 C6240008 */  lwc1      $f4, 0x8($s1)
/* F87C4 802D3E14 C6200044 */  lwc1      $f0, 0x44($s1)
/* F87C8 802D3E18 8E25003C */  lw        $a1, 0x3C($s1)
/* F87CC 802D3E1C 46002100 */  add.s     $f4, $f4, $f0
/* F87D0 802D3E20 C6220040 */  lwc1      $f2, 0x40($s1)
/* F87D4 802D3E24 8E260038 */  lw        $a2, 0x38($s1)
/* F87D8 802D3E28 46020001 */  sub.s     $f0, $f0, $f2
/* F87DC 802D3E2C 0220202D */  daddu     $a0, $s1, $zero
/* F87E0 802D3E30 E6240008 */  swc1      $f4, 0x8($s1)
/* F87E4 802D3E34 0C0B4BCD */  jal       virtual_entity_move_polar
/* F87E8 802D3E38 E6200044 */   swc1     $f0, 0x44($s1)
/* F87EC 802D3E3C C6200048 */  lwc1      $f0, 0x48($s1)
/* F87F0 802D3E40 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F87F4 802D3E44 44811000 */  mtc1      $at, $f2
/* F87F8 802D3E48 00000000 */  nop
/* F87FC 802D3E4C 46020001 */  sub.s     $f0, $f0, $f2
/* F8800 802D3E50 44801000 */  mtc1      $zero, $f2
/* F8804 802D3E54 00000000 */  nop
/* F8808 802D3E58 4602003E */  c.le.s    $f0, $f2
/* F880C 802D3E5C 00000000 */  nop
/* F8810 802D3E60 45010003 */  bc1t      .L802D3E70
/* F8814 802D3E64 E6200048 */   swc1     $f0, 0x48($s1)
/* F8818 802D3E68 080B4FA3 */  j         .L802D3E8C
/* F881C 802D3E6C 0000102D */   daddu    $v0, $zero, $zero
.L802D3E70:
/* F8820 802D3E70 C6200028 */  lwc1      $f0, 0x28($s1)
/* F8824 802D3E74 C622002C */  lwc1      $f2, 0x2C($s1)
/* F8828 802D3E78 C6240030 */  lwc1      $f4, 0x30($s1)
/* F882C 802D3E7C 24020001 */  addiu     $v0, $zero, 0x1
/* F8830 802D3E80 E6200004 */  swc1      $f0, 0x4($s1)
/* F8834 802D3E84 E6220008 */  swc1      $f2, 0x8($s1)
/* F8838 802D3E88 E624000C */  swc1      $f4, 0xC($s1)
.L802D3E8C:
/* F883C 802D3E8C 8FBF001C */  lw        $ra, 0x1C($sp)
/* F8840 802D3E90 8FB20018 */  lw        $s2, 0x18($sp)
/* F8844 802D3E94 8FB10014 */  lw        $s1, 0x14($sp)
/* F8848 802D3E98 8FB00010 */  lw        $s0, 0x10($sp)
/* F884C 802D3E9C D7BC0040 */  ldc1      $f28, 0x40($sp)
/* F8850 802D3EA0 D7BA0038 */  ldc1      $f26, 0x38($sp)
/* F8854 802D3EA4 D7B80030 */  ldc1      $f24, 0x30($sp)
/* F8858 802D3EA8 D7B60028 */  ldc1      $f22, 0x28($sp)
/* F885C 802D3EAC D7B40020 */  ldc1      $f20, 0x20($sp)
/* F8860 802D3EB0 03E00008 */  jr        $ra
/* F8864 802D3EB4 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

ApiStatus VirtualEntityJumpTo(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    VirtualEntity* virtualEntity;
    s32 index;
    f32 xTemp;
    f32 yTemp;
    f32 zTemp;
    s32 moveTime;
    f32 goalPosX;
    f32 goalPosY;
    f32 goalPosZ;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
    }

    if (script->functionTemp[0] == 0) {
        index = evt_get_variable(script, *args++);
        xTemp = evt_get_variable(script, *args++);
        yTemp = evt_get_variable(script, *args++);
        zTemp = evt_get_variable(script, *args++);
        moveTime = evt_get_variable(script, *args++);

        virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
        script->functionTemp[1] = index;

        virtualEntity->goalPos.x = xTemp;
        virtualEntity->goalPos.y = yTemp;
        virtualEntity->goalPos.z = zTemp;

        xTemp = virtualEntity->pos.x;
        yTemp = virtualEntity->pos.y;
        zTemp = virtualEntity->pos.z;

        goalPosX = virtualEntity->goalPos.x;
        yTemp = virtualEntity->goalPos.y - yTemp;
        goalPosZ = virtualEntity->goalPos.z;

        virtualEntity->moveTime = moveTime;
        virtualEntity->moveAngle = atan2(xTemp, zTemp, goalPosX, goalPosZ);
        virtualEntity->moveDist = dist2D(xTemp, zTemp, goalPosX, goalPosZ);

        if (virtualEntity->moveTime == 0.0f) {
            virtualEntity->moveTime = virtualEntity->moveDist / virtualEntity->moveSpeed;
        } else {
            virtualEntity->moveSpeed = virtualEntity->moveDist / virtualEntity->moveTime;
        }

        virtualEntity->jumpVelocity = (virtualEntity->jumpGravity * virtualEntity->moveTime / 2) +
                                      (yTemp / virtualEntity->moveTime);
        script->functionTemp[0] = 1;
    }

    virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]];
    virtualEntity->pos.y += virtualEntity->jumpVelocity;
    virtualEntity->jumpVelocity -= virtualEntity->jumpGravity;

    virtual_entity_move_polar(virtualEntity, virtualEntity->moveSpeed, virtualEntity->moveAngle);

    virtualEntity->moveTime -= 1.0f;
    if (virtualEntity->moveTime <= 0.0f) {
        virtualEntity->pos.x = virtualEntity->goalPos.x;
        virtualEntity->pos.y = virtualEntity->goalPos.y;
        virtualEntity->pos.z = virtualEntity->goalPos.z;
        return ApiStatus_DONE1;
    }

    return ApiStatus_BLOCK;
}