### RAW ASSEMBLY INSTRUCTIONS:

glabel star_main
/* 331940 E001E000 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 331944 E001E004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 331948 E001E008 4485A000 */  mtc1      $a1, $f20
/* 33194C E001E00C F7B60040 */  sdc1      $f22, 0x40($sp)
/* 331950 E001E010 4486B000 */  mtc1      $a2, $f22
/* 331954 E001E014 AFB00028 */  sw        $s0, 0x28($sp)
/* 331958 E001E018 0080802D */  daddu     $s0, $a0, $zero
/* 33195C E001E01C F7BA0050 */  sdc1      $f26, 0x50($sp)
/* 331960 E001E020 4487D000 */  mtc1      $a3, $f26
/* 331964 E001E024 27A40010 */  addiu     $a0, $sp, 0x10
/* 331968 E001E028 F7BE0060 */  sdc1      $f30, 0x60($sp)
/* 33196C E001E02C C7BE0084 */  lwc1      $f30, 0x84($sp)
/* 331970 E001E030 3C02E002 */  lui       $v0, %hi(star_init)
/* 331974 E001E034 2442E370 */  addiu     $v0, $v0, %lo(star_init)
/* 331978 E001E038 AFA20018 */  sw        $v0, 0x18($sp)
/* 33197C E001E03C 3C02E002 */  lui       $v0, %hi(star_update)
/* 331980 E001E040 2442E378 */  addiu     $v0, $v0, %lo(star_update)
/* 331984 E001E044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 331988 E001E048 3C02E002 */  lui       $v0, %hi(star_render)
/* 33198C E001E04C 2442E6E8 */  addiu     $v0, $v0, %lo(star_render)
/* 331990 E001E050 AFA20020 */  sw        $v0, 0x20($sp)
/* 331994 E001E054 2402000F */  addiu     $v0, $zero, 0xF
/* 331998 E001E058 AFBF0034 */  sw        $ra, 0x34($sp)
/* 33199C E001E05C AFB20030 */  sw        $s2, 0x30($sp)
/* 3319A0 E001E060 AFB1002C */  sw        $s1, 0x2C($sp)
/* 3319A4 E001E064 F7BC0058 */  sdc1      $f28, 0x58($sp)
/* 3319A8 E001E068 F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3319AC E001E06C AFA00010 */  sw        $zero, 0x10($sp)
/* 3319B0 E001E070 AFA00024 */  sw        $zero, 0x24($sp)
/* 3319B4 E001E074 0C080124 */  jal       shim_create_effect_instance
/* 3319B8 E001E078 AFA20014 */   sw       $v0, 0x14($sp)
/* 3319BC E001E07C 24040250 */  addiu     $a0, $zero, 0x250
/* 3319C0 E001E080 24030001 */  addiu     $v1, $zero, 0x1
/* 3319C4 E001E084 0040902D */  daddu     $s2, $v0, $zero
/* 3319C8 E001E088 0C08012C */  jal       shim_general_heap_malloc
/* 3319CC E001E08C AE430008 */   sw       $v1, 0x8($s2)
/* 3319D0 E001E090 0040882D */  daddu     $s1, $v0, $zero
/* 3319D4 E001E094 16200003 */  bnez      $s1, .LE001E0A4
/* 3319D8 E001E098 AE42000C */   sw       $v0, 0xC($s2)
.LE001E09C:
/* 3319DC E001E09C 08007827 */  j         .LE001E09C
/* 3319E0 E001E0A0 00000000 */   nop
.LE001E0A4:
/* 3319E4 E001E0A4 24020001 */  addiu     $v0, $zero, 0x1
/* 3319E8 E001E0A8 AE220000 */  sw        $v0, 0x0($s1)
/* 3319EC E001E0AC 24020003 */  addiu     $v0, $zero, 0x3
/* 3319F0 E001E0B0 E6340004 */  swc1      $f20, 0x4($s1)
/* 3319F4 E001E0B4 E6360008 */  swc1      $f22, 0x8($s1)
/* 3319F8 E001E0B8 E63A000C */  swc1      $f26, 0xC($s1)
/* 3319FC E001E0BC AE20001C */  sw        $zero, 0x1C($s1)
/* 331A00 E001E0C0 AE200024 */  sw        $zero, 0x24($s1)
/* 331A04 E001E0C4 AE200028 */  sw        $zero, 0x28($s1)
/* 331A08 E001E0C8 16020011 */  bne       $s0, $v0, .LE001E110
/* 331A0C E001E0CC AE300038 */   sw       $s0, 0x38($s1)
/* 331A10 E001E0D0 3C013E4C */  lui       $at, (0x3E4CCCCD >> 16)
/* 331A14 E001E0D4 3421CCCD */  ori       $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 331A18 E001E0D8 44810000 */  mtc1      $at, $f0
/* 331A1C E001E0DC 240400FF */  addiu     $a0, $zero, 0xFF
/* 331A20 E001E0E0 0C080138 */  jal       shim_rand_int
/* 331A24 E001E0E4 E6200240 */   swc1     $f0, 0x240($s1)
/* 331A28 E001E0E8 241000FF */  addiu     $s0, $zero, 0xFF
/* 331A2C E001E0EC 02022023 */  subu      $a0, $s0, $v0
/* 331A30 E001E0F0 0C080138 */  jal       shim_rand_int
/* 331A34 E001E0F4 AE220244 */   sw       $v0, 0x244($s1)
/* 331A38 E001E0F8 8E230244 */  lw        $v1, 0x244($s1)
/* 331A3C E001E0FC 02028023 */  subu      $s0, $s0, $v0
/* 331A40 E001E100 AE220248 */  sw        $v0, 0x248($s1)
/* 331A44 E001E104 02038023 */  subu      $s0, $s0, $v1
/* 331A48 E001E108 0800784D */  j         .LE001E134
/* 331A4C E001E10C AE30024C */   sw       $s0, 0x24C($s1)
.LE001E110:
/* 331A50 E001E110 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 331A54 E001E114 44810000 */  mtc1      $at, $f0
/* 331A58 E001E118 240200D2 */  addiu     $v0, $zero, 0xD2
/* 331A5C E001E11C AE220244 */  sw        $v0, 0x244($s1)
/* 331A60 E001E120 240200BA */  addiu     $v0, $zero, 0xBA
/* 331A64 E001E124 AE220248 */  sw        $v0, 0x248($s1)
/* 331A68 E001E128 2402005A */  addiu     $v0, $zero, 0x5A
/* 331A6C E001E12C AE22024C */  sw        $v0, 0x24C($s1)
/* 331A70 E001E130 E6200240 */  swc1      $f0, 0x240($s1)
.LE001E134:
/* 331A74 E001E134 C7A00078 */  lwc1      $f0, 0x78($sp)
/* 331A78 E001E138 46140601 */  sub.s     $f24, $f0, $f20
/* 331A7C E001E13C 4618C082 */  mul.s     $f2, $f24, $f24
/* 331A80 E001E140 00000000 */  nop
/* 331A84 E001E144 C7A0007C */  lwc1      $f0, 0x7C($sp)
/* 331A88 E001E148 46160581 */  sub.s     $f22, $f0, $f22
/* 331A8C E001E14C 4616B102 */  mul.s     $f4, $f22, $f22
/* 331A90 E001E150 00000000 */  nop
/* 331A94 E001E154 C7A00080 */  lwc1      $f0, 0x80($sp)
/* 331A98 E001E158 461A0501 */  sub.s     $f20, $f0, $f26
/* 331A9C E001E15C 4614A002 */  mul.s     $f0, $f20, $f20
/* 331AA0 E001E160 00000000 */  nop
/* 331AA4 E001E164 46041080 */  add.s     $f2, $f2, $f4
/* 331AA8 E001E168 46001680 */  add.s     $f26, $f2, $f0
/* 331AAC E001E16C 4480E000 */  mtc1      $zero, $f28
/* 331AB0 E001E170 00000000 */  nop
/* 331AB4 E001E174 461CD032 */  c.eq.s    $f26, $f28
/* 331AB8 E001E178 00000000 */  nop
/* 331ABC E001E17C 45010005 */  bc1t      .LE001E194
/* 331AC0 E001E180 4600D106 */   mov.s    $f4, $f26
/* 331AC4 E001E184 0C080154 */  jal       shim_sqrtf
/* 331AC8 E001E188 4600D306 */   mov.s    $f12, $f26
/* 331ACC E001E18C 46000686 */  mov.s     $f26, $f0
/* 331AD0 E001E190 461AF103 */  div.s     $f4, $f30, $f26
.LE001E194:
/* 331AD4 E001E194 4604C002 */  mul.s     $f0, $f24, $f4
/* 331AD8 E001E198 00000000 */  nop
/* 331ADC E001E19C 4604B082 */  mul.s     $f2, $f22, $f4
/* 331AE0 E001E1A0 00000000 */  nop
/* 331AE4 E001E1A4 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 331AE8 E001E1A8 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 331AEC E001E1AC 4604A102 */  mul.s     $f4, $f20, $f4
/* 331AF0 E001E1B0 00000000 */  nop
/* 331AF4 E001E1B4 00031080 */  sll       $v0, $v1, 2
/* 331AF8 E001E1B8 00431021 */  addu      $v0, $v0, $v1
/* 331AFC E001E1BC 00021080 */  sll       $v0, $v0, 2
/* 331B00 E001E1C0 00431023 */  subu      $v0, $v0, $v1
/* 331B04 E001E1C4 000218C0 */  sll       $v1, $v0, 3
/* 331B08 E001E1C8 00431021 */  addu      $v0, $v0, $v1
/* 331B0C E001E1CC 000210C0 */  sll       $v0, $v0, 3
/* 331B10 E001E1D0 E6200010 */  swc1      $f0, 0x10($s1)
/* 331B14 E001E1D4 E6220014 */  swc1      $f2, 0x14($s1)
/* 331B18 E001E1D8 E6240018 */  swc1      $f4, 0x18($s1)
/* 331B1C E001E1DC 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 331B20 E001E1E0 00220821 */  addu      $at, $at, $v0
/* 331B24 E001E1E4 C4341DEC */  lwc1      $f20, %lo(gCameras + 0x6C)($at)
/* 331B28 E001E1E8 0C080144 */  jal       shim_cos_deg
/* 331B2C E001E1EC 4600A306 */   mov.s    $f12, $f20
/* 331B30 E001E1F0 4600A306 */  mov.s     $f12, $f20
/* 331B34 E001E1F4 0C080140 */  jal       shim_sin_deg
/* 331B38 E001E1F8 46000587 */   neg.s    $f22, $f0
/* 331B3C E001E1FC C6240010 */  lwc1      $f4, 0x10($s1)
/* 331B40 E001E200 4604B102 */  mul.s     $f4, $f22, $f4
/* 331B44 E001E204 00000000 */  nop
/* 331B48 E001E208 C6220018 */  lwc1      $f2, 0x18($s1)
/* 331B4C E001E20C 46000507 */  neg.s     $f20, $f0
/* 331B50 E001E210 4602A082 */  mul.s     $f2, $f20, $f2
/* 331B54 E001E214 00000000 */  nop
/* 331B58 E001E218 46042102 */  mul.s     $f4, $f4, $f4
/* 331B5C E001E21C 00000000 */  nop
/* 331B60 E001E220 46021082 */  mul.s     $f2, $f2, $f2
/* 331B64 E001E224 00000000 */  nop
/* 331B68 E001E228 46022300 */  add.s     $f12, $f4, $f2
/* 331B6C E001E22C 461C6032 */  c.eq.s    $f12, $f28
/* 331B70 E001E230 00000000 */  nop
/* 331B74 E001E234 45010004 */  bc1t      .LE001E248
/* 331B78 E001E238 00000000 */   nop
/* 331B7C E001E23C 0C080154 */  jal       shim_sqrtf
/* 331B80 E001E240 00000000 */   nop
/* 331B84 E001E244 46000306 */  mov.s     $f12, $f0
.LE001E248:
/* 331B88 E001E248 C6220010 */  lwc1      $f2, 0x10($s1)
/* 331B8C E001E24C 4602B082 */  mul.s     $f2, $f22, $f2
/* 331B90 E001E250 00000000 */  nop
/* 331B94 E001E254 C6200018 */  lwc1      $f0, 0x18($s1)
/* 331B98 E001E258 4600A002 */  mul.s     $f0, $f20, $f0
/* 331B9C E001E25C 00000000 */  nop
/* 331BA0 E001E260 46001080 */  add.s     $f2, $f2, $f0
/* 331BA4 E001E264 461C103C */  c.lt.s    $f2, $f28
/* 331BA8 E001E268 00000000 */  nop
/* 331BAC E001E26C 45000005 */  bc1f      .LE001E284
/* 331BB0 E001E270 00000000 */   nop
/* 331BB4 E001E274 3C01C1A0 */  lui       $at, (0xC1A00000 >> 16)
/* 331BB8 E001E278 44810000 */  mtc1      $at, $f0
/* 331BBC E001E27C 080078A4 */  j         .LE001E290
/* 331BC0 E001E280 46006307 */   neg.s    $f12, $f12
.LE001E284:
/* 331BC4 E001E284 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
/* 331BC8 E001E288 44810000 */  mtc1      $at, $f0
/* 331BCC E001E28C 00000000 */  nop
.LE001E290:
/* 331BD0 E001E290 E620002C */  swc1      $f0, 0x2C($s1)
/* 331BD4 E001E294 46006507 */  neg.s     $f20, $f12
/* 331BD8 E001E298 4407A000 */  mfc1      $a3, $f20
/* 331BDC E001E29C C6200014 */  lwc1      $f0, 0x14($s1)
/* 331BE0 E001E2A0 44806000 */  mtc1      $zero, $f12
/* 331BE4 E001E2A4 46000007 */  neg.s     $f0, $f0
/* 331BE8 E001E2A8 44060000 */  mfc1      $a2, $f0
/* 331BEC E001E2AC 0C080148 */  jal       shim_atan2
/* 331BF0 E001E2B0 46006386 */   mov.s    $f14, $f12
/* 331BF4 E001E2B4 461ED083 */  div.s     $f2, $f26, $f30
/* 331BF8 E001E2B8 4600118D */  trunc.w.s $f6, $f2
/* 331BFC E001E2BC E6260030 */  swc1      $f6, 0x30($s1)
/* 331C00 E001E2C0 26300040 */  addiu     $s0, $s1, 0x40
/* 331C04 E001E2C4 8E260008 */  lw        $a2, 0x8($s1)
/* 331C08 E001E2C8 8E27000C */  lw        $a3, 0xC($s1)
/* 331C0C E001E2CC 8E250004 */  lw        $a1, 0x4($s1)
/* 331C10 E001E2D0 0200202D */  daddu     $a0, $s0, $zero
/* 331C14 E001E2D4 E6200024 */  swc1      $f0, 0x24($s1)
/* 331C18 E001E2D8 E6200020 */  swc1      $f0, 0x20($s1)
/* 331C1C E001E2DC 0C08010C */  jal       shim_guTranslate
/* 331C20 E001E2E0 E6340034 */   swc1     $f20, 0x34($s1)
/* 331C24 E001E2E4 24050001 */  addiu     $a1, $zero, 0x1
/* 331C28 E001E2E8 26260080 */  addiu     $a2, $s1, 0x80
/* 331C2C E001E2EC 0200202D */  daddu     $a0, $s0, $zero
.LE001E2F0:
/* 331C30 E001E2F0 24830040 */  addiu     $v1, $a0, 0x40
/* 331C34 E001E2F4 0200102D */  daddu     $v0, $s0, $zero
.LE001E2F8:
/* 331C38 E001E2F8 8C490000 */  lw        $t1, 0x0($v0)
/* 331C3C E001E2FC 8C4A0004 */  lw        $t2, 0x4($v0)
/* 331C40 E001E300 8C4B0008 */  lw        $t3, 0x8($v0)
/* 331C44 E001E304 8C48000C */  lw        $t0, 0xC($v0)
/* 331C48 E001E308 AC690000 */  sw        $t1, 0x0($v1)
/* 331C4C E001E30C AC6A0004 */  sw        $t2, 0x4($v1)
/* 331C50 E001E310 AC6B0008 */  sw        $t3, 0x8($v1)
/* 331C54 E001E314 AC68000C */  sw        $t0, 0xC($v1)
/* 331C58 E001E318 24420010 */  addiu     $v0, $v0, 0x10
/* 331C5C E001E31C 1446FFF6 */  bne       $v0, $a2, .LE001E2F8
/* 331C60 E001E320 24630010 */   addiu    $v1, $v1, 0x10
/* 331C64 E001E324 24A50001 */  addiu     $a1, $a1, 0x1
/* 331C68 E001E328 28A20008 */  slti      $v0, $a1, 0x8
/* 331C6C E001E32C 1440FFF0 */  bnez      $v0, .LE001E2F0
/* 331C70 E001E330 24840040 */   addiu    $a0, $a0, 0x40
/* 331C74 E001E334 2402FFFF */  addiu     $v0, $zero, -0x1
/* 331C78 E001E338 AE22003C */  sw        $v0, 0x3C($s1)
/* 331C7C E001E33C 0240102D */  daddu     $v0, $s2, $zero
/* 331C80 E001E340 8FBF0034 */  lw        $ra, 0x34($sp)
/* 331C84 E001E344 8FB20030 */  lw        $s2, 0x30($sp)
/* 331C88 E001E348 8FB1002C */  lw        $s1, 0x2C($sp)
/* 331C8C E001E34C 8FB00028 */  lw        $s0, 0x28($sp)
/* 331C90 E001E350 D7BE0060 */  ldc1      $f30, 0x60($sp)
/* 331C94 E001E354 D7BC0058 */  ldc1      $f28, 0x58($sp)
/* 331C98 E001E358 D7BA0050 */  ldc1      $f26, 0x50($sp)
/* 331C9C E001E35C D7B80048 */  ldc1      $f24, 0x48($sp)
/* 331CA0 E001E360 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 331CA4 E001E364 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 331CA8 E001E368 03E00008 */  jr        $ra
/* 331CAC E001E36C 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
    EffectBlueprint bp;
    StarFXData* part;
    EffectInstance* effect;
    s32 numParts = 1;
    s32 i;

    f32 temp_f12;
    f32 temp_f20;
    f32 currentYaw;
    f32 sinYaw;
    f32 cosYaw;
    f32 temp_f22;
    f32 temp_f24;
    f32 temp_f26;
    f32 temp_f2;
    f32 temp_f4;
    s32 temp_s0;
    f32 phi_f26;

    bp.unk_00 = 0;
    bp.init = star_init;
    bp.update = star_update;
    bp.renderWorld = star_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_STAR;

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

    ASSERT(effect->data.star != NULL);
    part->unk_00 = 1;
    part->unk_04 = arg1;
    part->unk_08 = arg2;
    part->unk_0C = arg3;
    part->unk_1C = 0;
    part->unk_24 = 0.0f;
    part->unk_28 = 0;
    part->unk_38 = arg0;

    if (arg0 == 3) {
        part->unk_240 = 0.2f;
        part->unk_244 = shim_rand_int(255);
        part->unk_248 = shim_rand_int(255 - part->unk_244);
        temp_s0 = 255 - part->unk_248;
        part->unk_24C = temp_s0 - part->unk_244;
    } else {
        part->unk_244 = 210;
        part->unk_248 = 186;
        part->unk_24C = 90;
        part->unk_240 = 0.5f;
    }

    temp_f24 = arg4 - arg1;
    temp_f22 = arg5 - arg2;
    temp_f20 = arg6 - arg3;

    temp_f26 = SQ(temp_f24) + SQ(temp_f22) + SQ(temp_f20);
    phi_f26 = temp_f26;
    if (temp_f26 != 0.0f) {
        phi_f26 = shim_sqrtf(temp_f26);
        temp_f26 = arg7 / phi_f26;
    }

    part->unk_10 = temp_f24 * temp_f26;
    part->unk_14 = temp_f22 * temp_f26;
    part->unk_18 = temp_f20 * temp_f26;

    currentYaw = gCameras[gCurrentCameraID].currentYaw;
    cosYaw = -shim_cos_deg(currentYaw);
    sinYaw = -shim_sin_deg(currentYaw);

    temp_f4 = cosYaw * part->unk_10;
    temp_f2 = sinYaw * part->unk_18;
    temp_f12 = SQ(temp_f4) + SQ(temp_f2);

    if (temp_f12 != 0.0f) {
        temp_f12 = shim_sqrtf(temp_f12);
    }

    if ((cosYaw * part->unk_10) + (sinYaw * part->unk_18) < 0.0f) {
        temp_f12 = -temp_f12;
        part->unk_2C = -20.0f;
    } else {
        part->unk_2C = 20.0f;
    }

    part->unk_20 = part->unk_24 = shim_atan2(0.0f, 0.0f, -part->unk_14, -temp_f12);
    part->unk_30 = phi_f26 / arg7;
    part->unk_34 = -temp_f12;
    shim_guTranslate(part->unk_40, part->unk_04, part->unk_08, part->unk_0C);

    for (i = 1; i < ARRAY_COUNT(part->unk_40); i++) {
        part->unk_40[i] = part->unk_40[0];
    }

    part->unk_3C = -1;
    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel shockwave_main
/* 3584C0 E004A000 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* 3584C4 E004A004 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 3584C8 E004A008 4485A000 */  mtc1      $a1, $f20
/* 3584CC E004A00C F7B60048 */  sdc1      $f22, 0x48($sp)
/* 3584D0 E004A010 4486B000 */  mtc1      $a2, $f22
/* 3584D4 E004A014 AFB20030 */  sw        $s2, 0x30($sp)
/* 3584D8 E004A018 0080902D */  daddu     $s2, $a0, $zero
/* 3584DC E004A01C F7B80050 */  sdc1      $f24, 0x50($sp)
/* 3584E0 E004A020 4487C000 */  mtc1      $a3, $f24
/* 3584E4 E004A024 27A40010 */  addiu     $a0, $sp, 0x10
/* 3584E8 E004A028 F7BA0058 */  sdc1      $f26, 0x58($sp)
/* 3584EC E004A02C 4480D000 */  mtc1      $zero, $f26
/* 3584F0 E004A030 24020001 */  addiu     $v0, $zero, 0x1
/* 3584F4 E004A034 AFBF0038 */  sw        $ra, 0x38($sp)
/* 3584F8 E004A038 AFB30034 */  sw        $s3, 0x34($sp)
/* 3584FC E004A03C AFB1002C */  sw        $s1, 0x2C($sp)
/* 358500 E004A040 1242000E */  beq       $s2, $v0, .LE004A07C
/* 358504 E004A044 AFB00028 */   sw       $s0, 0x28($sp)
/* 358508 E004A048 2A420002 */  slti      $v0, $s2, 0x2
/* 35850C E004A04C 10400005 */  beqz      $v0, .LE004A064
/* 358510 E004A050 24020002 */   addiu    $v0, $zero, 0x2
/* 358514 E004A054 12400007 */  beqz      $s2, .LE004A074
/* 358518 E004A058 24120005 */   addiu    $s2, $zero, 0x5
/* 35851C E004A05C 08012823 */  j         .LE004A08C
/* 358520 E004A060 24020001 */   addiu    $v0, $zero, 0x1
.LE004A064:
/* 358524 E004A064 12420007 */  beq       $s2, $v0, .LE004A084
/* 358528 E004A068 24120005 */   addiu    $s2, $zero, 0x5
/* 35852C E004A06C 08012823 */  j         .LE004A08C
/* 358530 E004A070 24020001 */   addiu    $v0, $zero, 0x1
.LE004A074:
/* 358534 E004A074 08012822 */  j         .LE004A088
/* 358538 E004A078 24120003 */   addiu    $s2, $zero, 0x3
.LE004A07C:
/* 35853C E004A07C 08012822 */  j         .LE004A088
/* 358540 E004A080 24120002 */   addiu    $s2, $zero, 0x2
.LE004A084:
/* 358544 E004A084 24120004 */  addiu     $s2, $zero, 0x4
.LE004A088:
/* 358548 E004A088 24020001 */  addiu     $v0, $zero, 0x1
.LE004A08C:
/* 35854C E004A08C 1242000D */  beq       $s2, $v0, .LE004A0C4
/* 358550 E004A090 2A420002 */   slti     $v0, $s2, 0x2
/* 358554 E004A094 10400005 */  beqz      $v0, .LE004A0AC
/* 358558 E004A098 24020002 */   addiu    $v0, $zero, 0x2
/* 35855C E004A09C 1240000B */  beqz      $s2, .LE004A0CC
/* 358560 E004A0A0 24130002 */   addiu    $s3, $zero, 0x2
/* 358564 E004A0A4 08012835 */  j         .LE004A0D4
/* 358568 E004A0A8 26730001 */   addiu    $s3, $s3, 0x1
.LE004A0AC:
/* 35856C E004A0AC 12420007 */  beq       $s2, $v0, .LE004A0CC
/* 358570 E004A0B0 24020005 */   addiu    $v0, $zero, 0x5
/* 358574 E004A0B4 12420005 */  beq       $s2, $v0, .LE004A0CC
/* 358578 E004A0B8 24130002 */   addiu    $s3, $zero, 0x2
/* 35857C E004A0BC 08012835 */  j         .LE004A0D4
/* 358580 E004A0C0 26730001 */   addiu    $s3, $s3, 0x1
.LE004A0C4:
/* 358584 E004A0C4 08012834 */  j         .LE004A0D0
/* 358588 E004A0C8 24130001 */   addiu    $s3, $zero, 0x1
.LE004A0CC:
/* 35858C E004A0CC 24130003 */  addiu     $s3, $zero, 0x3
.LE004A0D0:
/* 358590 E004A0D0 26730001 */  addiu     $s3, $s3, 0x1
.LE004A0D4:
/* 358594 E004A0D4 3C02E005 */  lui       $v0, %hi(shockwave_init)
/* 358598 E004A0D8 2442A328 */  addiu     $v0, $v0, %lo(shockwave_init)
/* 35859C E004A0DC AC820008 */  sw        $v0, 0x8($a0)
/* 3585A0 E004A0E0 3C02E005 */  lui       $v0, %hi(shockwave_update)
/* 3585A4 E004A0E4 2442A330 */  addiu     $v0, $v0, %lo(shockwave_update)
/* 3585A8 E004A0E8 AC82000C */  sw        $v0, 0xC($a0)
/* 3585AC E004A0EC 3C02E005 */  lui       $v0, %hi(shockwave_render)
/* 3585B0 E004A0F0 2442A748 */  addiu     $v0, $v0, %lo(shockwave_render)
/* 3585B4 E004A0F4 AC820010 */  sw        $v0, 0x10($a0)
/* 3585B8 E004A0F8 24020025 */  addiu     $v0, $zero, 0x25
/* 3585BC E004A0FC AC800000 */  sw        $zero, 0x0($a0)
/* 3585C0 E004A100 AC800014 */  sw        $zero, 0x14($a0)
/* 3585C4 E004A104 0C080124 */  jal       shim_create_effect_instance
/* 3585C8 E004A108 AC820004 */   sw       $v0, 0x4($a0)
/* 3585CC E004A10C 00132040 */  sll       $a0, $s3, 1
/* 3585D0 E004A110 00932021 */  addu      $a0, $a0, $s3
/* 3585D4 E004A114 00042080 */  sll       $a0, $a0, 2
/* 3585D8 E004A118 00932023 */  subu      $a0, $a0, $s3
/* 3585DC E004A11C 000420C0 */  sll       $a0, $a0, 3
/* 3585E0 E004A120 0040802D */  daddu     $s0, $v0, $zero
/* 3585E4 E004A124 0C08012C */  jal       shim_general_heap_malloc
/* 3585E8 E004A128 AE130008 */   sw       $s3, 0x8($s0)
/* 3585EC E004A12C 0040882D */  daddu     $s1, $v0, $zero
/* 3585F0 E004A130 16200003 */  bnez      $s1, .LE004A140
/* 3585F4 E004A134 AE11000C */   sw       $s1, 0xC($s0)
.LE004A138:
/* 3585F8 E004A138 0801284E */  j         .LE004A138
/* 3585FC E004A13C 00000000 */   nop
.LE004A140:
/* 358600 E004A140 0220202D */  daddu     $a0, $s1, $zero
/* 358604 E004A144 00132840 */  sll       $a1, $s3, 1
/* 358608 E004A148 00B32821 */  addu      $a1, $a1, $s3
/* 35860C E004A14C 00052880 */  sll       $a1, $a1, 2
/* 358610 E004A150 00B32823 */  subu      $a1, $a1, $s3
/* 358614 E004A154 0C080130 */  jal       shim_mem_clear
/* 358618 E004A158 000528C0 */   sll      $a1, $a1, 3
/* 35861C E004A15C 2A420002 */  slti      $v0, $s2, 0x2
/* 358620 E004A160 14400002 */  bnez      $v0, .LE004A16C
/* 358624 E004A164 2402001E */   addiu    $v0, $zero, 0x1E
/* 358628 E004A168 2402003C */  addiu     $v0, $zero, 0x3C
.LE004A16C:
/* 35862C E004A16C AE220028 */  sw        $v0, 0x28($s1)
/* 358630 E004A170 240200FF */  addiu     $v0, $zero, 0xFF
/* 358634 E004A174 AE220038 */  sw        $v0, 0x38($s1)
/* 358638 E004A178 2E420006 */  sltiu     $v0, $s2, 0x6
/* 35863C E004A17C AE20002C */  sw        $zero, 0x2C($s1)
/* 358640 E004A180 A6320000 */  sh        $s2, 0x0($s1)
/* 358644 E004A184 E6340004 */  swc1      $f20, 0x4($s1)
/* 358648 E004A188 E6360008 */  swc1      $f22, 0x8($s1)
/* 35864C E004A18C 10400033 */  beqz      $v0, .LE004A25C
/* 358650 E004A190 E638000C */   swc1     $f24, 0xC($s1)
/* 358654 E004A194 00121080 */  sll       $v0, $s2, 2
/* 358658 E004A198 3C01E005 */  lui       $at, (0xE0050000 >> 16)
/* 35865C E004A19C 00220821 */  addu      $at, $at, $v0
/* 358660 E004A1A0 8C22AE80 */  lw        $v0, -0x5180($at)
/* 358664 E004A1A4 00400008 */  jr        $v0
/* 358668 E004A1A8 00000000 */   nop
/* 35866C E004A1AC 240300FF */  addiu     $v1, $zero, 0xFF
/* 358670 E004A1B0 2402007A */  addiu     $v0, $zero, 0x7A
/* 358674 E004A1B4 A2220052 */  sb        $v0, 0x52($s1)
/* 358678 E004A1B8 240200F0 */  addiu     $v0, $zero, 0xF0
/* 35867C E004A1BC A2220053 */  sb        $v0, 0x53($s1)
/* 358680 E004A1C0 240200FA */  addiu     $v0, $zero, 0xFA
/* 358684 E004A1C4 A2200050 */  sb        $zero, 0x50($s1)
/* 358688 E004A1C8 A2230051 */  sb        $v1, 0x51($s1)
/* 35868C E004A1CC 080128A4 */  j         .LE004A290
/* 358690 E004A1D0 A2230054 */   sb       $v1, 0x54($s1)
/* 358694 E004A1D4 2402007D */  addiu     $v0, $zero, 0x7D
/* 358698 E004A1D8 A2220050 */  sb        $v0, 0x50($s1)
/* 35869C E004A1DC 24020078 */  addiu     $v0, $zero, 0x78
/* 3586A0 E004A1E0 A2220051 */  sb        $v0, 0x51($s1)
/* 3586A4 E004A1E4 24020064 */  addiu     $v0, $zero, 0x64
/* 3586A8 E004A1E8 A2220052 */  sb        $v0, 0x52($s1)
/* 3586AC E004A1EC 240200FF */  addiu     $v0, $zero, 0xFF
/* 3586B0 E004A1F0 A2220053 */  sb        $v0, 0x53($s1)
/* 3586B4 E004A1F4 A2220054 */  sb        $v0, 0x54($s1)
/* 3586B8 E004A1F8 080128A4 */  j         .LE004A290
/* 3586BC E004A1FC 240200F0 */   addiu    $v0, $zero, 0xF0
/* 3586C0 E004A200 240200DC */  addiu     $v0, $zero, 0xDC
/* 3586C4 E004A204 A2220050 */  sb        $v0, 0x50($s1)
/* 3586C8 E004A208 240200D2 */  addiu     $v0, $zero, 0xD2
/* 3586CC E004A20C A2220051 */  sb        $v0, 0x51($s1)
/* 3586D0 E004A210 240200C8 */  addiu     $v0, $zero, 0xC8
/* 3586D4 E004A214 A2220052 */  sb        $v0, 0x52($s1)
/* 3586D8 E004A218 240200FF */  addiu     $v0, $zero, 0xFF
/* 3586DC E004A21C A2220053 */  sb        $v0, 0x53($s1)
/* 3586E0 E004A220 A2220054 */  sb        $v0, 0x54($s1)
/* 3586E4 E004A224 080128A4 */  j         .LE004A290
/* 3586E8 E004A228 240200FA */   addiu    $v0, $zero, 0xFA
/* 3586EC E004A22C 240200E1 */  addiu     $v0, $zero, 0xE1
/* 3586F0 E004A230 A2220050 */  sb        $v0, 0x50($s1)
/* 3586F4 E004A234 240200CC */  addiu     $v0, $zero, 0xCC
/* 3586F8 E004A238 A2220051 */  sb        $v0, 0x51($s1)
/* 3586FC E004A23C 2402005D */  addiu     $v0, $zero, 0x5D
/* 358700 E004A240 A2220052 */  sb        $v0, 0x52($s1)
/* 358704 E004A244 240200E8 */  addiu     $v0, $zero, 0xE8
/* 358708 E004A248 A2220053 */  sb        $v0, 0x53($s1)
/* 35870C E004A24C 240200E7 */  addiu     $v0, $zero, 0xE7
/* 358710 E004A250 A2220054 */  sb        $v0, 0x54($s1)
/* 358714 E004A254 080128A4 */  j         .LE004A290
/* 358718 E004A258 240200AB */   addiu    $v0, $zero, 0xAB
.LE004A25C:
/* 35871C E004A25C 24020032 */  addiu     $v0, $zero, 0x32
/* 358720 E004A260 AE220028 */  sw        $v0, 0x28($s1)
/* 358724 E004A264 240200D0 */  addiu     $v0, $zero, 0xD0
/* 358728 E004A268 A2220050 */  sb        $v0, 0x50($s1)
/* 35872C E004A26C 24020088 */  addiu     $v0, $zero, 0x88
/* 358730 E004A270 A2220051 */  sb        $v0, 0x51($s1)
/* 358734 E004A274 24020028 */  addiu     $v0, $zero, 0x28
/* 358738 E004A278 A2220052 */  sb        $v0, 0x52($s1)
/* 35873C E004A27C 240200D8 */  addiu     $v0, $zero, 0xD8
/* 358740 E004A280 A2220053 */  sb        $v0, 0x53($s1)
/* 358744 E004A284 240200A9 */  addiu     $v0, $zero, 0xA9
/* 358748 E004A288 A2220054 */  sb        $v0, 0x54($s1)
/* 35874C E004A28C 24020041 */  addiu     $v0, $zero, 0x41
.LE004A290:
/* 358750 E004A290 A2220055 */  sb        $v0, 0x55($s1)
/* 358754 E004A294 24030001 */  addiu     $v1, $zero, 0x1
/* 358758 E004A298 0073102A */  slt       $v0, $v1, $s3
/* 35875C E004A29C 10400017 */  beqz      $v0, .LE004A2FC
/* 358760 E004A2A0 26310058 */   addiu    $s1, $s1, 0x58
/* 358764 E004A2A4 2A480002 */  slti      $t0, $s2, 0x2
/* 358768 E004A2A8 26240030 */  addiu     $a0, $s1, 0x30
/* 35876C E004A2AC 2407001E */  addiu     $a3, $zero, 0x1E
/* 358770 E004A2B0 2406FFFF */  addiu     $a2, $zero, -0x1
/* 358774 E004A2B4 00C0282D */  daddu     $a1, $a2, $zero
.LE004A2B8:
/* 358778 E004A2B8 51000004 */  beql      $t0, $zero, .LE004A2CC
/* 35877C E004A2BC AC86001C */   sw       $a2, 0x1C($a0)
/* 358780 E004A2C0 06420002 */  bltzl     $s2, .LE004A2CC
/* 358784 E004A2C4 AC86001C */   sw       $a2, 0x1C($a0)
/* 358788 E004A2C8 AC85001C */  sw        $a1, 0x1C($a0)
.LE004A2CC:
/* 35878C E004A2CC 44870000 */  mtc1      $a3, $f0
/* 358790 E004A2D0 00000000 */  nop
/* 358794 E004A2D4 46800020 */  cvt.s.w   $f0, $f0
/* 358798 E004A2D8 24E7001E */  addiu     $a3, $a3, 0x1E
/* 35879C E004A2DC 24C6FFFD */  addiu     $a2, $a2, -0x3
/* 3587A0 E004A2E0 24A5FFFE */  addiu     $a1, $a1, -0x2
/* 3587A4 E004A2E4 24630001 */  addiu     $v1, $v1, 0x1
/* 3587A8 E004A2E8 E49A0004 */  swc1      $f26, 0x4($a0)
/* 3587AC E004A2EC E4800000 */  swc1      $f0, 0x0($a0)
/* 3587B0 E004A2F0 0073102A */  slt       $v0, $v1, $s3
/* 3587B4 E004A2F4 1440FFF0 */  bnez      $v0, .LE004A2B8
/* 3587B8 E004A2F8 24840058 */   addiu    $a0, $a0, 0x58
.LE004A2FC:
/* 3587BC E004A2FC 8FBF0038 */  lw        $ra, 0x38($sp)
/* 3587C0 E004A300 8FB30034 */  lw        $s3, 0x34($sp)
/* 3587C4 E004A304 8FB20030 */  lw        $s2, 0x30($sp)
/* 3587C8 E004A308 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3587CC E004A30C 8FB00028 */  lw        $s0, 0x28($sp)
/* 3587D0 E004A310 D7BA0058 */  ldc1      $f26, 0x58($sp)
/* 3587D4 E004A314 D7B80050 */  ldc1      $f24, 0x50($sp)
/* 3587D8 E004A318 D7B60048 */  ldc1      $f22, 0x48($sp)
/* 3587DC E004A31C D7B40040 */  ldc1      $f20, 0x40($sp)
/* 3587E0 E004A320 03E00008 */  jr        $ra
/* 3587E4 E004A324 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

void shockwave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    ShockwaveFXData* part;
    f32 zero = 0.0f;
    s32 numParts;
    s32 i;

    switch (arg0) {
        case 0:
            arg0 = 3;
            break;
        case 1:
            arg0 = 2;
            break;
        case 2:
            arg0 = 4;
            break;
        default:
            arg0 = 5;
            break;
    }

    switch (arg0) {
        case 1:
            numParts = 1;
            break;
        case 0:
        case 2:
        case 5:
            numParts = 3;
            break;
        default:
            numParts = 2;
            break;
    }

    numParts++;

    bpPtr->init = shockwave_init;
    bpPtr->update = shockwave_update;
    bpPtr->renderWorld = shockwave_render;
    bpPtr->unk_00 = 0;
    bpPtr->renderUI = NULL;
    bpPtr->effectID = EFFECT_SHOCKWAVE;

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

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

    if (arg0 >= 2) {
        part->unk_28 = 60;
    } else {
        part->unk_28 = 30;
    }
    part->alpha = 255;
    part->unk_2C = 0;
    part->unk_00 = arg0;
    part->pos.x = arg1;
    part->pos.y = arg2;
    part->pos.z = arg3;

    switch (arg0) {
        case 0:
        case 1:
            part->prim.r = 0;
            part->prim.g = 255;
            part->prim.b = 122;
            part->env.r = 240;
            part->env.g = 255;
            part->env.b = 250;
            break;
        case 2:
            part->prim.r = 125;
            part->prim.g = 120;
            part->prim.b = 100;
            part->env.r = 255;
            part->env.g = 255;
            part->env.b = 240;
            break;
        case 3:
            part->prim.r = 220;
            part->prim.g = 210;
            part->prim.b = 200;
            part->env.r = 255;
            part->env.g = 255;
            part->env.b = 250;
            break;
        case 5:
            part->prim.r = 225;
            part->prim.g = 204;
            part->prim.b = 93;
            part->env.r = 232;
            part->env.g = 231;
            part->env.b = 171;
            break;
        default:
            part->unk_28 = 50;
            part->prim.r = 208;
            part->prim.g = 136;
            part->prim.b = 40;
            part->env.r = 216;
            part->env.g = 169;
            part->env.b = 65;
            break;
    }

    part++;
    for (i = 1; i < numParts; i++, part++) {
        switch (arg0) {
            case 0:
            case 1:
                part->unk_4C = 1 + i * -2;
                break;
            default:
                part->unk_4C = 2 + i * -3;
                break;
        }
        part->unk_34 = zero;
        part->unk_30 = i * 30;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_800F4944
/* 8DDF4 800F4944 3C028011 */  lui       $v0, %hi(PopupNotBattle)
/* 8DDF8 800F4948 8042D68E */  lb        $v0, %lo(PopupNotBattle)($v0)
/* 8DDFC 800F494C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 8DE00 800F4950 AFB00018 */  sw        $s0, 0x18($sp)
/* 8DE04 800F4954 00A0802D */  daddu     $s0, $a1, $zero
/* 8DE08 800F4958 AFB1001C */  sw        $s1, 0x1C($sp)
/* 8DE0C 800F495C 24D10007 */  addiu     $s1, $a2, 0x7
/* 8DE10 800F4960 104000A9 */  beqz      $v0, .L800F4C08
/* 8DE14 800F4964 AFBF0020 */   sw       $ra, 0x20($sp)
/* 8DE18 800F4968 3C028011 */  lui       $v0, %hi(gPopupMenu)
/* 8DE1C 800F496C 8C42D69C */  lw        $v0, %lo(gPopupMenu)($v0)
/* 8DE20 800F4970 8C430318 */  lw        $v1, 0x318($v0)
/* 8DE24 800F4974 2C62000E */  sltiu     $v0, $v1, 0xE
/* 8DE28 800F4978 104000A3 */  beqz      $v0, .L800F4C08
/* 8DE2C 800F497C 00031080 */   sll      $v0, $v1, 2
/* 8DE30 800F4980 3C018011 */  lui       $at, %hi(jtbl_8010C8E0)
/* 8DE34 800F4984 00220821 */  addu      $at, $at, $v0
/* 8DE38 800F4988 8C22C8E0 */  lw        $v0, %lo(jtbl_8010C8E0)($at)
/* 8DE3C 800F498C 00400008 */  jr        $v0
/* 8DE40 800F4990 00000000 */   nop
glabel .L800F4994
/* 8DE44 800F4994 3C04001D */  lui       $a0, (0x1D0061 >> 16)
/* 8DE48 800F4998 34840061 */  ori       $a0, $a0, (0x1D0061 & 0xFFFF)
/* 8DE4C 800F499C 0C04991D */  jal       get_msg_width
/* 8DE50 800F49A0 0000282D */   daddu    $a1, $zero, $zero
/* 8DE54 800F49A4 3C04001D */  lui       $a0, (0x1D0061 >> 16)
/* 8DE58 800F49A8 0803D2F7 */  j         .L800F4BDC
/* 8DE5C 800F49AC 34840061 */   ori      $a0, $a0, (0x1D0061 & 0xFFFF)
glabel .L800F49B0
/* 8DE60 800F49B0 3C04001D */  lui       $a0, (0x1D0063 >> 16)
/* 8DE64 800F49B4 34840063 */  ori       $a0, $a0, (0x1D0063 & 0xFFFF)
/* 8DE68 800F49B8 0C04991D */  jal       get_msg_width
/* 8DE6C 800F49BC 0000282D */   daddu    $a1, $zero, $zero
/* 8DE70 800F49C0 3C04001D */  lui       $a0, (0x1D0063 >> 16)
/* 8DE74 800F49C4 34840063 */  ori       $a0, $a0, (0x1D0063 & 0xFFFF)
/* 8DE78 800F49C8 26050048 */  addiu     $a1, $s0, 0x48
/* 8DE7C 800F49CC 00021FC2 */  srl       $v1, $v0, 31
/* 8DE80 800F49D0 00621821 */  addu      $v1, $v1, $v0
/* 8DE84 800F49D4 00031843 */  sra       $v1, $v1, 1
/* 8DE88 800F49D8 00A32823 */  subu      $a1, $a1, $v1
/* 8DE8C 800F49DC 0803D2FD */  j         .L800F4BF4
/* 8DE90 800F49E0 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F49E4
/* 8DE94 800F49E4 3C04001D */  lui       $a0, (0x1D0064 >> 16)
/* 8DE98 800F49E8 34840064 */  ori       $a0, $a0, (0x1D0064 & 0xFFFF)
/* 8DE9C 800F49EC 0C04991D */  jal       get_msg_width
/* 8DEA0 800F49F0 0000282D */   daddu    $a1, $zero, $zero
/* 8DEA4 800F49F4 3C04001D */  lui       $a0, (0x1D0064 >> 16)
/* 8DEA8 800F49F8 34840064 */  ori       $a0, $a0, (0x1D0064 & 0xFFFF)
/* 8DEAC 800F49FC 26050048 */  addiu     $a1, $s0, 0x48
/* 8DEB0 800F4A00 00021FC2 */  srl       $v1, $v0, 31
/* 8DEB4 800F4A04 00621821 */  addu      $v1, $v1, $v0
/* 8DEB8 800F4A08 00031843 */  sra       $v1, $v1, 1
/* 8DEBC 800F4A0C 00A32823 */  subu      $a1, $a1, $v1
/* 8DEC0 800F4A10 0803D2FD */  j         .L800F4BF4
/* 8DEC4 800F4A14 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4A18
/* 8DEC8 800F4A18 3C04001D */  lui       $a0, (0x1D0070 >> 16)
/* 8DECC 800F4A1C 34840070 */  ori       $a0, $a0, (0x1D0070 & 0xFFFF)
/* 8DED0 800F4A20 0C04991D */  jal       get_msg_width
/* 8DED4 800F4A24 0000282D */   daddu    $a1, $zero, $zero
/* 8DED8 800F4A28 3C04001D */  lui       $a0, (0x1D0070 >> 16)
/* 8DEDC 800F4A2C 34840070 */  ori       $a0, $a0, (0x1D0070 & 0xFFFF)
/* 8DEE0 800F4A30 26050040 */  addiu     $a1, $s0, 0x40
/* 8DEE4 800F4A34 00021FC2 */  srl       $v1, $v0, 31
/* 8DEE8 800F4A38 00621821 */  addu      $v1, $v1, $v0
/* 8DEEC 800F4A3C 00031843 */  sra       $v1, $v1, 1
/* 8DEF0 800F4A40 00A32823 */  subu      $a1, $a1, $v1
/* 8DEF4 800F4A44 0803D2FD */  j         .L800F4BF4
/* 8DEF8 800F4A48 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4A4C
/* 8DEFC 800F4A4C 3C04001D */  lui       $a0, (0x1D006A >> 16)
/* 8DF00 800F4A50 3484006A */  ori       $a0, $a0, (0x1D006A & 0xFFFF)
/* 8DF04 800F4A54 0C04991D */  jal       get_msg_width
/* 8DF08 800F4A58 0000282D */   daddu    $a1, $zero, $zero
/* 8DF0C 800F4A5C 3C04001D */  lui       $a0, (0x1D006A >> 16)
/* 8DF10 800F4A60 3484006A */  ori       $a0, $a0, (0x1D006A & 0xFFFF)
/* 8DF14 800F4A64 26050044 */  addiu     $a1, $s0, 0x44
/* 8DF18 800F4A68 00021FC2 */  srl       $v1, $v0, 31
/* 8DF1C 800F4A6C 00621821 */  addu      $v1, $v1, $v0
/* 8DF20 800F4A70 00031843 */  sra       $v1, $v1, 1
/* 8DF24 800F4A74 00A32823 */  subu      $a1, $a1, $v1
/* 8DF28 800F4A78 0803D2FD */  j         .L800F4BF4
/* 8DF2C 800F4A7C 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4A80
/* 8DF30 800F4A80 3C04001D */  lui       $a0, (0x1D0065 >> 16)
/* 8DF34 800F4A84 34840065 */  ori       $a0, $a0, (0x1D0065 & 0xFFFF)
/* 8DF38 800F4A88 0C04991D */  jal       get_msg_width
/* 8DF3C 800F4A8C 0000282D */   daddu    $a1, $zero, $zero
/* 8DF40 800F4A90 3C04001D */  lui       $a0, (0x1D0065 >> 16)
/* 8DF44 800F4A94 34840065 */  ori       $a0, $a0, (0x1D0065 & 0xFFFF)
/* 8DF48 800F4A98 0803D2F8 */  j         .L800F4BE0
/* 8DF4C 800F4A9C 2605003C */   addiu    $a1, $s0, 0x3C
glabel .L800F4AA0
/* 8DF50 800F4AA0 3C04001D */  lui       $a0, (0x1D0066 >> 16)
/* 8DF54 800F4AA4 34840066 */  ori       $a0, $a0, (0x1D0066 & 0xFFFF)
/* 8DF58 800F4AA8 0C04991D */  jal       get_msg_width
/* 8DF5C 800F4AAC 0000282D */   daddu    $a1, $zero, $zero
/* 8DF60 800F4AB0 3C04001D */  lui       $a0, (0x1D0066 >> 16)
/* 8DF64 800F4AB4 0803D2F7 */  j         .L800F4BDC
/* 8DF68 800F4AB8 34840066 */   ori      $a0, $a0, (0x1D0066 & 0xFFFF)
glabel .L800F4ABC
/* 8DF6C 800F4ABC 3C04001D */  lui       $a0, (0x1D0067 >> 16)
/* 8DF70 800F4AC0 34840067 */  ori       $a0, $a0, (0x1D0067 & 0xFFFF)
/* 8DF74 800F4AC4 0C04991D */  jal       get_msg_width
/* 8DF78 800F4AC8 0000282D */   daddu    $a1, $zero, $zero
/* 8DF7C 800F4ACC 3C04001D */  lui       $a0, (0x1D0067 >> 16)
/* 8DF80 800F4AD0 0803D2F7 */  j         .L800F4BDC
/* 8DF84 800F4AD4 34840067 */   ori      $a0, $a0, (0x1D0067 & 0xFFFF)
glabel .L800F4AD8
/* 8DF88 800F4AD8 3C04001D */  lui       $a0, (0x1D006F >> 16)
/* 8DF8C 800F4ADC 3484006F */  ori       $a0, $a0, (0x1D006F & 0xFFFF)
/* 8DF90 800F4AE0 0C04991D */  jal       get_msg_width
/* 8DF94 800F4AE4 0000282D */   daddu    $a1, $zero, $zero
/* 8DF98 800F4AE8 3C04001D */  lui       $a0, (0x1D006F >> 16)
/* 8DF9C 800F4AEC 3484006F */  ori       $a0, $a0, (0x1D006F & 0xFFFF)
/* 8DFA0 800F4AF0 26050048 */  addiu     $a1, $s0, 0x48
/* 8DFA4 800F4AF4 00021FC2 */  srl       $v1, $v0, 31
/* 8DFA8 800F4AF8 00621821 */  addu      $v1, $v1, $v0
/* 8DFAC 800F4AFC 00031843 */  sra       $v1, $v1, 1
/* 8DFB0 800F4B00 00A32823 */  subu      $a1, $a1, $v1
/* 8DFB4 800F4B04 0803D2FD */  j         .L800F4BF4
/* 8DFB8 800F4B08 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4B0C
/* 8DFBC 800F4B0C 3C04001D */  lui       $a0, (0x1D006D >> 16)
/* 8DFC0 800F4B10 3484006D */  ori       $a0, $a0, (0x1D006D & 0xFFFF)
/* 8DFC4 800F4B14 0C04991D */  jal       get_msg_width
/* 8DFC8 800F4B18 0000282D */   daddu    $a1, $zero, $zero
/* 8DFCC 800F4B1C 3C04001D */  lui       $a0, (0x1D006D >> 16)
/* 8DFD0 800F4B20 3484006D */  ori       $a0, $a0, (0x1D006D & 0xFFFF)
/* 8DFD4 800F4B24 26050038 */  addiu     $a1, $s0, 0x38
/* 8DFD8 800F4B28 00021FC2 */  srl       $v1, $v0, 31
/* 8DFDC 800F4B2C 00621821 */  addu      $v1, $v1, $v0
/* 8DFE0 800F4B30 00031843 */  sra       $v1, $v1, 1
/* 8DFE4 800F4B34 00A32823 */  subu      $a1, $a1, $v1
/* 8DFE8 800F4B38 0803D2FD */  j         .L800F4BF4
/* 8DFEC 800F4B3C 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4B40
/* 8DFF0 800F4B40 3C04001D */  lui       $a0, (0x1D00D6 >> 16)
/* 8DFF4 800F4B44 348400D6 */  ori       $a0, $a0, (0x1D00D6 & 0xFFFF)
/* 8DFF8 800F4B48 0C04991D */  jal       get_msg_width
/* 8DFFC 800F4B4C 0000282D */   daddu    $a1, $zero, $zero
/* 8E000 800F4B50 3C04001D */  lui       $a0, (0x1D00D6 >> 16)
/* 8E004 800F4B54 0803D2F7 */  j         .L800F4BDC
/* 8E008 800F4B58 348400D6 */   ori      $a0, $a0, (0x1D00D6 & 0xFFFF)
glabel .L800F4B5C
/* 8E00C 800F4B5C 3C04001D */  lui       $a0, (0x1D006C >> 16)
/* 8E010 800F4B60 3484006C */  ori       $a0, $a0, (0x1D006C & 0xFFFF)
/* 8E014 800F4B64 0C04991D */  jal       get_msg_width
/* 8E018 800F4B68 0000282D */   daddu    $a1, $zero, $zero
/* 8E01C 800F4B6C 3C04001D */  lui       $a0, (0x1D006C >> 16)
/* 8E020 800F4B70 3484006C */  ori       $a0, $a0, (0x1D006C & 0xFFFF)
/* 8E024 800F4B74 26050040 */  addiu     $a1, $s0, 0x40
/* 8E028 800F4B78 00021FC2 */  srl       $v1, $v0, 31
/* 8E02C 800F4B7C 00621821 */  addu      $v1, $v1, $v0
/* 8E030 800F4B80 00031843 */  sra       $v1, $v1, 1
/* 8E034 800F4B84 00A32823 */  subu      $a1, $a1, $v1
/* 8E038 800F4B88 0803D2FD */  j         .L800F4BF4
/* 8E03C 800F4B8C 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4B90
/* 8E040 800F4B90 3C04001D */  lui       $a0, (0x1D006D >> 16)
/* 8E044 800F4B94 3484006D */  ori       $a0, $a0, (0x1D006D & 0xFFFF)
/* 8E048 800F4B98 0C04991D */  jal       get_msg_width
/* 8E04C 800F4B9C 0000282D */   daddu    $a1, $zero, $zero
/* 8E050 800F4BA0 3C04001D */  lui       $a0, (0x1D006D >> 16)
/* 8E054 800F4BA4 3484006D */  ori       $a0, $a0, (0x1D006D & 0xFFFF)
/* 8E058 800F4BA8 26050040 */  addiu     $a1, $s0, 0x40
/* 8E05C 800F4BAC 00021FC2 */  srl       $v1, $v0, 31
/* 8E060 800F4BB0 00621821 */  addu      $v1, $v1, $v0
/* 8E064 800F4BB4 00031843 */  sra       $v1, $v1, 1
/* 8E068 800F4BB8 00A32823 */  subu      $a1, $a1, $v1
/* 8E06C 800F4BBC 0803D2FD */  j         .L800F4BF4
/* 8E070 800F4BC0 2626FFFC */   addiu    $a2, $s1, -0x4
glabel .L800F4BC4
/* 8E074 800F4BC4 3C04001D */  lui       $a0, (0x1D0062 >> 16)
/* 8E078 800F4BC8 34840062 */  ori       $a0, $a0, (0x1D0062 & 0xFFFF)
/* 8E07C 800F4BCC 0C04991D */  jal       get_msg_width
/* 8E080 800F4BD0 0000282D */   daddu    $a1, $zero, $zero
/* 8E084 800F4BD4 3C04001D */  lui       $a0, (0x1D0062 >> 16)
/* 8E088 800F4BD8 34840062 */  ori       $a0, $a0, (0x1D0062 & 0xFFFF)
.L800F4BDC:
/* 8E08C 800F4BDC 26050048 */  addiu     $a1, $s0, 0x48
.L800F4BE0:
/* 8E090 800F4BE0 00021FC2 */  srl       $v1, $v0, 31
/* 8E094 800F4BE4 00621821 */  addu      $v1, $v1, $v0
/* 8E098 800F4BE8 00031843 */  sra       $v1, $v1, 1
/* 8E09C 800F4BEC 00A32823 */  subu      $a1, $a1, $v1
/* 8E0A0 800F4BF0 0220302D */  daddu     $a2, $s1, $zero
.L800F4BF4:
/* 8E0A4 800F4BF4 240700FF */  addiu     $a3, $zero, 0xFF
/* 8E0A8 800F4BF8 2402000F */  addiu     $v0, $zero, 0xF
/* 8E0AC 800F4BFC AFA20010 */  sw        $v0, 0x10($sp)
/* 8E0B0 800F4C00 0C04993B */  jal       draw_msg
/* 8E0B4 800F4C04 AFA00014 */   sw       $zero, 0x14($sp)
.L800F4C08:
/* 8E0B8 800F4C08 8FBF0020 */  lw        $ra, 0x20($sp)
/* 8E0BC 800F4C0C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 8E0C0 800F4C10 8FB00018 */  lw        $s0, 0x18($sp)
/* 8E0C4 800F4C14 03E00008 */  jr        $ra
/* 8E0C8 800F4C18 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void func_800F4944(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
    s32 msgWidth;

    baseY += 7;

    if (PopupNotBattle) {
        switch (gPopupMenu->popupType) {
            case POPUP_MENU_USE_ITEM:
                msgWidth = get_msg_width(MSG_Menus_0061, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_0061, baseX, baseY, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_SWITCH_PARTNER:
                msgWidth = get_msg_width(MSG_Menus_0063, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_0063, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_THROW_AWAY_ITEM:
                msgWidth = get_msg_width(MSG_Menus_0064, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_0064, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_TRADE_FOR_BADGE:
                msgWidth = get_msg_width(MSG_Menus_0070, 0);
                baseX += 64 - (msgWidth / 2);
                draw_msg(MSG_Menus_0070, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_UPGRADE_PARTNER:
                msgWidth = get_msg_width(MSG_Menus_006A, 0);
                baseX += 68 - (msgWidth / 2);
                draw_msg(MSG_Menus_006A, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_SELL_ITEM:
                msgWidth = get_msg_width(MSG_Menus_0065, 0);
                baseX += 60 - (msgWidth / 2);
                draw_msg(MSG_Menus_0065, baseX, baseY, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_CHECK_ITEM:
                msgWidth = get_msg_width(MSG_Menus_0066, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_0066, baseX, baseY, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_CLAIM_ITEM:
                msgWidth = get_msg_width(MSG_Menus_0067, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_0067, baseX, baseY, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_POST_OFFICE:
                msgWidth = get_msg_width(MSG_Menus_006F, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_006F, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_READ_LETTER:
                msgWidth = get_msg_width(MSG_Menus_006D, 0);
                baseX += 56 - (msgWidth / 2);
                draw_msg(MSG_Menus_006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_TAKE_FROM_CHEST:
                msgWidth = get_msg_width(MSG_Menus_00D6, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_00D6, baseX, baseY, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_READ_DIARY_PAGE:
                msgWidth = get_msg_width(MSG_Menus_006C, 0);
                baseX += 64 - (msgWidth / 2);
                draw_msg(MSG_Menus_006C, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_READ_POSTCARD:
                msgWidth = get_msg_width(MSG_Menus_006D, 0);
                baseX += 64 - (msgWidth / 2);
                draw_msg(MSG_Menus_006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
                break;
            case POPUP_MENU_USEKEY:
                msgWidth = get_msg_width(MSG_Menus_0062, 0);
                baseX += 72 - (msgWidth / 2);
                draw_msg(MSG_Menus_0062, baseX, baseY, 255, MSG_PAL_0F, 0);
                break;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ending_decals_appendGfx
/* 36AB04 E0068234 27BDFF78 */  addiu     $sp, $sp, -0x88
/* 36AB08 E0068238 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 36AB0C E006823C AFB10064 */  sw        $s1, 0x64($sp)
/* 36AB10 E0068240 3C11800A */  lui       $s1, %hi(gMainGfxPos)
/* 36AB14 E0068244 2631A66C */  addiu     $s1, $s1, %lo(gMainGfxPos)
/* 36AB18 E0068248 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 36AB1C E006824C AFB3006C */  sw        $s3, 0x6C($sp)
/* 36AB20 E0068250 3C130001 */  lui       $s3, (0x11630 >> 16)
/* 36AB24 E0068254 AFBF0080 */  sw        $ra, 0x80($sp)
/* 36AB28 E0068258 AFB7007C */  sw        $s7, 0x7C($sp)
/* 36AB2C E006825C AFB60078 */  sw        $s6, 0x78($sp)
/* 36AB30 E0068260 AFB50074 */  sw        $s5, 0x74($sp)
/* 36AB34 E0068264 AFB40070 */  sw        $s4, 0x70($sp)
/* 36AB38 E0068268 AFB20068 */  sw        $s2, 0x68($sp)
/* 36AB3C E006826C AFB00060 */  sw        $s0, 0x60($sp)
/* 36AB40 E0068270 8E260000 */  lw        $a2, 0x0($s1)
/* 36AB44 E0068274 8C94000C */  lw        $s4, 0xC($a0)
/* 36AB48 E0068278 44800000 */  mtc1      $zero, $f0
/* 36AB4C E006827C 00C0182D */  daddu     $v1, $a2, $zero
/* 36AB50 E0068280 24C60008 */  addiu     $a2, $a2, 0x8
/* 36AB54 E0068284 8E820000 */  lw        $v0, 0x0($s4)
/* 36AB58 E0068288 44050000 */  mfc1      $a1, $f0
/* 36AB5C E006828C 8E960020 */  lw        $s6, 0x20($s4)
/* 36AB60 E0068290 00021080 */  sll       $v0, $v0, 2
/* 36AB64 E0068294 3C15E007 */  lui       $s5, (0xE0070000 >> 16)
/* 36AB68 E0068298 02A2A821 */  addu      $s5, $s5, $v0
/* 36AB6C E006829C 8EB585B0 */  lw        $s5, -0x7A50($s5)
/* 36AB70 E00682A0 3C17E007 */  lui       $s7, (0xE0070000 >> 16)
/* 36AB74 E00682A4 02E2B821 */  addu      $s7, $s7, $v0
/* 36AB78 E00682A8 8EF785F4 */  lw        $s7, -0x7A0C($s7)
/* 36AB7C E00682AC 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 36AB80 E00682B0 AC620000 */  sw        $v0, 0x0($v1)
/* 36AB84 E00682B4 AC600004 */  sw        $zero, 0x4($v1)
/* 36AB88 E00682B8 ACC70000 */  sw        $a3, 0x0($a2)
/* 36AB8C E00682BC 8C820010 */  lw        $v0, 0x10($a0)
/* 36AB90 E00682C0 3C048000 */  lui       $a0, (0x80000000 >> 16)
/* 36AB94 E00682C4 8C42001C */  lw        $v0, 0x1C($v0)
/* 36AB98 E00682C8 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 36AB9C E00682CC 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 36ABA0 E00682D0 00441021 */  addu      $v0, $v0, $a0
/* 36ABA4 E00682D4 ACC20004 */  sw        $v0, 0x4($a2)
/* 36ABA8 E00682D8 00031080 */  sll       $v0, $v1, 2
/* 36ABAC E00682DC 00431021 */  addu      $v0, $v0, $v1
/* 36ABB0 E00682E0 00021080 */  sll       $v0, $v0, 2
/* 36ABB4 E00682E4 00431023 */  subu      $v0, $v0, $v1
/* 36ABB8 E00682E8 000218C0 */  sll       $v1, $v0, 3
/* 36ABBC E00682EC 00431021 */  addu      $v0, $v0, $v1
/* 36ABC0 E00682F0 000210C0 */  sll       $v0, $v0, 3
/* 36ABC4 E00682F4 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 36ABC8 E00682F8 00220821 */  addu      $at, $at, $v0
/* 36ABCC E00682FC C4221DEC */  lwc1      $f2, %lo(gCameras + 0x6C)($at)
/* 36ABD0 E0068300 C6800010 */  lwc1      $f0, 0x10($s4)
/* 36ABD4 E0068304 36731630 */  ori       $s3, $s3, (0x11630 & 0xFFFF)
/* 36ABD8 E0068308 E7A00010 */  swc1      $f0, 0x10($sp)
/* 36ABDC E006830C C6800004 */  lwc1      $f0, 0x4($s4)
/* 36ABE0 E0068310 00A0382D */  daddu     $a3, $a1, $zero
/* 36ABE4 E0068314 E7A00014 */  swc1      $f0, 0x14($sp)
/* 36ABE8 E0068318 C6800008 */  lwc1      $f0, 0x8($s4)
/* 36ABEC E006831C 46001087 */  neg.s     $f2, $f2
/* 36ABF0 E0068320 AE260000 */  sw        $a2, 0x0($s1)
/* 36ABF4 E0068324 E7A00018 */  swc1      $f0, 0x18($sp)
/* 36ABF8 E0068328 C680000C */  lwc1      $f0, 0xC($s4)
/* 36ABFC E006832C 24C60008 */  addiu     $a2, $a2, 0x8
/* 36AC00 E0068330 AE260000 */  sw        $a2, 0x0($s1)
/* 36AC04 E0068334 44061000 */  mfc1      $a2, $f2
/* 36AC08 E0068338 27A40020 */  addiu     $a0, $sp, 0x20
/* 36AC0C E006833C 0C080180 */  jal       shim_guPositionF
/* 36AC10 E0068340 E7A0001C */   swc1     $f0, 0x1C($sp)
/* 36AC14 E0068344 27A40020 */  addiu     $a0, $sp, 0x20
/* 36AC18 E0068348 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 36AC1C E006834C 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 36AC20 E0068350 3C12800A */  lui       $s2, %hi(gDisplayContext)
/* 36AC24 E0068354 2652A674 */  addiu     $s2, $s2, %lo(gDisplayContext)
/* 36AC28 E0068358 96050000 */  lhu       $a1, 0x0($s0)
/* 36AC2C E006835C 8E420000 */  lw        $v0, 0x0($s2)
/* 36AC30 E0068360 00052980 */  sll       $a1, $a1, 6
/* 36AC34 E0068364 00B32821 */  addu      $a1, $a1, $s3
/* 36AC38 E0068368 0C080118 */  jal       shim_guMtxF2L
/* 36AC3C E006836C 00452821 */   addu     $a1, $v0, $a1
/* 36AC40 E0068370 8E220000 */  lw        $v0, 0x0($s1)
/* 36AC44 E0068374 0040202D */  daddu     $a0, $v0, $zero
/* 36AC48 E0068378 24420008 */  addiu     $v0, $v0, 0x8
/* 36AC4C E006837C AE220000 */  sw        $v0, 0x0($s1)
/* 36AC50 E0068380 96020000 */  lhu       $v0, 0x0($s0)
/* 36AC54 E0068384 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 36AC58 E0068388 AC830000 */  sw        $v1, 0x0($a0)
/* 36AC5C E006838C 24430001 */  addiu     $v1, $v0, 0x1
/* 36AC60 E0068390 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 36AC64 E0068394 00021180 */  sll       $v0, $v0, 6
/* 36AC68 E0068398 A6030000 */  sh        $v1, 0x0($s0)
/* 36AC6C E006839C 8E430000 */  lw        $v1, 0x0($s2)
/* 36AC70 E00683A0 00531021 */  addu      $v0, $v0, $s3
/* 36AC74 E00683A4 00621821 */  addu      $v1, $v1, $v0
/* 36AC78 E00683A8 AC830004 */  sw        $v1, 0x4($a0)
/* 36AC7C E00683AC C6820018 */  lwc1      $f2, 0x18($s4)
/* 36AC80 E00683B0 468010A1 */  cvt.d.w   $f2, $f2
/* 36AC84 E00683B4 32C20001 */  andi      $v0, $s6, 0x1
/* 36AC88 E00683B8 14400009 */  bnez      $v0, .LE00683E0
/* 36AC8C E00683BC 3C031A79 */   lui      $v1, (0x1A791D9E >> 16)
/* 36AC90 E00683C0 3C01E007 */  lui       $at, (0xE0070000 >> 16)
/* 36AC94 E00683C4 D4208600 */  ldc1      $f0, -0x7A00($at)
/* 36AC98 E00683C8 46201002 */  mul.d     $f0, $f2, $f0
/* 36AC9C E00683CC 00000000 */  nop
/* 36ACA0 E00683D0 4620010D */  trunc.w.d $f4, $f0
/* 36ACA4 E00683D4 44092000 */  mfc1      $t1, $f4
/* 36ACA8 E00683D8 0801A0FB */  j         .LE00683EC
/* 36ACAC E00683DC 34631D9E */   ori      $v1, $v1, (0x1A791D9E & 0xFFFF)
.LE00683E0:
/* 36ACB0 E00683E0 4620110D */  trunc.w.d $f4, $f2
/* 36ACB4 E00683E4 44092000 */  mfc1      $t1, $f4
/* 36ACB8 E00683E8 34631D9E */  ori       $v1, $v1, (0x1A791D9E & 0xFFFF)
.LE00683EC:
/* 36ACBC E00683EC 3C0AE300 */  lui       $t2, (0xE3001801 >> 16)
/* 36ACC0 E00683F0 354A1801 */  ori       $t2, $t2, (0xE3001801 & 0xFFFF)
/* 36ACC4 E00683F4 3C0BE300 */  lui       $t3, (0xE3001A01 >> 16)
/* 36ACC8 E00683F8 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* 36ACCC E00683FC 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* 36ACD0 E0068400 356B1A01 */  ori       $t3, $t3, (0xE3001A01 & 0xFFFF)
/* 36ACD4 E0068404 3C06FB00 */  lui       $a2, (0xFB000000 >> 16)
/* 36ACD8 E0068408 240D0040 */  addiu     $t5, $zero, 0x40
/* 36ACDC E006840C 8D070000 */  lw        $a3, 0x0($t0)
/* 36ACE0 E0068410 3C0CDE00 */  lui       $t4, (0xDE000000 >> 16)
/* 36ACE4 E0068414 00E0102D */  daddu     $v0, $a3, $zero
/* 36ACE8 E0068418 24E70008 */  addiu     $a3, $a3, 0x8
/* 36ACEC E006841C AD070000 */  sw        $a3, 0x0($t0)
/* 36ACF0 E0068420 AC460000 */  sw        $a2, 0x0($v0)
/* 36ACF4 E0068424 AC430004 */  sw        $v1, 0x4($v0)
/* 36ACF8 E0068428 24E20008 */  addiu     $v0, $a3, 0x8
/* 36ACFC E006842C AD020000 */  sw        $v0, 0x0($t0)
/* 36AD00 E0068430 24E20010 */  addiu     $v0, $a3, 0x10
/* 36AD04 E0068434 ACEA0000 */  sw        $t2, 0x0($a3)
/* 36AD08 E0068438 ACED0004 */  sw        $t5, 0x4($a3)
/* 36AD0C E006843C AD020000 */  sw        $v0, 0x0($t0)
/* 36AD10 E0068440 24E20018 */  addiu     $v0, $a3, 0x18
/* 36AD14 E0068444 ACEB0008 */  sw        $t3, 0x8($a3)
/* 36AD18 E0068448 ACE0000C */  sw        $zero, 0xC($a3)
/* 36AD1C E006844C AD020000 */  sw        $v0, 0x0($t0)
/* 36AD20 E0068450 24E20020 */  addiu     $v0, $a3, 0x20
/* 36AD24 E0068454 ACEC0010 */  sw        $t4, 0x10($a3)
/* 36AD28 E0068458 ACF70014 */  sw        $s7, 0x14($a3)
/* 36AD2C E006845C AD020000 */  sw        $v0, 0x0($t0)
/* 36AD30 E0068460 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 36AD34 E0068464 ACE20018 */  sw        $v0, 0x18($a3)
/* 36AD38 E0068468 92820024 */  lbu       $v0, 0x24($s4)
/* 36AD3C E006846C 92840025 */  lbu       $a0, 0x25($s4)
/* 36AD40 E0068470 92850026 */  lbu       $a1, 0x26($s4)
/* 36AD44 E0068474 24E30028 */  addiu     $v1, $a3, 0x28
/* 36AD48 E0068478 AD030000 */  sw        $v1, 0x0($t0)
/* 36AD4C E006847C 312300FF */  andi      $v1, $t1, 0xFF
/* 36AD50 E0068480 ACE60020 */  sw        $a2, 0x20($a3)
/* 36AD54 E0068484 00021600 */  sll       $v0, $v0, 24
/* 36AD58 E0068488 00042400 */  sll       $a0, $a0, 16
/* 36AD5C E006848C 00441025 */  or        $v0, $v0, $a0
/* 36AD60 E0068490 00052A00 */  sll       $a1, $a1, 8
/* 36AD64 E0068494 00451025 */  or        $v0, $v0, $a1
/* 36AD68 E0068498 00431025 */  or        $v0, $v0, $v1
/* 36AD6C E006849C ACE2001C */  sw        $v0, 0x1C($a3)
/* 36AD70 E00684A0 92820027 */  lbu       $v0, 0x27($s4)
/* 36AD74 E00684A4 92840028 */  lbu       $a0, 0x28($s4)
/* 36AD78 E00684A8 92830029 */  lbu       $v1, 0x29($s4)
/* 36AD7C E00684AC 00021600 */  sll       $v0, $v0, 24
/* 36AD80 E00684B0 00042400 */  sll       $a0, $a0, 16
/* 36AD84 E00684B4 00441025 */  or        $v0, $v0, $a0
/* 36AD88 E00684B8 00031A00 */  sll       $v1, $v1, 8
/* 36AD8C E00684BC 00431025 */  or        $v0, $v0, $v1
/* 36AD90 E00684C0 ACE20024 */  sw        $v0, 0x24($a3)
/* 36AD94 E00684C4 3C020900 */  lui       $v0, %hi(D_09001E40_40F0D0)
/* 36AD98 E00684C8 24421E40 */  addiu     $v0, $v0, %lo(D_09001E40_40F0D0)
/* 36AD9C E00684CC 16A20010 */  bne       $s5, $v0, .LE0068510
/* 36ADA0 E00684D0 3C03D838 */   lui      $v1, (0xD8380002 >> 16)
/* 36ADA4 E00684D4 00161842 */  srl       $v1, $s6, 1
/* 36ADA8 E00684D8 3C029249 */  lui       $v0, (0x92492493 >> 16)
/* 36ADAC E00684DC 34422493 */  ori       $v0, $v0, (0x92492493 & 0xFFFF)
/* 36ADB0 E00684E0 00620019 */  multu     $v1, $v0
/* 36ADB4 E00684E4 00007010 */  mfhi      $t6
/* 36ADB8 E00684E8 000E1882 */  srl       $v1, $t6, 2
/* 36ADBC E00684EC 000310C0 */  sll       $v0, $v1, 3
/* 36ADC0 E00684F0 00431023 */  subu      $v0, $v0, $v1
/* 36ADC4 E00684F4 00021040 */  sll       $v0, $v0, 1
/* 36ADC8 E00684F8 02C21023 */  subu      $v0, $s6, $v0
/* 36ADCC E00684FC 00021080 */  sll       $v0, $v0, 2
/* 36ADD0 E0068500 3C15E007 */  lui       $s5, (0xE0070000 >> 16)
/* 36ADD4 E0068504 02A2A821 */  addu      $s5, $s5, $v0
/* 36ADD8 E0068508 8EB585BC */  lw        $s5, -0x7A44($s5)
/* 36ADDC E006850C 3C03D838 */  lui       $v1, (0xD8380002 >> 16)
.LE0068510:
/* 36ADE0 E0068510 34630002 */  ori       $v1, $v1, (0xD8380002 & 0xFFFF)
/* 36ADE4 E0068514 24E20030 */  addiu     $v0, $a3, 0x30
/* 36ADE8 E0068518 AD020000 */  sw        $v0, 0x0($t0)
/* 36ADEC E006851C 24E20038 */  addiu     $v0, $a3, 0x38
/* 36ADF0 E0068520 ACEC0028 */  sw        $t4, 0x28($a3)
/* 36ADF4 E0068524 ACF5002C */  sw        $s5, 0x2C($a3)
/* 36ADF8 E0068528 AD020000 */  sw        $v0, 0x0($t0)
/* 36ADFC E006852C 24E20040 */  addiu     $v0, $a3, 0x40
/* 36AE00 E0068530 ACE30030 */  sw        $v1, 0x30($a3)
/* 36AE04 E0068534 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* 36AE08 E0068538 ACED0034 */  sw        $t5, 0x34($a3)
/* 36AE0C E006853C AD020000 */  sw        $v0, 0x0($t0)
/* 36AE10 E0068540 24E20048 */  addiu     $v0, $a3, 0x48
/* 36AE14 E0068544 ACE30038 */  sw        $v1, 0x38($a3)
/* 36AE18 E0068548 ACE0003C */  sw        $zero, 0x3C($a3)
/* 36AE1C E006854C AD020000 */  sw        $v0, 0x0($t0)
/* 36AE20 E0068550 240200C0 */  addiu     $v0, $zero, 0xC0
/* 36AE24 E0068554 ACE20044 */  sw        $v0, 0x44($a3)
/* 36AE28 E0068558 24E20050 */  addiu     $v0, $a3, 0x50
/* 36AE2C E006855C ACEA0040 */  sw        $t2, 0x40($a3)
/* 36AE30 E0068560 AD020000 */  sw        $v0, 0x0($t0)
/* 36AE34 E0068564 24020030 */  addiu     $v0, $zero, 0x30
/* 36AE38 E0068568 ACE2004C */  sw        $v0, 0x4C($a3)
/* 36AE3C E006856C 24E20058 */  addiu     $v0, $a3, 0x58
/* 36AE40 E0068570 ACEB0048 */  sw        $t3, 0x48($a3)
/* 36AE44 E0068574 AD020000 */  sw        $v0, 0x0($t0)
/* 36AE48 E0068578 ACE30050 */  sw        $v1, 0x50($a3)
/* 36AE4C E006857C ACE00054 */  sw        $zero, 0x54($a3)
/* 36AE50 E0068580 8FBF0080 */  lw        $ra, 0x80($sp)
/* 36AE54 E0068584 8FB7007C */  lw        $s7, 0x7C($sp)
/* 36AE58 E0068588 8FB60078 */  lw        $s6, 0x78($sp)
/* 36AE5C E006858C 8FB50074 */  lw        $s5, 0x74($sp)
/* 36AE60 E0068590 8FB40070 */  lw        $s4, 0x70($sp)
/* 36AE64 E0068594 8FB3006C */  lw        $s3, 0x6C($sp)
/* 36AE68 E0068598 8FB20068 */  lw        $s2, 0x68($sp)
/* 36AE6C E006859C 8FB10064 */  lw        $s1, 0x64($sp)
/* 36AE70 E00685A0 8FB00060 */  lw        $s0, 0x60($sp)
/* 36AE74 E00685A4 03E00008 */  jr        $ra
/* 36AE78 E00685A8 27BD0088 */   addiu    $sp, $sp, 0x88
/* 36AE7C E00685AC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void ending_decals_appendGfx(void* effect) {
    EndingDecalsFXData* data = ((EffectInstance*)effect)->data.endingDecals;
    Gfx* dlist1;
    Gfx* dlist2;
    u32 unk_20;
    s32 alpha;
    f64 temp_f64;
    Matrix4f sp20;

    unk_20 = data->unk_20;
    dlist1 = D_E00685F4[data->type];
    dlist2 = D_E00685B0[data->type];

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

    shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z);
    shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

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

    temp_f64 = data->haloAlpha;
    if (unk_20 % 2 == 0) {
        alpha = temp_f64 * 0.97;
    } else {
        alpha = temp_f64;
    }

    gDPSetEnvColor(gMainGfxPos++, 26, 121, 29, 158);
    gDPSetColorDither(gMainGfxPos++, G_CD_BAYER);
    gDPSetAlphaDither(gMainGfxPos++, G_AD_PATTERN);
    gSPDisplayList(gMainGfxPos++, dlist1);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_24, data->unk_25, data->unk_26, alpha);
    gDPSetEnvColor(gMainGfxPos++, data->unk_27, data->unk_28, data->unk_29, 0);

    if (dlist2 == D_09001E40_36CD20) {
        dlist2 = D_E00685BC[unk_20 % 14];
    }

    gSPDisplayList(gMainGfxPos++, dlist2);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    gDPPipeSync(gMainGfxPos++);
    gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
    gDPSetAlphaDither(gMainGfxPos++, G_AD_DISABLE);
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel remove_player_buffs
/* 195D34 80267454 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 195D38 80267458 AFB30024 */  sw        $s3, 0x24($sp)
/* 195D3C 8026745C 0080982D */  daddu     $s3, $a0, $zero
/* 195D40 80267460 AFB20020 */  sw        $s2, 0x20($sp)
/* 195D44 80267464 3C12800E */  lui       $s2, %hi(gBattleStatus)
/* 195D48 80267468 2652C070 */  addiu     $s2, $s2, %lo(gBattleStatus)
/* 195D4C 8026746C 32620001 */  andi      $v0, $s3, 0x1
/* 195D50 80267470 AFBF002C */  sw        $ra, 0x2C($sp)
/* 195D54 80267474 AFB40028 */  sw        $s4, 0x28($sp)
/* 195D58 80267478 AFB1001C */  sw        $s1, 0x1C($sp)
/* 195D5C 8026747C AFB00018 */  sw        $s0, 0x18($sp)
/* 195D60 80267480 F7B80040 */  sdc1      $f24, 0x40($sp)
/* 195D64 80267484 F7B60038 */  sdc1      $f22, 0x38($sp)
/* 195D68 80267488 F7B40030 */  sdc1      $f20, 0x30($sp)
/* 195D6C 8026748C 8E5100D8 */  lw        $s1, 0xD8($s2)
/* 195D70 80267490 8E5400DC */  lw        $s4, 0xDC($s2)
/* 195D74 80267494 8E3001F4 */  lw        $s0, 0x1F4($s1)
/* 195D78 80267498 10400006 */  beqz      $v0, .L802674B4
/* 195D7C 8026749C 3C03DFFF */   lui      $v1, (0xDFFFFFFF >> 16)
/* 195D80 802674A0 8E420000 */  lw        $v0, 0x0($s2)
/* 195D84 802674A4 3463FFFF */  ori       $v1, $v1, (0xDFFFFFFF & 0xFFFF)
/* 195D88 802674A8 A2400097 */  sb        $zero, 0x97($s2)
/* 195D8C 802674AC 00431024 */  and       $v0, $v0, $v1
/* 195D90 802674B0 AE420000 */  sw        $v0, 0x0($s2)
.L802674B4:
/* 195D94 802674B4 32620002 */  andi      $v0, $s3, 0x2
/* 195D98 802674B8 10400006 */  beqz      $v0, .L802674D4
/* 195D9C 802674BC 3C03EFFF */   lui      $v1, (0xEFFFFFFF >> 16)
/* 195DA0 802674C0 8E420000 */  lw        $v0, 0x0($s2)
/* 195DA4 802674C4 3463FFFF */  ori       $v1, $v1, (0xEFFFFFFF & 0xFFFF)
/* 195DA8 802674C8 A2400096 */  sb        $zero, 0x96($s2)
/* 195DAC 802674CC 00431024 */  and       $v0, $v0, $v1
/* 195DB0 802674D0 AE420000 */  sw        $v0, 0x0($s2)
.L802674D4:
/* 195DB4 802674D4 32620008 */  andi      $v0, $s3, 0x8
/* 195DB8 802674D8 10400003 */  beqz      $v0, .L802674E8
/* 195DBC 802674DC 32620010 */   andi     $v0, $s3, 0x10
/* 195DC0 802674E0 A2200215 */  sb        $zero, 0x215($s1)
/* 195DC4 802674E4 A2200214 */  sb        $zero, 0x214($s1)
.L802674E8:
/* 195DC8 802674E8 10400006 */  beqz      $v0, .L80267504
/* 195DCC 802674EC 3C03FBFF */   lui      $v1, (0xFBFFFFFF >> 16)
/* 195DD0 802674F0 8E420000 */  lw        $v0, 0x0($s2)
/* 195DD4 802674F4 3463FFFF */  ori       $v1, $v1, (0xFBFFFFFF & 0xFFFF)
/* 195DD8 802674F8 A240008B */  sb        $zero, 0x8B($s2)
/* 195DDC 802674FC 00431024 */  and       $v0, $v0, $v1
/* 195DE0 80267500 AE420000 */  sw        $v0, 0x0($s2)
.L80267504:
/* 195DE4 80267504 32620020 */  andi      $v0, $s3, 0x20
/* 195DE8 80267508 10400009 */  beqz      $v0, .L80267530
/* 195DEC 8026750C 32620040 */   andi     $v0, $s3, 0x40
/* 195DF0 80267510 82220212 */  lb        $v0, 0x212($s1)
/* 195DF4 80267514 10400006 */  beqz      $v0, .L80267530
/* 195DF8 80267518 32620040 */   andi     $v0, $s3, 0x40
/* 195DFC 8026751C 86240436 */  lh        $a0, 0x436($s1)
/* 195E00 80267520 A2200213 */  sb        $zero, 0x213($s1)
/* 195E04 80267524 0C011E68 */  jal       remove_status_static
/* 195E08 80267528 A2200212 */   sb       $zero, 0x212($s1)
/* 195E0C 8026752C 32620040 */  andi      $v0, $s3, 0x40
.L80267530:
/* 195E10 80267530 1040000C */  beqz      $v0, .L80267564
/* 195E14 80267534 32620200 */   andi     $v0, $s3, 0x200
/* 195E18 80267538 82220218 */  lb        $v0, 0x218($s1)
/* 195E1C 8026753C 10400008 */  beqz      $v0, .L80267560
/* 195E20 80267540 2403FEFF */   addiu    $v1, $zero, -0x101
/* 195E24 80267544 A2200219 */  sb        $zero, 0x219($s1)
/* 195E28 80267548 A2200218 */  sb        $zero, 0x218($s1)
/* 195E2C 8026754C 8E020000 */  lw        $v0, 0x0($s0)
/* 195E30 80267550 00431024 */  and       $v0, $v0, $v1
/* 195E34 80267554 AE020000 */  sw        $v0, 0x0($s0)
/* 195E38 80267558 0C011EAA */  jal       remove_status_transparent
/* 195E3C 8026755C 86240436 */   lh       $a0, 0x436($s1)
.L80267560:
/* 195E40 80267560 32620200 */  andi      $v0, $s3, 0x200
.L80267564:
/* 195E44 80267564 10400058 */  beqz      $v0, .L802676C8
/* 195E48 80267568 32620100 */   andi     $v0, $s3, 0x100
/* 195E4C 8026756C 8242009D */  lb        $v0, 0x9D($s2)
/* 195E50 80267570 10400055 */  beqz      $v0, .L802676C8
/* 195E54 80267574 32620100 */   andi     $v0, $s3, 0x100
/* 195E58 80267578 8E42043C */  lw        $v0, 0x43C($s2)
/* 195E5C 8026757C 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* 195E60 80267580 44811000 */  mtc1      $at, $f2
/* 195E64 80267584 A240009D */  sb        $zero, 0x9D($s2)
/* 195E68 80267588 8C42000C */  lw        $v0, 0xC($v0)
/* 195E6C 8026758C A4400010 */  sh        $zero, 0x10($v0)
/* 195E70 80267590 8E4300A0 */  lw        $v1, 0xA0($s2)
/* 195E74 80267594 3C014190 */  lui       $at, (0x41900000 >> 16)
/* 195E78 80267598 44810000 */  mtc1      $at, $f0
/* 195E7C 8026759C 8C620000 */  lw        $v0, 0x0($v1)
/* 195E80 802675A0 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 195E84 802675A4 4481A000 */  mtc1      $at, $f20
/* 195E88 802675A8 34420010 */  ori       $v0, $v0, 0x10
/* 195E8C 802675AC AC620000 */  sw        $v0, 0x0($v1)
/* 195E90 802675B0 2402000A */  addiu     $v0, $zero, 0xA
/* 195E94 802675B4 C6240148 */  lwc1      $f4, 0x148($s1)
/* 195E98 802675B8 C626014C */  lwc1      $f6, 0x14C($s1)
/* 195E9C 802675BC 46002100 */  add.s     $f4, $f4, $f0
/* 195EA0 802675C0 E7A20010 */  swc1      $f2, 0x10($sp)
/* 195EA4 802675C4 AFA20014 */  sw        $v0, 0x14($sp)
/* 195EA8 802675C8 46143180 */  add.s     $f6, $f6, $f20
/* 195EAC 802675CC 8E250144 */  lw        $a1, 0x144($s1)
/* 195EB0 802675D0 44062000 */  mfc1      $a2, $f4
/* 195EB4 802675D4 44073000 */  mfc1      $a3, $f6
/* 195EB8 802675D8 0C01C694 */  jal       fx_water_block
/* 195EBC 802675DC 24040001 */   addiu    $a0, $zero, 0x1
/* 195EC0 802675E0 C6220144 */  lwc1      $f2, 0x144($s1)
/* 195EC4 802675E4 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 195EC8 802675E8 44810000 */  mtc1      $at, $f0
/* 195ECC 802675EC 00000000 */  nop
/* 195ED0 802675F0 46001081 */  sub.s     $f2, $f2, $f0
/* 195ED4 802675F4 C6200148 */  lwc1      $f0, 0x148($s1)
/* 195ED8 802675F8 46140000 */  add.s     $f0, $f0, $f20
/* 195EDC 802675FC 44060000 */  mfc1      $a2, $f0
/* 195EE0 80267600 C620014C */  lwc1      $f0, 0x14C($s1)
/* 195EE4 80267604 0000202D */  daddu     $a0, $zero, $zero
/* 195EE8 80267608 46140000 */  add.s     $f0, $f0, $f20
/* 195EEC 8026760C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 195EF0 80267610 4481B000 */  mtc1      $at, $f22
/* 195EF4 80267614 44051000 */  mfc1      $a1, $f2
/* 195EF8 80267618 44070000 */  mfc1      $a3, $f0
/* 195EFC 8026761C 24100018 */  addiu     $s0, $zero, 0x18
/* 195F00 80267620 E7B60010 */  swc1      $f22, 0x10($sp)
/* 195F04 80267624 0C01C70C */  jal       fx_water_splash
/* 195F08 80267628 AFB00014 */   sw       $s0, 0x14($sp)
/* 195F0C 8026762C C6200144 */  lwc1      $f0, 0x144($s1)
/* 195F10 80267630 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 195F14 80267634 4481C000 */  mtc1      $at, $f24
/* 195F18 80267638 00000000 */  nop
/* 195F1C 8026763C 46180001 */  sub.s     $f0, $f0, $f24
/* 195F20 80267640 C6220148 */  lwc1      $f2, 0x148($s1)
/* 195F24 80267644 44050000 */  mfc1      $a1, $f0
/* 195F28 80267648 3C014200 */  lui       $at, (0x42000000 >> 16)
/* 195F2C 8026764C 44810000 */  mtc1      $at, $f0
/* 195F30 80267650 00000000 */  nop
/* 195F34 80267654 46001080 */  add.s     $f2, $f2, $f0
/* 195F38 80267658 C620014C */  lwc1      $f0, 0x14C($s1)
/* 195F3C 8026765C 46140000 */  add.s     $f0, $f0, $f20
/* 195F40 80267660 44061000 */  mfc1      $a2, $f2
/* 195F44 80267664 44070000 */  mfc1      $a3, $f0
/* 195F48 80267668 0000202D */  daddu     $a0, $zero, $zero
/* 195F4C 8026766C E7B60010 */  swc1      $f22, 0x10($sp)
/* 195F50 80267670 0C01C70C */  jal       fx_water_splash
/* 195F54 80267674 AFB00014 */   sw       $s0, 0x14($sp)
/* 195F58 80267678 C6200144 */  lwc1      $f0, 0x144($s1)
/* 195F5C 8026767C 46180000 */  add.s     $f0, $f0, $f24
/* 195F60 80267680 C6220148 */  lwc1      $f2, 0x148($s1)
/* 195F64 80267684 44050000 */  mfc1      $a1, $f0
/* 195F68 80267688 3C0141B0 */  lui       $at, (0x41B00000 >> 16)
/* 195F6C 8026768C 44810000 */  mtc1      $at, $f0
/* 195F70 80267690 00000000 */  nop
/* 195F74 80267694 46001080 */  add.s     $f2, $f2, $f0
/* 195F78 80267698 C620014C */  lwc1      $f0, 0x14C($s1)
/* 195F7C 8026769C 46140000 */  add.s     $f0, $f0, $f20
/* 195F80 802676A0 44061000 */  mfc1      $a2, $f2
/* 195F84 802676A4 44070000 */  mfc1      $a3, $f0
/* 195F88 802676A8 24040001 */  addiu     $a0, $zero, 0x1
/* 195F8C 802676AC E7B60010 */  swc1      $f22, 0x10($sp)
/* 195F90 802676B0 0C01C70C */  jal       fx_water_splash
/* 195F94 802676B4 AFB00014 */   sw       $s0, 0x14($sp)
/* 195F98 802676B8 24040299 */  addiu     $a0, $zero, 0x299
/* 195F9C 802676BC 0C05272D */  jal       sfx_play_sound
/* 195FA0 802676C0 AE4000A0 */   sw       $zero, 0xA0($s2)
/* 195FA4 802676C4 32620100 */  andi      $v0, $s3, 0x100
.L802676C8:
/* 195FA8 802676C8 10400009 */  beqz      $v0, .L802676F0
/* 195FAC 802676CC 32620080 */   andi     $v0, $s3, 0x80
/* 195FB0 802676D0 8242009B */  lb        $v0, 0x9B($s2)
/* 195FB4 802676D4 10400006 */  beqz      $v0, .L802676F0
/* 195FB8 802676D8 32620080 */   andi     $v0, $s3, 0x80
/* 195FBC 802676DC 8E42043C */  lw        $v0, 0x43C($s2)
/* 195FC0 802676E0 A240009B */  sb        $zero, 0x9B($s2)
/* 195FC4 802676E4 8C42000C */  lw        $v0, 0xC($v0)
/* 195FC8 802676E8 A4400024 */  sh        $zero, 0x24($v0)
/* 195FCC 802676EC 32620080 */  andi      $v0, $s3, 0x80
.L802676F0:
/* 195FD0 802676F0 1040000B */  beqz      $v0, .L80267720
/* 195FD4 802676F4 00000000 */   nop
/* 195FD8 802676F8 824200A4 */  lb        $v0, 0xA4($s2)
/* 195FDC 802676FC 10400008 */  beqz      $v0, .L80267720
/* 195FE0 80267700 00000000 */   nop
/* 195FE4 80267704 8E42043C */  lw        $v0, 0x43C($s2)
/* 195FE8 80267708 A24000A4 */  sb        $zero, 0xA4($s2)
/* 195FEC 8026770C 8C42000C */  lw        $v0, 0xC($v0)
/* 195FF0 80267710 A440001A */  sh        $zero, 0x1A($v0)
/* 195FF4 80267714 0C016914 */  jal       remove_effect
/* 195FF8 80267718 8E4400A8 */   lw       $a0, 0xA8($s2)
/* 195FFC 8026771C AE4000A8 */  sw        $zero, 0xA8($s2)
.L80267720:
/* 196000 80267720 1280000B */  beqz      $s4, .L80267750
/* 196004 80267724 3C020001 */   lui      $v0, (0x10000 >> 16)
/* 196008 80267728 02621024 */  and       $v0, $s3, $v0
/* 19600C 8026772C 10400008 */  beqz      $v0, .L80267750
/* 196010 80267730 3C04BFFF */   lui      $a0, (0xBFFFFFFF >> 16)
/* 196014 80267734 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 196018 80267738 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 19601C 8026773C A2800220 */  sb        $zero, 0x220($s4)
/* 196020 80267740 8C620000 */  lw        $v0, 0x0($v1)
/* 196024 80267744 3484FFFF */  ori       $a0, $a0, (0xBFFFFFFF & 0xFFFF)
/* 196028 80267748 00441024 */  and       $v0, $v0, $a0
/* 19602C 8026774C AC620000 */  sw        $v0, 0x0($v1)
.L80267750:
/* 196030 80267750 8FBF002C */  lw        $ra, 0x2C($sp)
/* 196034 80267754 8FB40028 */  lw        $s4, 0x28($sp)
/* 196038 80267758 8FB30024 */  lw        $s3, 0x24($sp)
/* 19603C 8026775C 8FB20020 */  lw        $s2, 0x20($sp)
/* 196040 80267760 8FB1001C */  lw        $s1, 0x1C($sp)
/* 196044 80267764 8FB00018 */  lw        $s0, 0x18($sp)
/* 196048 80267768 D7B80040 */  ldc1      $f24, 0x40($sp)
/* 19604C 8026776C D7B60038 */  ldc1      $f22, 0x38($sp)
/* 196050 80267770 D7B40030 */  ldc1      $f20, 0x30($sp)
/* 196054 80267774 03E00008 */  jr        $ra
/* 196058 80267778 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void remove_player_buffs(s32 buffs) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* player = battleStatus->playerActor;
    Actor* partner = battleStatus->partnerActor;
    ActorPart* playerActorParts = player->partsTable;

    if (buffs & PLAYER_BUFF_JUMP_CHARGE) {
        battleStatus->jumpCharge = 0;
        battleStatus->flags1 &= ~BS_FLAGS1_JUMP_CHARGED;
    }
    if (buffs & PLAYER_BUFF_HAMMER_CHARGE) {
        battleStatus->hammerCharge = 0;
        battleStatus->flags1 &= ~BS_FLAGS1_HAMMER_CHARGED;
    }
    if (buffs & PLAYER_BUFF_STONE) {
        player->stoneDuration = 0;
        player->stoneStatus = 0;
    }
    if (buffs & PLAYER_BUFF_HUSTLE) {
        battleStatus->hustleTurns = 0;
        battleStatus->flags1 &= ~BS_FLAGS1_HUSTLED;
    }
    if (buffs & PLAYER_BUFF_STATIC && (player->staticStatus != 0)) {
        player->staticDuration = 0;
        player->staticStatus = 0;
        remove_status_static(player->hudElementDataIndex);
    }
    if (buffs & PLAYER_BUFF_TRANSPARENT && (player->transparentStatus != 0)) {
        player->transparentDuration = 0;
        player->transparentStatus = 0;
        playerActorParts->flags &= ~ACTOR_PART_FLAG_100;
        remove_status_transparent(player->hudElementDataIndex);
    }
    if (buffs & PLAYER_BUFF_WATER_BLOCK && (battleStatus->waterBlockTurnsLeft != 0)) {
        battleStatus->waterBlockTurnsLeft = 0;
        battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_WATER_BLOCK].turnsLeft = 0;
        battleStatus->waterBlockEffect->flags |= FX_INSTANCE_FLAG_DISMISS;

        fx_water_block(1, player->currentPos.x, player->currentPos.y + 18.0f, player->currentPos.z + 5.0f, 1.5f, 0xA);
        fx_water_splash(0, player->currentPos.x - 10.0f, player->currentPos.y + 5.0f, player->currentPos.z + 5.0f, 1.0f, 0x18);
        fx_water_splash(0, player->currentPos.x - 15.0f, player->currentPos.y + 32.0f, player->currentPos.z + 5.0f, 1.0f, 0x18);
        fx_water_splash(1, player->currentPos.x + 15.0f, player->currentPos.y + 22.0f, player->currentPos.z + 5.0f, 1.0f, 0x18);

        battleStatus->waterBlockEffect = NULL;
        sfx_play_sound(SOUND_299);
    }
    if (buffs & PLAYER_BUFF_TURBO_CHARGE && (battleStatus->turboChargeTurnsLeft != 0)) {
        battleStatus->turboChargeTurnsLeft = 0;
        battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_TURBO_CHARGE].turnsLeft = 0;
    }
    if (buffs & PLAYER_BUFF_CLOUD_NINE && (battleStatus->cloudNineTurnsLeft != 0)) {
        battleStatus->cloudNineTurnsLeft = 0;
        battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_CLOUD_NINE].turnsLeft = 0;
        remove_effect(battleStatus->cloudNineEffect);
        battleStatus->cloudNineEffect = NULL;
    }

    if (partner != NULL && (buffs & PLAYER_BUFF_PARTNER_GLOWING)) {
        partner->isGlowing = FALSE;
        gBattleStatus.flags1 &= ~BS_FLAGS1_GOOMBARIO_CHARGED;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel D_8024CB68_C0A3E8
/* 17B448 8024CB68 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 17B44C 8024CB6C AFB00030 */  sw        $s0, 0x30($sp)
D_8024CB70:
/* 17B450 8024CB70 3C10800B */  lui       $s0, %hi(gCameras + 0x558)
/* 17B454 8024CB74 261022D8 */  addiu     $s0, $s0, %lo(gCameras + 0x558)
/* 17B458 8024CB78 3C02802A */  lui       $v0, %hi(BattleCam_TargetActor)
/* 17B45C 8024CB7C 9442F27C */  lhu       $v0, %lo(BattleCam_TargetActor)($v0)
/* 17B460 8024CB80 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 17B464 8024CB84 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
/* 17B468 8024CB88 AFBF0034 */  sw        $ra, 0x34($sp)
/* 17B46C 8024CB8C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 17B470 8024CB90 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 17B474 8024CB94 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 17B478 8024CB98 30430700 */  andi      $v1, $v0, 0x700
/* 17B47C 8024CB9C 304600FF */  andi      $a2, $v0, 0xFF
/* 17B480 8024CBA0 24020100 */  addiu     $v0, $zero, 0x100
/* 17B484 8024CBA4 10620018 */  beq       $v1, $v0, .L8024CC08
/* 17B488 8024CBA8 28620101 */   slti     $v0, $v1, 0x101
/* 17B48C 8024CBAC 10400019 */  beqz      $v0, .L8024CC14
/* 17B490 8024CBB0 00061080 */   sll      $v0, $a2, 2
/* 17B494 8024CBB4 14600018 */  bnez      $v1, .L8024CC18
/* 17B498 8024CBB8 00821021 */   addu     $v0, $a0, $v0
/* 17B49C 8024CBBC 8C8400D8 */  lw        $a0, 0xD8($a0)
/* 17B4A0 8024CBC0 108000AF */  beqz      $a0, .L8024CE80
/* 17B4A4 8024CBC4 0000102D */   daddu    $v0, $zero, $zero
/* 17B4A8 8024CBC8 3C028011 */  lui       $v0, %hi(gPlayerStatus)
/* 17B4AC 8024CBCC 2442EFC8 */  addiu     $v0, $v0, %lo(gPlayerStatus)
/* 17B4B0 8024CBD0 C4940144 */  lwc1      $f20, 0x144($a0)
/* 17B4B4 8024CBD4 944200B0 */  lhu       $v0, 0xB0($v0)
/* 17B4B8 8024CBD8 C498014C */  lwc1      $f24, 0x14C($a0)
/* 17B4BC 8024CBDC C4820148 */  lwc1      $f2, 0x148($a0)
/* 17B4C0 8024CBE0 00021400 */  sll       $v0, $v0, 16
/* 17B4C4 8024CBE4 00021C03 */  sra       $v1, $v0, 16
/* 17B4C8 8024CBE8 000217C2 */  srl       $v0, $v0, 31
/* 17B4CC 8024CBEC 00621821 */  addu      $v1, $v1, $v0
/* 17B4D0 8024CBF0 00031843 */  sra       $v1, $v1, 1
/* 17B4D4 8024CBF4 44830000 */  mtc1      $v1, $f0
/* 17B4D8 8024CBF8 00000000 */  nop
/* 17B4DC 8024CBFC 46800020 */  cvt.s.w   $f0, $f0
/* 17B4E0 8024CC00 0809330C */  j         .L8024CC30
/* 17B4E4 8024CC04 46001580 */   add.s    $f22, $f2, $f0
.L8024CC08:
/* 17B4E8 8024CC08 8C8200DC */  lw        $v0, 0xDC($a0)
/* 17B4EC 8024CC0C 08093307 */  j         .L8024CC1C
/* 17B4F0 8024CC10 00000000 */   nop
.L8024CC14:
/* 17B4F4 8024CC14 00821021 */  addu      $v0, $a0, $v0
.L8024CC18:
/* 17B4F8 8024CC18 8C4200E0 */  lw        $v0, 0xE0($v0)
.L8024CC1C:
/* 17B4FC 8024CC1C 50400098 */  beql      $v0, $zero, .L8024CE80
/* 17B500 8024CC20 0000102D */   daddu    $v0, $zero, $zero
/* 17B504 8024CC24 C4540144 */  lwc1      $f20, 0x144($v0)
D_8024CC28_C0A4A8:
/* 17B508 8024CC28 C4560148 */  lwc1      $f22, 0x148($v0)
/* 17B50C 8024CC2C C458014C */  lwc1      $f24, 0x14C($v0)
.L8024CC30:
/* 17B510 8024CC30 10A0001D */  beqz      $a1, .L8024CCA8
D_8024CC34:
/* 17B514 8024CC34 27A20020 */   addiu    $v0, $sp, 0x20
/* 17B518 8024CC38 C6000054 */  lwc1      $f0, 0x54($s0)
/* 17B51C 8024CC3C C6020058 */  lwc1      $f2, 0x58($s0)
/* 17B520 8024CC40 C604005C */  lwc1      $f4, 0x5C($s0)
/* 17B524 8024CC44 8602001E */  lh        $v0, 0x1E($s0)
/* 17B528 8024CC48 86030022 */  lh        $v1, 0x22($s0)
/* 17B52C 8024CC4C 3C01802A */  lui       $at, %hi(BattleCam_PosX)
/* 17B530 8024CC50 E420F270 */  swc1      $f0, %lo(BattleCam_PosX)($at)
/* 17B534 8024CC54 44820000 */  mtc1      $v0, $f0
/* 17B538 8024CC58 00000000 */  nop
/* 17B53C 8024CC5C 46800020 */  cvt.s.w   $f0, $f0
D_8024CC60:
/* 17B540 8024CC60 86020024 */  lh        $v0, 0x24($s0)
/* 17B544 8024CC64 3C01802A */  lui       $at, %hi(BattleCam_PosY)
/* 17B548 8024CC68 E422F274 */  swc1      $f2, %lo(BattleCam_PosY)($at)
/* 17B54C 8024CC6C 3C01802A */  lui       $at, %hi(BattleCam_PosZ)
/* 17B550 8024CC70 E424F278 */  swc1      $f4, %lo(BattleCam_PosZ)($at)
/* 17B554 8024CC74 3C01802A */  lui       $at, %hi(D_8029F288)
/* 17B558 8024CC78 E420F288 */  swc1      $f0, %lo(D_8029F288)($at)
/* 17B55C 8024CC7C 44820000 */  mtc1      $v0, $f0
/* 17B560 8024CC80 00000000 */  nop
/* 17B564 8024CC84 46800020 */  cvt.s.w   $f0, $f0
/* 17B568 8024CC88 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomYaw)
/* 17B56C 8024CC8C E420F290 */  swc1      $f0, %lo(BattleCam_InitialBoomYaw)($at)
/* 17B570 8024CC90 44830000 */  mtc1      $v1, $f0
/* 17B574 8024CC94 00000000 */  nop
/* 17B578 8024CC98 46800020 */  cvt.s.w   $f0, $f0
/* 17B57C 8024CC9C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomPitch)
D_8024CCA0_C0A520:
/* 17B580 8024CCA0 E420F294 */  swc1      $f0, %lo(BattleCam_InitialBoomPitch)($at)
/* 17B584 8024CCA4 27A20020 */  addiu     $v0, $sp, 0x20
.L8024CCA8:
/* 17B588 8024CCA8 AFA20010 */  sw        $v0, 0x10($sp)
/* 17B58C 8024CCAC 27A20024 */  addiu     $v0, $sp, 0x24
/* 17B590 8024CCB0 AFA20014 */  sw        $v0, 0x14($sp)
/* 17B594 8024CCB4 27A20028 */  addiu     $v0, $sp, 0x28
/* 17B598 8024CCB8 4405A000 */  mfc1      $a1, $f20
/* 17B59C 8024CCBC 4406B000 */  mfc1      $a2, $f22
/* 17B5A0 8024CCC0 4407C000 */  mfc1      $a3, $f24
D_8024CCC4:
/* 17B5A4 8024CCC4 24040001 */  addiu     $a0, $zero, 0x1
/* 17B5A8 8024CCC8 0C00B94E */  jal       get_screen_coords
/* 17B5AC 8024CCCC AFA20018 */   sw       $v0, 0x18($sp)
/* 17B5B0 8024CCD0 8FA20024 */  lw        $v0, 0x24($sp)
/* 17B5B4 8024CCD4 28420064 */  slti      $v0, $v0, 0x64
D_8024CCD8:
/* 17B5B8 8024CCD8 10400005 */  beqz      $v0, .L8024CCF0
/* 17B5BC 8024CCDC 00000000 */   nop
/* 17B5C0 8024CCE0 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 17B5C4 8024CCE4 44810000 */  mtc1      $at, $f0
/* 17B5C8 8024CCE8 00000000 */  nop
/* 17B5CC 8024CCEC 4600B580 */  add.s     $f22, $f22, $f0
.L8024CCF0:
/* 17B5D0 8024CCF0 3C01802A */  lui       $at, %hi(BattleCam_PosY)
/* 17B5D4 8024CCF4 C420F274 */  lwc1      $f0, %lo(BattleCam_PosY)($at)
/* 17B5D8 8024CCF8 4600B03C */  c.lt.s    $f22, $f0
/* 17B5DC 8024CCFC 00000000 */  nop
/* 17B5E0 8024CD00 45030001 */  bc1tl     .L8024CD08
/* 17B5E4 8024CD04 46000586 */   mov.s    $f22, $f0
.L8024CD08:
/* 17B5E8 8024CD08 8FA30020 */  lw        $v1, 0x20($sp)
/* 17B5EC 8024CD0C 28620064 */  slti      $v0, $v1, 0x64
D_8024CD10_C0A590:
/* 17B5F0 8024CD10 10400005 */  beqz      $v0, .L8024CD28
/* 17B5F4 8024CD14 00000000 */   nop
/* 17B5F8 8024CD18 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 17B5FC 8024CD1C 44810000 */  mtc1      $at, $f0
/* 17B600 8024CD20 00000000 */  nop
/* 17B604 8024CD24 4600A501 */  sub.s     $f20, $f20, $f0
.L8024CD28:
/* 17B608 8024CD28 3C01802A */  lui       $at, %hi(BattleCam_PosX)
/* 17B60C 8024CD2C C420F270 */  lwc1      $f0, %lo(BattleCam_PosX)($at)
/* 17B610 8024CD30 4600A03C */  c.lt.s    $f20, $f0
/* 17B614 8024CD34 00000000 */  nop
/* 17B618 8024CD38 45030001 */  bc1tl     .L8024CD40
/* 17B61C 8024CD3C 46000506 */   mov.s    $f20, $f0
.L8024CD40:
/* 17B620 8024CD40 286200DD */  slti      $v0, $v1, 0xDD
/* 17B624 8024CD44 14400005 */  bnez      $v0, .L8024CD5C
/* 17B628 8024CD48 00000000 */   nop
/* 17B62C 8024CD4C 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 17B630 8024CD50 44810000 */  mtc1      $at, $f0
/* 17B634 8024CD54 00000000 */  nop
/* 17B638 8024CD58 4600A500 */  add.s     $f20, $f20, $f0
.L8024CD5C:
/* 17B63C 8024CD5C C6060054 */  lwc1      $f6, 0x54($s0)
/* 17B640 8024CD60 4606A101 */  sub.s     $f4, $f20, $f6
/* 17B644 8024CD64 3C01802A */  lui       $at, %hi(D_8029CC30)
/* 17B648 8024CD68 D422CC30 */  ldc1      $f2, %lo(D_8029CC30)($at)
/* 17B64C 8024CD6C 46002005 */  abs.s     $f0, $f4
/* 17B650 8024CD70 46000021 */  cvt.d.s   $f0, $f0
/* 17B654 8024CD74 4622003C */  c.lt.d    $f0, $f2
/* 17B658 8024CD78 00000000 */  nop
/* 17B65C 8024CD7C 45000009 */  bc1f      .L8024CDA4
/* 17B660 8024CD80 00000000 */   nop
/* 17B664 8024CD84 44800000 */  mtc1      $zero, $f0
/* 17B668 8024CD88 00000000 */  nop
/* 17B66C 8024CD8C 46002032 */  c.eq.s    $f4, $f0
.L8024CD90:
/* 17B670 8024CD90 00000000 */  nop
/* 17B674 8024CD94 45020009 */  bc1fl     .L8024CDBC
D_8024CD98_C0A618:
/* 17B678 8024CD98 E6140054 */   swc1     $f20, 0x54($s0)
/* 17B67C 8024CD9C 0809336F */  j         .L8024CDBC
D_8024CDA0:
/* 17B680 8024CDA0 00000000 */   nop
.L8024CDA4:
/* 17B684 8024CDA4 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 17B688 8024CDA8 44810000 */  mtc1      $at, $f0
D_8024CDAC:
/* 17B68C 8024CDAC 00000000 */  nop
/* 17B690 8024CDB0 46002003 */  div.s     $f0, $f4, $f0
/* 17B694 8024CDB4 46003000 */  add.s     $f0, $f6, $f0
/* 17B698 8024CDB8 E6000054 */  swc1      $f0, 0x54($s0)
.L8024CDBC:
/* 17B69C 8024CDBC C6060058 */  lwc1      $f6, 0x58($s0)
/* 17B6A0 8024CDC0 4606B101 */  sub.s     $f4, $f22, $f6
/* 17B6A4 8024CDC4 3C01802A */  lui       $at, %hi(D_8029CC38)
/* 17B6A8 8024CDC8 D422CC38 */  ldc1      $f2, %lo(D_8029CC38)($at)
/* 17B6AC 8024CDCC 46002005 */  abs.s     $f0, $f4
/* 17B6B0 8024CDD0 46000021 */  cvt.d.s   $f0, $f0
/* 17B6B4 8024CDD4 4622003C */  c.lt.d    $f0, $f2
/* 17B6B8 8024CDD8 00000000 */  nop
/* 17B6BC 8024CDDC 45000009 */  bc1f      .L8024CE04
/* 17B6C0 8024CDE0 00000000 */   nop
/* 17B6C4 8024CDE4 44800000 */  mtc1      $zero, $f0
/* 17B6C8 8024CDE8 00000000 */  nop
/* 17B6CC 8024CDEC 46002032 */  c.eq.s    $f4, $f0
/* 17B6D0 8024CDF0 00000000 */  nop
/* 17B6D4 8024CDF4 45020009 */  bc1fl     .L8024CE1C
/* 17B6D8 8024CDF8 E6160058 */   swc1     $f22, 0x58($s0)
.L8024CDFC:
/* 17B6DC 8024CDFC 08093387 */  j         .L8024CE1C
/* 17B6E0 8024CE00 00000000 */   nop
.L8024CE04:
/* 17B6E4 8024CE04 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
D_8024CE08_C0A688:
/* 17B6E8 8024CE08 44810000 */  mtc1      $at, $f0
/* 17B6EC 8024CE0C 00000000 */  nop
/* 17B6F0 8024CE10 46002003 */  div.s     $f0, $f4, $f0
/* 17B6F4 8024CE14 46003000 */  add.s     $f0, $f6, $f0
/* 17B6F8 8024CE18 E6000058 */  swc1      $f0, 0x58($s0)
.L8024CE1C:
/* 17B6FC 8024CE1C C606005C */  lwc1      $f6, 0x5C($s0)
/* 17B700 8024CE20 4606C101 */  sub.s     $f4, $f24, $f6
/* 17B704 8024CE24 3C01802A */  lui       $at, %hi(D_8029CC40)
/* 17B708 8024CE28 D422CC40 */  ldc1      $f2, %lo(D_8029CC40)($at)
/* 17B70C 8024CE2C 46002005 */  abs.s     $f0, $f4
/* 17B710 8024CE30 46000021 */  cvt.d.s   $f0, $f0
/* 17B714 8024CE34 4622003C */  c.lt.d    $f0, $f2
/* 17B718 8024CE38 00000000 */  nop
/* 17B71C 8024CE3C 45000009 */  bc1f      .L8024CE64
/* 17B720 8024CE40 00000000 */   nop
/* 17B724 8024CE44 44800000 */  mtc1      $zero, $f0
/* 17B728 8024CE48 00000000 */  nop
/* 17B72C 8024CE4C 46002032 */  c.eq.s    $f4, $f0
/* 17B730 8024CE50 00000000 */  nop
/* 17B734 8024CE54 45020009 */  bc1fl     .L8024CE7C
/* 17B738 8024CE58 E618005C */   swc1     $f24, 0x5C($s0)
/* 17B73C 8024CE5C 080933A0 */  j         .L8024CE80
/* 17B740 8024CE60 0000102D */   daddu    $v0, $zero, $zero
.L8024CE64:
/* 17B744 8024CE64 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 17B748 8024CE68 44810000 */  mtc1      $at, $f0
/* 17B74C 8024CE6C 00000000 */  nop
/* 17B750 8024CE70 46002003 */  div.s     $f0, $f4, $f0
/* 17B754 8024CE74 46003000 */  add.s     $f0, $f6, $f0
/* 17B758 8024CE78 E600005C */  swc1      $f0, 0x5C($s0)
.L8024CE7C:
/* 17B75C 8024CE7C 0000102D */  daddu     $v0, $zero, $zero
.L8024CE80:
/* 17B760 8024CE80 8FBF0034 */  lw        $ra, 0x34($sp)
/* 17B764 8024CE84 8FB00030 */  lw        $s0, 0x30($sp)
/* 17B768 8024CE88 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 17B76C 8024CE8C D7B60040 */  ldc1      $f22, 0x40($sp)
/* 17B770 8024CE90 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 17B774 8024CE94 03E00008 */  jr        $ra
/* 17B778 8024CE98 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

ApiStatus CamPresetUpdate_L(Evt* script, s32 isInitialCall) {
    Camera* camera = &gCameras[CAM_BATTLE];
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerStatus* playerStatus = &gPlayerStatus;
    s32 actorClass = BattleCam_TargetActor & ACTOR_CLASS_MASK;
    s32 actorID = BattleCam_TargetActor & 0xFF;
    f32 x, y, z;
    s32 screenX, screenY, screenZ;
    f32 delta;

    switch (actorClass) {
        case ACTOR_CLASS_PLAYER:
            if (battleStatus->playerActor == NULL) {
                return ApiStatus_BLOCK;
            }
            x = battleStatus->playerActor->currentPos.x;
            y = battleStatus->playerActor->currentPos.y + (playerStatus->colliderHeight / 2);
            z = battleStatus->playerActor->currentPos.z;
            break;
        case ACTOR_CLASS_PARTNER:
            if (battleStatus->partnerActor == NULL) {
                return ApiStatus_BLOCK;
            }
            x = battleStatus->partnerActor->currentPos.x;
            y = battleStatus->partnerActor->currentPos.y;
            z = battleStatus->partnerActor->currentPos.z;
            break;
        case ACTOR_CLASS_ENEMY:
        default:
            if (battleStatus->enemyActors[actorID] == NULL) {
                return ApiStatus_BLOCK;
            }
            x = battleStatus->enemyActors[actorID]->currentPos.x;
            y = battleStatus->enemyActors[actorID]->currentPos.y;
            z = battleStatus->enemyActors[actorID]->currentPos.z;
            break;
    }

    if (isInitialCall) {
        BattleCam_PosX = camera->lookAt_obj_target.x;
        BattleCam_PosY = camera->lookAt_obj_target.y;
        BattleCam_PosZ = camera->lookAt_obj_target.z;
        D_8029F288 = camera->auxBoomLength;
        BattleCam_InitialBoomYaw = camera->auxBoomYaw;
        BattleCam_InitialBoomPitch = camera->auxBoomPitch;
    }

    get_screen_coords(1, x, y, z, &screenX, &screenY, &screenZ);

    if (screenY < 100) {
        y += 25.0f;
    }
    if (y < BattleCam_PosY) {
        y = BattleCam_PosY;
    }

    if (screenX < 100) {
        x -= 25.0f;
    }
    if (x < BattleCam_PosX) {
        x = BattleCam_PosX;
    }
    if (screenX > 220) {
        x += 25.0f;
    }

    delta = x - camera->lookAt_obj_target.x;
    if (fabsf(delta) < 0.01) {
        if (delta != 0.0f) {
            camera->lookAt_obj_target.x = x;
        }
    } else {
        camera->lookAt_obj_target.x += delta / 5.0f;
    }

    delta = y - camera->lookAt_obj_target.y;
    if (fabsf(delta) < 0.01) {
        if (delta != 0.0f) {
            camera->lookAt_obj_target.y = y;
        }
    } else {
        camera->lookAt_obj_target.y += delta / 5.0f;
    }

    delta = z - camera->lookAt_obj_target.z;
    if (fabsf(delta) < 0.01) {
        if (delta != 0.0f) {
            camera->lookAt_obj_target.z = z;
        }
    } else {
        camera->lookAt_obj_target.z += delta / 5.0f;
    }

    return ApiStatus_BLOCK;
}