### RAW ASSEMBLY INSTRUCTIONS:

glabel func_E02000AC
/* 325B7C E02000AC 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 325B80 E02000B0 3C068080 */  lui       $a2, (0x808080FF >> 16)
/* 325B84 E02000B4 34C680FF */  ori       $a2, $a2, (0x808080FF & 0xFFFF)
/* 325B88 E02000B8 AFB50034 */  sw        $s5, 0x34($sp)
/* 325B8C E02000BC 0000A82D */  daddu     $s5, $zero, $zero
/* 325B90 E02000C0 3C02800A */  lui       $v0, %hi(gMainGfxPos)
/* 325B94 E02000C4 2442A66C */  addiu     $v0, $v0, %lo(gMainGfxPos)
/* 325B98 E02000C8 0040502D */  daddu     $t2, $v0, $zero
/* 325B9C E02000CC 3C0EF510 */  lui       $t6, (0xF5102800 >> 16)
/* 325BA0 E02000D0 35CE2800 */  ori       $t6, $t6, (0xF5102800 & 0xFFFF)
/* 325BA4 E02000D4 AFBE0040 */  sw        $fp, 0x40($sp)
/* 325BA8 E02000D8 3C1E0701 */  lui       $fp, (0x7018070 >> 16)
/* 325BAC E02000DC 37DE8070 */  ori       $fp, $fp, (0x7018070 & 0xFFFF)
/* 325BB0 E02000E0 AFB7003C */  sw        $s7, 0x3C($sp)
/* 325BB4 E02000E4 3C17E700 */  lui       $s7, (0xE7000000 >> 16)
/* 325BB8 E02000E8 00041080 */  sll       $v0, $a0, 2
/* 325BBC E02000EC 30420FFF */  andi      $v0, $v0, 0xFFF
/* 325BC0 E02000F0 AFB3002C */  sw        $s3, 0x2C($sp)
/* 325BC4 E02000F4 00029B00 */  sll       $s3, $v0, 12
/* 325BC8 E02000F8 2482004F */  addiu     $v0, $a0, 0x4F
/* 325BCC E02000FC 00021080 */  sll       $v0, $v0, 2
/* 325BD0 E0200100 30420FFF */  andi      $v0, $v0, 0xFFF
/* 325BD4 E0200104 00021300 */  sll       $v0, $v0, 12
/* 325BD8 E0200108 AFAE0000 */  sw        $t6, 0x0($sp)
/* 325BDC E020010C 3C0EFD10 */  lui       $t6, (0xFD10013F >> 16)
/* 325BE0 E0200110 35CE013F */  ori       $t6, $t6, (0xFD10013F & 0xFFFF)
/* 325BE4 E0200114 AFB60038 */  sw        $s6, 0x38($sp)
/* 325BE8 E0200118 24960050 */  addiu     $s6, $a0, 0x50
/* 325BEC E020011C AFAE0008 */  sw        $t6, 0x8($sp)
/* 325BF0 E0200120 240E00A0 */  addiu     $t6, $zero, 0xA0
/* 325BF4 E0200124 00042540 */  sll       $a0, $a0, 21
/* 325BF8 E0200128 AFB20028 */  sw        $s2, 0x28($sp)
/* 325BFC E020012C 24120014 */  addiu     $s2, $zero, 0x14
/* 325C00 E0200130 AFB10024 */  sw        $s1, 0x24($sp)
/* 325C04 E0200134 02A0882D */  daddu     $s1, $s5, $zero
/* 325C08 E0200138 AFB40030 */  sw        $s4, 0x30($sp)
/* 325C0C E020013C AFB00020 */  sw        $s0, 0x20($sp)
/* 325C10 E0200140 AFA20004 */  sw        $v0, 0x4($sp)
/* 325C14 E0200144 AFAE000C */  sw        $t6, 0xC($sp)
/* 325C18 E0200148 AFA40010 */  sw        $a0, 0x10($sp)
/* 325C1C E020014C 8D420000 */  lw        $v0, 0x0($t2)
/* 325C20 E0200150 00A0582D */  daddu     $t3, $a1, $zero
/* 325C24 E0200154 0040182D */  daddu     $v1, $v0, $zero
/* 325C28 E0200158 24420008 */  addiu     $v0, $v0, 0x8
/* 325C2C E020015C AD420000 */  sw        $v0, 0x0($t2)
/* 325C30 E0200160 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 325C34 E0200164 AC620000 */  sw        $v0, 0x0($v1)
/* 325C38 E0200168 AC660004 */  sw        $a2, 0x4($v1)
.LE020016C:
/* 325C3C E020016C 3C07FD10 */  lui       $a3, (0xFD10004F >> 16)
/* 325C40 E0200170 34E7004F */  ori       $a3, $a3, (0xFD10004F & 0xFFFF)
/* 325C44 E0200174 3C080713 */  lui       $t0, (0x713C000 >> 16)
/* 325C48 E0200178 3508C000 */  ori       $t0, $t0, (0x713C000 & 0xFFFF)
/* 325C4C E020017C 3C090001 */  lui       $t1, (0x18070 >> 16)
/* 325C50 E0200180 35298070 */  ori       $t1, $t1, (0x18070 & 0xFFFF)
/* 325C54 E0200184 3C03F510 */  lui       $v1, (0xF5100100 >> 16)
/* 325C58 E0200188 34630100 */  ori       $v1, $v1, (0xF5100100 & 0xFFFF)
/* 325C5C E020018C 000B3080 */  sll       $a2, $t3, 2
/* 325C60 E0200190 30C60FFF */  andi      $a2, $a2, 0xFFF
/* 325C64 E0200194 25650005 */  addiu     $a1, $t3, 0x5
/* 325C68 E0200198 00052880 */  sll       $a1, $a1, 2
/* 325C6C E020019C 30A50FFF */  andi      $a1, $a1, 0xFFF
/* 325C70 E02001A0 8FAE000C */  lw        $t6, 0xC($sp)
/* 325C74 E02001A4 02667825 */  or        $t7, $s3, $a2
/* 325C78 E02001A8 000E1180 */  sll       $v0, $t6, 6
/* 325C7C E02001AC 00436825 */  or        $t5, $v0, $v1
/* 325C80 E02001B0 3C0EF400 */  lui       $t6, (0xF4000000 >> 16)
/* 325C84 E02001B4 00CE1025 */  or        $v0, $a2, $t6
/* 325C88 E02001B8 0262A025 */  or        $s4, $s3, $v0
/* 325C8C E02001BC 26C3FFFF */  addiu     $v1, $s6, -0x1
/* 325C90 E02001C0 00031880 */  sll       $v1, $v1, 2
/* 325C94 E02001C4 30630FFF */  andi      $v1, $v1, 0xFFF
/* 325C98 E02001C8 00031B00 */  sll       $v1, $v1, 12
/* 325C9C E02001CC 3C020700 */  lui       $v0, (0x7000000 >> 16)
/* 325CA0 E02001D0 00A21025 */  or        $v0, $a1, $v0
/* 325CA4 E02001D4 00628025 */  or        $s0, $v1, $v0
/* 325CA8 E02001D8 00161080 */  sll       $v0, $s6, 2
/* 325CAC E02001DC 30420FFF */  andi      $v0, $v0, 0xFFF
/* 325CB0 E02001E0 0002CB00 */  sll       $t9, $v0, 12
/* 325CB4 E02001E4 25620006 */  addiu     $v0, $t3, 0x6
/* 325CB8 E02001E8 00021080 */  sll       $v0, $v0, 2
/* 325CBC E02001EC 30580FFF */  andi      $t8, $v0, 0xFFF
/* 325CC0 E02001F0 8D430000 */  lw        $v1, 0x0($t2)
/* 325CC4 E02001F4 3C0E800A */  lui       $t6, %hi(nuGfxCfb_ptr)
/* 325CC8 E02001F8 8DCEA64C */  lw        $t6, %lo(nuGfxCfb_ptr)($t6)
/* 325CCC E02001FC 0060102D */  daddu     $v0, $v1, $zero
/* 325CD0 E0200200 01C0202D */  daddu     $a0, $t6, $zero
/* 325CD4 E0200204 24630008 */  addiu     $v1, $v1, 0x8
/* 325CD8 E0200208 AFAE0018 */  sw        $t6, 0x18($sp)
/* 325CDC E020020C AD430000 */  sw        $v1, 0x0($t2)
/* 325CE0 E0200210 AC470000 */  sw        $a3, 0x0($v0)
/* 325CE4 E0200214 AC440004 */  sw        $a0, 0x4($v0)
/* 325CE8 E0200218 24620008 */  addiu     $v0, $v1, 0x8
/* 325CEC E020021C AD420000 */  sw        $v0, 0x0($t2)
/* 325CF0 E0200220 8FAE0000 */  lw        $t6, 0x0($sp)
/* 325CF4 E0200224 24620010 */  addiu     $v0, $v1, 0x10
/* 325CF8 E0200228 AC7E0004 */  sw        $fp, 0x4($v1)
/* 325CFC E020022C AC6E0000 */  sw        $t6, 0x0($v1)
/* 325D00 E0200230 3C0EE600 */  lui       $t6, (0xE6000000 >> 16)
/* 325D04 E0200234 AD420000 */  sw        $v0, 0x0($t2)
/* 325D08 E0200238 24620018 */  addiu     $v0, $v1, 0x18
/* 325D0C E020023C AC6E0008 */  sw        $t6, 0x8($v1)
/* 325D10 E0200240 AC60000C */  sw        $zero, 0xC($v1)
/* 325D14 E0200244 AD420000 */  sw        $v0, 0x0($t2)
/* 325D18 E0200248 32220FFF */  andi      $v0, $s1, 0xFFF
/* 325D1C E020024C 3C0EF400 */  lui       $t6, (0xF4000000 >> 16)
/* 325D20 E0200250 004E1025 */  or        $v0, $v0, $t6
/* 325D24 E0200254 AC620010 */  sw        $v0, 0x10($v1)
/* 325D28 E0200258 32420FFF */  andi      $v0, $s2, 0xFFF
/* 325D2C E020025C 00481025 */  or        $v0, $v0, $t0
/* 325D30 E0200260 AC620014 */  sw        $v0, 0x14($v1)
/* 325D34 E0200264 24620020 */  addiu     $v0, $v1, 0x20
/* 325D38 E0200268 AD420000 */  sw        $v0, 0x0($t2)
/* 325D3C E020026C 24620028 */  addiu     $v0, $v1, 0x28
/* 325D40 E0200270 AC770018 */  sw        $s7, 0x18($v1)
/* 325D44 E0200274 AC60001C */  sw        $zero, 0x1C($v1)
/* 325D48 E0200278 AD420000 */  sw        $v0, 0x0($t2)
/* 325D4C E020027C 8FAE0000 */  lw        $t6, 0x0($sp)
/* 325D50 E0200280 24620030 */  addiu     $v0, $v1, 0x30
/* 325D54 E0200284 AC690024 */  sw        $t1, 0x24($v1)
/* 325D58 E0200288 AC6E0020 */  sw        $t6, 0x20($v1)
/* 325D5C E020028C AD420000 */  sw        $v0, 0x0($t2)
/* 325D60 E0200290 3C02F200 */  lui       $v0, (0xF2000000 >> 16)
/* 325D64 E0200294 00C23025 */  or        $a2, $a2, $v0
/* 325D68 E0200298 02663025 */  or        $a2, $s3, $a2
/* 325D6C E020029C AC660028 */  sw        $a2, 0x28($v1)
/* 325D70 E02002A0 8FAE0004 */  lw        $t6, 0x4($sp)
/* 325D74 E02002A4 0000602D */  daddu     $t4, $zero, $zero
/* 325D78 E02002A8 01C51025 */  or        $v0, $t6, $a1
/* 325D7C E02002AC AC62002C */  sw        $v0, 0x2C($v1)
/* 325D80 E02002B0 24620038 */  addiu     $v0, $v1, 0x38
/* 325D84 E02002B4 AD420000 */  sw        $v0, 0x0($t2)
/* 325D88 E02002B8 3C020100 */  lui       $v0, (0x1000000 >> 16)
/* 325D8C E02002BC 00A22825 */  or        $a1, $a1, $v0
/* 325D90 E02002C0 01C52825 */  or        $a1, $t6, $a1
/* 325D94 E02002C4 AC660030 */  sw        $a2, 0x30($v1)
/* 325D98 E02002C8 AC650034 */  sw        $a1, 0x34($v1)
.LE02002CC:
/* 325D9C E02002CC 3C040101 */  lui       $a0, (0x1018070 >> 16)
/* 325DA0 E02002D0 34848070 */  ori       $a0, $a0, (0x1018070 & 0xFFFF)
/* 325DA4 E02002D4 8D430000 */  lw        $v1, 0x0($t2)
/* 325DA8 E02002D8 3C050400 */  lui       $a1, (0x4000400 >> 16)
/* 325DAC E02002DC 0060102D */  daddu     $v0, $v1, $zero
/* 325DB0 E02002E0 24630008 */  addiu     $v1, $v1, 0x8
/* 325DB4 E02002E4 AD430000 */  sw        $v1, 0x0($t2)
/* 325DB8 E02002E8 8FAE0008 */  lw        $t6, 0x8($sp)
/* 325DBC E02002EC 34A50400 */  ori       $a1, $a1, (0x4000400 & 0xFFFF)
/* 325DC0 E02002F0 AC4E0000 */  sw        $t6, 0x0($v0)
/* 325DC4 E02002F4 8FAE0018 */  lw        $t6, 0x18($sp)
/* 325DC8 E02002F8 258C0001 */  addiu     $t4, $t4, 0x1
/* 325DCC E02002FC AC4E0004 */  sw        $t6, 0x4($v0)
/* 325DD0 E0200300 24620008 */  addiu     $v0, $v1, 0x8
/* 325DD4 E0200304 AD420000 */  sw        $v0, 0x0($t2)
/* 325DD8 E0200308 24620010 */  addiu     $v0, $v1, 0x10
/* 325DDC E020030C 3C0EE600 */  lui       $t6, (0xE6000000 >> 16)
/* 325DE0 E0200310 AC6D0000 */  sw        $t5, 0x0($v1)
/* 325DE4 E0200314 AC7E0004 */  sw        $fp, 0x4($v1)
/* 325DE8 E0200318 AD420000 */  sw        $v0, 0x0($t2)
/* 325DEC E020031C 24620018 */  addiu     $v0, $v1, 0x18
/* 325DF0 E0200320 AC6E0008 */  sw        $t6, 0x8($v1)
/* 325DF4 E0200324 AC60000C */  sw        $zero, 0xC($v1)
/* 325DF8 E0200328 AD420000 */  sw        $v0, 0x0($t2)
/* 325DFC E020032C 24620020 */  addiu     $v0, $v1, 0x20
/* 325E00 E0200330 AC740010 */  sw        $s4, 0x10($v1)
/* 325E04 E0200334 AC700014 */  sw        $s0, 0x14($v1)
/* 325E08 E0200338 AD420000 */  sw        $v0, 0x0($t2)
/* 325E0C E020033C 24620028 */  addiu     $v0, $v1, 0x28
/* 325E10 E0200340 AC770018 */  sw        $s7, 0x18($v1)
/* 325E14 E0200344 AC60001C */  sw        $zero, 0x1C($v1)
/* 325E18 E0200348 AD420000 */  sw        $v0, 0x0($t2)
/* 325E1C E020034C 24620030 */  addiu     $v0, $v1, 0x30
/* 325E20 E0200350 AC6D0020 */  sw        $t5, 0x20($v1)
/* 325E24 E0200354 AC640024 */  sw        $a0, 0x24($v1)
/* 325E28 E0200358 AD420000 */  sw        $v0, 0x0($t2)
/* 325E2C E020035C 3C02E400 */  lui       $v0, (0xE4000000 >> 16)
/* 325E30 E0200360 03021025 */  or        $v0, $t8, $v0
/* 325E34 E0200364 03221025 */  or        $v0, $t9, $v0
/* 325E38 E0200368 AC620028 */  sw        $v0, 0x28($v1)
/* 325E3C E020036C 24620038 */  addiu     $v0, $v1, 0x38
/* 325E40 E0200370 AC6F002C */  sw        $t7, 0x2C($v1)
/* 325E44 E0200374 AD420000 */  sw        $v0, 0x0($t2)
/* 325E48 E0200378 3C02E100 */  lui       $v0, (0xE1000000 >> 16)
/* 325E4C E020037C AC620030 */  sw        $v0, 0x30($v1)
/* 325E50 E0200380 000B1140 */  sll       $v0, $t3, 5
/* 325E54 E0200384 8FAE0010 */  lw        $t6, 0x10($sp)
/* 325E58 E0200388 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 325E5C E020038C 01C21025 */  or        $v0, $t6, $v0
/* 325E60 E0200390 AC620034 */  sw        $v0, 0x34($v1)
/* 325E64 E0200394 24620040 */  addiu     $v0, $v1, 0x40
/* 325E68 E0200398 AD420000 */  sw        $v0, 0x0($t2)
/* 325E6C E020039C 3C02F100 */  lui       $v0, (0xF1000000 >> 16)
/* 325E70 E02003A0 AC620038 */  sw        $v0, 0x38($v1)
/* 325E74 E02003A4 1980FFC9 */  blez      $t4, .LE02002CC
/* 325E78 E02003A8 AC65003C */   sw       $a1, 0x3C($v1)
/* 325E7C E02003AC 26520018 */  addiu     $s2, $s2, 0x18
/* 325E80 E02003B0 26310018 */  addiu     $s1, $s1, 0x18
/* 325E84 E02003B4 256B0006 */  addiu     $t3, $t3, 0x6
/* 325E88 E02003B8 8D420000 */  lw        $v0, 0x0($t2)
/* 325E8C E02003BC 26B50001 */  addiu     $s5, $s5, 0x1
/* 325E90 E02003C0 0040182D */  daddu     $v1, $v0, $zero
/* 325E94 E02003C4 24420008 */  addiu     $v0, $v0, 0x8
/* 325E98 E02003C8 AD420000 */  sw        $v0, 0x0($t2)
/* 325E9C E02003CC 2AA2000A */  slti      $v0, $s5, 0xA
/* 325EA0 E02003D0 AC770000 */  sw        $s7, 0x0($v1)
/* 325EA4 E02003D4 1440FF65 */  bnez      $v0, .LE020016C
/* 325EA8 E02003D8 AC600004 */   sw       $zero, 0x4($v1)
/* 325EAC E02003DC 8FBE0040 */  lw        $fp, 0x40($sp)
/* 325EB0 E02003E0 8FB7003C */  lw        $s7, 0x3C($sp)
/* 325EB4 E02003E4 8FB60038 */  lw        $s6, 0x38($sp)
/* 325EB8 E02003E8 8FB50034 */  lw        $s5, 0x34($sp)
/* 325EBC E02003EC 8FB40030 */  lw        $s4, 0x30($sp)
/* 325EC0 E02003F0 8FB3002C */  lw        $s3, 0x2C($sp)
/* 325EC4 E02003F4 8FB20028 */  lw        $s2, 0x28($sp)
/* 325EC8 E02003F8 8FB10024 */  lw        $s1, 0x24($sp)
/* 325ECC E02003FC 8FB00020 */  lw        $s0, 0x20($sp)
/* 325ED0 E0200400 03E00008 */  jr        $ra
/* 325ED4 E0200404 27BD0048 */   addiu    $sp, $sp, 0x48
/* 325ED8 E0200408 00000000 */  nop
/* 325EDC E020040C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void func_E02000AC(s32 arg0, s32 arg1) {
    s32 i;
    s32 j;
    s32 width;
    s32 x;
    s32 new_var;
    s32 var_t3;
    s32 s2 = 20;
    s32 s1 = 0;

    gDPSetPrimColor(gMainGfxPos++, 0, 0, 128, 128, 128, 255);
    width = 80;

    for (i = 0; i < 10; i++, s1 = i * 24, s2 = i * 24 + 20) {
        x = arg0;
        new_var = x + width;
        var_t3 = i * 6;
        gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, nuGfxCfb_ptr);
        gDPSetTile(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 20, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
                  6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 7, G_TX_NOLOD);
        gDPLoadSync(gMainGfxPos++);
        gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, s1, 0x013C, s2);
        gDPPipeSync(gMainGfxPos++);
        gDPSetTile(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 20, 0x0000, G_TX_RENDERTILE, 0,
                   G_TX_NOMIRROR | G_TX_WRAP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 7, G_TX_NOLOD);
        gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, arg0 << G_TEXTURE_IMAGE_FRAC,
                       (arg1 + var_t3) << G_TEXTURE_IMAGE_FRAC, (arg0 + 79) << G_TEXTURE_IMAGE_FRAC,
                       ((arg1 + var_t3) + 5) << G_TEXTURE_IMAGE_FRAC);
        gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE + 1, arg0 << G_TEXTURE_IMAGE_FRAC,
                       (arg1 + var_t3) << G_TEXTURE_IMAGE_FRAC, (arg0 + 79) << G_TEXTURE_IMAGE_FRAC,
                       ((arg1 + var_t3) + 5) << G_TEXTURE_IMAGE_FRAC);

        for (j = 0; j < 1; j++) {
            gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, nuGfxCfb_ptr);
            gDPSetTile(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b,
                       ((((((x + width) - 1) - x) + 1) * G_IM_SIZ_16b_TILE_BYTES) + 7) >> 3, 0x100, G_TX_LOADTILE, 0,
                       G_TX_WRAP, 6, G_TX_NOLOD, G_TX_WRAP, 7, G_TX_NOLOD);
            gDPLoadSync(gMainGfxPos++);
            gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, x << G_TEXTURE_IMAGE_FRAC,
                        (arg1 + var_t3) << G_TEXTURE_IMAGE_FRAC,
                        ((new_var) - 1) << G_TEXTURE_IMAGE_FRAC,
                        ((arg1 + var_t3) + 5) << G_TEXTURE_IMAGE_FRAC);
            gDPPipeSync(gMainGfxPos++);
            gDPSetTile(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b,
                       ((((((x + width) - 1) - x) + 1) * G_IM_SIZ_16b_TILE_BYTES) + 7) >> 3, 0x100, G_TX_RENDERTILE + 1,
                       0, G_TX_WRAP, 6, G_TX_NOLOD, G_TX_WRAP, 7, G_TX_NOLOD);
            gSPTextureRectangle(gMainGfxPos++, x * 4, (arg1 + var_t3) * 4, (x + width) * 4, ((arg1 + var_t3) + 6) * 4,
                                0, x * 32, (arg1 + (i * 6)) * 32, 0x400, 0x400);
        }
        gDPPipeSync(gMainGfxPos++);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel gather_magic_appendGfx
/* 38F340 E008E4E0 27BDFEF8 */  addiu     $sp, $sp, -0x108
/* 38F344 E008E4E4 3C05DB06 */  lui       $a1, (0xDB060024 >> 16)
/* 38F348 E008E4E8 34A50024 */  ori       $a1, $a1, (0xDB060024 & 0xFFFF)
/* 38F34C E008E4EC AFA40108 */  sw        $a0, 0x108($sp)
/* 38F350 E008E4F0 27A40018 */  addiu     $a0, $sp, 0x18
/* 38F354 E008E4F4 AFB100DC */  sw        $s1, 0xDC($sp)
/* 38F358 E008E4F8 3C110001 */  lui       $s1, (0x11630 >> 16)
/* 38F35C E008E4FC 36311630 */  ori       $s1, $s1, (0x11630 & 0xFFFF)
/* 38F360 E008E500 AFB400E8 */  sw        $s4, 0xE8($sp)
/* 38F364 E008E504 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 38F368 E008E508 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 38F36C E008E50C 8FA90108 */  lw        $t1, 0x108($sp)
/* 38F370 E008E510 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 38F374 E008E514 AFBF00FC */  sw        $ra, 0xFC($sp)
/* 38F378 E008E518 AFBE00F8 */  sw        $fp, 0xF8($sp)
/* 38F37C E008E51C AFB700F4 */  sw        $s7, 0xF4($sp)
/* 38F380 E008E520 AFB600F0 */  sw        $s6, 0xF0($sp)
/* 38F384 E008E524 AFB500EC */  sw        $s5, 0xEC($sp)
/* 38F388 E008E528 AFB300E4 */  sw        $s3, 0xE4($sp)
/* 38F38C E008E52C AFB200E0 */  sw        $s2, 0xE0($sp)
/* 38F390 E008E530 AFB000D8 */  sw        $s0, 0xD8($sp)
/* 38F394 E008E534 F7B40100 */  sdc1      $f20, 0x100($sp)
/* 38F398 E008E538 8E880000 */  lw        $t0, 0x0($s4)
/* 38F39C E008E53C 8D32000C */  lw        $s2, 0xC($t1)
/* 38F3A0 E008E540 0100182D */  daddu     $v1, $t0, $zero
/* 38F3A4 E008E544 8E550030 */  lw        $s5, 0x30($s2)
/* 38F3A8 E008E548 8E570034 */  lw        $s7, 0x34($s2)
/* 38F3AC E008E54C 8E5E0038 */  lw        $fp, 0x38($s2)
/* 38F3B0 E008E550 25080008 */  addiu     $t0, $t0, 0x8
/* 38F3B4 E008E554 AC620000 */  sw        $v0, 0x0($v1)
/* 38F3B8 E008E558 AC600004 */  sw        $zero, 0x4($v1)
/* 38F3BC E008E55C AD050000 */  sw        $a1, 0x0($t0)
/* 38F3C0 E008E560 8D220010 */  lw        $v0, 0x10($t1)
/* 38F3C4 E008E564 24130001 */  addiu     $s3, $zero, 0x1
/* 38F3C8 E008E568 AE880000 */  sw        $t0, 0x0($s4)
/* 38F3CC E008E56C 8C42001C */  lw        $v0, 0x1C($v0)
/* 38F3D0 E008E570 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 38F3D4 E008E574 00431021 */  addu      $v0, $v0, $v1
/* 38F3D8 E008E578 AD020004 */  sw        $v0, 0x4($t0)
/* 38F3DC E008E57C 8E450008 */  lw        $a1, 0x8($s2)
/* 38F3E0 E008E580 8E46000C */  lw        $a2, 0xC($s2)
/* 38F3E4 E008E584 8E470010 */  lw        $a3, 0x10($s2)
/* 38F3E8 E008E588 25080008 */  addiu     $t0, $t0, 0x8
/* 38F3EC E008E58C 0C080108 */  jal       shim_guTranslateF
/* 38F3F0 E008E590 AE880000 */   sw       $t0, 0x0($s4)
/* 38F3F4 E008E594 27B00098 */  addiu     $s0, $sp, 0x98
/* 38F3F8 E008E598 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 38F3FC E008E59C 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 38F400 E008E5A0 44800000 */  mtc1      $zero, $f0
/* 38F404 E008E5A4 00031080 */  sll       $v0, $v1, 2
/* 38F408 E008E5A8 00431021 */  addu      $v0, $v0, $v1
/* 38F40C E008E5AC 00021080 */  sll       $v0, $v0, 2
/* 38F410 E008E5B0 00431023 */  subu      $v0, $v0, $v1
/* 38F414 E008E5B4 000218C0 */  sll       $v1, $v0, 3
/* 38F418 E008E5B8 00431021 */  addu      $v0, $v0, $v1
/* 38F41C E008E5BC 000210C0 */  sll       $v0, $v0, 3
/* 38F420 E008E5C0 44060000 */  mfc1      $a2, $f0
/* 38F424 E008E5C4 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 38F428 E008E5C8 00220821 */  addu      $at, $at, $v0
/* 38F42C E008E5CC C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 38F430 E008E5D0 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 38F434 E008E5D4 46000007 */  neg.s     $f0, $f0
/* 38F438 E008E5D8 44050000 */  mfc1      $a1, $f0
/* 38F43C E008E5DC 0200202D */  daddu     $a0, $s0, $zero
/* 38F440 E008E5E0 0C080104 */  jal       shim_guRotateF
/* 38F444 E008E5E4 AFA60010 */   sw       $a2, 0x10($sp)
/* 38F448 E008E5E8 0200202D */  daddu     $a0, $s0, $zero
/* 38F44C E008E5EC 27A50018 */  addiu     $a1, $sp, 0x18
/* 38F450 E008E5F0 0C080114 */  jal       shim_guMtxCatF
/* 38F454 E008E5F4 00A0302D */   daddu    $a2, $a1, $zero
/* 38F458 E008E5F8 27A40018 */  addiu     $a0, $sp, 0x18
/* 38F45C E008E5FC 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 38F460 E008E600 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 38F464 E008E604 3C16800A */  lui       $s6, %hi(gDisplayContext)
/* 38F468 E008E608 26D6A674 */  addiu     $s6, $s6, %lo(gDisplayContext)
/* 38F46C E008E60C 96050000 */  lhu       $a1, 0x0($s0)
/* 38F470 E008E610 8EC20000 */  lw        $v0, 0x0($s6)
/* 38F474 E008E614 00052980 */  sll       $a1, $a1, 6
/* 38F478 E008E618 00B12821 */  addu      $a1, $a1, $s1
/* 38F47C E008E61C 0C080118 */  jal       shim_guMtxF2L
/* 38F480 E008E620 00452821 */   addu     $a1, $v0, $a1
/* 38F484 E008E624 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 38F488 E008E628 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 38F48C E008E62C 8E850000 */  lw        $a1, 0x0($s4)
/* 38F490 E008E630 96020000 */  lhu       $v0, 0x0($s0)
/* 38F494 E008E634 00A0202D */  daddu     $a0, $a1, $zero
/* 38F498 E008E638 24A50008 */  addiu     $a1, $a1, 0x8
/* 38F49C E008E63C AE850000 */  sw        $a1, 0x0($s4)
/* 38F4A0 E008E640 AC830000 */  sw        $v1, 0x0($a0)
/* 38F4A4 E008E644 00531821 */  addu      $v1, $v0, $s3
/* 38F4A8 E008E648 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 38F4AC E008E64C 00021180 */  sll       $v0, $v0, 6
/* 38F4B0 E008E650 A6030000 */  sh        $v1, 0x0($s0)
/* 38F4B4 E008E654 8EC30000 */  lw        $v1, 0x0($s6)
/* 38F4B8 E008E658 00511021 */  addu      $v0, $v0, $s1
/* 38F4BC E008E65C 00621821 */  addu      $v1, $v1, $v0
/* 38F4C0 E008E660 24A20008 */  addiu     $v0, $a1, 0x8
/* 38F4C4 E008E664 AC830004 */  sw        $v1, 0x4($a0)
/* 38F4C8 E008E668 AE820000 */  sw        $v0, 0x0($s4)
/* 38F4CC E008E66C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 38F4D0 E008E670 ACA20000 */  sw        $v0, 0x0($a1)
/* 38F4D4 E008E674 3C020900 */  lui       $v0, %hi(D_09000080_4150E0)
/* 38F4D8 E008E678 24420080 */  addiu     $v0, $v0, %lo(D_09000080_4150E0)
/* 38F4DC E008E67C ACA20004 */  sw        $v0, 0x4($a1)
/* 38F4E0 E008E680 24A20010 */  addiu     $v0, $a1, 0x10
/* 38F4E4 E008E684 AE820000 */  sw        $v0, 0x0($s4)
/* 38F4E8 E008E688 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 38F4EC E008E68C ACA20008 */  sw        $v0, 0x8($a1)
/* 38F4F0 E008E690 9242003F */  lbu       $v0, 0x3F($s2)
/* 38F4F4 E008E694 92440043 */  lbu       $a0, 0x43($s2)
/* 38F4F8 E008E698 92430047 */  lbu       $v1, 0x47($s2)
/* 38F4FC E008E69C 00021600 */  sll       $v0, $v0, 24
/* 38F500 E008E6A0 00042400 */  sll       $a0, $a0, 16
/* 38F504 E008E6A4 00441025 */  or        $v0, $v0, $a0
/* 38F508 E008E6A8 00031A00 */  sll       $v1, $v1, 8
/* 38F50C E008E6AC 00431025 */  or        $v0, $v0, $v1
/* 38F510 E008E6B0 ACA2000C */  sw        $v0, 0xC($a1)
/* 38F514 E008E6B4 8FA90108 */  lw        $t1, 0x108($sp)
/* 38F518 E008E6B8 8D220008 */  lw        $v0, 0x8($t1)
/* 38F51C E008E6BC 0262102A */  slt       $v0, $s3, $v0
/* 38F520 E008E6C0 1040005A */  beqz      $v0, .LE008E82C
/* 38F524 E008E6C4 26520048 */   addiu    $s2, $s2, 0x48
/* 38F528 E008E6C8 0280882D */  daddu     $s1, $s4, $zero
/* 38F52C E008E6CC 00151600 */  sll       $v0, $s5, 24
/* 38F530 E008E6D0 32E300FF */  andi      $v1, $s7, 0xFF
/* 38F534 E008E6D4 00031C00 */  sll       $v1, $v1, 16
/* 38F538 E008E6D8 00431025 */  or        $v0, $v0, $v1
/* 38F53C E008E6DC 33C300FF */  andi      $v1, $fp, 0xFF
/* 38F540 E008E6E0 00031A00 */  sll       $v1, $v1, 8
/* 38F544 E008E6E4 0043F025 */  or        $fp, $v0, $v1
/* 38F548 E008E6E8 27B50058 */  addiu     $s5, $sp, 0x58
/* 38F54C E008E6EC 02C0B82D */  daddu     $s7, $s6, $zero
/* 38F550 E008E6F0 0200B02D */  daddu     $s6, $s0, $zero
/* 38F554 E008E6F4 3C140001 */  lui       $s4, (0x11630 >> 16)
/* 38F558 E008E6F8 36941630 */  ori       $s4, $s4, (0x11630 & 0xFFFF)
/* 38F55C E008E6FC 26500010 */  addiu     $s0, $s2, 0x10
.LE008E700:
/* 38F560 E008E700 C6140018 */  lwc1      $f20, 0x18($s0)
/* 38F564 E008E704 44800000 */  mtc1      $zero, $f0
/* 38F568 E008E708 00000000 */  nop
/* 38F56C E008E70C 4600A032 */  c.eq.s    $f20, $f0
/* 38F570 E008E710 00000000 */  nop
/* 38F574 E008E714 4501003F */  bc1t      .LE008E814
/* 38F578 E008E718 00000000 */   nop
/* 38F57C E008E71C 8E220000 */  lw        $v0, 0x0($s1)
/* 38F580 E008E720 0040182D */  daddu     $v1, $v0, $zero
/* 38F584 E008E724 24420008 */  addiu     $v0, $v0, 0x8
/* 38F588 E008E728 AE220000 */  sw        $v0, 0x0($s1)
/* 38F58C E008E72C 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 38F590 E008E730 AC620000 */  sw        $v0, 0x0($v1)
/* 38F594 E008E734 92020007 */  lbu       $v0, 0x7($s0)
/* 38F598 E008E738 03C21025 */  or        $v0, $fp, $v0
/* 38F59C E008E73C AC620004 */  sw        $v0, 0x4($v1)
/* 38F5A0 E008E740 8E05FFF8 */  lw        $a1, -0x8($s0)
/* 38F5A4 E008E744 8E06FFFC */  lw        $a2, -0x4($s0)
/* 38F5A8 E008E748 8E070000 */  lw        $a3, 0x0($s0)
/* 38F5AC E008E74C 0C080108 */  jal       shim_guTranslateF
/* 38F5B0 E008E750 27A40018 */   addiu    $a0, $sp, 0x18
/* 38F5B4 E008E754 4405A000 */  mfc1      $a1, $f20
/* 38F5B8 E008E758 02A0202D */  daddu     $a0, $s5, $zero
/* 38F5BC E008E75C 00A0302D */  daddu     $a2, $a1, $zero
/* 38F5C0 E008E760 0C080110 */  jal       shim_guScaleF
/* 38F5C4 E008E764 00A0382D */   daddu    $a3, $a1, $zero
/* 38F5C8 E008E768 02A0202D */  daddu     $a0, $s5, $zero
/* 38F5CC E008E76C 27A50018 */  addiu     $a1, $sp, 0x18
/* 38F5D0 E008E770 0C080114 */  jal       shim_guMtxCatF
/* 38F5D4 E008E774 00A0302D */   daddu    $a2, $a1, $zero
/* 38F5D8 E008E778 27A40018 */  addiu     $a0, $sp, 0x18
/* 38F5DC E008E77C 96C50000 */  lhu       $a1, 0x0($s6)
/* 38F5E0 E008E780 8EE20000 */  lw        $v0, 0x0($s7)
/* 38F5E4 E008E784 00052980 */  sll       $a1, $a1, 6
/* 38F5E8 E008E788 00B42821 */  addu      $a1, $a1, $s4
/* 38F5EC E008E78C 0C080118 */  jal       shim_guMtxF2L
/* 38F5F0 E008E790 00452821 */   addu     $a1, $v0, $a1
/* 38F5F4 E008E794 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 38F5F8 E008E798 8E240000 */  lw        $a0, 0x0($s1)
/* 38F5FC E008E79C 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 38F600 E008E7A0 0080282D */  daddu     $a1, $a0, $zero
/* 38F604 E008E7A4 24840008 */  addiu     $a0, $a0, 0x8
/* 38F608 E008E7A8 AE240000 */  sw        $a0, 0x0($s1)
/* 38F60C E008E7AC 96C20000 */  lhu       $v0, 0x0($s6)
/* 38F610 E008E7B0 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 38F614 E008E7B4 ACA30000 */  sw        $v1, 0x0($a1)
/* 38F618 E008E7B8 24430001 */  addiu     $v1, $v0, 0x1
/* 38F61C E008E7BC 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 38F620 E008E7C0 00021180 */  sll       $v0, $v0, 6
/* 38F624 E008E7C4 A6C30000 */  sh        $v1, 0x0($s6)
/* 38F628 E008E7C8 8EE30000 */  lw        $v1, 0x0($s7)
/* 38F62C E008E7CC 00541021 */  addu      $v0, $v0, $s4
/* 38F630 E008E7D0 00621821 */  addu      $v1, $v1, $v0
/* 38F634 E008E7D4 24820008 */  addiu     $v0, $a0, 0x8
/* 38F638 E008E7D8 ACA30004 */  sw        $v1, 0x4($a1)
/* 38F63C E008E7DC AE220000 */  sw        $v0, 0x0($s1)
/* 38F640 E008E7E0 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 38F644 E008E7E4 AC820000 */  sw        $v0, 0x0($a0)
/* 38F648 E008E7E8 32620001 */  andi      $v0, $s3, 0x1
/* 38F64C E008E7EC 00021080 */  sll       $v0, $v0, 2
/* 38F650 E008E7F0 3C03E009 */  lui       $v1, (0xE0090000 >> 16)
/* 38F654 E008E7F4 00621821 */  addu      $v1, $v1, $v0
/* 38F658 E008E7F8 8C63E890 */  lw        $v1, -0x1770($v1)
/* 38F65C E008E7FC 24820010 */  addiu     $v0, $a0, 0x10
/* 38F660 E008E800 AE220000 */  sw        $v0, 0x0($s1)
/* 38F664 E008E804 24020040 */  addiu     $v0, $zero, 0x40
/* 38F668 E008E808 AC860008 */  sw        $a2, 0x8($a0)
/* 38F66C E008E80C AC82000C */  sw        $v0, 0xC($a0)
/* 38F670 E008E810 AC830004 */  sw        $v1, 0x4($a0)
.LE008E814:
/* 38F674 E008E814 8FA90108 */  lw        $t1, 0x108($sp)
/* 38F678 E008E818 26730001 */  addiu     $s3, $s3, 0x1
/* 38F67C E008E81C 8D220008 */  lw        $v0, 0x8($t1)
/* 38F680 E008E820 0262102A */  slt       $v0, $s3, $v0
/* 38F684 E008E824 1440FFB6 */  bnez      $v0, .LE008E700
/* 38F688 E008E828 26100048 */   addiu    $s0, $s0, 0x48
.LE008E82C:
/* 38F68C E008E82C 3C05D838 */  lui       $a1, (0xD8380002 >> 16)
/* 38F690 E008E830 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 38F694 E008E834 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 38F698 E008E838 8C620000 */  lw        $v0, 0x0($v1)
/* 38F69C E008E83C 34A50002 */  ori       $a1, $a1, (0xD8380002 & 0xFFFF)
/* 38F6A0 E008E840 0040202D */  daddu     $a0, $v0, $zero
/* 38F6A4 E008E844 24420008 */  addiu     $v0, $v0, 0x8
/* 38F6A8 E008E848 AC620000 */  sw        $v0, 0x0($v1)
/* 38F6AC E008E84C 24020040 */  addiu     $v0, $zero, 0x40
/* 38F6B0 E008E850 AC850000 */  sw        $a1, 0x0($a0)
/* 38F6B4 E008E854 AC820004 */  sw        $v0, 0x4($a0)
/* 38F6B8 E008E858 8FBF00FC */  lw        $ra, 0xFC($sp)
/* 38F6BC E008E85C 8FBE00F8 */  lw        $fp, 0xF8($sp)
/* 38F6C0 E008E860 8FB700F4 */  lw        $s7, 0xF4($sp)
/* 38F6C4 E008E864 8FB600F0 */  lw        $s6, 0xF0($sp)
/* 38F6C8 E008E868 8FB500EC */  lw        $s5, 0xEC($sp)
/* 38F6CC E008E86C 8FB400E8 */  lw        $s4, 0xE8($sp)
/* 38F6D0 E008E870 8FB300E4 */  lw        $s3, 0xE4($sp)
/* 38F6D4 E008E874 8FB200E0 */  lw        $s2, 0xE0($sp)
/* 38F6D8 E008E878 8FB100DC */  lw        $s1, 0xDC($sp)
/* 38F6DC E008E87C 8FB000D8 */  lw        $s0, 0xD8($sp)
/* 38F6E0 E008E880 D7B40100 */  ldc1      $f20, 0x100($sp)
/* 38F6E4 E008E884 03E00008 */  jr        $ra
/* 38F6E8 E008E888 27BD0108 */   addiu    $sp, $sp, 0x108
/* 38F6EC E008E88C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void gather_magic_appendGfx(void* effect) {
    GatherMagicFXData* part = ((EffectInstance*)effect)->data.gatherMagic;
    s32 unk_30 = part->unk_30;
    s32 unk_34 = part->unk_34;
    s32 unk_38 = part->unk_38;
    Matrix4f sp18;
    Matrix4f sp58;
    Matrix4f sp98;
    s32 i;

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

    shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
    shim_guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(sp98, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPDisplayList(gMainGfxPos++, D_09000080_38F790);
    gDPSetEnvColor(gMainGfxPos++, part->unk_3C, part->unk_40, part->unk_44, 0);

    part++;
    for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
        f32 scale = part->unk_28;

        if (scale != 0.0f) {
            gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_30, unk_34, unk_38, part->unk_14);

            shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
            shim_guScaleF(sp58, scale, scale, scale);
            shim_guMtxCatF(sp58, sp18, sp18);
            shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gSPDisplayList(gMainGfxPos++, D_E008E890[i & 1]);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel water_splash_main
/* 3BBF60 E00BE000 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 3BBF64 E00BE004 F7B40040 */  sdc1      $f20, 0x40($sp)
/* 3BBF68 E00BE008 4485A000 */  mtc1      $a1, $f20
/* 3BBF6C E00BE00C F7B60048 */  sdc1      $f22, 0x48($sp)
/* 3BBF70 E00BE010 4486B000 */  mtc1      $a2, $f22
/* 3BBF74 E00BE014 F7B80050 */  sdc1      $f24, 0x50($sp)
/* 3BBF78 E00BE018 4487C000 */  mtc1      $a3, $f24
/* 3BBF7C E00BE01C AFB20030 */  sw        $s2, 0x30($sp)
/* 3BBF80 E00BE020 0080902D */  daddu     $s2, $a0, $zero
/* 3BBF84 E00BE024 AFB1002C */  sw        $s1, 0x2C($sp)
/* 3BBF88 E00BE028 8FB1006C */  lw        $s1, 0x6C($sp)
/* 3BBF8C E00BE02C 27A40010 */  addiu     $a0, $sp, 0x10
/* 3BBF90 E00BE030 AFBF003C */  sw        $ra, 0x3C($sp)
/* 3BBF94 E00BE034 AFB40038 */  sw        $s4, 0x38($sp)
/* 3BBF98 E00BE038 AFB30034 */  sw        $s3, 0x34($sp)
/* 3BBF9C E00BE03C 06400009 */  bltz      $s2, .LE00BE064
/* 3BBFA0 E00BE040 AFB00028 */   sw       $s0, 0x28($sp)
/* 3BBFA4 E00BE044 2A420002 */  slti      $v0, $s2, 0x2
/* 3BBFA8 E00BE048 14400007 */  bnez      $v0, .LE00BE068
/* 3BBFAC E00BE04C 24100015 */   addiu    $s0, $zero, 0x15
/* 3BBFB0 E00BE050 24020002 */  addiu     $v0, $zero, 0x2
/* 3BBFB4 E00BE054 16420004 */  bne       $s2, $v0, .LE00BE068
/* 3BBFB8 E00BE058 2410000B */   addiu    $s0, $zero, 0xB
/* 3BBFBC E00BE05C 0802F81A */  j         .LE00BE068
/* 3BBFC0 E00BE060 24100029 */   addiu    $s0, $zero, 0x29
.LE00BE064:
/* 3BBFC4 E00BE064 2410000B */  addiu     $s0, $zero, 0xB
.LE00BE068:
/* 3BBFC8 E00BE068 3C02E00C */  lui       $v0, %hi(water_splash_init)
/* 3BBFCC E00BE06C 2442E39C */  addiu     $v0, $v0, %lo(water_splash_init)
/* 3BBFD0 E00BE070 AC820008 */  sw        $v0, 0x8($a0)
/* 3BBFD4 E00BE074 3C02E00C */  lui       $v0, %hi(water_splash_update)
/* 3BBFD8 E00BE078 2442E3A4 */  addiu     $v0, $v0, %lo(water_splash_update)
/* 3BBFDC E00BE07C AC82000C */  sw        $v0, 0xC($a0)
/* 3BBFE0 E00BE080 3C02E00C */  lui       $v0, %hi(water_splash_render)
/* 3BBFE4 E00BE084 2442E578 */  addiu     $v0, $v0, %lo(water_splash_render)
/* 3BBFE8 E00BE088 AC820010 */  sw        $v0, 0x10($a0)
/* 3BBFEC E00BE08C 2402005F */  addiu     $v0, $zero, 0x5F
/* 3BBFF0 E00BE090 AC800000 */  sw        $zero, 0x0($a0)
/* 3BBFF4 E00BE094 AC800014 */  sw        $zero, 0x14($a0)
/* 3BBFF8 E00BE098 0C080124 */  jal       shim_create_effect_instance
/* 3BBFFC E00BE09C AC820004 */   sw       $v0, 0x4($a0)
/* 3BC000 E00BE0A0 001020C0 */  sll       $a0, $s0, 3
/* 3BC004 E00BE0A4 00902023 */  subu      $a0, $a0, $s0
/* 3BC008 E00BE0A8 000420C0 */  sll       $a0, $a0, 3
/* 3BC00C E00BE0AC 0040982D */  daddu     $s3, $v0, $zero
/* 3BC010 E00BE0B0 0C08012C */  jal       shim_general_heap_malloc
/* 3BC014 E00BE0B4 AE700008 */   sw       $s0, 0x8($s3)
/* 3BC018 E00BE0B8 0040202D */  daddu     $a0, $v0, $zero
/* 3BC01C E00BE0BC 14800003 */  bnez      $a0, .LE00BE0CC
/* 3BC020 E00BE0C0 AE64000C */   sw       $a0, 0xC($s3)
.LE00BE0C4:
/* 3BC024 E00BE0C4 0802F831 */  j         .LE00BE0C4
/* 3BC028 E00BE0C8 00000000 */   nop
.LE00BE0CC:
/* 3BC02C E00BE0CC AC920000 */  sw        $s2, 0x0($a0)
/* 3BC030 E00BE0D0 1E200004 */  bgtz      $s1, .LE00BE0E4
/* 3BC034 E00BE0D4 AC800020 */   sw       $zero, 0x20($a0)
/* 3BC038 E00BE0D8 240203E8 */  addiu     $v0, $zero, 0x3E8
/* 3BC03C E00BE0DC 0802F83A */  j         .LE00BE0E8
/* 3BC040 E00BE0E0 AC82001C */   sw       $v0, 0x1C($a0)
.LE00BE0E4:
/* 3BC044 E00BE0E4 AC91001C */  sw        $s1, 0x1C($a0)
.LE00BE0E8:
/* 3BC048 E00BE0E8 240300FF */  addiu     $v1, $zero, 0xFF
/* 3BC04C E00BE0EC AC830030 */  sw        $v1, 0x30($a0)
/* 3BC050 E00BE0F0 E4940004 */  swc1      $f20, 0x4($a0)
/* 3BC054 E00BE0F4 E4960008 */  swc1      $f22, 0x8($a0)
/* 3BC058 E00BE0F8 E498000C */  swc1      $f24, 0xC($a0)
/* 3BC05C E00BE0FC C7A00068 */  lwc1      $f0, 0x68($sp)
/* 3BC060 E00BE100 24020046 */  addiu     $v0, $zero, 0x46
/* 3BC064 E00BE104 AC820024 */  sw        $v0, 0x24($a0)
/* 3BC068 E00BE108 240200B4 */  addiu     $v0, $zero, 0xB4
/* 3BC06C E00BE10C 24110001 */  addiu     $s1, $zero, 0x1
/* 3BC070 E00BE110 AC820028 */  sw        $v0, 0x28($a0)
/* 3BC074 E00BE114 AC83002C */  sw        $v1, 0x2C($a0)
/* 3BC078 E00BE118 E4800034 */  swc1      $f0, 0x34($a0)
/* 3BC07C E00BE11C 8E620008 */  lw        $v0, 0x8($s3)
/* 3BC080 E00BE120 0222102A */  slt       $v0, $s1, $v0
/* 3BC084 E00BE124 10400091 */  beqz      $v0, .LE00BE36C
/* 3BC088 E00BE128 24840038 */   addiu    $a0, $a0, 0x38
/* 3BC08C E00BE12C 24140002 */  addiu     $s4, $zero, 0x2
/* 3BC090 E00BE130 24900030 */  addiu     $s0, $a0, 0x30
/* 3BC094 E00BE134 3C013D8F */  lui       $at, (0x3D8F5C29 >> 16)
/* 3BC098 E00BE138 34215C29 */  ori       $at, $at, (0x3D8F5C29 & 0xFFFF)
/* 3BC09C E00BE13C 4481B000 */  mtc1      $at, $f22
/* 3BC0A0 E00BE140 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3BC0A4 E00BE144 4481A800 */  mtc1      $at, $f21
/* 3BC0A8 E00BE148 4480A000 */  mtc1      $zero, $f20
.LE00BE14C:
/* 3BC0AC E00BE14C 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BC0B0 E00BE150 44810000 */  mtc1      $at, $f0
/* 3BC0B4 E00BE154 24020001 */  addiu     $v0, $zero, 0x1
/* 3BC0B8 E00BE158 AE00FFD4 */  sw        $zero, -0x2C($s0)
/* 3BC0BC E00BE15C AE00FFD8 */  sw        $zero, -0x28($s0)
/* 3BC0C0 E00BE160 AE00FFDC */  sw        $zero, -0x24($s0)
/* 3BC0C4 E00BE164 12420022 */  beq       $s2, $v0, .LE00BE1F0
/* 3BC0C8 E00BE168 E6000004 */   swc1     $f0, 0x4($s0)
/* 3BC0CC E00BE16C 2A420002 */  slti      $v0, $s2, 0x2
/* 3BC0D0 E00BE170 10400005 */  beqz      $v0, .LE00BE188
/* 3BC0D4 E00BE174 00000000 */   nop
/* 3BC0D8 E00BE178 12400007 */  beqz      $s2, .LE00BE198
/* 3BC0DC E00BE17C 00000000 */   nop
/* 3BC0E0 E00BE180 0802F8B1 */  j         .LE00BE2C4
/* 3BC0E4 E00BE184 00000000 */   nop
.LE00BE188:
/* 3BC0E8 E00BE188 1254002F */  beq       $s2, $s4, .LE00BE248
/* 3BC0EC E00BE18C 00000000 */   nop
/* 3BC0F0 E00BE190 0802F8B1 */  j         .LE00BE2C4
/* 3BC0F4 E00BE194 00000000 */   nop
.LE00BE198:
/* 3BC0F8 E00BE198 0C080138 */  jal       shim_rand_int
/* 3BC0FC E00BE19C 2404000A */   addiu    $a0, $zero, 0xA
/* 3BC100 E00BE1A0 2404000A */  addiu     $a0, $zero, 0xA
/* 3BC104 E00BE1A4 2442FFFE */  addiu     $v0, $v0, -0x2
/* 3BC108 E00BE1A8 44820000 */  mtc1      $v0, $f0
/* 3BC10C E00BE1AC 00000000 */  nop
/* 3BC110 E00BE1B0 46800020 */  cvt.s.w   $f0, $f0
/* 3BC114 E00BE1B4 0C080138 */  jal       shim_rand_int
/* 3BC118 E00BE1B8 E600FFE0 */   swc1     $f0, -0x20($s0)
/* 3BC11C E00BE1BC 2404000A */  addiu     $a0, $zero, 0xA
/* 3BC120 E00BE1C0 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC124 E00BE1C4 44820000 */  mtc1      $v0, $f0
/* 3BC128 E00BE1C8 00000000 */  nop
/* 3BC12C E00BE1CC 46800020 */  cvt.s.w   $f0, $f0
/* 3BC130 E00BE1D0 0C080138 */  jal       shim_rand_int
/* 3BC134 E00BE1D4 E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 3BC138 E00BE1D8 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC13C E00BE1DC 44820000 */  mtc1      $v0, $f0
/* 3BC140 E00BE1E0 00000000 */  nop
/* 3BC144 E00BE1E4 46800020 */  cvt.s.w   $f0, $f0
/* 3BC148 E00BE1E8 0802F8D4 */  j         .LE00BE350
/* 3BC14C E00BE1EC E600FFE8 */   swc1     $f0, -0x18($s0)
.LE00BE1F0:
/* 3BC150 E00BE1F0 0C080138 */  jal       shim_rand_int
/* 3BC154 E00BE1F4 2404000A */   addiu    $a0, $zero, 0xA
/* 3BC158 E00BE1F8 2404000A */  addiu     $a0, $zero, 0xA
/* 3BC15C E00BE1FC 02821023 */  subu      $v0, $s4, $v0
/* 3BC160 E00BE200 44820000 */  mtc1      $v0, $f0
/* 3BC164 E00BE204 00000000 */  nop
/* 3BC168 E00BE208 46800020 */  cvt.s.w   $f0, $f0
/* 3BC16C E00BE20C 0C080138 */  jal       shim_rand_int
/* 3BC170 E00BE210 E600FFE0 */   swc1     $f0, -0x20($s0)
/* 3BC174 E00BE214 2404000A */  addiu     $a0, $zero, 0xA
/* 3BC178 E00BE218 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC17C E00BE21C 44820000 */  mtc1      $v0, $f0
/* 3BC180 E00BE220 00000000 */  nop
/* 3BC184 E00BE224 46800020 */  cvt.s.w   $f0, $f0
/* 3BC188 E00BE228 0C080138 */  jal       shim_rand_int
/* 3BC18C E00BE22C E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 3BC190 E00BE230 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC194 E00BE234 44820000 */  mtc1      $v0, $f0
/* 3BC198 E00BE238 00000000 */  nop
/* 3BC19C E00BE23C 46800020 */  cvt.s.w   $f0, $f0
/* 3BC1A0 E00BE240 0802F8D4 */  j         .LE00BE350
/* 3BC1A4 E00BE244 E600FFE8 */   swc1     $f0, -0x18($s0)
.LE00BE248:
/* 3BC1A8 E00BE248 0C080138 */  jal       shim_rand_int
/* 3BC1AC E00BE24C 24040064 */   addiu    $a0, $zero, 0x64
/* 3BC1B0 E00BE250 2442FFCE */  addiu     $v0, $v0, -0x32
/* 3BC1B4 E00BE254 44820000 */  mtc1      $v0, $f0
/* 3BC1B8 E00BE258 00000000 */  nop
/* 3BC1BC E00BE25C 46800020 */  cvt.s.w   $f0, $f0
/* 3BC1C0 E00BE260 46160002 */  mul.s     $f0, $f0, $f22
/* 3BC1C4 E00BE264 00000000 */  nop
/* 3BC1C8 E00BE268 24040064 */  addiu     $a0, $zero, 0x64
/* 3BC1CC E00BE26C 0C080138 */  jal       shim_rand_int
/* 3BC1D0 E00BE270 E600FFE0 */   swc1     $f0, -0x20($s0)
/* 3BC1D4 E00BE274 2442000A */  addiu     $v0, $v0, 0xA
/* 3BC1D8 E00BE278 3C013E4C */  lui       $at, (0x3E4CCCCD >> 16)
/* 3BC1DC E00BE27C 3421CCCD */  ori       $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 3BC1E0 E00BE280 44811000 */  mtc1      $at, $f2
/* 3BC1E4 E00BE284 44820000 */  mtc1      $v0, $f0
/* 3BC1E8 E00BE288 00000000 */  nop
/* 3BC1EC E00BE28C 46800020 */  cvt.s.w   $f0, $f0
/* 3BC1F0 E00BE290 46020002 */  mul.s     $f0, $f0, $f2
/* 3BC1F4 E00BE294 00000000 */  nop
/* 3BC1F8 E00BE298 24040064 */  addiu     $a0, $zero, 0x64
/* 3BC1FC E00BE29C 0C080138 */  jal       shim_rand_int
/* 3BC200 E00BE2A0 E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 3BC204 E00BE2A4 2442FFCE */  addiu     $v0, $v0, -0x32
/* 3BC208 E00BE2A8 44820000 */  mtc1      $v0, $f0
/* 3BC20C E00BE2AC 00000000 */  nop
/* 3BC210 E00BE2B0 46800020 */  cvt.s.w   $f0, $f0
/* 3BC214 E00BE2B4 46160002 */  mul.s     $f0, $f0, $f22
/* 3BC218 E00BE2B8 00000000 */  nop
/* 3BC21C E00BE2BC 0802F8D4 */  j         .LE00BE350
/* 3BC220 E00BE2C0 E600FFE8 */   swc1     $f0, -0x18($s0)
.LE00BE2C4:
/* 3BC224 E00BE2C4 0C080138 */  jal       shim_rand_int
/* 3BC228 E00BE2C8 2404000A */   addiu    $a0, $zero, 0xA
/* 3BC22C E00BE2CC 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC230 E00BE2D0 44820000 */  mtc1      $v0, $f0
/* 3BC234 E00BE2D4 00000000 */  nop
/* 3BC238 E00BE2D8 46800021 */  cvt.d.w   $f0, $f0
/* 3BC23C E00BE2DC 46340002 */  mul.d     $f0, $f0, $f20
/* 3BC240 E00BE2E0 00000000 */  nop
/* 3BC244 E00BE2E4 2404000A */  addiu     $a0, $zero, 0xA
/* 3BC248 E00BE2E8 46200020 */  cvt.s.d   $f0, $f0
/* 3BC24C E00BE2EC 0C080138 */  jal       shim_rand_int
/* 3BC250 E00BE2F0 E600FFE0 */   swc1     $f0, -0x20($s0)
/* 3BC254 E00BE2F4 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC258 E00BE2F8 44820000 */  mtc1      $v0, $f0
/* 3BC25C E00BE2FC 00000000 */  nop
/* 3BC260 E00BE300 46800021 */  cvt.d.w   $f0, $f0
/* 3BC264 E00BE304 46340002 */  mul.d     $f0, $f0, $f20
/* 3BC268 E00BE308 00000000 */  nop
/* 3BC26C E00BE30C 2404000A */  addiu     $a0, $zero, 0xA
/* 3BC270 E00BE310 46200020 */  cvt.s.d   $f0, $f0
/* 3BC274 E00BE314 0C080138 */  jal       shim_rand_int
/* 3BC278 E00BE318 E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 3BC27C E00BE31C 2442FFFB */  addiu     $v0, $v0, -0x5
/* 3BC280 E00BE320 44820000 */  mtc1      $v0, $f0
/* 3BC284 E00BE324 00000000 */  nop
/* 3BC288 E00BE328 46800021 */  cvt.d.w   $f0, $f0
/* 3BC28C E00BE32C 46340002 */  mul.d     $f0, $f0, $f20
/* 3BC290 E00BE330 00000000 */  nop
/* 3BC294 E00BE334 3C013ECC */  lui       $at, (0x3ECCCCCD >> 16)
/* 3BC298 E00BE338 3421CCCD */  ori       $at, $at, (0x3ECCCCCD & 0xFFFF)
/* 3BC29C E00BE33C 44811000 */  mtc1      $at, $f2
/* 3BC2A0 E00BE340 AE11FFEC */  sw        $s1, -0x14($s0)
/* 3BC2A4 E00BE344 E6020004 */  swc1      $f2, 0x4($s0)
/* 3BC2A8 E00BE348 46200020 */  cvt.s.d   $f0, $f0
/* 3BC2AC E00BE34C E600FFE8 */  swc1      $f0, -0x18($s0)
.LE00BE350:
/* 3BC2B0 E00BE350 26310001 */  addiu     $s1, $s1, 0x1
/* 3BC2B4 E00BE354 240200FF */  addiu     $v0, $zero, 0xFF
/* 3BC2B8 E00BE358 AE020000 */  sw        $v0, 0x0($s0)
/* 3BC2BC E00BE35C 8E620008 */  lw        $v0, 0x8($s3)
/* 3BC2C0 E00BE360 0222102A */  slt       $v0, $s1, $v0
/* 3BC2C4 E00BE364 1440FF79 */  bnez      $v0, .LE00BE14C
/* 3BC2C8 E00BE368 26100038 */   addiu    $s0, $s0, 0x38
.LE00BE36C:
/* 3BC2CC E00BE36C 0260102D */  daddu     $v0, $s3, $zero
/* 3BC2D0 E00BE370 8FBF003C */  lw        $ra, 0x3C($sp)
/* 3BC2D4 E00BE374 8FB40038 */  lw        $s4, 0x38($sp)
/* 3BC2D8 E00BE378 8FB30034 */  lw        $s3, 0x34($sp)
/* 3BC2DC E00BE37C 8FB20030 */  lw        $s2, 0x30($sp)
/* 3BC2E0 E00BE380 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3BC2E4 E00BE384 8FB00028 */  lw        $s0, 0x28($sp)
/* 3BC2E8 E00BE388 D7B80050 */  ldc1      $f24, 0x50($sp)
/* 3BC2EC E00BE38C D7B60048 */  ldc1      $f22, 0x48($sp)
/* 3BC2F0 E00BE390 D7B40040 */  ldc1      $f20, 0x40($sp)
/* 3BC2F4 E00BE394 03E00008 */  jr        $ra
/* 3BC2F8 E00BE398 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

EffectInstance* water_splash_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance *effect;
    WaterSplashFXData* part;
    s32 i;
    s32 numParts;

    switch (arg0) {
        case 0:
        case 1:
            numParts = 21;
            break;
        case 2:
            numParts = 41;
            break;
        default:
            numParts = 11;
            break;
    }

    bpPtr->init = water_splash_init;
    bpPtr->update = water_splash_update;
    bpPtr->renderWorld = water_splash_render;
    bpPtr->unk_00 = 0;
    bpPtr->renderUI = NULL;
    bpPtr->effectID = EFFECT_WATER_SPLASH;
    effect = shim_create_effect_instance(bpPtr);
    effect->numParts = numParts;
    effect->data.waterSplash = part = shim_general_heap_malloc(numParts * sizeof(*part));
    ASSERT(part != NULL);

    part->unk_00 = arg0;
    part->unk_20 = 0;
    if (arg5 <= 0) {
        part->unk_1C = 1000;
    } else {
        part->unk_1C = arg5;
    }
    part->unk_30 = 255;
    part->unk_04.x = arg1;
    part->unk_04.y = arg2;
    part->unk_04.z = arg3;
    part->unk_34 = arg4;
    part->unk_24 = 70;
    part->unk_28 = 180;
    part->unk_2C = 255;
    part++;

    for (i = 1; i < effect->numParts; i++, part++) {
        part->unk_04.x = 0.0f;
        part->unk_04.y = 0.0f;
        part->unk_04.z = 0.0f;
        part->unk_34 = 2.0f;
        switch (arg0) {
            case 0:
                part->unk_10.x = shim_rand_int(10) - 2;
                part->unk_10.y = shim_rand_int(10) - 5;
                part->unk_10.z = shim_rand_int(10) - 5;
                break;
            case 1:
                part->unk_10.x = 2 - shim_rand_int(10);
                part->unk_10.y = shim_rand_int(10) - 5;
                part->unk_10.z = shim_rand_int(10) - 5;
                break;
            case 2:
                part->unk_10.x = (shim_rand_int(100) - 50) * 0.07f;
                part->unk_10.y = (shim_rand_int(100) + 10) * 0.2f;
                part->unk_10.z = (shim_rand_int(100) - 50) * 0.07f;
                break;
            default:
                part->unk_10.x = (shim_rand_int(10) - 5) * 0.5;
                part->unk_10.y = (shim_rand_int(10) - 5) * 0.5;
                part->unk_10.z = (shim_rand_int(10) - 5) * 0.5;
                part->unk_1C = i;
                part->unk_34 = 0.4f;
                break;
        }
        part->unk_30 = 0xFF;
    }
    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel D_80258E14
/* 1876F4 80258E14 27BDFCE8 */  addiu     $sp, $sp, -0x318
/* 1876F8 80258E18 AFB002D8 */  sw        $s0, 0x2D8($sp)
/* 1876FC 80258E1C 3C10800E */  lui       $s0, %hi(gBattleStatus + 0xD8)
/* 187700 80258E20 8E10C148 */  lw        $s0, %lo(gBattleStatus + 0xD8)($s0)
/* 187704 80258E24 AFBF02F8 */  sw        $ra, 0x2F8($sp)
/* 187708 80258E28 AFB702F4 */  sw        $s7, 0x2F4($sp)
/* 18770C 80258E2C AFB602F0 */  sw        $s6, 0x2F0($sp)
/* 187710 80258E30 AFB502EC */  sw        $s5, 0x2EC($sp)
/* 187714 80258E34 AFB402E8 */  sw        $s4, 0x2E8($sp)
/* 187718 80258E38 AFB302E4 */  sw        $s3, 0x2E4($sp)
/* 18771C 80258E3C AFB202E0 */  sw        $s2, 0x2E0($sp)
/* 187720 80258E40 AFB102DC */  sw        $s1, 0x2DC($sp)
/* 187724 80258E44 F7B80310 */  sdc1      $f24, 0x310($sp)
/* 187728 80258E48 F7B60308 */  sdc1      $f22, 0x308($sp)
/* 18772C 80258E4C F7B40300 */  sdc1      $f20, 0x300($sp)
/* 187730 80258E50 86020150 */  lh        $v0, 0x150($s0)
/* 187734 80258E54 C6040144 */  lwc1      $f4, 0x144($s0)
/* 187738 80258E58 C6020148 */  lwc1      $f2, 0x148($s0)
/* 18773C 80258E5C 44820000 */  mtc1      $v0, $f0
/* 187740 80258E60 00000000 */  nop
/* 187744 80258E64 46800020 */  cvt.s.w   $f0, $f0
/* 187748 80258E68 46002100 */  add.s     $f4, $f4, $f0
/* 18774C 80258E6C 86020152 */  lh        $v0, 0x152($s0)
/* 187750 80258E70 8E1301F4 */  lw        $s3, 0x1F4($s0)
/* 187754 80258E74 44820000 */  mtc1      $v0, $f0
/* 187758 80258E78 00000000 */  nop
/* 18775C 80258E7C 46800020 */  cvt.s.w   $f0, $f0
/* 187760 80258E80 46001080 */  add.s     $f2, $f2, $f0
/* 187764 80258E84 86620068 */  lh        $v0, 0x68($s3)
/* 187768 80258E88 44820000 */  mtc1      $v0, $f0
/* 18776C 80258E8C 00000000 */  nop
/* 187770 80258E90 46800020 */  cvt.s.w   $f0, $f0
/* 187774 80258E94 46002100 */  add.s     $f4, $f4, $f0
/* 187778 80258E98 8662006A */  lh        $v0, 0x6A($s3)
/* 18777C 80258E9C 44820000 */  mtc1      $v0, $f0
/* 187780 80258EA0 00000000 */  nop
/* 187784 80258EA4 46800020 */  cvt.s.w   $f0, $f0
/* 187788 80258EA8 46001080 */  add.s     $f2, $f2, $f0
/* 18778C 80258EAC 86020154 */  lh        $v0, 0x154($s0)
/* 187790 80258EB0 C600014C */  lwc1      $f0, 0x14C($s0)
/* 187794 80258EB4 44061000 */  mfc1      $a2, $f2
/* 187798 80258EB8 44821000 */  mtc1      $v0, $f2
/* 18779C 80258EBC 00000000 */  nop
/* 1877A0 80258EC0 468010A0 */  cvt.s.w   $f2, $f2
/* 1877A4 80258EC4 46020000 */  add.s     $f0, $f0, $f2
/* 1877A8 80258EC8 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 1877AC 80258ECC 44811000 */  mtc1      $at, $f2
/* 1877B0 80258ED0 00000000 */  nop
/* 1877B4 80258ED4 46020001 */  sub.s     $f0, $f0, $f2
/* 1877B8 80258ED8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 1877BC 80258EDC 4481B000 */  mtc1      $at, $f22
/* 1877C0 80258EE0 27B701D8 */  addiu     $s7, $sp, 0x1D8
/* 1877C4 80258EE4 46160001 */  sub.s     $f0, $f0, $f22
/* 1877C8 80258EE8 C618018C */  lwc1      $f24, 0x18C($s0)
/* 1877CC 80258EEC 44052000 */  mfc1      $a1, $f4
/* 1877D0 80258EF0 44070000 */  mfc1      $a3, $f0
/* 1877D4 80258EF4 02E0202D */  daddu     $a0, $s7, $zero
/* 1877D8 80258EF8 0C019E40 */  jal       guTranslateF
/* 1877DC 80258EFC E6780064 */   swc1     $f24, 0x64($s3)
/* 1877E0 80258F00 86020168 */  lh        $v0, 0x168($s0)
/* 1877E4 80258F04 C6020188 */  lwc1      $f2, 0x188($s0)
/* 1877E8 80258F08 00021023 */  negu      $v0, $v0
/* 1877EC 80258F0C 44820000 */  mtc1      $v0, $f0
/* 1877F0 80258F10 00000000 */  nop
/* 1877F4 80258F14 46800020 */  cvt.s.w   $f0, $f0
/* 1877F8 80258F18 46020002 */  mul.s     $f0, $f0, $f2
/* 1877FC 80258F1C 00000000 */  nop
/* 187800 80258F20 8602016A */  lh        $v0, 0x16A($s0)
/* 187804 80258F24 00021023 */  negu      $v0, $v0
/* 187808 80258F28 44050000 */  mfc1      $a1, $f0
/* 18780C 80258F2C 44820000 */  mtc1      $v0, $f0
/* 187810 80258F30 00000000 */  nop
/* 187814 80258F34 46800020 */  cvt.s.w   $f0, $f0
/* 187818 80258F38 46020002 */  mul.s     $f0, $f0, $f2
/* 18781C 80258F3C 00000000 */  nop
/* 187820 80258F40 8602016C */  lh        $v0, 0x16C($s0)
/* 187824 80258F44 00021023 */  negu      $v0, $v0
/* 187828 80258F48 44060000 */  mfc1      $a2, $f0
/* 18782C 80258F4C 44820000 */  mtc1      $v0, $f0
/* 187830 80258F50 00000000 */  nop
/* 187834 80258F54 46800020 */  cvt.s.w   $f0, $f0
/* 187838 80258F58 46020002 */  mul.s     $f0, $f0, $f2
/* 18783C 80258F5C 00000000 */  nop
/* 187840 80258F60 27B60158 */  addiu     $s6, $sp, 0x158
/* 187844 80258F64 44070000 */  mfc1      $a3, $f0
/* 187848 80258F68 0C019E40 */  jal       guTranslateF
/* 18784C 80258F6C 02C0202D */   daddu    $a0, $s6, $zero
/* 187850 80258F70 86020168 */  lh        $v0, 0x168($s0)
/* 187854 80258F74 C6020188 */  lwc1      $f2, 0x188($s0)
/* 187858 80258F78 44820000 */  mtc1      $v0, $f0
/* 18785C 80258F7C 00000000 */  nop
/* 187860 80258F80 46800020 */  cvt.s.w   $f0, $f0
/* 187864 80258F84 46020002 */  mul.s     $f0, $f0, $f2
/* 187868 80258F88 00000000 */  nop
/* 18786C 80258F8C 8602016A */  lh        $v0, 0x16A($s0)
/* 187870 80258F90 44050000 */  mfc1      $a1, $f0
/* 187874 80258F94 44820000 */  mtc1      $v0, $f0
/* 187878 80258F98 00000000 */  nop
/* 18787C 80258F9C 46800020 */  cvt.s.w   $f0, $f0
/* 187880 80258FA0 46020002 */  mul.s     $f0, $f0, $f2
/* 187884 80258FA4 00000000 */  nop
/* 187888 80258FA8 8602016C */  lh        $v0, 0x16C($s0)
/* 18788C 80258FAC 44060000 */  mfc1      $a2, $f0
/* 187890 80258FB0 44820000 */  mtc1      $v0, $f0
/* 187894 80258FB4 00000000 */  nop
/* 187898 80258FB8 46800020 */  cvt.s.w   $f0, $f0
/* 18789C 80258FBC 46020002 */  mul.s     $f0, $f0, $f2
/* 1878A0 80258FC0 00000000 */  nop
/* 1878A4 80258FC4 27B50198 */  addiu     $s5, $sp, 0x198
/* 1878A8 80258FC8 44070000 */  mfc1      $a3, $f0
/* 1878AC 80258FCC 4480A000 */  mtc1      $zero, $f20
/* 1878B0 80258FD0 0C019E40 */  jal       guTranslateF
/* 1878B4 80258FD4 02A0202D */   daddu    $a0, $s5, $zero
/* 1878B8 80258FD8 E7B40010 */  swc1      $f20, 0x10($sp)
/* 1878BC 80258FDC 8E05015C */  lw        $a1, 0x15C($s0)
/* 1878C0 80258FE0 4406B000 */  mfc1      $a2, $f22
/* 1878C4 80258FE4 4407A000 */  mfc1      $a3, $f20
/* 1878C8 80258FE8 0C019EC8 */  jal       guRotateF
/* 1878CC 80258FEC 27A40018 */   addiu    $a0, $sp, 0x18
/* 1878D0 80258FF0 27B10058 */  addiu     $s1, $sp, 0x58
/* 1878D4 80258FF4 E7B40010 */  swc1      $f20, 0x10($sp)
/* 1878D8 80258FF8 8E050160 */  lw        $a1, 0x160($s0)
/* 1878DC 80258FFC 4406A000 */  mfc1      $a2, $f20
/* 1878E0 80259000 4407B000 */  mfc1      $a3, $f22
/* 1878E4 80259004 0C019EC8 */  jal       guRotateF
/* 1878E8 80259008 0220202D */   daddu    $a0, $s1, $zero
/* 1878EC 8025900C 27B20098 */  addiu     $s2, $sp, 0x98
/* 1878F0 80259010 4406A000 */  mfc1      $a2, $f20
/* 1878F4 80259014 0240202D */  daddu     $a0, $s2, $zero
/* 1878F8 80259018 E7B60010 */  swc1      $f22, 0x10($sp)
/* 1878FC 8025901C 8E050164 */  lw        $a1, 0x164($s0)
/* 187900 80259020 0C019EC8 */  jal       guRotateF
/* 187904 80259024 00C0382D */   daddu    $a3, $a2, $zero
/* 187908 80259028 0220202D */  daddu     $a0, $s1, $zero
/* 18790C 8025902C 27A50018 */  addiu     $a1, $sp, 0x18
/* 187910 80259030 27B10218 */  addiu     $s1, $sp, 0x218
/* 187914 80259034 0C019D80 */  jal       guMtxCatF
/* 187918 80259038 0220302D */   daddu    $a2, $s1, $zero
/* 18791C 8025903C 0220202D */  daddu     $a0, $s1, $zero
/* 187920 80259040 0240282D */  daddu     $a1, $s2, $zero
/* 187924 80259044 27B400D8 */  addiu     $s4, $sp, 0xD8
/* 187928 80259048 0C019D80 */  jal       guMtxCatF
/* 18792C 8025904C 0280302D */   daddu    $a2, $s4, $zero
/* 187930 80259050 C6060170 */  lwc1      $f6, 0x170($s0)
/* 187934 80259054 3C01802A */  lui       $at, %hi(D_8029D398)
/* 187938 80259058 D428D398 */  ldc1      $f8, %lo(D_8029D398)($at)
/* 18793C 8025905C 460031A1 */  cvt.d.s   $f6, $f6
/* 187940 80259060 46283182 */  mul.d     $f6, $f6, $f8
/* 187944 80259064 00000000 */  nop
/* 187948 80259068 C6020174 */  lwc1      $f2, 0x174($s0)
/* 18794C 8025906C 460010A1 */  cvt.d.s   $f2, $f2
/* 187950 80259070 46281082 */  mul.d     $f2, $f2, $f8
/* 187954 80259074 00000000 */  nop
/* 187958 80259078 C6040178 */  lwc1      $f4, 0x178($s0)
/* 18795C 8025907C 46002121 */  cvt.d.s   $f4, $f4
/* 187960 80259080 46282102 */  mul.d     $f4, $f4, $f8
/* 187964 80259084 00000000 */  nop
/* 187968 80259088 C6000188 */  lwc1      $f0, 0x188($s0)
/* 18796C 8025908C 46000021 */  cvt.d.s   $f0, $f0
/* 187970 80259090 46203182 */  mul.d     $f6, $f6, $f0
/* 187974 80259094 00000000 */  nop
/* 187978 80259098 46201082 */  mul.d     $f2, $f2, $f0
/* 18797C 8025909C 00000000 */  nop
/* 187980 802590A0 82620074 */  lb        $v0, 0x74($s3)
/* 187984 802590A4 44820000 */  mtc1      $v0, $f0
/* 187988 802590A8 00000000 */  nop
/* 18798C 802590AC 46800021 */  cvt.d.w   $f0, $f0
/* 187990 802590B0 46201082 */  mul.d     $f2, $f2, $f0
/* 187994 802590B4 00000000 */  nop
/* 187998 802590B8 27B00118 */  addiu     $s0, $sp, 0x118
/* 18799C 802590BC 46202120 */  cvt.s.d   $f4, $f4
/* 1879A0 802590C0 44072000 */  mfc1      $a3, $f4
/* 1879A4 802590C4 462031A0 */  cvt.s.d   $f6, $f6
/* 1879A8 802590C8 44053000 */  mfc1      $a1, $f6
/* 1879AC 802590CC 462010A0 */  cvt.s.d   $f2, $f2
/* 1879B0 802590D0 44061000 */  mfc1      $a2, $f2
/* 1879B4 802590D4 0C019DF0 */  jal       guScaleF
/* 1879B8 802590D8 0200202D */   daddu    $a0, $s0, $zero
/* 1879BC 802590DC 27B20298 */  addiu     $s2, $sp, 0x298
/* 1879C0 802590E0 0C0950A2 */  jal       func_80254288
/* 1879C4 802590E4 0240202D */   daddu    $a0, $s2, $zero
/* 1879C8 802590E8 0200202D */  daddu     $a0, $s0, $zero
/* 1879CC 802590EC 02C0282D */  daddu     $a1, $s6, $zero
/* 1879D0 802590F0 0C019D80 */  jal       guMtxCatF
/* 1879D4 802590F4 0220302D */   daddu    $a2, $s1, $zero
/* 1879D8 802590F8 0220202D */  daddu     $a0, $s1, $zero
/* 1879DC 802590FC 0280282D */  daddu     $a1, $s4, $zero
/* 1879E0 80259100 0C019D80 */  jal       guMtxCatF
/* 1879E4 80259104 0220302D */   daddu    $a2, $s1, $zero
/* 1879E8 80259108 0220202D */  daddu     $a0, $s1, $zero
/* 1879EC 8025910C 02A0282D */  daddu     $a1, $s5, $zero
/* 1879F0 80259110 0C019D80 */  jal       guMtxCatF
/* 1879F4 80259114 0220302D */   daddu    $a2, $s1, $zero
/* 1879F8 80259118 0220202D */  daddu     $a0, $s1, $zero
/* 1879FC 8025911C 02E0282D */  daddu     $a1, $s7, $zero
/* 187A00 80259120 27B00258 */  addiu     $s0, $sp, 0x258
/* 187A04 80259124 0C019D80 */  jal       guMtxCatF
/* 187A08 80259128 0200302D */   daddu    $a2, $s0, $zero
/* 187A0C 8025912C 0200202D */  daddu     $a0, $s0, $zero
/* 187A10 80259130 0240282D */  daddu     $a1, $s2, $zero
/* 187A14 80259134 0C019D80 */  jal       guMtxCatF
/* 187A18 80259138 0200302D */   daddu    $a2, $s0, $zero
/* 187A1C 8025913C 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 187A20 80259140 44810000 */  mtc1      $at, $f0
/* 187A24 80259144 00000000 */  nop
/* 187A28 80259148 4600C600 */  add.s     $f24, $f24, $f0
/* 187A2C 8025914C 0C00A6C9 */  jal       clamp_angle
/* 187A30 80259150 4600C306 */   mov.s    $f12, $f24
/* 187A34 80259154 0000202D */  daddu     $a0, $zero, $zero
/* 187A38 80259158 0260282D */  daddu     $a1, $s3, $zero
/* 187A3C 8025915C 4600028D */  trunc.w.s $f10, $f0
/* 187A40 80259160 44065000 */  mfc1      $a2, $f10
/* 187A44 80259164 0C097210 */  jal       func_8025C840
/* 187A48 80259168 24070001 */   addiu    $a3, $zero, 0x1
/* 187A4C 8025916C 0C00A6C9 */  jal       clamp_angle
/* 187A50 80259170 4600C306 */   mov.s    $f12, $f24
/* 187A54 80259174 0000202D */  daddu     $a0, $zero, $zero
/* 187A58 80259178 0260282D */  daddu     $a1, $s3, $zero
/* 187A5C 8025917C 4600028D */  trunc.w.s $f10, $f0
/* 187A60 80259180 44065000 */  mfc1      $a2, $f10
/* 187A64 80259184 0C097332 */  jal       func_8025CCC8
/* 187A68 80259188 24070001 */   addiu    $a3, $zero, 0x1
/* 187A6C 8025918C 0C00A6C9 */  jal       clamp_angle
/* 187A70 80259190 4600C306 */   mov.s    $f12, $f24
/* 187A74 80259194 0000202D */  daddu     $a0, $zero, $zero
/* 187A78 80259198 0260282D */  daddu     $a1, $s3, $zero
/* 187A7C 8025919C 4600028D */  trunc.w.s $f10, $f0
/* 187A80 802591A0 44065000 */  mfc1      $a2, $f10
/* 187A84 802591A4 0200382D */  daddu     $a3, $s0, $zero
/* 187A88 802591A8 24020001 */  addiu     $v0, $zero, 0x1
/* 187A8C 802591AC 0C09647B */  jal       func_802591EC
/* 187A90 802591B0 AFA20010 */   sw       $v0, 0x10($sp)
/* 187A94 802591B4 8FBF02F8 */  lw        $ra, 0x2F8($sp)
/* 187A98 802591B8 8FB702F4 */  lw        $s7, 0x2F4($sp)
/* 187A9C 802591BC 8FB602F0 */  lw        $s6, 0x2F0($sp)
/* 187AA0 802591C0 8FB502EC */  lw        $s5, 0x2EC($sp)
/* 187AA4 802591C4 8FB402E8 */  lw        $s4, 0x2E8($sp)
/* 187AA8 802591C8 8FB302E4 */  lw        $s3, 0x2E4($sp)
/* 187AAC 802591CC 8FB202E0 */  lw        $s2, 0x2E0($sp)
/* 187AB0 802591D0 8FB102DC */  lw        $s1, 0x2DC($sp)
/* 187AB4 802591D4 8FB002D8 */  lw        $s0, 0x2D8($sp)
/* 187AB8 802591D8 D7B80310 */  ldc1      $f24, 0x310($sp)
/* 187ABC 802591DC D7B60308 */  ldc1      $f22, 0x308($sp)
/* 187AC0 802591E0 D7B40300 */  ldc1      $f20, 0x300($sp)
/* 187AC4 802591E4 03E00008 */  jr        $ra
/* 187AC8 802591E8 27BD0318 */   addiu    $sp, $sp, 0x318

### DECOMPILED C INSTRUCTIONS:

void appendGfx_player_actor_reflection(void* arg0) {
    Matrix4f mtxRotX, mtxRotY, mtxRotZ, mtxRotation, mtxScale;
    Matrix4f mtxPivotOn, mtxPivotOff, mtxTranslate;
    Matrix4f mtxTemp, mtxTransform, mtxMirror;
    Actor* player = gBattleStatus.playerActor;
    ActorPart* part = &player->partsTable[0];
    f32 playerYaw = player->yaw;
    f32 dx, dy, dz;

    dx = player->currentPos.x + player->headOffset.x;
    dx += part->palAnimPosOffset[0];
    dy = player->currentPos.y + player->headOffset.y;
    dy += part->palAnimPosOffset[1];
    dz = player->currentPos.z + player->headOffset.z - 5.0f;
    part->yaw = playerYaw;

    guTranslateF(mtxTranslate, dx, dy, dz - 1.0f);

    guTranslateF(mtxPivotOn,
        -player->rotationPivotOffset.x * player->scalingFactor,
        -player->rotationPivotOffset.y * player->scalingFactor,
        -player->rotationPivotOffset.z * player->scalingFactor);
    guTranslateF(mtxPivotOff,
        player->rotationPivotOffset.x * player->scalingFactor,
        player->rotationPivotOffset.y * player->scalingFactor,
        player->rotationPivotOffset.z * player->scalingFactor);

    guRotateF(mtxRotX, player->rotation.x, 1.0f, 0.0f, 0.0f);
    guRotateF(mtxRotY, player->rotation.y, 0.0f, 1.0f, 0.0f);
    guRotateF(mtxRotZ, player->rotation.z, 0.0f, 0.0f, 1.0f);
    guMtxCatF(mtxRotY, mtxRotX, mtxTemp);
    guMtxCatF(mtxTemp, mtxRotZ, mtxRotation);
    guScaleF(mtxScale,
        player->scale.x * SPRITE_WORLD_SCALE_D * player->scalingFactor,
        player->scale.y * SPRITE_WORLD_SCALE_D * player->scalingFactor * part->verticalStretch,
        player->scale.z * SPRITE_WORLD_SCALE_D);
    mtx_mirror_y(mtxMirror);

    guMtxCatF(mtxScale, mtxPivotOn, mtxTemp);
    guMtxCatF(mtxTemp, mtxRotation, mtxTemp);
    guMtxCatF(mtxTemp, mtxPivotOff, mtxTemp);
    guMtxCatF(mtxTemp, mtxTranslate, mtxTransform);
    guMtxCatF(mtxTransform, mtxMirror, mtxTransform);

    func_8025C840(0, part, clamp_angle(playerYaw + 180.0f), 1);
    func_8025CCC8(0, part, clamp_angle(playerYaw + 180.0f), 1);
    render_with_adjusted_palettes(SPRITE_MODE_PLAYER, part, clamp_angle(playerYaw + 180.0f), mtxTransform, TRUE);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ElectrifyActor
/* 19F23C 8027095C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 19F240 80270960 AFB20020 */  sw        $s2, 0x20($sp)
/* 19F244 80270964 0080902D */  daddu     $s2, $a0, $zero
/* 19F248 80270968 AFBF0024 */  sw        $ra, 0x24($sp)
/* 19F24C 8027096C AFB1001C */  sw        $s1, 0x1C($sp)
/* 19F250 80270970 AFB00018 */  sw        $s0, 0x18($sp)
/* 19F254 80270974 8E51000C */  lw        $s1, 0xC($s2)
/* 19F258 80270978 54A00001 */  bnel      $a1, $zero, .L80270980
/* 19F25C 8027097C AE400070 */   sw       $zero, 0x70($s2)
.L80270980:
/* 19F260 80270980 8E420070 */  lw        $v0, 0x70($s2)
/* 19F264 80270984 1440002D */  bnez      $v0, .L80270A3C
/* 19F268 80270988 00000000 */   nop
/* 19F26C 8027098C 8E250000 */  lw        $a1, 0x0($s1)
/* 19F270 80270990 26310004 */  addiu     $s1, $s1, 0x4
/* 19F274 80270994 0C0B1EAF */  jal       evt_get_variable
/* 19F278 80270998 0240202D */   daddu    $a0, $s2, $zero
/* 19F27C 8027099C 0040802D */  daddu     $s0, $v0, $zero
/* 19F280 802709A0 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 19F284 802709A4 16020002 */  bne       $s0, $v0, .L802709B0
/* 19F288 802709A8 00000000 */   nop
/* 19F28C 802709AC 8E500148 */  lw        $s0, 0x148($s2)
.L802709B0:
/* 19F290 802709B0 8E250000 */  lw        $a1, 0x0($s1)
/* 19F294 802709B4 0C0B1EAF */  jal       evt_get_variable
/* 19F298 802709B8 0240202D */   daddu    $a0, $s2, $zero
/* 19F29C 802709BC 0040882D */  daddu     $s1, $v0, $zero
/* 19F2A0 802709C0 0C09A75B */  jal       get_actor
/* 19F2A4 802709C4 0200202D */   daddu    $a0, $s0, $zero
/* 19F2A8 802709C8 0040802D */  daddu     $s0, $v0, $zero
/* 19F2AC 802709CC 24040008 */  addiu     $a0, $zero, 0x8
/* 19F2B0 802709D0 AE500074 */  sw        $s0, 0x74($s2)
/* 19F2B4 802709D4 0C093903 */  jal       func_8024E40C
/* 19F2B8 802709D8 AE510078 */   sw       $s1, 0x78($s2)
/* 19F2BC 802709DC 0C093978 */  jal       func_8024E5E0
/* 19F2C0 802709E0 2404000C */   addiu    $a0, $zero, 0xC
/* 19F2C4 802709E4 86040192 */  lh        $a0, 0x192($s0)
/* 19F2C8 802709E8 0C09390F */  jal       func_8024E43C
/* 19F2CC 802709EC 00000000 */   nop
/* 19F2D0 802709F0 0C093965 */  jal       func_8024E594
/* 19F2D4 802709F4 240400FA */   addiu    $a0, $zero, 0xFA
/* 19F2D8 802709F8 0C093936 */  jal       D_8024E4D8_C0BD58
/* 19F2DC 802709FC 2404000A */   addiu    $a0, $zero, 0xA
/* 19F2E0 80270A00 0C093983 */  jal       func_8024E60C
/* 19F2E4 80270A04 00000000 */   nop
/* 19F2E8 80270A08 8E020000 */  lw        $v0, 0x0($s0)
/* 19F2EC 80270A0C 30420800 */  andi      $v0, $v0, 0x800
/* 19F2F0 80270A10 10400004 */  beqz      $v0, .L80270A24
/* 19F2F4 80270A14 24020001 */   addiu    $v0, $zero, 0x1
/* 19F2F8 80270A18 0C093978 */  jal       func_8024E5E0
/* 19F2FC 80270A1C 0000202D */   daddu    $a0, $zero, $zero
/* 19F300 80270A20 24020001 */  addiu     $v0, $zero, 0x1
.L80270A24:
/* 19F304 80270A24 3C01802A */  lui       $at, %hi(D_8029FBD4)
/* 19F308 80270A28 A022FBD4 */  sb        $v0, %lo(D_8029FBD4)($at)
/* 19F30C 80270A2C 24020005 */  addiu     $v0, $zero, 0x5
/* 19F310 80270A30 AE42007C */  sw        $v0, 0x7C($s2)
/* 19F314 80270A34 24020001 */  addiu     $v0, $zero, 0x1
/* 19F318 80270A38 AE420070 */  sw        $v0, 0x70($s2)
.L80270A3C:
/* 19F31C 80270A3C 0C09A75B */  jal       get_actor
/* 19F320 80270A40 8E440148 */   lw       $a0, 0x148($s2)
/* 19F324 80270A44 8E500074 */  lw        $s0, 0x74($s2)
/* 19F328 80270A48 8E510078 */  lw        $s1, 0x78($s2)
/* 19F32C 80270A4C 86020150 */  lh        $v0, 0x150($s0)
/* 19F330 80270A50 8E030000 */  lw        $v1, 0x0($s0)
/* 19F334 80270A54 C6000144 */  lwc1      $f0, 0x144($s0)
/* 19F338 80270A58 44821000 */  mtc1      $v0, $f2
/* 19F33C 80270A5C 00000000 */  nop
/* 19F340 80270A60 468010A0 */  cvt.s.w   $f2, $f2
/* 19F344 80270A64 30620800 */  andi      $v0, $v1, 0x800
/* 19F348 80270A68 1040000E */  beqz      $v0, .L80270AA4
/* 19F34C 80270A6C 46020180 */   add.s    $f6, $f0, $f2
/* 19F350 80270A70 86020152 */  lh        $v0, 0x152($s0)
/* 19F354 80270A74 C6020148 */  lwc1      $f2, 0x148($s0)
/* 19F358 80270A78 44820000 */  mtc1      $v0, $f0
/* 19F35C 80270A7C 00000000 */  nop
/* 19F360 80270A80 46800020 */  cvt.s.w   $f0, $f0
/* 19F364 80270A84 92020191 */  lbu       $v0, 0x191($s0)
/* 19F368 80270A88 46001080 */  add.s     $f2, $f2, $f0
/* 19F36C 80270A8C 00021042 */  srl       $v0, $v0, 1
/* 19F370 80270A90 44820000 */  mtc1      $v0, $f0
/* 19F374 80270A94 00000000 */  nop
/* 19F378 80270A98 46800020 */  cvt.s.w   $f0, $f0
/* 19F37C 80270A9C 0809C2C4 */  j         .L80270B10
/* 19F380 80270AA0 46001101 */   sub.s    $f4, $f2, $f0
.L80270AA4:
/* 19F384 80270AA4 30628000 */  andi      $v0, $v1, 0x8000
/* 19F388 80270AA8 1440000E */  bnez      $v0, .L80270AE4
/* 19F38C 80270AAC 00000000 */   nop
/* 19F390 80270AB0 86020152 */  lh        $v0, 0x152($s0)
/* 19F394 80270AB4 C6020148 */  lwc1      $f2, 0x148($s0)
/* 19F398 80270AB8 44820000 */  mtc1      $v0, $f0
/* 19F39C 80270ABC 00000000 */  nop
/* 19F3A0 80270AC0 46800020 */  cvt.s.w   $f0, $f0
/* 19F3A4 80270AC4 92020191 */  lbu       $v0, 0x191($s0)
/* 19F3A8 80270AC8 46001080 */  add.s     $f2, $f2, $f0
/* 19F3AC 80270ACC 00021042 */  srl       $v0, $v0, 1
/* 19F3B0 80270AD0 44820000 */  mtc1      $v0, $f0
/* 19F3B4 80270AD4 00000000 */  nop
/* 19F3B8 80270AD8 46800020 */  cvt.s.w   $f0, $f0
/* 19F3BC 80270ADC 0809C2C4 */  j         .L80270B10
/* 19F3C0 80270AE0 46020100 */   add.s    $f4, $f0, $f2
.L80270AE4:
/* 19F3C4 80270AE4 86020152 */  lh        $v0, 0x152($s0)
/* 19F3C8 80270AE8 C6000148 */  lwc1      $f0, 0x148($s0)
/* 19F3CC 80270AEC 44821000 */  mtc1      $v0, $f2
/* 19F3D0 80270AF0 00000000 */  nop
/* 19F3D4 80270AF4 468010A0 */  cvt.s.w   $f2, $f2
/* 19F3D8 80270AF8 92020191 */  lbu       $v0, 0x191($s0)
/* 19F3DC 80270AFC 46020000 */  add.s     $f0, $f0, $f2
/* 19F3E0 80270B00 44821000 */  mtc1      $v0, $f2
/* 19F3E4 80270B04 00000000 */  nop
/* 19F3E8 80270B08 468010A0 */  cvt.s.w   $f2, $f2
/* 19F3EC 80270B0C 46020100 */  add.s     $f4, $f0, $f2
.L80270B10:
/* 19F3F0 80270B10 86020154 */  lh        $v0, 0x154($s0)
/* 19F3F4 80270B14 C600014C */  lwc1      $f0, 0x14C($s0)
/* 19F3F8 80270B18 44821000 */  mtc1      $v0, $f2
/* 19F3FC 80270B1C 00000000 */  nop
/* 19F400 80270B20 468010A0 */  cvt.s.w   $f2, $f2
/* 19F404 80270B24 46020000 */  add.s     $f0, $f0, $f2
/* 19F408 80270B28 8E420070 */  lw        $v0, 0x70($s2)
/* 19F40C 80270B2C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 19F410 80270B30 44811000 */  mtc1      $at, $f2
/* 19F414 80270B34 2443FFFF */  addiu     $v1, $v0, -0x1
/* 19F418 80270B38 2C620005 */  sltiu     $v0, $v1, 0x5
/* 19F41C 80270B3C 10400052 */  beqz      $v0, .L80270C88
/* 19F420 80270B40 46020080 */   add.s    $f2, $f0, $f2
/* 19F424 80270B44 00031080 */  sll       $v0, $v1, 2
/* 19F428 80270B48 3C01802A */  lui       $at, %hi(jtbl_8029D850)
/* 19F42C 80270B4C 00220821 */  addu      $at, $at, $v0
/* 19F430 80270B50 8C22D850 */  lw        $v0, %lo(jtbl_8029D850)($at)
/* 19F434 80270B54 00400008 */  jr        $v0
/* 19F438 80270B58 00000000 */   nop
glabel .L80270B5C
/* 19F43C 80270B5C 8E42007C */  lw        $v0, 0x7C($s2)
/* 19F440 80270B60 1440003C */  bnez      $v0, .L80270C54
/* 19F444 80270B64 2442FFFF */   addiu    $v0, $v0, -0x1
/* 19F448 80270B68 24040008 */  addiu     $a0, $zero, 0x8
/* 19F44C 80270B6C 44053000 */  mfc1      $a1, $f6
/* 19F450 80270B70 44062000 */  mfc1      $a2, $f4
/* 19F454 80270B74 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 19F458 80270B78 44810000 */  mtc1      $at, $f0
/* 19F45C 80270B7C 44071000 */  mfc1      $a3, $f2
/* 19F460 80270B80 2410001E */  addiu     $s0, $zero, 0x1E
/* 19F464 80270B84 AFB00014 */  sw        $s0, 0x14($sp)
/* 19F468 80270B88 0C01C64C */  jal       fx_snaking_static
/* 19F46C 80270B8C E7A00010 */   swc1     $f0, 0x10($sp)
/* 19F470 80270B90 0C0938F6 */  jal       func_8024E3D8
/* 19F474 80270B94 24040013 */   addiu    $a0, $zero, 0x13
/* 19F478 80270B98 24020002 */  addiu     $v0, $zero, 0x2
/* 19F47C 80270B9C AE50007C */  sw        $s0, 0x7C($s2)
/* 19F480 80270BA0 0809C322 */  j         .L80270C88
/* 19F484 80270BA4 AE420070 */   sw       $v0, 0x70($s2)
glabel .L80270BA8
/* 19F488 80270BA8 8E42007C */  lw        $v0, 0x7C($s2)
/* 19F48C 80270BAC 14400029 */  bnez      $v0, .L80270C54
/* 19F490 80270BB0 2442FFFF */   addiu    $v0, $v0, -0x1
/* 19F494 80270BB4 0200202D */  daddu     $a0, $s0, $zero
/* 19F498 80270BB8 0C09DC58 */  jal       dispatch_event_actor
/* 19F49C 80270BBC 2405003F */   addiu    $a1, $zero, 0x3F
/* 19F4A0 80270BC0 0C093903 */  jal       func_8024E40C
/* 19F4A4 80270BC4 24040002 */   addiu    $a0, $zero, 0x2
/* 19F4A8 80270BC8 0C093936 */  jal       D_8024E4D8_C0BD58
/* 19F4AC 80270BCC 2404000F */   addiu    $a0, $zero, 0xF
/* 19F4B0 80270BD0 0200202D */  daddu     $a0, $s0, $zero
/* 19F4B4 80270BD4 2405000B */  addiu     $a1, $zero, 0xB
/* 19F4B8 80270BD8 0C0997D0 */  jal       inflict_status
/* 19F4BC 80270BDC 0220302D */   daddu    $a2, $s1, $zero
/* 19F4C0 80270BE0 2402000F */  addiu     $v0, $zero, 0xF
/* 19F4C4 80270BE4 AE42007C */  sw        $v0, 0x7C($s2)
/* 19F4C8 80270BE8 24020003 */  addiu     $v0, $zero, 0x3
/* 19F4CC 80270BEC 0809C322 */  j         .L80270C88
/* 19F4D0 80270BF0 AE420070 */   sw       $v0, 0x70($s2)
glabel .L80270BF4
/* 19F4D4 80270BF4 8E42007C */  lw        $v0, 0x7C($s2)
/* 19F4D8 80270BF8 14400016 */  bnez      $v0, .L80270C54
/* 19F4DC 80270BFC 2442FFFF */   addiu    $v0, $v0, -0x1
/* 19F4E0 80270C00 24040022 */  addiu     $a0, $zero, 0x22
/* 19F4E4 80270C04 2405003C */  addiu     $a1, $zero, 0x3C
/* 19F4E8 80270C08 0C093E81 */  jal       func_8024FA04
/* 19F4EC 80270C0C 0220302D */   daddu    $a2, $s1, $zero
/* 19F4F0 80270C10 24020004 */  addiu     $v0, $zero, 0x4
/* 19F4F4 80270C14 0809C322 */  j         .L80270C88
/* 19F4F8 80270C18 AE420070 */   sw       $v0, 0x70($s2)
glabel .L80270C1C
/* 19F4FC 80270C1C 0C093EAD */  jal       func_8024FAB4
/* 19F500 80270C20 00000000 */   nop
/* 19F504 80270C24 14400019 */  bnez      $v0, .L80270C8C
/* 19F508 80270C28 0000102D */   daddu    $v0, $zero, $zero
/* 19F50C 80270C2C 0C093903 */  jal       func_8024E40C
/* 19F510 80270C30 24040002 */   addiu    $a0, $zero, 0x2
/* 19F514 80270C34 2402000A */  addiu     $v0, $zero, 0xA
/* 19F518 80270C38 AE42007C */  sw        $v0, 0x7C($s2)
/* 19F51C 80270C3C 24020005 */  addiu     $v0, $zero, 0x5
/* 19F520 80270C40 0809C322 */  j         .L80270C88
/* 19F524 80270C44 AE420070 */   sw       $v0, 0x70($s2)
glabel .L80270C48
/* 19F528 80270C48 8E42007C */  lw        $v0, 0x7C($s2)
/* 19F52C 80270C4C 10400003 */  beqz      $v0, .L80270C5C
/* 19F530 80270C50 2442FFFF */   addiu    $v0, $v0, -0x1
.L80270C54:
/* 19F534 80270C54 0809C322 */  j         .L80270C88
/* 19F538 80270C58 AE42007C */   sw       $v0, 0x7C($s2)
.L80270C5C:
/* 19F53C 80270C5C 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 19F540 80270C60 10400005 */  beqz      $v0, .L80270C78
/* 19F544 80270C64 00000000 */   nop
/* 19F548 80270C68 0C0B1059 */  jal       does_script_exist
/* 19F54C 80270C6C 8E0401E8 */   lw       $a0, 0x1E8($s0)
/* 19F550 80270C70 14400006 */  bnez      $v0, .L80270C8C
/* 19F554 80270C74 0000102D */   daddu    $v0, $zero, $zero
.L80270C78:
/* 19F558 80270C78 3C01802A */  lui       $at, %hi(D_8029FBD4)
/* 19F55C 80270C7C A020FBD4 */  sb        $zero, %lo(D_8029FBD4)($at)
/* 19F560 80270C80 0809C323 */  j         .L80270C8C
/* 19F564 80270C84 24020002 */   addiu    $v0, $zero, 0x2
.L80270C88:
/* 19F568 80270C88 0000102D */  daddu     $v0, $zero, $zero
.L80270C8C:
/* 19F56C 80270C8C 8FBF0024 */  lw        $ra, 0x24($sp)
/* 19F570 80270C90 8FB20020 */  lw        $s2, 0x20($sp)
/* 19F574 80270C94 8FB1001C */  lw        $s1, 0x1C($sp)
/* 19F578 80270C98 8FB00018 */  lw        $s0, 0x18($sp)
/* 19F57C 80270C9C 03E00008 */  jr        $ra
/* 19F580 80270CA0 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus ElectrifyActor(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    s32 actorID;
    Actor* actor;
    f32 x, y, z;
    s32 electrified;
    s32 flags;

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

    if (script->functionTemp[0] == 0) {
        actorID = evt_get_variable(script, *args++);
        if (actorID == ACTOR_SELF) {
            actorID = script->owner1.actorID;
        }
        electrified = evt_get_variable(script, *args++);
        actor = get_actor(actorID);
        script->functionTempPtr[1] = actor;
        script->functionTemp[2] = electrified;

        btl_cam_use_preset(BTL_CAM_PRESET_08);
        btl_cam_set_zoffset(12);
        btl_cam_target_actor(actor->actorID);
        btl_cam_set_zoom(250);
        btl_cam_move(10);
        func_8024E60C();
        if (actor->flags & ACTOR_FLAG_UPSIDE_DOWN) {
            btl_cam_set_zoffset(0);
        }

        D_8029FBD4 = 1;
        script->functionTemp[3] = 5;
        script->functionTemp[0] = 1;
    }
    get_actor(script->owner1.actorID);
    actor = script->functionTempPtr[1];
    electrified = script->functionTemp[2];

    flags = actor->flags;
    x = actor->currentPos.x + actor->headOffset.x;
    if (flags & ACTOR_FLAG_UPSIDE_DOWN) {
        y = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2;
    } else if (!(flags & ACTOR_FLAG_8000)) {
        y = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2;
    } else {
        y = actor->currentPos.y + actor->headOffset.y + actor->size.y;
    }
    z = actor->currentPos.z + actor->headOffset.z + 10.0f;

    switch (script->functionTemp[0]) {
        case 1:
            if (script->functionTemp[3] == 0) {
                fx_snaking_static(8, x, y, z, 1.0f, 30);
                btl_cam_use_preset_immediately(BTL_CAM_PRESET_19);
                script->functionTemp[3] = 0x1E;
                script->functionTemp[0] = 2;
            } else {
                script->functionTemp[3]--;
                break;
            }
            break;
        case 2:
            if (script->functionTemp[3] == 0) {
                dispatch_event_actor(actor, EVENT_SWAP_PARTNER);
                btl_cam_use_preset(BTL_CAM_DEFAULT);
                btl_cam_move(15);
                inflict_status(actor, 0xB, electrified);
                script->functionTemp[3] = 15;
                script->functionTemp[0] = 3;
            } else {
                script->functionTemp[3]--;
                break;
            }
            break;
        case 3:
            if (script->functionTemp[3] == 0) {
                btl_show_variable_battle_message(BTL_MSG_ENEMY_CHARGED, 60, electrified);
                script->functionTemp[0] = 4;
            } else {
                script->functionTemp[3]--;
                break;
            }
            break;
        case 4:
            if (btl_is_popup_displayed() == 0) {
                btl_cam_use_preset(BTL_CAM_DEFAULT);
                script->functionTemp[3] = 10;
                script->functionTemp[0] = 5;
            }
            break;
        case 5:
            if (script->functionTemp[3] != 0) {
                script->functionTemp[3]--;
                break;
            }
            if ((actor->handleEventScript == NULL) || !does_script_exist(actor->handleEventScriptID)) {
                D_8029FBD4 = 0;
                return ApiStatus_DONE2;
            }
            break;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel UpdatePlayerImgFX
/* F6ED0 802D2520 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* F6ED4 802D2524 AFB40030 */  sw        $s4, 0x30($sp)
/* F6ED8 802D2528 0080A02D */  daddu     $s4, $a0, $zero
/* F6EDC 802D252C AFBF0038 */  sw        $ra, 0x38($sp)
/* F6EE0 802D2530 AFB50034 */  sw        $s5, 0x34($sp)
/* F6EE4 802D2534 AFB3002C */  sw        $s3, 0x2C($sp)
/* F6EE8 802D2538 AFB20028 */  sw        $s2, 0x28($sp)
/* F6EEC 802D253C AFB10024 */  sw        $s1, 0x24($sp)
/* F6EF0 802D2540 AFB00020 */  sw        $s0, 0x20($sp)
/* F6EF4 802D2544 8E90000C */  lw        $s0, 0xC($s4)
/* F6EF8 802D2548 8E150000 */  lw        $s5, 0x0($s0)
/* F6EFC 802D254C 26100004 */  addiu     $s0, $s0, 0x4
/* F6F00 802D2550 8E050000 */  lw        $a1, 0x0($s0)
/* F6F04 802D2554 0C0B1EAF */  jal       evt_get_variable
/* F6F08 802D2558 26100004 */   addiu    $s0, $s0, 0x4
/* F6F0C 802D255C 02A0202D */  daddu     $a0, $s5, $zero
/* F6F10 802D2560 0000282D */  daddu     $a1, $zero, $zero
/* F6F14 802D2564 00A0302D */  daddu     $a2, $a1, $zero
/* F6F18 802D2568 00A0382D */  daddu     $a3, $a1, $zero
/* F6F1C 802D256C 0040882D */  daddu     $s1, $v0, $zero
/* F6F20 802D2570 AFA00010 */  sw        $zero, 0x10($sp)
/* F6F24 802D2574 AFA00014 */  sw        $zero, 0x14($sp)
/* F6F28 802D2578 0C0B77FE */  jal       set_player_imgfx_all
/* F6F2C 802D257C AFA00018 */   sw       $zero, 0x18($sp)
/* F6F30 802D2580 3C128011 */  lui       $s2, %hi(gPlayerStatus)
/* F6F34 802D2584 2652EFC8 */  addiu     $s2, $s2, %lo(gPlayerStatus)
/* F6F38 802D2588 2E22000E */  sltiu     $v0, $s1, 0xE
/* F6F3C 802D258C 104000AB */  beqz      $v0, .L802D283C
/* F6F40 802D2590 00111080 */   sll      $v0, $s1, 2
/* F6F44 802D2594 3C01802E */  lui       $at, %hi(jtbl_802DA208)
/* F6F48 802D2598 00220821 */  addu      $at, $at, $v0
/* F6F4C 802D259C 8C22A208 */  lw        $v0, %lo(jtbl_802DA208)($at)
/* F6F50 802D25A0 00400008 */  jr        $v0
/* F6F54 802D25A4 00000000 */   nop
glabel .L802D25A8
/* F6F58 802D25A8 02A0202D */  daddu     $a0, $s5, $zero
/* F6F5C 802D25AC 0000282D */  daddu     $a1, $zero, $zero
/* F6F60 802D25B0 00A0302D */  daddu     $a2, $a1, $zero
/* F6F64 802D25B4 00A0382D */  daddu     $a3, $a1, $zero
/* F6F68 802D25B8 3C03802E */  lui       $v1, %hi(PlayerImgFXFlags)
/* F6F6C 802D25BC 9463B5B0 */  lhu       $v1, %lo(PlayerImgFXFlags)($v1)
/* F6F70 802D25C0 2402000D */  addiu     $v0, $zero, 0xD
/* F6F74 802D25C4 A24200BE */  sb        $v0, 0xBE($s2)
/* F6F78 802D25C8 AFA00010 */  sw        $zero, 0x10($sp)
/* F6F7C 802D25CC 080B4A0C */  j         .L802D2830
/* F6F80 802D25D0 AFA00014 */   sw       $zero, 0x14($sp)
glabel .L802D25D4
/* F6F84 802D25D4 2402000D */  addiu     $v0, $zero, 0xD
/* F6F88 802D25D8 A24200BE */  sb        $v0, 0xBE($s2)
glabel .L802D25DC
/* F6F8C 802D25DC 02A0202D */  daddu     $a0, $s5, $zero
/* F6F90 802D25E0 0220282D */  daddu     $a1, $s1, $zero
/* F6F94 802D25E4 0000302D */  daddu     $a2, $zero, $zero
/* F6F98 802D25E8 3C02802E */  lui       $v0, %hi(PlayerImgFXFlags)
/* F6F9C 802D25EC 9442B5B0 */  lhu       $v0, %lo(PlayerImgFXFlags)($v0)
/* F6FA0 802D25F0 00C0382D */  daddu     $a3, $a2, $zero
/* F6FA4 802D25F4 AFA00010 */  sw        $zero, 0x10($sp)
/* F6FA8 802D25F8 AFA00014 */  sw        $zero, 0x14($sp)
/* F6FAC 802D25FC 080B4A0D */  j         .L802D2834
/* F6FB0 802D2600 AFA20018 */   sw       $v0, 0x18($sp)
glabel .L802D2604
/* F6FB4 802D2604 2402000D */  addiu     $v0, $zero, 0xD
/* F6FB8 802D2608 A24200BE */  sb        $v0, 0xBE($s2)
/* F6FBC 802D260C 8E050000 */  lw        $a1, 0x0($s0)
/* F6FC0 802D2610 26100004 */  addiu     $s0, $s0, 0x4
/* F6FC4 802D2614 0C0B1EAF */  jal       evt_get_variable
/* F6FC8 802D2618 0280202D */   daddu    $a0, $s4, $zero
/* F6FCC 802D261C 0040982D */  daddu     $s3, $v0, $zero
/* F6FD0 802D2620 8E050000 */  lw        $a1, 0x0($s0)
/* F6FD4 802D2624 26100004 */  addiu     $s0, $s0, 0x4
/* F6FD8 802D2628 0C0B1EAF */  jal       evt_get_variable
/* F6FDC 802D262C 0280202D */   daddu    $a0, $s4, $zero
/* F6FE0 802D2630 0040902D */  daddu     $s2, $v0, $zero
/* F6FE4 802D2634 8E050000 */  lw        $a1, 0x0($s0)
/* F6FE8 802D2638 0C0B1EAF */  jal       evt_get_variable
/* F6FEC 802D263C 0280202D */   daddu    $a0, $s4, $zero
/* F6FF0 802D2640 02A0202D */  daddu     $a0, $s5, $zero
/* F6FF4 802D2644 24050004 */  addiu     $a1, $zero, 0x4
/* F6FF8 802D2648 0260302D */  daddu     $a2, $s3, $zero
/* F6FFC 802D264C 3C03802E */  lui       $v1, %hi(PlayerImgFXFlags)
/* F7000 802D2650 9463B5B0 */  lhu       $v1, %lo(PlayerImgFXFlags)($v1)
/* F7004 802D2654 0240382D */  daddu     $a3, $s2, $zero
/* F7008 802D2658 AFA20010 */  sw        $v0, 0x10($sp)
/* F700C 802D265C 080B4A0C */  j         .L802D2830
/* F7010 802D2660 AFA00014 */   sw       $zero, 0x14($sp)
glabel .L802D2664
/* F7014 802D2664 2402000D */  addiu     $v0, $zero, 0xD
/* F7018 802D2668 A24200BE */  sb        $v0, 0xBE($s2)
/* F701C 802D266C 8E050000 */  lw        $a1, 0x0($s0)
/* F7020 802D2670 26100004 */  addiu     $s0, $s0, 0x4
/* F7024 802D2674 0C0B1EAF */  jal       evt_get_variable
/* F7028 802D2678 0280202D */   daddu    $a0, $s4, $zero
/* F702C 802D267C 0040982D */  daddu     $s3, $v0, $zero
/* F7030 802D2680 8E050000 */  lw        $a1, 0x0($s0)
/* F7034 802D2684 26100004 */  addiu     $s0, $s0, 0x4
/* F7038 802D2688 0C0B1EAF */  jal       evt_get_variable
/* F703C 802D268C 0280202D */   daddu    $a0, $s4, $zero
/* F7040 802D2690 0040902D */  daddu     $s2, $v0, $zero
/* F7044 802D2694 8E050000 */  lw        $a1, 0x0($s0)
/* F7048 802D2698 0C0B1EAF */  jal       evt_get_variable
/* F704C 802D269C 0280202D */   daddu    $a0, $s4, $zero
/* F7050 802D26A0 02A0202D */  daddu     $a0, $s5, $zero
/* F7054 802D26A4 24050006 */  addiu     $a1, $zero, 0x6
/* F7058 802D26A8 0260302D */  daddu     $a2, $s3, $zero
/* F705C 802D26AC 3C03802E */  lui       $v1, %hi(PlayerImgFXFlags)
/* F7060 802D26B0 9463B5B0 */  lhu       $v1, %lo(PlayerImgFXFlags)($v1)
/* F7064 802D26B4 0240382D */  daddu     $a3, $s2, $zero
/* F7068 802D26B8 AFA20010 */  sw        $v0, 0x10($sp)
/* F706C 802D26BC 080B4A0B */  j         .L802D282C
/* F7070 802D26C0 240200FF */   addiu    $v0, $zero, 0xFF
glabel .L802D26C4
/* F7074 802D26C4 24020016 */  addiu     $v0, $zero, 0x16
/* F7078 802D26C8 A24200BE */  sb        $v0, 0xBE($s2)
/* F707C 802D26CC 8E050000 */  lw        $a1, 0x0($s0)
/* F7080 802D26D0 0C0B1EAF */  jal       evt_get_variable
/* F7084 802D26D4 0280202D */   daddu    $a0, $s4, $zero
/* F7088 802D26D8 02A0202D */  daddu     $a0, $s5, $zero
/* F708C 802D26DC 24050007 */  addiu     $a1, $zero, 0x7
/* F7090 802D26E0 240600FF */  addiu     $a2, $zero, 0xFF
/* F7094 802D26E4 00C0382D */  daddu     $a3, $a2, $zero
/* F7098 802D26E8 3C08802E */  lui       $t0, %hi(PlayerImgFXFlags)
/* F709C 802D26EC 9508B5B0 */  lhu       $t0, %lo(PlayerImgFXFlags)($t0)
/* F70A0 802D26F0 00C0182D */  daddu     $v1, $a2, $zero
/* F70A4 802D26F4 AFA30010 */  sw        $v1, 0x10($sp)
/* F70A8 802D26F8 AFA20014 */  sw        $v0, 0x14($sp)
/* F70AC 802D26FC 080B4A0D */  j         .L802D2834
/* F70B0 802D2700 AFA80018 */   sw       $t0, 0x18($sp)
glabel .L802D2704
/* F70B4 802D2704 24020016 */  addiu     $v0, $zero, 0x16
/* F70B8 802D2708 A24200BE */  sb        $v0, 0xBE($s2)
/* F70BC 802D270C 8E050000 */  lw        $a1, 0x0($s0)
/* F70C0 802D2710 26100004 */  addiu     $s0, $s0, 0x4
/* F70C4 802D2714 0C0B1EAF */  jal       evt_get_variable
/* F70C8 802D2718 0280202D */   daddu    $a0, $s4, $zero
/* F70CC 802D271C 0040982D */  daddu     $s3, $v0, $zero
/* F70D0 802D2720 8E050000 */  lw        $a1, 0x0($s0)
/* F70D4 802D2724 26100004 */  addiu     $s0, $s0, 0x4
/* F70D8 802D2728 0C0B1EAF */  jal       evt_get_variable
/* F70DC 802D272C 0280202D */   daddu    $a0, $s4, $zero
/* F70E0 802D2730 0040902D */  daddu     $s2, $v0, $zero
/* F70E4 802D2734 8E050000 */  lw        $a1, 0x0($s0)
/* F70E8 802D2738 26100004 */  addiu     $s0, $s0, 0x4
/* F70EC 802D273C 0C0B1EAF */  jal       evt_get_variable
/* F70F0 802D2740 0280202D */   daddu    $a0, $s4, $zero
/* F70F4 802D2744 0040882D */  daddu     $s1, $v0, $zero
/* F70F8 802D2748 8E050000 */  lw        $a1, 0x0($s0)
/* F70FC 802D274C 0C0B1EAF */  jal       evt_get_variable
/* F7100 802D2750 0280202D */   daddu    $a0, $s4, $zero
/* F7104 802D2754 02A0202D */  daddu     $a0, $s5, $zero
/* F7108 802D2758 080B4A06 */  j         .L802D2818
/* F710C 802D275C 24050008 */   addiu    $a1, $zero, 0x8
glabel .L802D2760
/* F7110 802D2760 2402000D */  addiu     $v0, $zero, 0xD
/* F7114 802D2764 A24200BE */  sb        $v0, 0xBE($s2)
/* F7118 802D2768 8E050000 */  lw        $a1, 0x0($s0)
/* F711C 802D276C 26100004 */  addiu     $s0, $s0, 0x4
/* F7120 802D2770 0C0B1EAF */  jal       evt_get_variable
/* F7124 802D2774 0280202D */   daddu    $a0, $s4, $zero
/* F7128 802D2778 0040982D */  daddu     $s3, $v0, $zero
/* F712C 802D277C 8E050000 */  lw        $a1, 0x0($s0)
/* F7130 802D2780 26100004 */  addiu     $s0, $s0, 0x4
/* F7134 802D2784 0C0B1EAF */  jal       evt_get_variable
/* F7138 802D2788 0280202D */   daddu    $a0, $s4, $zero
/* F713C 802D278C 0040902D */  daddu     $s2, $v0, $zero
/* F7140 802D2790 8E050000 */  lw        $a1, 0x0($s0)
/* F7144 802D2794 0C0B1EAF */  jal       evt_get_variable
/* F7148 802D2798 0280202D */   daddu    $a0, $s4, $zero
/* F714C 802D279C 02A0202D */  daddu     $a0, $s5, $zero
/* F7150 802D27A0 24050005 */  addiu     $a1, $zero, 0x5
/* F7154 802D27A4 0260302D */  daddu     $a2, $s3, $zero
/* F7158 802D27A8 3C03802E */  lui       $v1, %hi(PlayerImgFXFlags)
/* F715C 802D27AC 9463B5B0 */  lhu       $v1, %lo(PlayerImgFXFlags)($v1)
/* F7160 802D27B0 0240382D */  daddu     $a3, $s2, $zero
/* F7164 802D27B4 AFA20010 */  sw        $v0, 0x10($sp)
/* F7168 802D27B8 080B4A0C */  j         .L802D2830
/* F716C 802D27BC AFA00014 */   sw       $zero, 0x14($sp)
glabel .L802D27C0
/* F7170 802D27C0 24020016 */  addiu     $v0, $zero, 0x16
/* F7174 802D27C4 A24200BE */  sb        $v0, 0xBE($s2)
/* F7178 802D27C8 8E050000 */  lw        $a1, 0x0($s0)
/* F717C 802D27CC 26100004 */  addiu     $s0, $s0, 0x4
/* F7180 802D27D0 0C0B1EAF */  jal       evt_get_variable
/* F7184 802D27D4 0280202D */   daddu    $a0, $s4, $zero
/* F7188 802D27D8 0040982D */  daddu     $s3, $v0, $zero
/* F718C 802D27DC 8E050000 */  lw        $a1, 0x0($s0)
/* F7190 802D27E0 26100004 */  addiu     $s0, $s0, 0x4
/* F7194 802D27E4 0C0B1EAF */  jal       evt_get_variable
/* F7198 802D27E8 0280202D */   daddu    $a0, $s4, $zero
/* F719C 802D27EC 0040902D */  daddu     $s2, $v0, $zero
/* F71A0 802D27F0 8E050000 */  lw        $a1, 0x0($s0)
/* F71A4 802D27F4 26100004 */  addiu     $s0, $s0, 0x4
/* F71A8 802D27F8 0C0B1EAF */  jal       evt_get_variable
/* F71AC 802D27FC 0280202D */   daddu    $a0, $s4, $zero
/* F71B0 802D2800 0040882D */  daddu     $s1, $v0, $zero
/* F71B4 802D2804 8E050000 */  lw        $a1, 0x0($s0)
/* F71B8 802D2808 0C0B1EAF */  jal       evt_get_variable
/* F71BC 802D280C 0280202D */   daddu    $a0, $s4, $zero
/* F71C0 802D2810 02A0202D */  daddu     $a0, $s5, $zero
/* F71C4 802D2814 2405000D */  addiu     $a1, $zero, 0xD
.L802D2818:
/* F71C8 802D2818 0260302D */  daddu     $a2, $s3, $zero
/* F71CC 802D281C 3C03802E */  lui       $v1, %hi(PlayerImgFXFlags)
/* F71D0 802D2820 9463B5B0 */  lhu       $v1, %lo(PlayerImgFXFlags)($v1)
/* F71D4 802D2824 0240382D */  daddu     $a3, $s2, $zero
/* F71D8 802D2828 AFB10010 */  sw        $s1, 0x10($sp)
.L802D282C:
/* F71DC 802D282C AFA20014 */  sw        $v0, 0x14($sp)
.L802D2830:
/* F71E0 802D2830 AFA30018 */  sw        $v1, 0x18($sp)
.L802D2834:
/* F71E4 802D2834 0C0B77FE */  jal       set_player_imgfx_all
/* F71E8 802D2838 00000000 */   nop
glabel .L802D283C
/* F71EC 802D283C 8FBF0038 */  lw        $ra, 0x38($sp)
/* F71F0 802D2840 8FB50034 */  lw        $s5, 0x34($sp)
/* F71F4 802D2844 8FB40030 */  lw        $s4, 0x30($sp)
/* F71F8 802D2848 8FB3002C */  lw        $s3, 0x2C($sp)
/* F71FC 802D284C 8FB20028 */  lw        $s2, 0x28($sp)
/* F7200 802D2850 8FB10024 */  lw        $s1, 0x24($sp)
/* F7204 802D2854 8FB00020 */  lw        $s0, 0x20($sp)
/* F7208 802D2858 24020002 */  addiu     $v0, $zero, 0x2
/* F720C 802D285C 3C01802E */  lui       $at, %hi(PlayerImgFXFlags)
/* F7210 802D2860 A420B5B0 */  sh        $zero, %lo(PlayerImgFXFlags)($at)
/* F7214 802D2864 03E00008 */  jr        $ra
/* F7218 802D2868 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

ApiStatus UpdatePlayerImgFX(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    PlayerStatus* playerStatus = &gPlayerStatus;
    s32 a0 = *args++;
    s32 imgfxType = evt_get_variable(script, *args++);
    s32 a2, a3, a4, a5;

    set_player_imgfx_all(a0, IMGFX_CLEAR, 0, 0, 0, 0, 0);

    switch (imgfxType) {
        case IMGFX_CLEAR:
            playerStatus->renderMode = RENDER_MODE_ALPHATEST;
            set_player_imgfx_all(a0, IMGFX_CLEAR, 0, 0, 0, 0, PlayerImgFXFlags);
            break;
        case IMGFX_UNK_2:
        case IMGFX_RESET:
            playerStatus->renderMode = RENDER_MODE_ALPHATEST;
        case IMGFX_UNK_1:
            set_player_imgfx_all(a0, imgfxType, 0, 0, 0, 0, PlayerImgFXFlags);
            break;
        case IMGFX_SET_WAVY:
            playerStatus->renderMode = RENDER_MODE_ALPHATEST;
            a2 = evt_get_variable(script, *args++);
            a3 = evt_get_variable(script, *args++);
            a4 = evt_get_variable(script, *args++);
            set_player_imgfx_all(a0, IMGFX_SET_WAVY, a2, a3, a4, 0, PlayerImgFXFlags);
            break;
        case IMGFX_SET_COLOR:
            playerStatus->renderMode = RENDER_MODE_ALPHATEST;
            a2 = evt_get_variable(script, *args++);
            a3 = evt_get_variable(script, *args++);
            a4 = evt_get_variable(script, *args++);
            set_player_imgfx_all(a0, IMGFX_SET_COLOR, a2, a3, a4, 255, PlayerImgFXFlags);
            break;
        case IMGFX_SET_ALPHA:
            playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
            a5 = evt_get_variable(script, *args++);
            set_player_imgfx_all(a0, IMGFX_SET_ALPHA, 255, 255, 255, a5, PlayerImgFXFlags);
            break;
        case IMGFX_SET_TINT:
            playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
            a2 = evt_get_variable(script, *args++);
            a3 = evt_get_variable(script, *args++);
            a4 = evt_get_variable(script, *args++);
            a5 = evt_get_variable(script, *args++);
            set_player_imgfx_all(a0, IMGFX_SET_TINT, a2, a3, a4, a5, PlayerImgFXFlags);
            break;
        case IMGFX_SET_ANIM:
            playerStatus->renderMode = RENDER_MODE_ALPHATEST;
            a2 = evt_get_variable(script, *args++);
            a3 = evt_get_variable(script, *args++);
            a4 = evt_get_variable(script, *args++);
            set_player_imgfx_all(a0, IMGFX_SET_ANIM, a2, a3, a4, 0, PlayerImgFXFlags);
            break;
        case IMGFX_HOLOGRAM:
            playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
            a2 = evt_get_variable(script, *args++);
            a3 = evt_get_variable(script, *args++);
            a4 = evt_get_variable(script, *args++);
            a5 = evt_get_variable(script, *args++);
            set_player_imgfx_all(a0, IMGFX_HOLOGRAM, a2, a3, a4, a5, PlayerImgFXFlags);
            break;
    }

    PlayerImgFXFlags = 0;
    return ApiStatus_DONE2;
}