### RAW ASSEMBLY INSTRUCTIONS:

glabel ice_pillar_appendGfx
/* 409F08 E011E578 27BDFF50 */  addiu     $sp, $sp, -0xB0
/* 409F0C E011E57C 0080302D */  daddu     $a2, $a0, $zero
/* 409F10 E011E580 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 409F14 E011E584 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 409F18 E011E588 27A40010 */  addiu     $a0, $sp, 0x10
/* 409F1C E011E58C AFB500A4 */  sw        $s5, 0xA4($sp)
/* 409F20 E011E590 3C150001 */  lui       $s5, (0x11630 >> 16)
/* 409F24 E011E594 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* 409F28 E011E598 AFB3009C */  sw        $s3, 0x9C($sp)
/* 409F2C E011E59C 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 409F30 E011E5A0 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 409F34 E011E5A4 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 409F38 E011E5A8 AFBF00AC */  sw        $ra, 0xAC($sp)
/* 409F3C E011E5AC AFB600A8 */  sw        $s6, 0xA8($sp)
/* 409F40 E011E5B0 AFB400A0 */  sw        $s4, 0xA0($sp)
/* 409F44 E011E5B4 AFB20098 */  sw        $s2, 0x98($sp)
/* 409F48 E011E5B8 AFB10094 */  sw        $s1, 0x94($sp)
/* 409F4C E011E5BC AFB00090 */  sw        $s0, 0x90($sp)
/* 409F50 E011E5C0 8E650000 */  lw        $a1, 0x0($s3)
/* 409F54 E011E5C4 8CD2000C */  lw        $s2, 0xC($a2)
/* 409F58 E011E5C8 00A0182D */  daddu     $v1, $a1, $zero
/* 409F5C E011E5CC 9256001B */  lbu       $s6, 0x1B($s2)
/* 409F60 E011E5D0 24A50008 */  addiu     $a1, $a1, 0x8
/* 409F64 E011E5D4 AE650000 */  sw        $a1, 0x0($s3)
/* 409F68 E011E5D8 AC620000 */  sw        $v0, 0x0($v1)
/* 409F6C E011E5DC AC600004 */  sw        $zero, 0x4($v1)
/* 409F70 E011E5E0 ACA70000 */  sw        $a3, 0x0($a1)
/* 409F74 E011E5E4 8CC30010 */  lw        $v1, 0x10($a2)
/* 409F78 E011E5E8 24A20008 */  addiu     $v0, $a1, 0x8
/* 409F7C E011E5EC AE620000 */  sw        $v0, 0x0($s3)
/* 409F80 E011E5F0 8C62001C */  lw        $v0, 0x1C($v1)
/* 409F84 E011E5F4 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 409F88 E011E5F8 00431021 */  addu      $v0, $v0, $v1
/* 409F8C E011E5FC 3C03800B */  lui       $v1, %hi(gCameras)
/* 409F90 E011E600 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
/* 409F94 E011E604 ACA20004 */  sw        $v0, 0x4($a1)
/* 409F98 E011E608 8E450004 */  lw        $a1, 0x4($s2)
/* 409F9C E011E60C 8E460008 */  lw        $a2, 0x8($s2)
/* 409FA0 E011E610 3C028007 */  lui       $v0, %hi(gCurrentCameraID)
/* 409FA4 E011E614 8C427410 */  lw        $v0, %lo(gCurrentCameraID)($v0)
/* 409FA8 E011E618 8E47000C */  lw        $a3, 0xC($s2)
/* 409FAC E011E61C 00028080 */  sll       $s0, $v0, 2
/* 409FB0 E011E620 02028021 */  addu      $s0, $s0, $v0
/* 409FB4 E011E624 00108080 */  sll       $s0, $s0, 2
/* 409FB8 E011E628 02028023 */  subu      $s0, $s0, $v0
/* 409FBC E011E62C 001010C0 */  sll       $v0, $s0, 3
/* 409FC0 E011E630 02028021 */  addu      $s0, $s0, $v0
/* 409FC4 E011E634 001080C0 */  sll       $s0, $s0, 3
/* 409FC8 E011E638 0C080108 */  jal       shim_guTranslateF
/* 409FCC E011E63C 02038021 */   addu     $s0, $s0, $v1
/* 409FD0 E011E640 27B10050 */  addiu     $s1, $sp, 0x50
/* 409FD4 E011E644 8E450020 */  lw        $a1, 0x20($s2)
/* 409FD8 E011E648 0220202D */  daddu     $a0, $s1, $zero
/* 409FDC E011E64C 00A0302D */  daddu     $a2, $a1, $zero
/* 409FE0 E011E650 0C080110 */  jal       shim_guScaleF
/* 409FE4 E011E654 00A0382D */   daddu    $a3, $a1, $zero
/* 409FE8 E011E658 0220202D */  daddu     $a0, $s1, $zero
/* 409FEC E011E65C 27A50010 */  addiu     $a1, $sp, 0x10
/* 409FF0 E011E660 0C080114 */  jal       shim_guMtxCatF
/* 409FF4 E011E664 00A0302D */   daddu    $a2, $a1, $zero
/* 409FF8 E011E668 27A40010 */  addiu     $a0, $sp, 0x10
/* 409FFC E011E66C 3C118007 */  lui       $s1, %hi(gMatrixListPos)
/* 40A000 E011E670 263141F0 */  addiu     $s1, $s1, %lo(gMatrixListPos)
/* 40A004 E011E674 3C14800A */  lui       $s4, %hi(gDisplayContext)
/* 40A008 E011E678 2694A674 */  addiu     $s4, $s4, %lo(gDisplayContext)
/* 40A00C E011E67C 96250000 */  lhu       $a1, 0x0($s1)
/* 40A010 E011E680 8E820000 */  lw        $v0, 0x0($s4)
/* 40A014 E011E684 00052980 */  sll       $a1, $a1, 6
/* 40A018 E011E688 00B52821 */  addu      $a1, $a1, $s5
/* 40A01C E011E68C 0C080118 */  jal       shim_guMtxF2L
/* 40A020 E011E690 00452821 */   addu     $a1, $v0, $a1
/* 40A024 E011E694 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 40A028 E011E698 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 40A02C E011E69C 3C06DA38 */  lui       $a2, (0xDA380001 >> 16)
/* 40A030 E011E6A0 34C60001 */  ori       $a2, $a2, (0xDA380001 & 0xFFFF)
/* 40A034 E011E6A4 3C07DE00 */  lui       $a3, (0xDE000000 >> 16)
/* 40A038 E011E6A8 8E640000 */  lw        $a0, 0x0($s3)
/* 40A03C E011E6AC 96220000 */  lhu       $v0, 0x0($s1)
/* 40A040 E011E6B0 0080282D */  daddu     $a1, $a0, $zero
/* 40A044 E011E6B4 24840008 */  addiu     $a0, $a0, 0x8
/* 40A048 E011E6B8 AE640000 */  sw        $a0, 0x0($s3)
/* 40A04C E011E6BC ACA30000 */  sw        $v1, 0x0($a1)
/* 40A050 E011E6C0 24430001 */  addiu     $v1, $v0, 0x1
/* 40A054 E011E6C4 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 40A058 E011E6C8 00021180 */  sll       $v0, $v0, 6
/* 40A05C E011E6CC A6230000 */  sh        $v1, 0x0($s1)
/* 40A060 E011E6D0 8E830000 */  lw        $v1, 0x0($s4)
/* 40A064 E011E6D4 00551021 */  addu      $v0, $v0, $s5
/* 40A068 E011E6D8 00621821 */  addu      $v1, $v1, $v0
/* 40A06C E011E6DC 24820008 */  addiu     $v0, $a0, 0x8
/* 40A070 E011E6E0 ACA30004 */  sw        $v1, 0x4($a1)
/* 40A074 E011E6E4 AE620000 */  sw        $v0, 0x0($s3)
/* 40A078 E011E6E8 24820010 */  addiu     $v0, $a0, 0x10
/* 40A07C E011E6EC AC860000 */  sw        $a2, 0x0($a0)
/* 40A080 E011E6F0 AE620000 */  sw        $v0, 0x0($s3)
/* 40A084 E011E6F4 8E030204 */  lw        $v1, 0x204($s0)
/* 40A088 E011E6F8 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 40A08C E011E6FC AC820008 */  sw        $v0, 0x8($a0)
/* 40A090 E011E700 AC830004 */  sw        $v1, 0x4($a0)
/* 40A094 E011E704 92420018 */  lbu       $v0, 0x18($s2)
/* 40A098 E011E708 92450019 */  lbu       $a1, 0x19($s2)
/* 40A09C E011E70C 9246001A */  lbu       $a2, 0x1A($s2)
/* 40A0A0 E011E710 24830018 */  addiu     $v1, $a0, 0x18
/* 40A0A4 E011E714 AE630000 */  sw        $v1, 0x0($s3)
/* 40A0A8 E011E718 3C03FB00 */  lui       $v1, (0xFB000000 >> 16)
/* 40A0AC E011E71C AC830010 */  sw        $v1, 0x10($a0)
/* 40A0B0 E011E720 00021600 */  sll       $v0, $v0, 24
/* 40A0B4 E011E724 00052C00 */  sll       $a1, $a1, 16
/* 40A0B8 E011E728 00451025 */  or        $v0, $v0, $a1
/* 40A0BC E011E72C 00063200 */  sll       $a2, $a2, 8
/* 40A0C0 E011E730 00461025 */  or        $v0, $v0, $a2
/* 40A0C4 E011E734 00561025 */  or        $v0, $v0, $s6
/* 40A0C8 E011E738 AC82000C */  sw        $v0, 0xC($a0)
/* 40A0CC E011E73C 9242001C */  lbu       $v0, 0x1C($s2)
/* 40A0D0 E011E740 9245001D */  lbu       $a1, 0x1D($s2)
/* 40A0D4 E011E744 9246001E */  lbu       $a2, 0x1E($s2)
/* 40A0D8 E011E748 9248001F */  lbu       $t0, 0x1F($s2)
/* 40A0DC E011E74C 24830020 */  addiu     $v1, $a0, 0x20
/* 40A0E0 E011E750 AE630000 */  sw        $v1, 0x0($s3)
/* 40A0E4 E011E754 AC870018 */  sw        $a3, 0x18($a0)
/* 40A0E8 E011E758 00021600 */  sll       $v0, $v0, 24
/* 40A0EC E011E75C 00052C00 */  sll       $a1, $a1, 16
/* 40A0F0 E011E760 00451025 */  or        $v0, $v0, $a1
/* 40A0F4 E011E764 00063200 */  sll       $a2, $a2, 8
/* 40A0F8 E011E768 00461025 */  or        $v0, $v0, $a2
/* 40A0FC E011E76C 00481025 */  or        $v0, $v0, $t0
/* 40A100 E011E770 AC820014 */  sw        $v0, 0x14($a0)
/* 40A104 E011E774 3C03E012 */  lui       $v1, (0xE0120000 >> 16)
/* 40A108 E011E778 8C63E800 */  lw        $v1, -0x1800($v1)
/* 40A10C E011E77C 24820028 */  addiu     $v0, $a0, 0x28
/* 40A110 E011E780 AE620000 */  sw        $v0, 0x0($s3)
/* 40A114 E011E784 AC870020 */  sw        $a3, 0x20($a0)
/* 40A118 E011E788 AC83001C */  sw        $v1, 0x1C($a0)
/* 40A11C E011E78C 82420024 */  lb        $v0, 0x24($s2)
/* 40A120 E011E790 3C03D838 */  lui       $v1, (0xD8380002 >> 16)
/* 40A124 E011E794 00021080 */  sll       $v0, $v0, 2
/* 40A128 E011E798 3C01E012 */  lui       $at, (0xE0120000 >> 16)
/* 40A12C E011E79C 00220821 */  addu      $at, $at, $v0
/* 40A130 E011E7A0 8C22E7F0 */  lw        $v0, -0x1810($at)
/* 40A134 E011E7A4 34630002 */  ori       $v1, $v1, (0xD8380002 & 0xFFFF)
/* 40A138 E011E7A8 AC820024 */  sw        $v0, 0x24($a0)
/* 40A13C E011E7AC 24820030 */  addiu     $v0, $a0, 0x30
/* 40A140 E011E7B0 AE620000 */  sw        $v0, 0x0($s3)
/* 40A144 E011E7B4 24020040 */  addiu     $v0, $zero, 0x40
/* 40A148 E011E7B8 AC830028 */  sw        $v1, 0x28($a0)
/* 40A14C E011E7BC AC82002C */  sw        $v0, 0x2C($a0)
/* 40A150 E011E7C0 8FBF00AC */  lw        $ra, 0xAC($sp)
/* 40A154 E011E7C4 8FB600A8 */  lw        $s6, 0xA8($sp)
/* 40A158 E011E7C8 8FB500A4 */  lw        $s5, 0xA4($sp)
/* 40A15C E011E7CC 8FB400A0 */  lw        $s4, 0xA0($sp)
/* 40A160 E011E7D0 8FB3009C */  lw        $s3, 0x9C($sp)
/* 40A164 E011E7D4 8FB20098 */  lw        $s2, 0x98($sp)
/* 40A168 E011E7D8 8FB10094 */  lw        $s1, 0x94($sp)
/* 40A16C E011E7DC 8FB00090 */  lw        $s0, 0x90($sp)
/* 40A170 E011E7E0 03E00008 */  jr        $ra
/* 40A174 E011E7E4 27BD00B0 */   addiu    $sp, $sp, 0xB0
/* 40A178 E011E7E8 00000000 */  nop
/* 40A17C E011E7EC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void ice_pillar_appendGfx(void* effect) {
    IcePillarFXData* data = ((EffectInstance*)effect)->data.icePillar;
    s32 alpha = data->prim.a;
    Matrix4f sp10, sp50;
    Camera* camera;

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

    camera = &gCameras[gCurrentCameraID];
    shim_guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z);
    shim_guScaleF(sp50, data->scale, data->scale, data->scale);
    shim_guMtxCatF(sp50, sp10, sp10);
    shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
              G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->prim.r, data->prim.g, data->prim.b, alpha);
    gDPSetEnvColor(gMainGfxPos++, data->env.r, data->env.g, data->env.b, data->env.a);
    gSPDisplayList(gMainGfxPos++, D_E011E800[0]);
    gSPDisplayList(gMainGfxPos++, D_E011E7F0[data->unk_24]);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel flower_trail_main
/* 32DF14 E0012204 27BDFF90 */  addiu     $sp, $sp, -0x70
/* 32DF18 E0012208 F7BE0068 */  sdc1      $f30, 0x68($sp)
/* 32DF1C E001220C 4485F000 */  mtc1      $a1, $f30
/* 32DF20 E0012210 AFB40038 */  sw        $s4, 0x38($sp)
/* 32DF24 E0012214 0080A02D */  daddu     $s4, $a0, $zero
/* 32DF28 E0012218 F7BA0058 */  sdc1      $f26, 0x58($sp)
/* 32DF2C E001221C C7BA0080 */  lwc1      $f26, 0x80($sp)
/* 32DF30 E0012220 27A40010 */  addiu     $a0, $sp, 0x10
/* 32DF34 E0012224 F7BC0060 */  sdc1      $f28, 0x60($sp)
/* 32DF38 E0012228 C7BC0084 */  lwc1      $f28, 0x84($sp)
/* 32DF3C E001222C 3C02E001 */  lui       $v0, %hi(flower_trail_init)
/* 32DF40 E0012230 24422440 */  addiu     $v0, $v0, %lo(flower_trail_init)
/* 32DF44 E0012234 AFA20018 */  sw        $v0, 0x18($sp)
/* 32DF48 E0012238 3C02E001 */  lui       $v0, %hi(flower_trail_update)
/* 32DF4C E001223C 24422448 */  addiu     $v0, $v0, %lo(flower_trail_update)
/* 32DF50 E0012240 AFA2001C */  sw        $v0, 0x1C($sp)
/* 32DF54 E0012244 3C02E001 */  lui       $v0, %hi(flower_trail_render)
/* 32DF58 E0012248 24422504 */  addiu     $v0, $v0, %lo(flower_trail_render)
/* 32DF5C E001224C AFA20020 */  sw        $v0, 0x20($sp)
/* 32DF60 E0012250 24020009 */  addiu     $v0, $zero, 0x9
/* 32DF64 E0012254 AFBF003C */  sw        $ra, 0x3C($sp)
/* 32DF68 E0012258 AFB30034 */  sw        $s3, 0x34($sp)
/* 32DF6C E001225C AFB20030 */  sw        $s2, 0x30($sp)
/* 32DF70 E0012260 AFB1002C */  sw        $s1, 0x2C($sp)
/* 32DF74 E0012264 AFB00028 */  sw        $s0, 0x28($sp)
/* 32DF78 E0012268 F7B80050 */  sdc1      $f24, 0x50($sp)
/* 32DF7C E001226C F7B60048 */  sdc1      $f22, 0x48($sp)
/* 32DF80 E0012270 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 32DF84 E0012274 AFA60078 */  sw        $a2, 0x78($sp)
/* 32DF88 E0012278 AFA7007C */  sw        $a3, 0x7C($sp)
/* 32DF8C E001227C AFA00010 */  sw        $zero, 0x10($sp)
/* 32DF90 E0012280 AFA00024 */  sw        $zero, 0x24($sp)
/* 32DF94 E0012284 0C080124 */  jal       shim_create_effect_instance
/* 32DF98 E0012288 AFA20014 */   sw       $v0, 0x14($sp)
/* 32DF9C E001228C 24040098 */  addiu     $a0, $zero, 0x98
/* 32DFA0 E0012290 24130001 */  addiu     $s3, $zero, 0x1
/* 32DFA4 E0012294 0040802D */  daddu     $s0, $v0, $zero
/* 32DFA8 E0012298 0C08012C */  jal       shim_general_heap_malloc
/* 32DFAC E001229C AE130008 */   sw       $s3, 0x8($s0)
/* 32DFB0 E00122A0 0040882D */  daddu     $s1, $v0, $zero
/* 32DFB4 E00122A4 16200003 */  bnez      $s1, .LE00122B4
/* 32DFB8 E00122A8 AE11000C */   sw       $s1, 0xC($s0)
.LE00122AC:
/* 32DFBC E00122AC 080048AB */  j         .LE00122AC
/* 32DFC0 E00122B0 00000000 */   nop
.LE00122B4:
/* 32DFC4 E00122B4 0220202D */  daddu     $a0, $s1, $zero
/* 32DFC8 E00122B8 00132880 */  sll       $a1, $s3, 2
/* 32DFCC E00122BC 00B32821 */  addu      $a1, $a1, $s3
/* 32DFD0 E00122C0 00052880 */  sll       $a1, $a1, 2
/* 32DFD4 E00122C4 00B32823 */  subu      $a1, $a1, $s3
/* 32DFD8 E00122C8 0C080130 */  jal       shim_mem_clear
/* 32DFDC E00122CC 000528C0 */   sll      $a1, $a1, 3
/* 32DFE0 E00122D0 0000902D */  daddu     $s2, $zero, $zero
/* 32DFE4 E00122D4 0253102A */  slt       $v0, $s2, $s3
/* 32DFE8 E00122D8 1040004B */  beqz      $v0, .LE0012408
/* 32DFEC E00122DC 26300094 */   addiu    $s0, $s1, 0x94
/* 32DFF0 E00122E0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 32DFF4 E00122E4 4481B000 */  mtc1      $at, $f22
/* 32DFF8 E00122E8 4480C000 */  mtc1      $zero, $f24
.LE00122EC:
/* 32DFFC E00122EC 24020001 */  addiu     $v0, $zero, 0x1
/* 32E000 E00122F0 AE220000 */  sw        $v0, 0x0($s1)
/* 32E004 E00122F4 A614FF70 */  sh        $s4, -0x90($s0)
/* 32E008 E00122F8 AE00FFE8 */  sw        $zero, -0x18($s0)
/* 32E00C E00122FC E61EFF78 */  swc1      $f30, -0x88($s0)
/* 32E010 E0012300 C7A60078 */  lwc1      $f6, 0x78($sp)
/* 32E014 E0012304 3C0140AC */  lui       $at, (0x40ACCCCD >> 16)
/* 32E018 E0012308 3421CCCD */  ori       $at, $at, (0x40ACCCCD & 0xFFFF)
/* 32E01C E001230C 44810000 */  mtc1      $at, $f0
/* 32E020 E0012310 240200FF */  addiu     $v0, $zero, 0xFF
/* 32E024 E0012314 E606FF7C */  swc1      $f6, -0x84($s0)
/* 32E028 E0012318 C7A6007C */  lwc1      $f6, 0x7C($sp)
/* 32E02C E001231C 4618E032 */  c.eq.s    $f28, $f24
/* 32E030 E0012320 E616FF84 */  swc1      $f22, -0x7C($s0)
/* 32E034 E0012324 E616FF88 */  swc1      $f22, -0x78($s0)
/* 32E038 E0012328 E616FF8C */  swc1      $f22, -0x74($s0)
/* 32E03C E001232C A202FF74 */  sb        $v0, -0x8C($s0)
/* 32E040 E0012330 E616FFE4 */  swc1      $f22, -0x1C($s0)
/* 32E044 E0012334 E600FFE0 */  swc1      $f0, -0x20($s0)
/* 32E048 E0012338 45010005 */  bc1t      .LE0012350
/* 32E04C E001233C E606FF80 */   swc1     $f6, -0x80($s0)
/* 32E050 E0012340 3C01C120 */  lui       $at, (0xC1200000 >> 16)
/* 32E054 E0012344 44810000 */  mtc1      $at, $f0
/* 32E058 E0012348 080048D8 */  j         .LE0012360
/* 32E05C E001234C E600FFDC */   swc1     $f0, -0x24($s0)
.LE0012350:
/* 32E060 E0012350 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 32E064 E0012354 44810000 */  mtc1      $at, $f0
/* 32E068 E0012358 00000000 */  nop
/* 32E06C E001235C E600FFDC */  swc1      $f0, -0x24($s0)
.LE0012360:
/* 32E070 E0012360 24040064 */  addiu     $a0, $zero, 0x64
/* 32E074 E0012364 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 32E078 E0012368 44810000 */  mtc1      $at, $f0
/* 32E07C E001236C 3C01BD8F */  lui       $at, (0xBD8F5C29 >> 16)
/* 32E080 E0012370 34215C29 */  ori       $at, $at, (0xBD8F5C29 & 0xFFFF)
/* 32E084 E0012374 44811000 */  mtc1      $at, $f2
/* 32E088 E0012378 3C013B44 */  lui       $at, (0x3B449BA6 >> 16)
/* 32E08C E001237C 34219BA6 */  ori       $at, $at, (0x3B449BA6 & 0xFFFF)
/* 32E090 E0012380 44812000 */  mtc1      $at, $f4
/* 32E094 E0012384 2402000F */  addiu     $v0, $zero, 0xF
/* 32E098 E0012388 AE00FFF8 */  sw        $zero, -0x8($s0)
/* 32E09C E001238C A602FF72 */  sh        $v0, -0x8E($s0)
/* 32E0A0 E0012390 E61AFF94 */  swc1      $f26, -0x6C($s0)
/* 32E0A4 E0012394 AE00FF90 */  sw        $zero, -0x70($s0)
/* 32E0A8 E0012398 AE00FF98 */  sw        $zero, -0x68($s0)
/* 32E0AC E001239C E600FFEC */  swc1      $f0, -0x14($s0)
/* 32E0B0 E00123A0 E602FFF0 */  swc1      $f2, -0x10($s0)
/* 32E0B4 E00123A4 0C080138 */  jal       shim_rand_int
/* 32E0B8 E00123A8 E604FFF4 */   swc1     $f4, -0xC($s0)
/* 32E0BC E00123AC 00021103 */  sra       $v0, $v0, 4
/* 32E0C0 E00123B0 30420001 */  andi      $v0, $v0, 0x1
/* 32E0C4 E00123B4 4618E032 */  c.eq.s    $f28, $f24
/* 32E0C8 E00123B8 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 32E0CC E00123BC 44810000 */  mtc1      $at, $f0
/* 32E0D0 E00123C0 45010003 */  bc1t      .LE00123D0
/* 32E0D4 E00123C4 A202FF75 */   sb       $v0, -0x8B($s0)
/* 32E0D8 E00123C8 3C01C2B4 */  lui       $at, (0xC2B40000 >> 16)
/* 32E0DC E00123CC 44810000 */  mtc1      $at, $f0
.LE00123D0:
/* 32E0E0 E00123D0 0C08013C */  jal       shim_clamp_angle
/* 32E0E4 E00123D4 4600D300 */   add.s    $f12, $f26, $f0
/* 32E0E8 E00123D8 46000506 */  mov.s     $f20, $f0
/* 32E0EC E00123DC 0C080140 */  jal       shim_sin_deg
/* 32E0F0 E00123E0 4600A306 */   mov.s    $f12, $f20
/* 32E0F4 E00123E4 4600A306 */  mov.s     $f12, $f20
/* 32E0F8 E00123E8 0C080144 */  jal       shim_cos_deg
/* 32E0FC E00123EC E600FFFC */   swc1     $f0, -0x4($s0)
/* 32E100 E00123F0 26520001 */  addiu     $s2, $s2, 0x1
/* 32E104 E00123F4 E6000000 */  swc1      $f0, 0x0($s0)
/* 32E108 E00123F8 26100098 */  addiu     $s0, $s0, 0x98
/* 32E10C E00123FC 0253102A */  slt       $v0, $s2, $s3
/* 32E110 E0012400 1440FFBA */  bnez      $v0, .LE00122EC
/* 32E114 E0012404 26310098 */   addiu    $s1, $s1, 0x98
.LE0012408:
/* 32E118 E0012408 8FBF003C */  lw        $ra, 0x3C($sp)
/* 32E11C E001240C 8FB40038 */  lw        $s4, 0x38($sp)
/* 32E120 E0012410 8FB30034 */  lw        $s3, 0x34($sp)
/* 32E124 E0012414 8FB20030 */  lw        $s2, 0x30($sp)
/* 32E128 E0012418 8FB1002C */  lw        $s1, 0x2C($sp)
/* 32E12C E001241C 8FB00028 */  lw        $s0, 0x28($sp)
/* 32E130 E0012420 D7BE0068 */  ldc1      $f30, 0x68($sp)
/* 32E134 E0012424 D7BC0060 */  ldc1      $f28, 0x60($sp)
/* 32E138 E0012428 D7BA0058 */  ldc1      $f26, 0x58($sp)
/* 32E13C E001242C D7B80050 */  ldc1      $f24, 0x50($sp)
/* 32E140 E0012430 D7B60048 */  ldc1      $f22, 0x48($sp)
/* 32E144 E0012434 D7B40040 */  ldc1      $f20, 0x40($sp)
/* 32E148 E0012438 03E00008 */  jr        $ra
/* 32E14C E001243C 27BD0070 */   addiu    $sp, $sp, 0x70

### DECOMPILED C INSTRUCTIONS:

void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 angle, f32 direction) {
    EffectBlueprint bp;
    EffectInstance* effect;
    FlowerFXData* part;
    s32 numParts = 1;
    f32 partAngle;
    f32 angleOffset;
    s32 i;

    bp.init = flower_trail_init;
    bp.update = flower_trail_update;
    bp.renderWorld = flower_trail_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_FLOWER_TRAIL;

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

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

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

    for (i = 0; i < numParts; i++, part++) {
        part->alive = TRUE;
        part->triggeredByNpc = triggeredByNpc;
        part->unk_7C = 0.0f;

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

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

        part->primAlpha = 255;

        part->visibilityAmt = 1.0f;
        part->velocityScaleB = 5.4f;
        if (direction != 0.0f) {
            part->velocityScaleA = -10.0f;
        } else {
            part->velocityScaleA = 10.0f;
        }

        part->integrator[0] = 0.5f;
        part->integrator[1] = -0.07f;
        part->integrator[2] = 0.003f;
        part->integrator[3] = 0;

        part->timeLeft = 15;
        part->rot.y = angle;
        part->rot.x = 0.0f;
        part->rot.z = 0.0f;
        part->useAltColor = (shim_rand_int(100) >> 4) & 1;

        if (direction != 0.0f) {
            angleOffset = -90.0f;
            partAngle = shim_clamp_angle(angle + angleOffset);
        } else {
            angleOffset = 90.0f;
            partAngle = shim_clamp_angle(angle + angleOffset);
        }

        part->velocity.x = shim_sin_deg(partAngle);
        part->velocity.z = shim_cos_deg(partAngle);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel nuScCreateScheduler
/* 39DB0 8005E9B0 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 39DB4 8005E9B4 AFB40028 */  sw        $s4, 0x28($sp)
/* 39DB8 8005E9B8 0080A02D */  daddu     $s4, $a0, $zero
/* 39DBC 8005E9BC AFB30024 */  sw        $s3, 0x24($sp)
/* 39DC0 8005E9C0 00A0982D */  daddu     $s3, $a1, $zero
/* 39DC4 8005E9C4 3C04800E */  lui       $a0, %hi(D_800DAAAC)
/* 39DC8 8005E9C8 2484AAAC */  addiu     $a0, $a0, %lo(D_800DAAAC)
/* 39DCC 8005E9CC 24020001 */  addiu     $v0, $zero, 0x1
/* 39DD0 8005E9D0 24030002 */  addiu     $v1, $zero, 0x2
/* 39DD4 8005E9D4 AFBF002C */  sw        $ra, 0x2C($sp)
/* 39DD8 8005E9D8 AFB20020 */  sw        $s2, 0x20($sp)
/* 39DDC 8005E9DC AFB1001C */  sw        $s1, 0x1C($sp)
/* 39DE0 8005E9E0 AFB00018 */  sw        $s0, 0x18($sp)
/* 39DE4 8005E9E4 A482F994 */  sh        $v0, -0x66C($a0)
/* 39DE8 8005E9E8 326200FF */  andi      $v0, $s3, 0xFF
/* 39DEC 8005E9EC AC82000C */  sw        $v0, 0xC($a0)
/* 39DF0 8005E9F0 A0830011 */  sb        $v1, 0x11($a0)
/* 39DF4 8005E9F4 3C028000 */  lui       $v0, %hi(osTvType)
/* 39DF8 8005E9F8 8C420300 */  lw        $v0, %lo(osTvType)($v0)
/* 39DFC 8005E9FC A483F996 */  sh        $v1, -0x66A($a0)
/* 39E00 8005EA00 2483F994 */  addiu     $v1, $a0, -0x66C
/* 39E04 8005EA04 AC800000 */  sw        $zero, 0x0($a0)
/* 39E08 8005EA08 AC800004 */  sw        $zero, 0x4($a0)
/* 39E0C 8005EA0C AC800008 */  sw        $zero, 0x8($a0)
/* 39E10 8005EA10 14400004 */  bnez      $v0, .L8005EA24
/* 39E14 8005EA14 AC80FFFC */   sw       $zero, -0x4($a0)
/* 39E18 8005EA18 24020032 */  addiu     $v0, $zero, 0x32
/* 39E1C 8005EA1C 08017A8B */  j         .L8005EA2C
/* 39E20 8005EA20 A062067C */   sb       $v0, 0x67C($v1)
.L8005EA24:
/* 39E24 8005EA24 2402003C */  addiu     $v0, $zero, 0x3C
/* 39E28 8005EA28 A0820010 */  sb        $v0, 0x10($a0)
.L8005EA2C:
/* 39E2C 8005EA2C 3C10800E */  lui       $s0, %hi(D_800DA4B4)
/* 39E30 8005EA30 2610A4B4 */  addiu     $s0, $s0, %lo(D_800DA4B4)
/* 39E34 8005EA34 0200202D */  daddu     $a0, $s0, $zero
/* 39E38 8005EA38 26050018 */  addiu     $a1, $s0, 0x18
/* 39E3C 8005EA3C 3C01800A */  lui       $at, %hi(nuScPreNMIFlag)
/* 39E40 8005EA40 A020A5B0 */  sb        $zero, %lo(nuScPreNMIFlag)($at)
/* 39E44 8005EA44 0C019560 */  jal       osCreateMesgQueue
/* 39E48 8005EA48 24060008 */   addiu    $a2, $zero, 0x8
/* 39E4C 8005EA4C 26120038 */  addiu     $s2, $s0, 0x38
/* 39E50 8005EA50 0240202D */  daddu     $a0, $s2, $zero
/* 39E54 8005EA54 26050050 */  addiu     $a1, $s0, 0x50
/* 39E58 8005EA58 0C019560 */  jal       osCreateMesgQueue
/* 39E5C 8005EA5C 24060008 */   addiu    $a2, $zero, 0x8
/* 39E60 8005EA60 26110070 */  addiu     $s1, $s0, 0x70
/* 39E64 8005EA64 0220202D */  daddu     $a0, $s1, $zero
/* 39E68 8005EA68 26050088 */  addiu     $a1, $s0, 0x88
/* 39E6C 8005EA6C 0C019560 */  jal       osCreateMesgQueue
/* 39E70 8005EA70 24060008 */   addiu    $a2, $zero, 0x8
/* 39E74 8005EA74 2604FFC8 */  addiu     $a0, $s0, -0x38
/* 39E78 8005EA78 2605FFE0 */  addiu     $a1, $s0, -0x20
/* 39E7C 8005EA7C 0C019560 */  jal       osCreateMesgQueue
/* 39E80 8005EA80 24060008 */   addiu    $a2, $zero, 0x8
/* 39E84 8005EA84 2604FF90 */  addiu     $a0, $s0, -0x70
/* 39E88 8005EA88 2605FFA8 */  addiu     $a1, $s0, -0x58
/* 39E8C 8005EA8C 0C019560 */  jal       osCreateMesgQueue
/* 39E90 8005EA90 24060008 */   addiu    $a2, $zero, 0x8
/* 39E94 8005EA94 260400A8 */  addiu     $a0, $s0, 0xA8
/* 39E98 8005EA98 260500C0 */  addiu     $a1, $s0, 0xC0
/* 39E9C 8005EA9C 0C019560 */  jal       osCreateMesgQueue
/* 39EA0 8005EAA0 24060008 */   addiu    $a2, $zero, 0x8
/* 39EA4 8005EAA4 0C019A9C */  jal       osCreateViManager
/* 39EA8 8005EAA8 240400FE */   addiu    $a0, $zero, 0xFE
/* 39EAC 8005EAAC 328200FF */  andi      $v0, $s4, 0xFF
/* 39EB0 8005EAB0 00022080 */  sll       $a0, $v0, 2
/* 39EB4 8005EAB4 00822021 */  addu      $a0, $a0, $v0
/* 39EB8 8005EAB8 00042100 */  sll       $a0, $a0, 4
/* 39EBC 8005EABC 3C028009 */  lui       $v0, %hi(osViModeTable)
/* 39EC0 8005EAC0 244246A0 */  addiu     $v0, $v0, %lo(osViModeTable)
/* 39EC4 8005EAC4 0C019B84 */  jal       osViSetMode
/* 39EC8 8005EAC8 00822021 */   addu     $a0, $a0, $v0
/* 39ECC 8005EACC 0C019CE0 */  jal       osViBlack
/* 39ED0 8005EAD0 24040001 */   addiu    $a0, $zero, 0x1
/* 39ED4 8005EAD4 0200202D */  daddu     $a0, $s0, $zero
/* 39ED8 8005EAD8 2405029A */  addiu     $a1, $zero, 0x29A
/* 39EDC 8005EADC 0C019B6C */  jal       osViSetEvent
/* 39EE0 8005EAE0 326600FF */   andi     $a2, $s3, 0xFF
/* 39EE4 8005EAE4 24040004 */  addiu     $a0, $zero, 0x4
/* 39EE8 8005EAE8 0240282D */  daddu     $a1, $s2, $zero
/* 39EEC 8005EAEC 0C019654 */  jal       osSetEventMesg
/* 39EF0 8005EAF0 2406029B */   addiu    $a2, $zero, 0x29B
/* 39EF4 8005EAF4 24040009 */  addiu     $a0, $zero, 0x9
/* 39EF8 8005EAF8 0220282D */  daddu     $a1, $s1, $zero
/* 39EFC 8005EAFC 0C019654 */  jal       osSetEventMesg
/* 39F00 8005EB00 2406029C */   addiu    $a2, $zero, 0x29C
/* 39F04 8005EB04 2404000E */  addiu     $a0, $zero, 0xE
/* 39F08 8005EB08 0200282D */  daddu     $a1, $s0, $zero
/* 39F0C 8005EB0C 0C019654 */  jal       osSetEventMesg
/* 39F10 8005EB10 2406029D */   addiu    $a2, $zero, 0x29D
/* 39F14 8005EB14 261200E4 */  addiu     $s2, $s0, 0xE4
/* 39F18 8005EB18 0240202D */  daddu     $a0, $s2, $zero
/* 39F1C 8005EB1C 24050013 */  addiu     $a1, $zero, 0x13
/* 39F20 8005EB20 3C068006 */  lui       $a2, %hi(nuScEventHandler)
/* 39F24 8005EB24 24C6EFA8 */  addiu     $a2, $a2, %lo(nuScEventHandler)
/* 39F28 8005EB28 2611FF8C */  addiu     $s1, $s0, -0x74
/* 39F2C 8005EB2C 0220382D */  daddu     $a3, $s1, $zero
/* 39F30 8005EB30 3C02800B */  lui       $v0, %hi(nuScAudioStack)
/* 39F34 8005EB34 244285D0 */  addiu     $v0, $v0, %lo(nuScAudioStack)
/* 39F38 8005EB38 AFA20010 */  sw        $v0, 0x10($sp)
/* 39F3C 8005EB3C 24020078 */  addiu     $v0, $zero, 0x78
/* 39F40 8005EB40 0C019798 */  jal       osCreateThread
/* 39F44 8005EB44 AFA20014 */   sw       $v0, 0x14($sp)
/* 39F48 8005EB48 0C019808 */  jal       osStartThread
/* 39F4C 8005EB4C 0240202D */   daddu    $a0, $s2, $zero
/* 39F50 8005EB50 26120294 */  addiu     $s2, $s0, 0x294
/* 39F54 8005EB54 0240202D */  daddu     $a0, $s2, $zero
/* 39F58 8005EB58 24050012 */  addiu     $a1, $zero, 0x12
/* 39F5C 8005EB5C 3C068006 */  lui       $a2, %hi(nuScExecuteAudio)
/* 39F60 8005EB60 24C6EBE0 */  addiu     $a2, $a2, %lo(nuScExecuteAudio)
/* 39F64 8005EB64 0220382D */  daddu     $a3, $s1, $zero
/* 39F68 8005EB68 3C02800B */  lui       $v0, %hi(nuScGraphicsStack)
/* 39F6C 8005EB6C 2442A5D0 */  addiu     $v0, $v0, %lo(nuScGraphicsStack)
/* 39F70 8005EB70 AFA20010 */  sw        $v0, 0x10($sp)
/* 39F74 8005EB74 2402006E */  addiu     $v0, $zero, 0x6E
/* 39F78 8005EB78 0C019798 */  jal       osCreateThread
/* 39F7C 8005EB7C AFA20014 */   sw       $v0, 0x14($sp)
/* 39F80 8005EB80 0C019808 */  jal       osStartThread
/* 39F84 8005EB84 0240202D */   daddu    $a0, $s2, $zero
/* 39F88 8005EB88 26100444 */  addiu     $s0, $s0, 0x444
/* 39F8C 8005EB8C 0200202D */  daddu     $a0, $s0, $zero
/* 39F90 8005EB90 24050011 */  addiu     $a1, $zero, 0x11
/* 39F94 8005EB94 3C068006 */  lui       $a2, %hi(nuScExecuteGraphics)
/* 39F98 8005EB98 24C6ED14 */  addiu     $a2, $a2, %lo(nuScExecuteGraphics)
/* 39F9C 8005EB9C 0220382D */  daddu     $a3, $s1, $zero
/* 39FA0 8005EBA0 3C02800B */  lui       $v0, %hi(D_800AC5D0)
/* 39FA4 8005EBA4 2442C5D0 */  addiu     $v0, $v0, %lo(D_800AC5D0)
/* 39FA8 8005EBA8 AFA20010 */  sw        $v0, 0x10($sp)
/* 39FAC 8005EBAC 24020064 */  addiu     $v0, $zero, 0x64
/* 39FB0 8005EBB0 0C019798 */  jal       osCreateThread
/* 39FB4 8005EBB4 AFA20014 */   sw       $v0, 0x14($sp)
/* 39FB8 8005EBB8 0C019808 */  jal       osStartThread
/* 39FBC 8005EBBC 0200202D */   daddu    $a0, $s0, $zero
/* 39FC0 8005EBC0 8FBF002C */  lw        $ra, 0x2C($sp)
/* 39FC4 8005EBC4 8FB40028 */  lw        $s4, 0x28($sp)
/* 39FC8 8005EBC8 8FB30024 */  lw        $s3, 0x24($sp)
/* 39FCC 8005EBCC 8FB20020 */  lw        $s2, 0x20($sp)
/* 39FD0 8005EBD0 8FB1001C */  lw        $s1, 0x1C($sp)
/* 39FD4 8005EBD4 8FB00018 */  lw        $s0, 0x18($sp)
/* 39FD8 8005EBD8 03E00008 */  jr        $ra
/* 39FDC 8005EBDC 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void nuScCreateScheduler(u8 videoMode, u8 numFields) {
    nusched.curGraphicsTask =       NULL;
    nusched.curAudioTask =          NULL;
    nusched.graphicsTaskSuspended = NULL;
    nusched.clientList =            NULL;

    nusched.retraceMsg =     NU_SC_RETRACE_MSG;
    nusched.prenmiMsg =      NU_SC_PRENMI_MSG;
    nusched.retraceCount =   numFields;
    nusched.frameBufferNum = 2;

    if (osTvType == OS_TV_PAL) {
        nusched.frameRate = 50;
    } else {
        nusched.frameRate = 60;
    }

    nuScPreNMIFlag = NU_SC_PRENMI_YET;

    osCreateMesgQueue(&nusched.retraceMQ,         nusched.retraceMsgBuf,      NU_SC_MAX_MESGS);
    osCreateMesgQueue(&nusched.rspMQ,             nusched.rspMsgBuf,          NU_SC_MAX_MESGS);
    osCreateMesgQueue(&nusched.rdpMQ,             nusched.rdpMsgBuf,          NU_SC_MAX_MESGS);
    osCreateMesgQueue(&nusched.graphicsRequestMQ, nusched.graphicsRequestBuf, NU_SC_MAX_MESGS);
    osCreateMesgQueue(&nusched.audioRequestMQ,    nusched.audioRequestBuf,    NU_SC_MAX_MESGS);
    osCreateMesgQueue(&nusched.waitMQ,            nusched.waitMsgBuf,         NU_SC_MAX_MESGS);

    osCreateViManager(0xFE);
    osViSetMode(&osViModeTable[videoMode]);
    osViBlack(TRUE);
    osViSetEvent(&nusched.retraceMQ, (OSMesg) 0x29A, numFields);

    osSetEventMesg(OS_EVENT_SP,     &nusched.rspMQ, (OSMesg) 0x29B);
    osSetEventMesg(OS_EVENT_DP,     &nusched.rdpMQ, (OSMesg) 0x29C);
    osSetEventMesg(OS_EVENT_PRENMI, &nusched.retraceMQ, (OSMesg) 0x29D);

    osCreateThread(&nusched.schedulerThread, 19, (void(*)) nuScEventHandler,    &nusched,
                   nuScStack + NU_SC_STACK_SIZE / sizeof(u64),         NU_SC_HANDLER_PRI);
    osStartThread(&nusched.schedulerThread);

    osCreateThread(&nusched.audioThread,     18, (void(*)) nuScExecuteAudio,    &nusched,
                   nuScAudioStack + NU_SC_STACK_SIZE / sizeof(u64),    NU_SC_AUDIO_PRI);
    osStartThread(&nusched.audioThread);

    osCreateThread(&nusched.graphicsThread,  17, (void(*)) nuScExecuteGraphics, &nusched,
                   nuScGraphicsStack + NU_SC_STACK_SIZE / sizeof(u64), NU_SC_GRAPHICS_PRI);
    osStartThread(&nusched.graphicsThread);
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_80252B3C
/* 18141C 80252B3C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 181420 80252B40 AFB20018 */  sw        $s2, 0x18($sp)
/* 181424 80252B44 0080902D */  daddu     $s2, $a0, $zero
/* 181428 80252B48 AFBF0020 */  sw        $ra, 0x20($sp)
/* 18142C 80252B4C AFB3001C */  sw        $s3, 0x1C($sp)
/* 181430 80252B50 AFB10014 */  sw        $s1, 0x14($sp)
/* 181434 80252B54 AFB00010 */  sw        $s0, 0x10($sp)
dgb_01_D_80252B58_C103D8:
/* 181438 80252B58 8E50000C */  lw        $s0, 0xC($s2)
/* 18143C 80252B5C 3C11800E */  lui       $s1, %hi(gBattleStatus)
D_80252B60:
/* 181440 80252B60 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
/* 181444 80252B64 8E130000 */  lw        $s3, 0x0($s0)
/* 181448 80252B68 26100004 */  addiu     $s0, $s0, 0x4
/* 18144C 80252B6C 8E020000 */  lw        $v0, 0x0($s0)
/* 181450 80252B70 26100004 */  addiu     $s0, $s0, 0x4
/* 181454 80252B74 AE20018C */  sw        $zero, 0x18C($s1)
/* 181458 80252B78 AE220188 */  sw        $v0, 0x188($s1)
/* 18145C 80252B7C 8E050000 */  lw        $a1, 0x0($s0)
/* 181460 80252B80 0C0B1EAF */  jal       evt_get_variable
dgb_01_D_80252B84_C10404:
/* 181464 80252B84 26100004 */   addiu    $s0, $s0, 0x4
/* 181468 80252B88 AE220190 */  sw        $v0, 0x190($s1)
/* 18146C 80252B8C 8E050000 */  lw        $a1, 0x0($s0)
/* 181470 80252B90 26100004 */  addiu     $s0, $s0, 0x4
/* 181474 80252B94 0C0B1EAF */  jal       evt_get_variable
/* 181478 80252B98 0240202D */   daddu    $a0, $s2, $zero
/* 18147C 80252B9C A622017E */  sh        $v0, 0x17E($s1)
/* 181480 80252BA0 8E100000 */  lw        $s0, 0x0($s0)
/* 181484 80252BA4 24020030 */  addiu     $v0, $zero, 0x30
/* 181488 80252BA8 32030030 */  andi      $v1, $s0, 0x30
/* 18148C 80252BAC 54620004 */  bnel      $v1, $v0, .L80252BC0
dgb_01_D_80252BB0_C10430:
/* 181490 80252BB0 32020010 */   andi     $v0, $s0, 0x10
/* 181494 80252BB4 8E220000 */  lw        $v0, 0x0($s1)
/* 181498 80252BB8 08094B00 */  j         .L80252C00
/* 18149C 80252BBC 34420030 */   ori      $v0, $v0, 0x30
.L80252BC0:
/* 1814A0 80252BC0 10400004 */  beqz      $v0, .L80252BD4
/* 1814A4 80252BC4 2403FFDF */   addiu    $v1, $zero, -0x21
mac_05_D_80252BC8:
/* 1814A8 80252BC8 8E220000 */  lw        $v0, 0x0($s1)
/* 1814AC 80252BCC 08094AFF */  j         .L80252BFC
/* 1814B0 80252BD0 34420010 */   ori      $v0, $v0, 0x10
.L80252BD4:
/* 1814B4 80252BD4 32020020 */  andi      $v0, $s0, 0x20
/* 1814B8 80252BD8 10400005 */  beqz      $v0, .L80252BF0
dgb_01_D_80252BDC_C1045C:
/* 1814BC 80252BDC 2403FFEF */   addiu    $v1, $zero, -0x11
/* 1814C0 80252BE0 8E220000 */  lw        $v0, 0x0($s1)
/* 1814C4 80252BE4 00431024 */  and       $v0, $v0, $v1
/* 1814C8 80252BE8 08094B00 */  j         .L80252C00
/* 1814CC 80252BEC 34420020 */   ori      $v0, $v0, 0x20
.L80252BF0:
/* 1814D0 80252BF0 8E220000 */  lw        $v0, 0x0($s1)
/* 1814D4 80252BF4 00431024 */  and       $v0, $v0, $v1
/* 1814D8 80252BF8 2403FFDF */  addiu     $v1, $zero, -0x21
.L80252BFC:
/* 1814DC 80252BFC 00431024 */  and       $v0, $v0, $v1
.L80252C00:
/* 1814E0 80252C00 AE220000 */  sw        $v0, 0x0($s1)
/* 1814E4 80252C04 32020040 */  andi      $v0, $s0, 0x40
dgb_01_D_80252C08_C10488:
/* 1814E8 80252C08 10400007 */  beqz      $v0, .L80252C28
/* 1814EC 80252C0C 2404FFBF */   addiu    $a0, $zero, -0x41
/* 1814F0 80252C10 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1814F4 80252C14 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1814F8 80252C18 8C620000 */  lw        $v0, 0x0($v1)
/* 1814FC 80252C1C 34420040 */  ori       $v0, $v0, 0x40
/* 181500 80252C20 08094B0F */  j         .L80252C3C
/* 181504 80252C24 AC620000 */   sw       $v0, 0x0($v1)
.L80252C28:
/* 181508 80252C28 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 18150C 80252C2C 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 181510 80252C30 8C430000 */  lw        $v1, 0x0($v0)
dgb_01_D_80252C34_C104B4:
/* 181514 80252C34 00641824 */  and       $v1, $v1, $a0
/* 181518 80252C38 AC430000 */  sw        $v1, 0x0($v0)
.L80252C3C:
/* 18151C 80252C3C 32020200 */  andi      $v0, $s0, 0x200
/* 181520 80252C40 10400007 */  beqz      $v0, dgb_01_D_80252C60_C104E0
/* 181524 80252C44 2404FDFF */   addiu    $a0, $zero, -0x201
/* 181528 80252C48 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 18152C 80252C4C 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 181530 80252C50 8C620000 */  lw        $v0, 0x0($v1)
/* 181534 80252C54 34420200 */  ori       $v0, $v0, 0x200
/* 181538 80252C58 08094B1D */  j         .L80252C74
/* 18153C 80252C5C AC620000 */   sw       $v0, 0x0($v1)
dgb_01_D_80252C60_C104E0:
/* 181540 80252C60 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 181544 80252C64 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 181548 80252C68 8C430000 */  lw        $v1, 0x0($v0)
/* 18154C 80252C6C 00641824 */  and       $v1, $v1, $a0
/* 181550 80252C70 AC430000 */  sw        $v1, 0x0($v0)
.L80252C74:
/* 181554 80252C74 32020080 */  andi      $v0, $s0, 0x80
/* 181558 80252C78 10400007 */  beqz      $v0, .L80252C98
/* 18155C 80252C7C 2404FF7F */   addiu    $a0, $zero, -0x81
/* 181560 80252C80 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 181564 80252C84 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 181568 80252C88 8C620000 */  lw        $v0, 0x0($v1)
dgb_01_D_80252C8C_C1050C:
/* 18156C 80252C8C 34420080 */  ori       $v0, $v0, 0x80
/* 181570 80252C90 08094B2B */  j         .L80252CAC
/* 181574 80252C94 AC620000 */   sw       $v0, 0x0($v1)
.L80252C98:
/* 181578 80252C98 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 18157C 80252C9C 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 181580 80252CA0 8C430000 */  lw        $v1, 0x0($v0)
/* 181584 80252CA4 00641824 */  and       $v1, $v1, $a0
/* 181588 80252CA8 AC430000 */  sw        $v1, 0x0($v0)
.L80252CAC:
/* 18158C 80252CAC 0C09A75B */  jal       get_actor
/* 181590 80252CB0 8E440148 */   lw       $a0, 0x148($s2)
/* 181594 80252CB4 94430428 */  lhu       $v1, 0x428($v0)
dgb_01_D_80252CB8_C10538:
/* 181598 80252CB8 A62301A0 */  sh        $v1, 0x1A0($s1)
/* 18159C 80252CBC 92230193 */  lbu       $v1, 0x193($s1)
/* 1815A0 80252CC0 90420426 */  lbu       $v0, 0x426($v0)
/* 1815A4 80252CC4 A2230194 */  sb        $v1, 0x194($s1)
/* 1815A8 80252CC8 306300FF */  andi      $v1, $v1, 0xFF
/* 1815AC 80252CCC A22201A2 */  sb        $v0, 0x1A2($s1)
/* 1815B0 80252CD0 240200FF */  addiu     $v0, $zero, 0xFF
/* 1815B4 80252CD4 50620001 */  beql      $v1, $v0, .L80252CDC
/* 1815B8 80252CD8 A2200194 */   sb       $zero, 0x194($s1)
.L80252CDC:
/* 1815BC 80252CDC 8E220190 */  lw        $v0, 0x190($s1)
/* 1815C0 80252CE0 30420F00 */  andi      $v0, $v0, 0xF00
dgb_01_D_80252CE4_C10564:
/* 1815C4 80252CE4 00021203 */  sra       $v0, $v0, 8
/* 1815C8 80252CE8 0C0945BA */  jal       func_802516E8
/* 1815CC 80252CEC A2220195 */   sb       $v0, 0x195($s1)
/* 1815D0 80252CF0 0440000B */  bltz      $v0, .L80252D20
/* 1815D4 80252CF4 0240202D */   daddu    $a0, $s2, $zero
/* 1815D8 80252CF8 0260282D */  daddu     $a1, $s3, $zero
/* 1815DC 80252CFC 0C0B2026 */  jal       evt_set_variable
/* 1815E0 80252D00 0040302D */   daddu    $a2, $v0, $zero
/* 1815E4 80252D04 0C0B1069 */  jal       does_script_exist_by_ref
/* 1815E8 80252D08 0240202D */   daddu    $a0, $s2, $zero
/* 1815EC 80252D0C 0040182D */  daddu     $v1, $v0, $zero
dgb_01_D_80252D10_C10590:
/* 1815F0 80252D10 10600004 */  beqz      $v1, .L80252D24
/* 1815F4 80252D14 240200FF */   addiu    $v0, $zero, 0xFF
/* 1815F8 80252D18 08094B49 */  j         .L80252D24
/* 1815FC 80252D1C 24020002 */   addiu    $v0, $zero, 0x2
.L80252D20:
/* 181600 80252D20 240200FF */  addiu     $v0, $zero, 0xFF
.L80252D24:
/* 181604 80252D24 8FBF0020 */  lw        $ra, 0x20($sp)
/* 181608 80252D28 8FB3001C */  lw        $s3, 0x1C($sp)
/* 18160C 80252D2C 8FB20018 */  lw        $s2, 0x18($sp)
/* 181610 80252D30 8FB10014 */  lw        $s1, 0x14($sp)
/* 181614 80252D34 8FB00010 */  lw        $s0, 0x10($sp)
mac_05_LetterDelivery_SavedNpcAnim:
/* 181618 80252D38 03E00008 */  jr        $ra
dgb_01_D_80252D3C_C105BC:
/* 18161C 80252D3C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

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

    battleStatus->currentAttackElement = *args++;
    battleStatus->currentAttackEventSuppression = 0;
    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 render_messages
/* BA904 80124204 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* BA908 80124208 AFB10024 */  sw        $s1, 0x24($sp)
/* BA90C 8012420C 0000882D */  daddu     $s1, $zero, $zero
/* BA910 80124210 AFB00020 */  sw        $s0, 0x20($sp)
/* BA914 80124214 3C10800A */  lui       $s0, %hi(gMainGfxPos)
/* BA918 80124218 2610A66C */  addiu     $s0, $s0, %lo(gMainGfxPos)
/* BA91C 8012421C 3C058015 */  lui       $a1, %hi(gMessagePrinters)
/* BA920 80124220 24A54C30 */  addiu     $a1, $a1, %lo(gMessagePrinters)
/* BA924 80124224 44803000 */  mtc1      $zero, $f6
/* BA928 80124228 3C028007 */  lui       $v0, %hi(gCurrentDisplayContextIndex)
/* BA92C 8012422C 8C4241F4 */  lw        $v0, %lo(gCurrentDisplayContextIndex)($v0)
/* BA930 80124230 3C038015 */  lui       $v1, %hi(gMessageWindowProjMatrix)
/* BA934 80124234 24635CA0 */  addiu     $v1, $v1, %lo(gMessageWindowProjMatrix)
/* BA938 80124238 AFBF002C */  sw        $ra, 0x2C($sp)
/* BA93C 8012423C AFB20028 */  sw        $s2, 0x28($sp)
/* BA940 80124240 00021180 */  sll       $v0, $v0, 6
/* BA944 80124244 00432021 */  addu      $a0, $v0, $v1
/* BA948 80124248 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* BA94C 8012424C 00829021 */  addu      $s2, $a0, $v0
.L80124250:
/* BA950 80124250 8CA204FC */  lw        $v0, 0x4FC($a1)
/* BA954 80124254 30420002 */  andi      $v0, $v0, 0x2
/* BA958 80124258 1040003B */  beqz      $v0, .L80124348
/* BA95C 8012425C 3C03DC08 */   lui      $v1, (0xDC080008 >> 16)
/* BA960 80124260 34630008 */  ori       $v1, $v1, (0xDC080008 & 0xFFFF)
/* BA964 80124264 8E020000 */  lw        $v0, 0x0($s0)
/* BA968 80124268 3C01C3FA */  lui       $at, (0xC3FA0000 >> 16)
/* BA96C 8012426C 44810000 */  mtc1      $at, $f0
/* BA970 80124270 3C0143FA */  lui       $at, (0x43FA0000 >> 16)
/* BA974 80124274 44811000 */  mtc1      $at, $f2
/* BA978 80124278 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* BA97C 8012427C 44812000 */  mtc1      $at, $f4
/* BA980 80124280 44053000 */  mfc1      $a1, $f6
/* BA984 80124284 3C06439F */  lui       $a2, (0x439F8000 >> 16)
/* BA988 80124288 34C68000 */  ori       $a2, $a2, (0x439F8000 & 0xFFFF)
/* BA98C 8012428C 3C07C370 */  lui       $a3, (0xC3700000 >> 16)
/* BA990 80124290 0040402D */  daddu     $t0, $v0, $zero
/* BA994 80124294 24420008 */  addiu     $v0, $v0, 0x8
/* BA998 80124298 AE020000 */  sw        $v0, 0x0($s0)
/* BA99C 8012429C 3C028015 */  lui       $v0, %hi(D_8014C280)
/* BA9A0 801242A0 2442C280 */  addiu     $v0, $v0, %lo(D_8014C280)
/* BA9A4 801242A4 AD030000 */  sw        $v1, 0x0($t0)
/* BA9A8 801242A8 AD020004 */  sw        $v0, 0x4($t0)
/* BA9AC 801242AC AFA50010 */  sw        $a1, 0x10($sp)
/* BA9B0 801242B0 E7A00014 */  swc1      $f0, 0x14($sp)
/* BA9B4 801242B4 E7A20018 */  swc1      $f2, 0x18($sp)
/* BA9B8 801242B8 0C018E90 */  jal       guOrtho
/* BA9BC 801242BC E7A4001C */   swc1     $f4, 0x1C($sp)
/* BA9C0 801242C0 3C04DA38 */  lui       $a0, (0xDA380007 >> 16)
/* BA9C4 801242C4 34840007 */  ori       $a0, $a0, (0xDA380007 & 0xFFFF)
/* BA9C8 801242C8 3C05E300 */  lui       $a1, (0xE3000A01 >> 16)
/* BA9CC 801242CC 34A50A01 */  ori       $a1, $a1, (0xE3000A01 & 0xFFFF)
/* BA9D0 801242D0 3C06D9C0 */  lui       $a2, (0xD9C0F9FB >> 16)
/* BA9D4 801242D4 34C6F9FB */  ori       $a2, $a2, (0xD9C0F9FB & 0xFFFF)
/* BA9D8 801242D8 3C08D9FF */  lui       $t0, (0xD9FFFFFF >> 16)
/* BA9DC 801242DC 3508FFFF */  ori       $t0, $t0, (0xD9FFFFFF & 0xFFFF)
/* BA9E0 801242E0 3C070020 */  lui       $a3, (0x200004 >> 16)
/* BA9E4 801242E4 8E030000 */  lw        $v1, 0x0($s0)
/* BA9E8 801242E8 34E70004 */  ori       $a3, $a3, (0x200004 & 0xFFFF)
/* BA9EC 801242EC 0060102D */  daddu     $v0, $v1, $zero
/* BA9F0 801242F0 24630008 */  addiu     $v1, $v1, 0x8
/* BA9F4 801242F4 AE030000 */  sw        $v1, 0x0($s0)
/* BA9F8 801242F8 AC440000 */  sw        $a0, 0x0($v0)
/* BA9FC 801242FC AC520004 */  sw        $s2, 0x4($v0)
/* BAA00 80124300 24620008 */  addiu     $v0, $v1, 0x8
/* BAA04 80124304 AE020000 */  sw        $v0, 0x0($s0)
/* BAA08 80124308 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* BAA0C 8012430C AC620000 */  sw        $v0, 0x0($v1)
/* BAA10 80124310 24620010 */  addiu     $v0, $v1, 0x10
/* BAA14 80124314 AC600004 */  sw        $zero, 0x4($v1)
/* BAA18 80124318 AE020000 */  sw        $v0, 0x0($s0)
/* BAA1C 8012431C 24620018 */  addiu     $v0, $v1, 0x18
/* BAA20 80124320 AC650008 */  sw        $a1, 0x8($v1)
/* BAA24 80124324 AC60000C */  sw        $zero, 0xC($v1)
/* BAA28 80124328 AE020000 */  sw        $v0, 0x0($s0)
/* BAA2C 8012432C 24620020 */  addiu     $v0, $v1, 0x20
/* BAA30 80124330 AC660010 */  sw        $a2, 0x10($v1)
/* BAA34 80124334 AC600014 */  sw        $zero, 0x14($v1)
/* BAA38 80124338 AE020000 */  sw        $v0, 0x0($s0)
/* BAA3C 8012433C AC680018 */  sw        $t0, 0x18($v1)
/* BAA40 80124340 080490D6 */  j         .L80124358
/* BAA44 80124344 AC67001C */   sw       $a3, 0x1C($v1)
.L80124348:
/* BAA48 80124348 26310001 */  addiu     $s1, $s1, 0x1
/* BAA4C 8012434C 2A220003 */  slti      $v0, $s1, 0x3
/* BAA50 80124350 1440FFBF */  bnez      $v0, .L80124250
/* BAA54 80124354 24A50558 */   addiu    $a1, $a1, 0x558
.L80124358:
/* BAA58 80124358 0000882D */  daddu     $s1, $zero, $zero
/* BAA5C 8012435C 24120005 */  addiu     $s2, $zero, 0x5
/* BAA60 80124360 3C108015 */  lui       $s0, %hi(gMessagePrinters)
/* BAA64 80124364 26104C30 */  addiu     $s0, $s0, %lo(gMessagePrinters)
.L80124368:
/* BAA68 80124368 8E0204FC */  lw        $v0, 0x4FC($s0)
/* BAA6C 8012436C 30420002 */  andi      $v0, $v0, 0x2
/* BAA70 80124370 50400026 */  beql      $v0, $zero, .L8012440C
/* BAA74 80124374 26100558 */   addiu    $s0, $s0, 0x558
/* BAA78 80124378 0C049EE9 */  jal       draw_message_window
/* BAA7C 8012437C 0200202D */   daddu    $a0, $s0, $zero
/* BAA80 80124380 920404F8 */  lbu       $a0, 0x4F8($s0)
/* BAA84 80124384 308300FF */  andi      $v1, $a0, 0xFF
/* BAA88 80124388 1472000C */  bne       $v1, $s2, .L801243BC
/* BAA8C 8012438C 2402000C */   addiu    $v0, $zero, 0xC
/* BAA90 80124390 8E0304FC */  lw        $v1, 0x4FC($s0)
/* BAA94 80124394 30628000 */  andi      $v0, $v1, 0x8000
/* BAA98 80124398 5440001C */  bnel      $v0, $zero, .L8012440C
/* BAA9C 8012439C 26100558 */   addiu    $s0, $s0, 0x558
/* BAAA0 801243A0 30620040 */  andi      $v0, $v1, 0x40
/* BAAA4 801243A4 54400019 */  bnel      $v0, $zero, .L8012440C
/* BAAA8 801243A8 26100558 */   addiu    $s0, $s0, 0x558
/* BAAAC 801243AC 0C0499E4 */  jal       msg_update_rewind_arrow
/* BAAB0 801243B0 0220202D */   daddu    $a0, $s1, $zero
/* BAAB4 801243B4 08049103 */  j         .L8012440C
/* BAAB8 801243B8 26100558 */   addiu    $s0, $s0, 0x558
.L801243BC:
/* BAABC 801243BC 14620005 */  bne       $v1, $v0, .L801243D4
/* BAAC0 801243C0 2482FFF9 */   addiu    $v0, $a0, -0x7
/* BAAC4 801243C4 0C049BAB */  jal       msg_draw_rewind_arrow
/* BAAC8 801243C8 0220202D */   daddu    $a0, $s1, $zero
/* BAACC 801243CC 08049103 */  j         .L8012440C
/* BAAD0 801243D0 26100558 */   addiu    $s0, $s0, 0x558
.L801243D4:
/* BAAD4 801243D4 304200FF */  andi      $v0, $v0, 0xFF
/* BAAD8 801243D8 2C420002 */  sltiu     $v0, $v0, 0x2
/* BAADC 801243DC 14400008 */  bnez      $v0, .L80124400
/* BAAE0 801243E0 3C020001 */   lui      $v0, (0x10000 >> 16)
/* BAAE4 801243E4 8E0304FC */  lw        $v1, 0x4FC($s0)
/* BAAE8 801243E8 00621024 */  and       $v0, $v1, $v0
/* BAAEC 801243EC 14400004 */  bnez      $v0, .L80124400
/* BAAF0 801243F0 3C020002 */   lui      $v0, (0x20000 >> 16)
/* BAAF4 801243F4 00621024 */  and       $v0, $v1, $v0
/* BAAF8 801243F8 50400004 */  beql      $v0, $zero, .L8012440C
/* BAAFC 801243FC 26100558 */   addiu    $s0, $s0, 0x558
.L80124400:
/* BAB00 80124400 0C049BDE */  jal       msg_draw_choice_pointer
/* BAB04 80124404 0200202D */   daddu    $a0, $s0, $zero
/* BAB08 80124408 26100558 */  addiu     $s0, $s0, 0x558
.L8012440C:
/* BAB0C 8012440C 26310001 */  addiu     $s1, $s1, 0x1
/* BAB10 80124410 2A220003 */  slti      $v0, $s1, 0x3
/* BAB14 80124414 1440FFD4 */  bnez      $v0, .L80124368
/* BAB18 80124418 00000000 */   nop
/* BAB1C 8012441C 8FBF002C */  lw        $ra, 0x2C($sp)
/* BAB20 80124420 8FB20028 */  lw        $s2, 0x28($sp)
/* BAB24 80124424 8FB10024 */  lw        $s1, 0x24($sp)
/* BAB28 80124428 8FB00020 */  lw        $s0, 0x20($sp)
/* BAB2C 8012442C 03E00008 */  jr        $ra
/* BAB30 80124430 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void render_messages(void) {
    Mtx* matrix = &gMessageWindowProjMatrix[gCurrentDisplayContextIndex];
    s32 i;

    for (i = 0; i < ARRAY_COUNT(gMessagePrinters); i++) {
        if (gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_2) {
            gSPViewport(gMainGfxPos++, D_8014C280);
            guOrtho(matrix, 0.0f, 319.0f, -240.0f, 0.0f, -500.0f, 500.0f, 1.0f);
            gSPMatrix(gMainGfxPos++, OS_K0_TO_PHYSICAL(matrix), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
            gDPPipeSync(gMainGfxPos++);
            gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
            gSPClearGeometryMode(gMainGfxPos++, G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
                                 G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
            gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
            break;
        }
    }

    for (i = 0; i < ARRAY_COUNT(gMessagePrinters); i++) {
        if (gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_2) {
            draw_message_window(&gMessagePrinters[i]);

            if (gMessagePrinters[i].windowState == MSG_WINDOW_STATE_WAITING) {
                if (!(gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_8000) &&
                    !(gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_40))
                {
                    msg_update_rewind_arrow(i);
                }
            } else if (gMessagePrinters[i].windowState == MSG_WINDOW_STATE_C) {
                msg_draw_rewind_arrow(i);
            } else if (gMessagePrinters[i].windowState == MSG_WINDOW_STATE_WAITING_FOR_CHOICE ||
                       gMessagePrinters[i].windowState == MSG_WINDOW_STATE_SCROLLING_BACK ||
                       gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_10000 ||
                       gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_20000)
            {
                msg_draw_choice_pointer(&gMessagePrinters[i]);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel AdjustCam
/* F1010 802CC660 27BDFF58 */  addiu     $sp, $sp, -0xA8
/* F1014 802CC664 AFB10064 */  sw        $s1, 0x64($sp)
/* F1018 802CC668 0080882D */  daddu     $s1, $a0, $zero
/* F101C 802CC66C AFB20068 */  sw        $s2, 0x68($sp)
/* F1020 802CC670 00A0902D */  daddu     $s2, $a1, $zero
/* F1024 802CC674 AFBF0070 */  sw        $ra, 0x70($sp)
/* F1028 802CC678 AFB3006C */  sw        $s3, 0x6C($sp)
/* F102C 802CC67C AFB00060 */  sw        $s0, 0x60($sp)
/* F1030 802CC680 F7BE00A0 */  sdc1      $f30, 0xA0($sp)
/* F1034 802CC684 F7BC0098 */  sdc1      $f28, 0x98($sp)
/* F1038 802CC688 F7BA0090 */  sdc1      $f26, 0x90($sp)
/* F103C 802CC68C F7B80088 */  sdc1      $f24, 0x88($sp)
/* F1040 802CC690 F7B60080 */  sdc1      $f22, 0x80($sp)
/* F1044 802CC694 F7B40078 */  sdc1      $f20, 0x78($sp)
/* F1048 802CC698 8E30000C */  lw        $s0, 0xC($s1)
/* F104C 802CC69C 8E050000 */  lw        $a1, 0x0($s0)
/* F1050 802CC6A0 0C0B1EAF */  jal       evt_get_variable
/* F1054 802CC6A4 26100004 */   addiu    $s0, $s0, 0x4
/* F1058 802CC6A8 8E050000 */  lw        $a1, 0x0($s0)
/* F105C 802CC6AC 26100004 */  addiu     $s0, $s0, 0x4
/* F1060 802CC6B0 0220202D */  daddu     $a0, $s1, $zero
/* F1064 802CC6B4 3C06800B */  lui       $a2, %hi(gCameras)
/* F1068 802CC6B8 24C61D80 */  addiu     $a2, $a2, %lo(gCameras)
/* F106C 802CC6BC 00021880 */  sll       $v1, $v0, 2
/* F1070 802CC6C0 00621821 */  addu      $v1, $v1, $v0
/* F1074 802CC6C4 00031880 */  sll       $v1, $v1, 2
/* F1078 802CC6C8 00621823 */  subu      $v1, $v1, $v0
/* F107C 802CC6CC 000310C0 */  sll       $v0, $v1, 3
/* F1080 802CC6D0 00621821 */  addu      $v1, $v1, $v0
/* F1084 802CC6D4 000318C0 */  sll       $v1, $v1, 3
/* F1088 802CC6D8 0C0B210B */  jal       evt_get_float_variable
/* F108C 802CC6DC 00669821 */   addu     $s3, $v1, $a2
/* F1090 802CC6E0 8E050000 */  lw        $a1, 0x0($s0)
/* F1094 802CC6E4 26100004 */  addiu     $s0, $s0, 0x4
/* F1098 802CC6E8 0220202D */  daddu     $a0, $s1, $zero
/* F109C 802CC6EC 0C0B210B */  jal       evt_get_float_variable
/* F10A0 802CC6F0 E7A00054 */   swc1     $f0, 0x54($sp)
/* F10A4 802CC6F4 8E050000 */  lw        $a1, 0x0($s0)
/* F10A8 802CC6F8 26100004 */  addiu     $s0, $s0, 0x4
/* F10AC 802CC6FC 0220202D */  daddu     $a0, $s1, $zero
/* F10B0 802CC700 0C0B210B */  jal       evt_get_float_variable
/* F10B4 802CC704 E7A00058 */   swc1     $f0, 0x58($sp)
/* F10B8 802CC708 8E050000 */  lw        $a1, 0x0($s0)
/* F10BC 802CC70C 26100004 */  addiu     $s0, $s0, 0x4
/* F10C0 802CC710 0220202D */  daddu     $a0, $s1, $zero
/* F10C4 802CC714 0C0B210B */  jal       evt_get_float_variable
/* F10C8 802CC718 46000786 */   mov.s    $f30, $f0
/* F10CC 802CC71C 0220202D */  daddu     $a0, $s1, $zero
/* F10D0 802CC720 8E050000 */  lw        $a1, 0x0($s0)
/* F10D4 802CC724 0C0B210B */  jal       evt_get_float_variable
/* F10D8 802CC728 46000706 */   mov.s    $f28, $f0
/* F10DC 802CC72C 3C038011 */  lui       $v1, %hi(gPlayerStatus)
/* F10E0 802CC730 2463EFC8 */  addiu     $v1, $v1, %lo(gPlayerStatus)
/* F10E4 802CC734 1240004E */  beqz      $s2, .L802CC870
/* F10E8 802CC738 46000686 */   mov.s    $f26, $f0
/* F10EC 802CC73C 3C0146FF */  lui       $at, (0x46FFFE00 >> 16)
/* F10F0 802CC740 3421FE00 */  ori       $at, $at, (0x46FFFE00 & 0xFFFF)
/* F10F4 802CC744 44811000 */  mtc1      $at, $f2
/* F10F8 802CC748 44802000 */  mtc1      $zero, $f4
/* F10FC 802CC74C 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* F1100 802CC750 44810000 */  mtc1      $at, $f0
/* F1104 802CC754 3C014120 */  lui       $at, (0x41200000 >> 16)
/* F1108 802CC758 44817000 */  mtc1      $at, $f14
/* F110C 802CC75C 27A20038 */  addiu     $v0, $sp, 0x38
/* F1110 802CC760 E7A20044 */  swc1      $f2, 0x44($sp)
/* F1114 802CC764 AFA20018 */  sw        $v0, 0x18($sp)
/* F1118 802CC768 27A2003C */  addiu     $v0, $sp, 0x3C
/* F111C 802CC76C AFA2001C */  sw        $v0, 0x1C($sp)
/* F1120 802CC770 27A20040 */  addiu     $v0, $sp, 0x40
/* F1124 802CC774 AFA20020 */  sw        $v0, 0x20($sp)
/* F1128 802CC778 27A20044 */  addiu     $v0, $sp, 0x44
/* F112C 802CC77C AFA20024 */  sw        $v0, 0x24($sp)
/* F1130 802CC780 27A20048 */  addiu     $v0, $sp, 0x48
/* F1134 802CC784 AFA20028 */  sw        $v0, 0x28($sp)
/* F1138 802CC788 27A2004C */  addiu     $v0, $sp, 0x4C
/* F113C 802CC78C E7A00010 */  swc1      $f0, 0x10($sp)
/* F1140 802CC790 E7A40014 */  swc1      $f4, 0x14($sp)
/* F1144 802CC794 AFA2002C */  sw        $v0, 0x2C($sp)
/* F1148 802CC798 C476002C */  lwc1      $f22, 0x2C($v1)
/* F114C 802CC79C 27A20050 */  addiu     $v0, $sp, 0x50
/* F1150 802CC7A0 AFA20030 */  sw        $v0, 0x30($sp)
/* F1154 802CC7A4 C4740030 */  lwc1      $f20, 0x30($v1)
/* F1158 802CC7A8 C4780028 */  lwc1      $f24, 0x28($v1)
/* F115C 802CC7AC 44072000 */  mfc1      $a3, $f4
/* F1160 802CC7B0 460EB380 */  add.s     $f14, $f22, $f14
/* F1164 802CC7B4 4406A000 */  mfc1      $a2, $f20
/* F1168 802CC7B8 0C017449 */  jal       test_ray_zones
/* F116C 802CC7BC 4600C306 */   mov.s    $f12, $f24
/* F1170 802CC7C0 0040182D */  daddu     $v1, $v0, $zero
/* F1174 802CC7C4 0460001A */  bltz      $v1, .L802CC830
/* F1178 802CC7C8 000310C0 */   sll      $v0, $v1, 3
/* F117C 802CC7CC 00431023 */  subu      $v0, $v0, $v1
/* F1180 802CC7D0 3C03800E */  lui       $v1, %hi(D_800D91D4)
/* F1184 802CC7D4 8C6391D4 */  lw        $v1, %lo(D_800D91D4)($v1)
/* F1188 802CC7D8 00021080 */  sll       $v0, $v0, 2
/* F118C 802CC7DC 00431021 */  addu      $v0, $v0, $v1
/* F1190 802CC7E0 8C420010 */  lw        $v0, 0x10($v0)
/* F1194 802CC7E4 266304D8 */  addiu     $v1, $s3, 0x4D8
/* F1198 802CC7E8 24440020 */  addiu     $a0, $v0, 0x20
.L802CC7EC:
/* F119C 802CC7EC 8C480000 */  lw        $t0, 0x0($v0)
/* F11A0 802CC7F0 8C490004 */  lw        $t1, 0x4($v0)
/* F11A4 802CC7F4 8C4A0008 */  lw        $t2, 0x8($v0)
/* F11A8 802CC7F8 8C4B000C */  lw        $t3, 0xC($v0)
/* F11AC 802CC7FC AC680000 */  sw        $t0, 0x0($v1)
/* F11B0 802CC800 AC690004 */  sw        $t1, 0x4($v1)
/* F11B4 802CC804 AC6A0008 */  sw        $t2, 0x8($v1)
/* F11B8 802CC808 AC6B000C */  sw        $t3, 0xC($v1)
/* F11BC 802CC80C 24420010 */  addiu     $v0, $v0, 0x10
/* F11C0 802CC810 1444FFF6 */  bne       $v0, $a0, .L802CC7EC
/* F11C4 802CC814 24630010 */   addiu    $v1, $v1, 0x10
/* F11C8 802CC818 8C480000 */  lw        $t0, 0x0($v0)
/* F11CC 802CC81C 8C490004 */  lw        $t1, 0x4($v0)
/* F11D0 802CC820 8C4A0008 */  lw        $t2, 0x8($v0)
/* F11D4 802CC824 AC680000 */  sw        $t0, 0x0($v1)
/* F11D8 802CC828 AC690004 */  sw        $t1, 0x4($v1)
/* F11DC 802CC82C AC6A0008 */  sw        $t2, 0x8($v1)
.L802CC830:
/* F11E0 802CC830 E67604B4 */  swc1      $f22, 0x4B4($s3)
/* F11E4 802CC834 E67404B8 */  swc1      $f20, 0x4B8($s3)
/* F11E8 802CC838 E67E04DC */  swc1      $f30, 0x4DC($s3)
/* F11EC 802CC83C E67C04E0 */  swc1      $f28, 0x4E0($s3)
/* F11F0 802CC840 E67A04FC */  swc1      $f26, 0x4FC($s3)
/* F11F4 802CC844 C7A60054 */  lwc1      $f6, 0x54($sp)
/* F11F8 802CC848 24030001 */  addiu     $v1, $zero, 0x1
/* F11FC 802CC84C E6660490 */  swc1      $f6, 0x490($s3)
/* F1200 802CC850 A6630506 */  sh        $v1, 0x506($s3)
/* F1204 802CC854 C7A60058 */  lwc1      $f6, 0x58($sp)
/* F1208 802CC858 0000102D */  daddu     $v0, $zero, $zero
/* F120C 802CC85C 4606C000 */  add.s     $f0, $f24, $f6
/* F1210 802CC860 A6630504 */  sh        $v1, 0x504($s3)
/* F1214 802CC864 AE600508 */  sw        $zero, 0x508($s3)
/* F1218 802CC868 080B3225 */  j         .L802CC894
/* F121C 802CC86C E66004B0 */   swc1     $f0, 0x4B0($s3)
.L802CC870:
/* F1220 802CC870 C6620484 */  lwc1      $f2, 0x484($s3)
/* F1224 802CC874 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F1228 802CC878 44810000 */  mtc1      $at, $f0
/* F122C 802CC87C 00000000 */  nop
/* F1230 802CC880 4602003E */  c.le.s    $f0, $f2
/* F1234 802CC884 00000000 */  nop
/* F1238 802CC888 45010002 */  bc1t      .L802CC894
/* F123C 802CC88C 24020002 */   addiu    $v0, $zero, 0x2
/* F1240 802CC890 0000102D */  daddu     $v0, $zero, $zero
.L802CC894:
/* F1244 802CC894 8FBF0070 */  lw        $ra, 0x70($sp)
/* F1248 802CC898 8FB3006C */  lw        $s3, 0x6C($sp)
/* F124C 802CC89C 8FB20068 */  lw        $s2, 0x68($sp)
/* F1250 802CC8A0 8FB10064 */  lw        $s1, 0x64($sp)
/* F1254 802CC8A4 8FB00060 */  lw        $s0, 0x60($sp)
/* F1258 802CC8A8 D7BE00A0 */  ldc1      $f30, 0xA0($sp)
/* F125C 802CC8AC D7BC0098 */  ldc1      $f28, 0x98($sp)
/* F1260 802CC8B0 D7BA0090 */  ldc1      $f26, 0x90($sp)
/* F1264 802CC8B4 D7B80088 */  ldc1      $f24, 0x88($sp)
/* F1268 802CC8B8 D7B60080 */  ldc1      $f22, 0x80($sp)
/* F126C 802CC8BC D7B40078 */  ldc1      $f20, 0x78($sp)
/* F1270 802CC8C0 03E00008 */  jr        $ra
/* F1274 802CC8C4 27BD00A8 */   addiu    $sp, $sp, 0xA8

### DECOMPILED C INSTRUCTIONS:

ApiStatus AdjustCam(Evt* script, s32 isInitialCall) {
    f32 hitX, hitY, hitZ, hitDepth, nX, nY, nZ;
    f32 posX, posY, posZ;
    s32 zoneID;
    Bytecode* args = script->ptrReadPos;
    Camera* camera = &gCameras[evt_get_variable(script, *args++)];
    f32 moveSpeed = evt_get_float_variable(script, *args++);
    f32 deltaPosX = evt_get_float_variable(script, *args++);
    f32 boomLength = evt_get_float_variable(script, *args++);
    f32 boomPitch = evt_get_float_variable(script, *args++);
    f32 viewPitch = evt_get_float_variable(script, *args++);
    PlayerStatus* playerStatus = &gPlayerStatus;

    if (isInitialCall) {
        hitDepth = 32767.0f;
        posX = playerStatus->position.x;
        posY = playerStatus->position.y;
        posZ = playerStatus->position.z;
        zoneID = test_ray_zones(posX, posY + 10.0f, posZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &nX, &nY, &nZ);
        if (zoneID >= 0) {
            camera->controlSettings = *gZoneCollisionData.colliderList[zoneID].camSettings;
        }

        camera->movePos.x = posX + deltaPosX;
        camera->movePos.y = posY;
        camera->movePos.z = posZ;
        camera->controlSettings.boomLength = boomLength;
        camera->controlSettings.boomPitch = boomPitch;
        camera->controlSettings.viewPitch = viewPitch;
        camera->moveSpeed = moveSpeed;
        camera->panActive = TRUE;
        camera->followPlayer = TRUE;
        camera->panPhase = 0.0f;
        return ApiStatus_BLOCK;
    }

    if (camera->interpAlpha >= 1.0f) {
        return ApiStatus_DONE2;
    } else {
        return ApiStatus_BLOCK;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ispy_notification_update
/* E2290C 802B735C 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* E22910 802B7360 3C058011 */  lui       $a1, %hi(gPlayerStatus)
/* E22914 802B7364 24A5EFC8 */  addiu     $a1, $a1, %lo(gPlayerStatus)
/* E22918 802B7368 AFBF0010 */  sw        $ra, 0x10($sp)
/* E2291C 802B736C 84A200B0 */  lh        $v0, 0xB0($a1)
/* E22920 802B7370 C4A0002C */  lwc1      $f0, 0x2C($a1)
/* E22924 802B7374 44821000 */  mtc1      $v0, $f2
/* E22928 802B7378 00000000 */  nop
/* E2292C 802B737C 468010A0 */  cvt.s.w   $f2, $f2
/* E22930 802B7380 46020000 */  add.s     $f0, $f0, $f2
/* E22934 802B7384 3C014120 */  lui       $at, (0x41200000 >> 16)
/* E22938 802B7388 44811000 */  mtc1      $at, $f2
/* E2293C 802B738C 3C04802B */  lui       $a0, %hi(ISpyPtr)
.L802B7390:
/* E22940 802B7390 8C847C78 */  lw        $a0, %lo(ISpyPtr)($a0)
/* E22944 802B7394 46020000 */  add.s     $f0, $f0, $f2
/* E22948 802B7398 C4820004 */  lwc1      $f2, 0x4($a0)
/* E2294C 802B739C 46020001 */  sub.s     $f0, $f0, $f2
/* E22950 802B73A0 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* E22954 802B73A4 44812000 */  mtc1      $at, $f4
/* E22958 802B73A8 00000000 */  nop
/* E2295C 802B73AC 46040003 */  div.s     $f0, $f0, $f4
/* E22960 802B73B0 46001080 */  add.s     $f2, $f2, $f0
/* E22964 802B73B4 8C830024 */  lw        $v1, 0x24($a0)
/* E22968 802B73B8 E4820004 */  swc1      $f2, 0x4($a0)
/* E2296C 802B73BC C4A00028 */  lwc1      $f0, 0x28($a1)
glabel .L802B73C0
/* E22970 802B73C0 3C068011 */  lui       $a2, %hi(gPartnerStatus)
/* E22974 802B73C4 24C6EBB0 */  addiu     $a2, $a2, %lo(gPartnerStatus)
glabel .L802B73C8
/* E22978 802B73C8 E4800000 */  swc1      $f0, 0x0($a0)
/* E2297C 802B73CC C4A00030 */  lwc1      $f0, 0x30($a1)
glabel .L802B73D0
/* E22980 802B73D0 24020001 */  addiu     $v0, $zero, 0x1
/* E22984 802B73D4 10620022 */  beq       $v1, $v0, .L802B7460
glabel .L802B73D8
/* E22988 802B73D8 E4800008 */   swc1     $f0, 0x8($a0)
/* E2298C 802B73DC 28620002 */  slti      $v0, $v1, 0x2
glabel .L802B73E0
/* E22990 802B73E0 50400005 */  beql      $v0, $zero, .L802B73F8
/* E22994 802B73E4 24020002 */   addiu    $v0, $zero, 0x2
glabel .L802B73E8
/* E22998 802B73E8 10600009 */  beqz      $v1, .L802B7410
/* E2299C 802B73EC 00000000 */   nop
.L802B73F0:
/* E229A0 802B73F0 080ADD5A */  j         .L802B7568
/* E229A4 802B73F4 00000000 */   nop
.L802B73F8:
/* E229A8 802B73F8 1062002D */  beq       $v1, $v0, .L802B74B0
.L802B73FC:
/* E229AC 802B73FC 24020003 */   addiu    $v0, $zero, 0x3
/* E229B0 802B7400 10620037 */  beq       $v1, $v0, .L802B74E0
/* E229B4 802B7404 00000000 */   nop
.L802B7408:
/* E229B8 802B7408 080ADD5A */  j         .L802B7568
/* E229BC 802B740C 00000000 */   nop
.L802B7410:
/* E229C0 802B7410 80C20000 */  lb        $v0, 0x0($a2)
/* E229C4 802B7414 10400008 */  beqz      $v0, .L802B7438
/* E229C8 802B7418 24020008 */   addiu    $v0, $zero, 0x8
/* E229CC 802B741C 80C30003 */  lb        $v1, 0x3($a2)
/* E229D0 802B7420 14620005 */  bne       $v1, $v0, .L802B7438
/* E229D4 802B7424 00000000 */   nop
/* E229D8 802B7428 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
glabel interact_speech_update
/* E229DC 802B742C 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* E229E0 802B7430 080ADD10 */  j         .L802B7440
/* E229E4 802B7434 8042007D */   lb       $v0, 0x7D($v0)
.L802B7438:
/* E229E8 802B7438 8CA20000 */  lw        $v0, 0x0($a1)
/* E229EC 802B743C 30423000 */  andi      $v0, $v0, 0x3000
.L802B7440:
/* E229F0 802B7440 14400049 */  bnez      $v0, .L802B7568
.L802B7444:
/* E229F4 802B7444 00000000 */   nop
/* E229F8 802B7448 3C03802B */  lui       $v1, %hi(ISpyPtr)
/* E229FC 802B744C 8C637C78 */  lw        $v1, %lo(ISpyPtr)($v1)
glabel should_continue_inspect
/* E22A00 802B7450 8C620024 */  lw        $v0, 0x24($v1)
/* E22A04 802B7454 24420001 */  addiu     $v0, $v0, 0x1
/* E22A08 802B7458 080ADD5A */  j         .L802B7568
/* E22A0C 802B745C AC620024 */   sw       $v0, 0x24($v1)
.L802B7460:
/* E22A10 802B7460 8CA20000 */  lw        $v0, 0x0($a1)
.L802B7464:
/* E22A14 802B7464 30420020 */  andi      $v0, $v0, 0x20
/* E22A18 802B7468 10400003 */  beqz      $v0, .L802B7478
/* E22A1C 802B746C 24020003 */   addiu    $v0, $zero, 0x3
/* E22A20 802B7470 080ADD5A */  j         .L802B7568
/* E22A24 802B7474 AC820024 */   sw       $v0, 0x24($a0)
.L802B7478:
/* E22A28 802B7478 8C820018 */  lw        $v0, 0x18($a0)
/* E22A2C 802B747C 0040182D */  daddu     $v1, $v0, $zero
/* E22A30 802B7480 24420001 */  addiu     $v0, $v0, 0x1
/* E22A34 802B7484 28630010 */  slti      $v1, $v1, 0x10
/* E22A38 802B7488 14600037 */  bnez      $v1, .L802B7568
/* E22A3C 802B748C AC820018 */   sw       $v0, 0x18($a0)
/* E22A40 802B7490 8C820024 */  lw        $v0, 0x24($a0)
/* E22A44 802B7494 3C013EB8 */  lui       $at, (0x3EB851EC >> 16)
.L802B7498:
/* E22A48 802B7498 342151EC */  ori       $at, $at, (0x3EB851EC & 0xFFFF)
/* E22A4C 802B749C 44810000 */  mtc1      $at, $f0
/* E22A50 802B74A0 24420001 */  addiu     $v0, $v0, 0x1
/* E22A54 802B74A4 E480000C */  swc1      $f0, 0xC($a0)
.L802B74A8:
/* E22A58 802B74A8 080ADD5A */  j         .L802B7568
/* E22A5C 802B74AC AC820024 */   sw       $v0, 0x24($a0)
.L802B74B0:
/* E22A60 802B74B0 0000282D */  daddu     $a1, $zero, $zero
/* E22A64 802B74B4 8C820024 */  lw        $v0, 0x24($a0)
/* E22A68 802B74B8 3C013F11 */  lui       $at, (0x3F11EB85 >> 16)
/* E22A6C 802B74BC 3421EB85 */  ori       $at, $at, (0x3F11EB85 & 0xFFFF)
/* E22A70 802B74C0 44810000 */  mtc1      $at, $f0
/* E22A74 802B74C4 24420001 */  addiu     $v0, $v0, 0x1
glabel .L802B74C8
/* E22A78 802B74C8 E480000C */  swc1      $f0, 0xC($a0)
/* E22A7C 802B74CC AC820024 */  sw        $v0, 0x24($a0)
.L802B74D0:
/* E22A80 802B74D0 0C052736 */  jal       sfx_play_sound_at_player
.L802B74D4:
/* E22A84 802B74D4 2404017B */   addiu    $a0, $zero, 0x17B
/* E22A88 802B74D8 080ADD5A */  j         .L802B7568
.L802B74DC:
/* E22A8C 802B74DC 00000000 */   nop
.L802B74E0:
/* E22A90 802B74E0 8C820018 */  lw        $v0, 0x18($a0)
/* E22A94 802B74E4 3C013F07 */  lui       $at, (0x3F07AE14 >> 16)
/* E22A98 802B74E8 3421AE14 */  ori       $at, $at, (0x3F07AE14 & 0xFFFF)
/* E22A9C 802B74EC 44810000 */  mtc1      $at, $f0
glabel pulse_stone_notification_update
/* E22AA0 802B74F0 2842002F */  slti      $v0, $v0, 0x2F
.L802B74F4:
/* E22AA4 802B74F4 10400005 */  beqz      $v0, .L802B750C
/* E22AA8 802B74F8 E480000C */   swc1     $f0, 0xC($a0)
/* E22AAC 802B74FC 8CA20000 */  lw        $v0, 0x0($a1)
/* E22AB0 802B7500 30420020 */  andi      $v0, $v0, 0x20
/* E22AB4 802B7504 10400008 */  beqz      $v0, .L802B7528
/* E22AB8 802B7508 00000000 */   nop
.L802B750C:
/* E22ABC 802B750C 8C820028 */  lw        $v0, 0x28($a0)
/* E22AC0 802B7510 2442FFC0 */  addiu     $v0, $v0, -0x40
/* E22AC4 802B7514 04410004 */  bgez      $v0, .L802B7528
/* E22AC8 802B7518 AC820028 */   sw       $v0, 0x28($a0)
/* E22ACC 802B751C 24020033 */  addiu     $v0, $zero, 0x33
.L802B7520:
/* E22AD0 802B7520 AC800028 */  sw        $zero, 0x28($a0)
.L802B7524:
/* E22AD4 802B7524 AC820018 */  sw        $v0, 0x18($a0)
.L802B7528:
/* E22AD8 802B7528 3C02802B */  lui       $v0, %hi(ISpyPtr)
/* E22ADC 802B752C 8C427C78 */  lw        $v0, %lo(ISpyPtr)($v0)
/* E22AE0 802B7530 8C430018 */  lw        $v1, 0x18($v0)
/* E22AE4 802B7534 0060202D */  daddu     $a0, $v1, $zero
/* E22AE8 802B7538 24630001 */  addiu     $v1, $v1, 0x1
/* E22AEC 802B753C 28840033 */  slti      $a0, $a0, 0x33
/* E22AF0 802B7540 14800009 */  bnez      $a0, .L802B7568
.L802B7544:
/* E22AF4 802B7544 AC430018 */   sw       $v1, 0x18($v0)
/* E22AF8 802B7548 3C018016 */  lui       $at, %hi(D_8015A57A)
/* E22AFC 802B754C A020A57A */  sb        $zero, %lo(D_8015A57A)($at)
/* E22B00 802B7550 8CA20004 */  lw        $v0, 0x4($a1)
/* E22B04 802B7554 2403FEFF */  addiu     $v1, $zero, -0x101
.L802B7558:
/* E22B08 802B7558 3C018011 */  lui       $at, %hi(ISpyNotificationCallback)
/* E22B0C 802B755C AC20C93C */  sw        $zero, %lo(ISpyNotificationCallback)($at)
/* E22B10 802B7560 00431024 */  and       $v0, $v0, $v1
.L802B7564:
/* E22B14 802B7564 ACA20004 */  sw        $v0, 0x4($a1)
.L802B7568:
/* E22B18 802B7568 8FBF0010 */  lw        $ra, 0x10($sp)
.L802B756C:
/* E22B1C 802B756C 03E00008 */  jr        $ra
/* E22B20 802B7570 27BD0018 */   addiu    $sp, $sp, 0x18
/* E22B24 802B7574 00000000 */  nop
/* E22B28 802B7578 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void ispy_notification_update(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    PartnerStatus* partnerStatus = &gPartnerStatus;
    s32 cond;

    ISpyPtr->pos.y +=
        (playerStatus->position.y + playerStatus->colliderHeight + 10.0f - ISpyPtr->pos.y) / 1.5f;
    ISpyPtr->pos.x = playerStatus->position.x;
    ISpyPtr->pos.z = playerStatus->position.z;

    switch (ISpyPtr->state) {
        case I_SPY_DELAY:
            if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE
             && partnerStatus->actingPartner == PARTNER_LAKILESTER
            ) {
                cond = gGameStatusPtr->keepUsingPartnerOnMapChange;
            } else {
                cond = playerStatus->flags & (PS_FLAG_INPUT_DISABLED | PS_FLAG_NO_STATIC_COLLISION);
            }

            if (!cond) {
                ISpyPtr->state++;
            }
            break;
        case I_SPY_APPEAR:
            if (playerStatus->flags & PS_FLAG_PAUSED) {
                ISpyPtr->state = I_SPY_ANIMATE;
                return;
            }

            if (ISpyPtr->time++ >= 16) {
                ISpyPtr->scale = 0.36f;
                ISpyPtr->state++;
            }
            break;
        case I_SPY_OVERSHOOT:
            ISpyPtr->scale = 0.57f;
            ISpyPtr->state++;
            sfx_play_sound_at_player(SOUND_17B, SOUND_SPACE_MODE_0);
            break;
        case I_SPY_ANIMATE:
            ISpyPtr->scale = 0.53f;
            if (ISpyPtr->time >= 47 || playerStatus->flags & PS_FLAG_PAUSED) {
                ISpyPtr->alpha -= 64;
                if (ISpyPtr->alpha < 0) {
                    ISpyPtr->alpha = 0;
                    ISpyPtr->time = 51;
                }
            }

            if (ISpyPtr->time++ > 50) {
                gCurrentHiddenPanels.activateISpy = FALSE;
                ISpyNotificationCallback = NULL;
                playerStatus->animFlags &= ~PA_FLAG_ISPY_VISIBLE;
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel moving_cloud_appendGfx
/* 3E1A4C E00E83BC 27BDFF50 */  addiu     $sp, $sp, -0xB0
/* 3E1A50 E00E83C0 0080302D */  daddu     $a2, $a0, $zero
/* 3E1A54 E00E83C4 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3E1A58 E00E83C8 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3E1A5C E00E83CC 27A40010 */  addiu     $a0, $sp, 0x10
/* 3E1A60 E00E83D0 AFB600A8 */  sw        $s6, 0xA8($sp)
/* 3E1A64 E00E83D4 3C160001 */  lui       $s6, (0x11630 >> 16)
/* 3E1A68 E00E83D8 AFB3009C */  sw        $s3, 0x9C($sp)
/* 3E1A6C E00E83DC 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 3E1A70 E00E83E0 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 3E1A74 E00E83E4 36D61630 */  ori       $s6, $s6, (0x11630 & 0xFFFF)
/* 3E1A78 E00E83E8 AFBF00AC */  sw        $ra, 0xAC($sp)
/* 3E1A7C E00E83EC AFB500A4 */  sw        $s5, 0xA4($sp)
/* 3E1A80 E00E83F0 AFB400A0 */  sw        $s4, 0xA0($sp)
/* 3E1A84 E00E83F4 AFB20098 */  sw        $s2, 0x98($sp)
/* 3E1A88 E00E83F8 AFB10094 */  sw        $s1, 0x94($sp)
/* 3E1A8C E00E83FC AFB00090 */  sw        $s0, 0x90($sp)
/* 3E1A90 E00E8400 8E650000 */  lw        $a1, 0x0($s3)
/* 3E1A94 E00E8404 8CD2000C */  lw        $s2, 0xC($a2)
/* 3E1A98 E00E8408 00A0182D */  daddu     $v1, $a1, $zero
/* 3E1A9C E00E840C 24A50008 */  addiu     $a1, $a1, 0x8
/* 3E1AA0 E00E8410 AE650000 */  sw        $a1, 0x0($s3)
/* 3E1AA4 E00E8414 8E550030 */  lw        $s5, 0x30($s2)
/* 3E1AA8 E00E8418 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3E1AAC E00E841C AC620000 */  sw        $v0, 0x0($v1)
/* 3E1AB0 E00E8420 AC600004 */  sw        $zero, 0x4($v1)
/* 3E1AB4 E00E8424 ACA70000 */  sw        $a3, 0x0($a1)
/* 3E1AB8 E00E8428 8CC30010 */  lw        $v1, 0x10($a2)
/* 3E1ABC E00E842C 24A20008 */  addiu     $v0, $a1, 0x8
/* 3E1AC0 E00E8430 AE620000 */  sw        $v0, 0x0($s3)
/* 3E1AC4 E00E8434 8C62001C */  lw        $v0, 0x1C($v1)
/* 3E1AC8 E00E8438 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3E1ACC E00E843C 00431021 */  addu      $v0, $v0, $v1
/* 3E1AD0 E00E8440 3C03800B */  lui       $v1, %hi(gCameras)
/* 3E1AD4 E00E8444 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
/* 3E1AD8 E00E8448 ACA20004 */  sw        $v0, 0x4($a1)
/* 3E1ADC E00E844C 8E450004 */  lw        $a1, 0x4($s2)
/* 3E1AE0 E00E8450 8E460008 */  lw        $a2, 0x8($s2)
/* 3E1AE4 E00E8454 3C028007 */  lui       $v0, %hi(gCurrentCameraID)
/* 3E1AE8 E00E8458 8C427410 */  lw        $v0, %lo(gCurrentCameraID)($v0)
/* 3E1AEC E00E845C 8E47000C */  lw        $a3, 0xC($s2)
/* 3E1AF0 E00E8460 00028080 */  sll       $s0, $v0, 2
/* 3E1AF4 E00E8464 02028021 */  addu      $s0, $s0, $v0
/* 3E1AF8 E00E8468 00108080 */  sll       $s0, $s0, 2
/* 3E1AFC E00E846C 02028023 */  subu      $s0, $s0, $v0
/* 3E1B00 E00E8470 001010C0 */  sll       $v0, $s0, 3
/* 3E1B04 E00E8474 02028021 */  addu      $s0, $s0, $v0
/* 3E1B08 E00E8478 001080C0 */  sll       $s0, $s0, 3
/* 3E1B0C E00E847C 0C080108 */  jal       shim_guTranslateF
/* 3E1B10 E00E8480 02038021 */   addu     $s0, $s0, $v1
/* 3E1B14 E00E8484 27B10050 */  addiu     $s1, $sp, 0x50
/* 3E1B18 E00E8488 8E450044 */  lw        $a1, 0x44($s2)
/* 3E1B1C E00E848C 0220202D */  daddu     $a0, $s1, $zero
/* 3E1B20 E00E8490 00A0302D */  daddu     $a2, $a1, $zero
/* 3E1B24 E00E8494 0C080110 */  jal       shim_guScaleF
/* 3E1B28 E00E8498 00A0382D */   daddu    $a3, $a1, $zero
/* 3E1B2C E00E849C 0220202D */  daddu     $a0, $s1, $zero
/* 3E1B30 E00E84A0 27A50010 */  addiu     $a1, $sp, 0x10
/* 3E1B34 E00E84A4 0C080114 */  jal       shim_guMtxCatF
/* 3E1B38 E00E84A8 00A0302D */   daddu    $a2, $a1, $zero
/* 3E1B3C E00E84AC 27A40010 */  addiu     $a0, $sp, 0x10
/* 3E1B40 E00E84B0 3C118007 */  lui       $s1, %hi(gMatrixListPos)
/* 3E1B44 E00E84B4 263141F0 */  addiu     $s1, $s1, %lo(gMatrixListPos)
/* 3E1B48 E00E84B8 3C14800A */  lui       $s4, %hi(gDisplayContext)
/* 3E1B4C E00E84BC 2694A674 */  addiu     $s4, $s4, %lo(gDisplayContext)
/* 3E1B50 E00E84C0 96250000 */  lhu       $a1, 0x0($s1)
/* 3E1B54 E00E84C4 8E820000 */  lw        $v0, 0x0($s4)
/* 3E1B58 E00E84C8 00052980 */  sll       $a1, $a1, 6
/* 3E1B5C E00E84CC 00B62821 */  addu      $a1, $a1, $s6
/* 3E1B60 E00E84D0 0C080118 */  jal       shim_guMtxF2L
/* 3E1B64 E00E84D4 00452821 */   addu     $a1, $v0, $a1
/* 3E1B68 E00E84D8 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 3E1B6C E00E84DC 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3E1B70 E00E84E0 3C06DA38 */  lui       $a2, (0xDA380001 >> 16)
/* 3E1B74 E00E84E4 34C60001 */  ori       $a2, $a2, (0xDA380001 & 0xFFFF)
/* 3E1B78 E00E84E8 3C09D838 */  lui       $t1, (0xD8380002 >> 16)
/* 3E1B7C E00E84EC 35290002 */  ori       $t1, $t1, (0xD8380002 & 0xFFFF)
/* 3E1B80 E00E84F0 32B500FF */  andi      $s5, $s5, 0xFF
/* 3E1B84 E00E84F4 3C07DE00 */  lui       $a3, (0xDE000000 >> 16)
/* 3E1B88 E00E84F8 8E640000 */  lw        $a0, 0x0($s3)
/* 3E1B8C E00E84FC 96220000 */  lhu       $v0, 0x0($s1)
/* 3E1B90 E00E8500 0080282D */  daddu     $a1, $a0, $zero
/* 3E1B94 E00E8504 24840008 */  addiu     $a0, $a0, 0x8
/* 3E1B98 E00E8508 AE640000 */  sw        $a0, 0x0($s3)
/* 3E1B9C E00E850C ACA30000 */  sw        $v1, 0x0($a1)
/* 3E1BA0 E00E8510 24430001 */  addiu     $v1, $v0, 0x1
/* 3E1BA4 E00E8514 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3E1BA8 E00E8518 00021180 */  sll       $v0, $v0, 6
/* 3E1BAC E00E851C A6230000 */  sh        $v1, 0x0($s1)
/* 3E1BB0 E00E8520 8E830000 */  lw        $v1, 0x0($s4)
/* 3E1BB4 E00E8524 00561021 */  addu      $v0, $v0, $s6
/* 3E1BB8 E00E8528 00621821 */  addu      $v1, $v1, $v0
/* 3E1BBC E00E852C 24820008 */  addiu     $v0, $a0, 0x8
/* 3E1BC0 E00E8530 ACA30004 */  sw        $v1, 0x4($a1)
/* 3E1BC4 E00E8534 AE620000 */  sw        $v0, 0x0($s3)
/* 3E1BC8 E00E8538 24820010 */  addiu     $v0, $a0, 0x10
/* 3E1BCC E00E853C AC860000 */  sw        $a2, 0x0($a0)
/* 3E1BD0 E00E8540 AE620000 */  sw        $v0, 0x0($s3)
/* 3E1BD4 E00E8544 8E030204 */  lw        $v1, 0x204($s0)
/* 3E1BD8 E00E8548 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3E1BDC E00E854C AC820008 */  sw        $v0, 0x8($a0)
/* 3E1BE0 E00E8550 AC830004 */  sw        $v1, 0x4($a0)
/* 3E1BE4 E00E8554 92420027 */  lbu       $v0, 0x27($s2)
/* 3E1BE8 E00E8558 9245002B */  lbu       $a1, 0x2B($s2)
/* 3E1BEC E00E855C 9246002F */  lbu       $a2, 0x2F($s2)
/* 3E1BF0 E00E8560 24830018 */  addiu     $v1, $a0, 0x18
/* 3E1BF4 E00E8564 AE630000 */  sw        $v1, 0x0($s3)
/* 3E1BF8 E00E8568 3C03FB00 */  lui       $v1, (0xFB000000 >> 16)
/* 3E1BFC E00E856C AC830010 */  sw        $v1, 0x10($a0)
/* 3E1C00 E00E8570 00021600 */  sll       $v0, $v0, 24
/* 3E1C04 E00E8574 00052C00 */  sll       $a1, $a1, 16
/* 3E1C08 E00E8578 00451025 */  or        $v0, $v0, $a1
/* 3E1C0C E00E857C 00063200 */  sll       $a2, $a2, 8
/* 3E1C10 E00E8580 00461025 */  or        $v0, $v0, $a2
/* 3E1C14 E00E8584 00551025 */  or        $v0, $v0, $s5
/* 3E1C18 E00E8588 AC82000C */  sw        $v0, 0xC($a0)
/* 3E1C1C E00E858C 92420037 */  lbu       $v0, 0x37($s2)
/* 3E1C20 E00E8590 9245003B */  lbu       $a1, 0x3B($s2)
/* 3E1C24 E00E8594 9246003F */  lbu       $a2, 0x3F($s2)
/* 3E1C28 E00E8598 92480043 */  lbu       $t0, 0x43($s2)
/* 3E1C2C E00E859C 24830020 */  addiu     $v1, $a0, 0x20
/* 3E1C30 E00E85A0 AE630000 */  sw        $v1, 0x0($s3)
/* 3E1C34 E00E85A4 AC870018 */  sw        $a3, 0x18($a0)
/* 3E1C38 E00E85A8 00021600 */  sll       $v0, $v0, 24
/* 3E1C3C E00E85AC 00052C00 */  sll       $a1, $a1, 16
/* 3E1C40 E00E85B0 00451025 */  or        $v0, $v0, $a1
/* 3E1C44 E00E85B4 00063200 */  sll       $a2, $a2, 8
/* 3E1C48 E00E85B8 00461025 */  or        $v0, $v0, $a2
/* 3E1C4C E00E85BC 00481025 */  or        $v0, $v0, $t0
/* 3E1C50 E00E85C0 AC820014 */  sw        $v0, 0x14($a0)
/* 3E1C54 E00E85C4 3C03E00F */  lui       $v1, (0xE00F0000 >> 16)
/* 3E1C58 E00E85C8 8C638634 */  lw        $v1, -0x79CC($v1)
/* 3E1C5C E00E85CC 24820028 */  addiu     $v0, $a0, 0x28
/* 3E1C60 E00E85D0 AE620000 */  sw        $v0, 0x0($s3)
/* 3E1C64 E00E85D4 AC870020 */  sw        $a3, 0x20($a0)
/* 3E1C68 E00E85D8 AC83001C */  sw        $v1, 0x1C($a0)
/* 3E1C6C E00E85DC 3C03E00F */  lui       $v1, (0xE00F0000 >> 16)
/* 3E1C70 E00E85E0 8C638630 */  lw        $v1, -0x79D0($v1)
/* 3E1C74 E00E85E4 24820030 */  addiu     $v0, $a0, 0x30
/* 3E1C78 E00E85E8 AE620000 */  sw        $v0, 0x0($s3)
/* 3E1C7C E00E85EC 24020040 */  addiu     $v0, $zero, 0x40
/* 3E1C80 E00E85F0 AC830024 */  sw        $v1, 0x24($a0)
/* 3E1C84 E00E85F4 AC890028 */  sw        $t1, 0x28($a0)
/* 3E1C88 E00E85F8 AC82002C */  sw        $v0, 0x2C($a0)
/* 3E1C8C E00E85FC 8FBF00AC */  lw        $ra, 0xAC($sp)
/* 3E1C90 E00E8600 8FB600A8 */  lw        $s6, 0xA8($sp)
/* 3E1C94 E00E8604 8FB500A4 */  lw        $s5, 0xA4($sp)
/* 3E1C98 E00E8608 8FB400A0 */  lw        $s4, 0xA0($sp)
/* 3E1C9C E00E860C 8FB3009C */  lw        $s3, 0x9C($sp)
/* 3E1CA0 E00E8610 8FB20098 */  lw        $s2, 0x98($sp)
/* 3E1CA4 E00E8614 8FB10094 */  lw        $s1, 0x94($sp)
/* 3E1CA8 E00E8618 8FB00090 */  lw        $s0, 0x90($sp)
/* 3E1CAC E00E861C 03E00008 */  jr        $ra
/* 3E1CB0 E00E8620 27BD00B0 */   addiu    $sp, $sp, 0xB0
/* 3E1CB4 E00E8624 00000000 */  nop
/* 3E1CB8 E00E8628 00000000 */  nop
/* 3E1CBC E00E862C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void moving_cloud_appendGfx(void* effect) {
    MovingCloudFXData* data = ((EffectInstance*)effect)->data.movingCloud;
    Camera* camera = &gCameras[gCurrentCameraID];
    s32 unk_30 = data->unk_30;
    Matrix4f sp10;
    Matrix4f sp50;

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

    shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
    shim_guScaleF(sp50, data->unk_44, data->unk_44, data->unk_44);
    shim_guMtxCatF(sp50, sp10, sp10);
    shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_24, data->unk_28, data->unk_2C, unk_30);
    gDPSetEnvColor(gMainGfxPos++, data->unk_34, data->unk_38, data->unk_3C, data->unk_40);
    gSPDisplayList(gMainGfxPos++, D_E00E8634[0]);
    gSPDisplayList(gMainGfxPos++, D_E00E8630[0]);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ShakeCam
/* EFC58 802CB2A8 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* EFC5C 802CB2AC AFB5002C */  sw        $s5, 0x2C($sp)
/* EFC60 802CB2B0 0080A82D */  daddu     $s5, $a0, $zero
/* EFC64 802CB2B4 AFB20020 */  sw        $s2, 0x20($sp)
/* EFC68 802CB2B8 00A0902D */  daddu     $s2, $a1, $zero
/* EFC6C 802CB2BC AFBF0030 */  sw        $ra, 0x30($sp)
/* EFC70 802CB2C0 AFB40028 */  sw        $s4, 0x28($sp)
/* EFC74 802CB2C4 AFB30024 */  sw        $s3, 0x24($sp)
/* EFC78 802CB2C8 AFB1001C */  sw        $s1, 0x1C($sp)
/* EFC7C 802CB2CC AFB00018 */  sw        $s0, 0x18($sp)
/* EFC80 802CB2D0 F7B40038 */  sdc1      $f20, 0x38($sp)
/* EFC84 802CB2D4 8EB0000C */  lw        $s0, 0xC($s5)
/* EFC88 802CB2D8 8E050000 */  lw        $a1, 0x0($s0)
/* EFC8C 802CB2DC 0C0B1EAF */  jal       evt_get_variable
/* EFC90 802CB2E0 26100004 */   addiu    $s0, $s0, 0x4
/* EFC94 802CB2E4 8E050000 */  lw        $a1, 0x0($s0)
/* EFC98 802CB2E8 26100004 */  addiu     $s0, $s0, 0x4
/* EFC9C 802CB2EC 02A0202D */  daddu     $a0, $s5, $zero
/* EFCA0 802CB2F0 0C0B1EAF */  jal       evt_get_variable
/* EFCA4 802CB2F4 0040882D */   daddu    $s1, $v0, $zero
/* EFCA8 802CB2F8 8E050000 */  lw        $a1, 0x0($s0)
/* EFCAC 802CB2FC 26100004 */  addiu     $s0, $s0, 0x4
/* EFCB0 802CB300 02A0202D */  daddu     $a0, $s5, $zero
/* EFCB4 802CB304 0C0B1EAF */  jal       evt_get_variable
/* EFCB8 802CB308 0040982D */   daddu    $s3, $v0, $zero
/* EFCBC 802CB30C 0040A02D */  daddu     $s4, $v0, $zero
/* EFCC0 802CB310 8E050000 */  lw        $a1, 0x0($s0)
/* EFCC4 802CB314 0C0B210B */  jal       evt_get_float_variable
/* EFCC8 802CB318 02A0202D */   daddu    $a0, $s5, $zero
/* EFCCC 802CB31C 3C04800B */  lui       $a0, %hi(gCameras)
/* EFCD0 802CB320 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* EFCD4 802CB324 00111080 */  sll       $v0, $s1, 2
/* EFCD8 802CB328 00511021 */  addu      $v0, $v0, $s1
/* EFCDC 802CB32C 00021080 */  sll       $v0, $v0, 2
/* EFCE0 802CB330 00511023 */  subu      $v0, $v0, $s1
/* EFCE4 802CB334 000218C0 */  sll       $v1, $v0, 3
/* EFCE8 802CB338 00431021 */  addu      $v0, $v0, $v1
/* EFCEC 802CB33C 000210C0 */  sll       $v0, $v0, 3
/* EFCF0 802CB340 00448021 */  addu      $s0, $v0, $a0
/* EFCF4 802CB344 12400031 */  beqz      $s2, .L802CB40C
/* EFCF8 802CB348 46000500 */   add.s    $f20, $f0, $f0
/* EFCFC 802CB34C 06600005 */  bltz      $s3, .L802CB364
/* EFD00 802CB350 2A620002 */   slti     $v0, $s3, 0x2
/* EFD04 802CB354 14400003 */  bnez      $v0, .L802CB364
/* EFD08 802CB358 24020002 */   addiu    $v0, $zero, 0x2
/* EFD0C 802CB35C 52620001 */  beql      $s3, $v0, .L802CB364
/* EFD10 802CB360 0054A004 */   sllv     $s4, $s4, $v0
.L802CB364:
/* EFD14 802CB364 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* EFD18 802CB368 44810000 */  mtc1      $at, $f0
/* EFD1C 802CB36C 00000000 */  nop
/* EFD20 802CB370 E6A0007C */  swc1      $f0, 0x7C($s5)
/* EFD24 802CB374 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* EFD28 802CB378 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* EFD2C 802CB37C AEB40074 */  sw        $s4, 0x74($s5)
/* EFD30 802CB380 80420070 */  lb        $v0, 0x70($v0)
/* EFD34 802CB384 14400021 */  bnez      $v0, .L802CB40C
/* EFD38 802CB388 00000000 */   nop
/* EFD3C 802CB38C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* EFD40 802CB390 44810000 */  mtc1      $at, $f0
/* EFD44 802CB394 00000000 */  nop
/* EFD48 802CB398 4614003C */  c.lt.s    $f0, $f20
/* EFD4C 802CB39C 00000000 */  nop
/* EFD50 802CB3A0 45030001 */  bc1tl     .L802CB3A8
/* EFD54 802CB3A4 46000506 */   mov.s    $f20, $f0
.L802CB3A8:
/* EFD58 802CB3A8 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
/* EFD5C 802CB3AC 44810000 */  mtc1      $at, $f0
/* EFD60 802CB3B0 00000000 */  nop
/* EFD64 802CB3B4 4614003C */  c.lt.s    $f0, $f20
/* EFD68 802CB3B8 00000000 */  nop
/* EFD6C 802CB3BC 45000002 */  bc1f      .L802CB3C8
/* EFD70 802CB3C0 4600A086 */   mov.s    $f2, $f20
/* EFD74 802CB3C4 46000086 */  mov.s     $f2, $f0
.L802CB3C8:
/* EFD78 802CB3C8 3C014200 */  lui       $at, (0x42000000 >> 16)
/* EFD7C 802CB3CC 44810000 */  mtc1      $at, $f0
/* EFD80 802CB3D0 00000000 */  nop
/* EFD84 802CB3D4 46001002 */  mul.s     $f0, $f2, $f0
/* EFD88 802CB3D8 00000000 */  nop
/* EFD8C 802CB3DC 0280282D */  daddu     $a1, $s4, $zero
/* EFD90 802CB3E0 3C014280 */  lui       $at, (0x42800000 >> 16)
/* EFD94 802CB3E4 44811000 */  mtc1      $at, $f2
/* EFD98 802CB3E8 2A820005 */  slti      $v0, $s4, 0x5
/* EFD9C 802CB3EC 10400002 */  beqz      $v0, .L802CB3F8
/* EFDA0 802CB3F0 46020080 */   add.s    $f2, $f0, $f2
/* EFDA4 802CB3F4 24050005 */  addiu     $a1, $zero, 0x5
.L802CB3F8:
/* EFDA8 802CB3F8 4600110D */  trunc.w.s $f4, $f2
/* EFDAC 802CB3FC 44042000 */  mfc1      $a0, $f4
/* EFDB0 802CB400 30A5FFFF */  andi      $a1, $a1, 0xFFFF
/* EFDB4 802CB404 0C00A3C2 */  jal       start_rumble
/* EFDB8 802CB408 00052840 */   sll      $a1, $a1, 1
.L802CB40C:
/* EFDBC 802CB40C 96020000 */  lhu       $v0, 0x0($s0)
/* EFDC0 802CB410 34420008 */  ori       $v0, $v0, 0x8
/* EFDC4 802CB414 A6020000 */  sh        $v0, 0x0($s0)
/* EFDC8 802CB418 24020001 */  addiu     $v0, $zero, 0x1
/* EFDCC 802CB41C C6A2007C */  lwc1      $f2, 0x7C($s5)
/* EFDD0 802CB420 12620016 */  beq       $s3, $v0, .L802CB47C
/* EFDD4 802CB424 2A620002 */   slti     $v0, $s3, 0x2
/* EFDD8 802CB428 10400005 */  beqz      $v0, .L802CB440
/* EFDDC 802CB42C 24020002 */   addiu    $v0, $zero, 0x2
/* EFDE0 802CB430 52600007 */  beql      $s3, $zero, .L802CB450
/* EFDE4 802CB434 46001007 */   neg.s    $f0, $f2
/* EFDE8 802CB438 080B2D47 */  j         .L802CB51C
/* EFDEC 802CB43C 00000000 */   nop
.L802CB440:
/* EFDF0 802CB440 5262001B */  beql      $s3, $v0, .L802CB4B0
/* EFDF4 802CB444 46001007 */   neg.s    $f0, $f2
/* EFDF8 802CB448 080B2D47 */  j         .L802CB51C
/* EFDFC 802CB44C 00000000 */   nop
.L802CB450:
/* EFE00 802CB450 46140002 */  mul.s     $f0, $f0, $f20
/* EFE04 802CB454 00000000 */  nop
/* EFE08 802CB458 44060000 */  mfc1      $a2, $f0
/* EFE0C 802CB45C 44800000 */  mtc1      $zero, $f0
/* EFE10 802CB460 00000000 */  nop
/* EFE14 802CB464 44050000 */  mfc1      $a1, $f0
/* EFE18 802CB468 26040194 */  addiu     $a0, $s0, 0x194
/* EFE1C 802CB46C 0C019E40 */  jal       guTranslateF
/* EFE20 802CB470 00A0382D */   daddu    $a3, $a1, $zero
/* EFE24 802CB474 080B2D44 */  j         .L802CB510
/* EFE28 802CB478 00000000 */   nop
.L802CB47C:
/* EFE2C 802CB47C 46141082 */  mul.s     $f2, $f2, $f20
/* EFE30 802CB480 00000000 */  nop
/* EFE34 802CB484 44800000 */  mtc1      $zero, $f0
/* EFE38 802CB488 26040194 */  addiu     $a0, $s0, 0x194
/* EFE3C 802CB48C 44060000 */  mfc1      $a2, $f0
/* EFE40 802CB490 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* EFE44 802CB494 44810000 */  mtc1      $at, $f0
/* EFE48 802CB498 44051000 */  mfc1      $a1, $f2
/* EFE4C 802CB49C 00C0382D */  daddu     $a3, $a2, $zero
/* EFE50 802CB4A0 0C019EC8 */  jal       guRotateF
/* EFE54 802CB4A4 E7A00010 */   swc1     $f0, 0x10($sp)
/* EFE58 802CB4A8 080B2D44 */  j         .L802CB510
/* EFE5C 802CB4AC 00000000 */   nop
.L802CB4B0:
/* EFE60 802CB4B0 46140002 */  mul.s     $f0, $f0, $f20
/* EFE64 802CB4B4 00000000 */  nop
/* EFE68 802CB4B8 44060000 */  mfc1      $a2, $f0
/* EFE6C 802CB4BC 44800000 */  mtc1      $zero, $f0
/* EFE70 802CB4C0 00000000 */  nop
/* EFE74 802CB4C4 44050000 */  mfc1      $a1, $f0
/* EFE78 802CB4C8 26040194 */  addiu     $a0, $s0, 0x194
/* EFE7C 802CB4CC 0C019E40 */  jal       guTranslateF
/* EFE80 802CB4D0 00A0382D */   daddu    $a3, $a1, $zero
/* EFE84 802CB4D4 8EA30074 */  lw        $v1, 0x74($s5)
/* EFE88 802CB4D8 00141040 */  sll       $v0, $s4, 1
/* EFE8C 802CB4DC 0062102A */  slt       $v0, $v1, $v0
/* EFE90 802CB4E0 1040000B */  beqz      $v0, .L802CB510
/* EFE94 802CB4E4 0283102A */   slt      $v0, $s4, $v1
/* EFE98 802CB4E8 10400009 */  beqz      $v0, .L802CB510
/* EFE9C 802CB4EC 00000000 */   nop
/* EFEA0 802CB4F0 C6A0007C */  lwc1      $f0, 0x7C($s5)
/* EFEA4 802CB4F4 3C01802E */  lui       $at, %hi(D_802DA1D0)
/* EFEA8 802CB4F8 D422A1D0 */  ldc1      $f2, %lo(D_802DA1D0)($at)
/* EFEAC 802CB4FC 46000021 */  cvt.d.s   $f0, $f0
/* EFEB0 802CB500 46220002 */  mul.d     $f0, $f0, $f2
/* EFEB4 802CB504 00000000 */  nop
/* EFEB8 802CB508 080B2D46 */  j         .L802CB518
/* EFEBC 802CB50C 46200020 */   cvt.s.d  $f0, $f0
.L802CB510:
/* EFEC0 802CB510 C6A0007C */  lwc1      $f0, 0x7C($s5)
/* EFEC4 802CB514 46000007 */  neg.s     $f0, $f0
.L802CB518:
/* EFEC8 802CB518 E6A0007C */  swc1      $f0, 0x7C($s5)
.L802CB51C:
/* EFECC 802CB51C 8EA20074 */  lw        $v0, 0x74($s5)
/* EFED0 802CB520 10400004 */  beqz      $v0, .L802CB534
/* EFED4 802CB524 2442FFFF */   addiu    $v0, $v0, -0x1
/* EFED8 802CB528 AEA20074 */  sw        $v0, 0x74($s5)
/* EFEDC 802CB52C 080B2D51 */  j         .L802CB544
/* EFEE0 802CB530 0000102D */   daddu    $v0, $zero, $zero
.L802CB534:
/* EFEE4 802CB534 96030000 */  lhu       $v1, 0x0($s0)
/* EFEE8 802CB538 24020002 */  addiu     $v0, $zero, 0x2
/* EFEEC 802CB53C 3063FFF7 */  andi      $v1, $v1, 0xFFF7
/* EFEF0 802CB540 A6030000 */  sh        $v1, 0x0($s0)
.L802CB544:
/* EFEF4 802CB544 8FBF0030 */  lw        $ra, 0x30($sp)
/* EFEF8 802CB548 8FB5002C */  lw        $s5, 0x2C($sp)
/* EFEFC 802CB54C 8FB40028 */  lw        $s4, 0x28($sp)
/* EFF00 802CB550 8FB30024 */  lw        $s3, 0x24($sp)
/* EFF04 802CB554 8FB20020 */  lw        $s2, 0x20($sp)
/* EFF08 802CB558 8FB1001C */  lw        $s1, 0x1C($sp)
/* EFF0C 802CB55C 8FB00018 */  lw        $s0, 0x18($sp)
/* EFF10 802CB560 D7B40038 */  ldc1      $f20, 0x38($sp)
/* EFF14 802CB564 03E00008 */  jr        $ra
/* EFF18 802CB568 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

EvtScript ShakeCam1 = {
    EVT_SET_GROUP(EVT_GROUP_00)
    EVT_CALL(ShakeCam, LVar0, LVar1, LVar2, EVT_FLOAT(1.0))
    EVT_RETURN
    EVT_END
};

EvtScript ShakeCamX = {
    EVT_SET_GROUP(EVT_GROUP_00)
    EVT_CALL(ShakeCam, LVar0, LVar1, LVar2, LVar3)
    EVT_RETURN
    EVT_END
};

ApiStatus SetCamEnabled(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    s32 id = evt_get_variable(script, *args++);
    s32 enabled = evt_get_variable(script, *args++);

    if (!enabled) {
        gCameras[id].flags |= CAMERA_FLAG_DISABLED;
    } else {
        gCameras[id].flags &= ~CAMERA_FLAG_DISABLED;
    }
    return ApiStatus_DONE2;
}