### RAW ASSEMBLY INSTRUCTIONS:

glabel partner_put_away
/* 87E68 800EE9B8 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 87E6C 800EE9BC AFB00010 */  sw        $s0, 0x10($sp)
/* 87E70 800EE9C0 0080802D */  daddu     $s0, $a0, $zero
/* 87E74 800EE9C4 3C048011 */  lui       $a0, %hi(gPlayerStatus)
/* 87E78 800EE9C8 2484EFC8 */  addiu     $a0, $a0, %lo(gPlayerStatus)
/* 87E7C 800EE9CC AFB10014 */  sw        $s1, 0x14($sp)
/* 87E80 800EE9D0 3C118011 */  lui       $s1, %hi(wPartnerFollowState)
/* 87E84 800EE9D4 2631CFC8 */  addiu     $s1, $s1, %lo(wPartnerFollowState)
/* 87E88 800EE9D8 AFBF001C */  sw        $ra, 0x1C($sp)
/* 87E8C 800EE9DC AFB20018 */  sw        $s2, 0x18($sp)
/* 87E90 800EE9E0 F7BE0048 */  sdc1      $f30, 0x48($sp)
/* 87E94 800EE9E4 F7BC0040 */  sdc1      $f28, 0x40($sp)
/* 87E98 800EE9E8 F7BA0038 */  sdc1      $f26, 0x38($sp)
/* 87E9C 800EE9EC F7B80030 */  sdc1      $f24, 0x30($sp)
/* 87EA0 800EE9F0 F7B60028 */  sdc1      $f22, 0x28($sp)
/* 87EA4 800EE9F4 F7B40020 */  sdc1      $f20, 0x20($sp)
/* 87EA8 800EE9F8 86230000 */  lh        $v1, 0x0($s1)
/* 87EAC 800EE9FC 24120001 */  addiu     $s2, $zero, 0x1
/* 87EB0 800EEA00 10720062 */  beq       $v1, $s2, .L800EEB8C
/* 87EB4 800EEA04 28620002 */   slti     $v0, $v1, 0x2
/* 87EB8 800EEA08 10400005 */  beqz      $v0, .L800EEA20
/* 87EBC 800EEA0C 24020002 */   addiu    $v0, $zero, 0x2
/* 87EC0 800EEA10 10600007 */  beqz      $v1, .L800EEA30
/* 87EC4 800EEA14 0000102D */   daddu    $v0, $zero, $zero
/* 87EC8 800EEA18 0803BB25 */  j         .L800EEC94
/* 87ECC 800EEA1C 00000000 */   nop
.L800EEA20:
/* 87ED0 800EEA20 1062008C */  beq       $v1, $v0, .L800EEC54
/* 87ED4 800EEA24 0200202D */   daddu    $a0, $s0, $zero
/* 87ED8 800EEA28 0803BB25 */  j         .L800EEC94
/* 87EDC 800EEA2C 0000102D */   daddu    $v0, $zero, $zero
.L800EEA30:
/* 87EE0 800EEA30 2403FDFF */  addiu     $v1, $zero, -0x201
/* 87EE4 800EEA34 8E020000 */  lw        $v0, 0x0($s0)
/* 87EE8 800EEA38 C61A0038 */  lwc1      $f26, 0x38($s0)
/* 87EEC 800EEA3C C614003C */  lwc1      $f20, 0x3C($s0)
/* 87EF0 800EEA40 C6160040 */  lwc1      $f22, 0x40($s0)
/* 87EF4 800EEA44 3C013FCC */  lui       $at, (0x3FCCCCCD >> 16)
/* 87EF8 800EEA48 3421CCCD */  ori       $at, $at, (0x3FCCCCCD & 0xFFFF)
/* 87EFC 800EEA4C 44811000 */  mtc1      $at, $f2
/* 87F00 800EEA50 00431024 */  and       $v0, $v0, $v1
/* 87F04 800EEA54 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 87F08 800EEA58 00431024 */  and       $v0, $v0, $v1
/* 87F0C 800EEA5C AE020000 */  sw        $v0, 0x0($s0)
/* 87F10 800EEA60 C49C0028 */  lwc1      $f28, 0x28($a0)
/* 87F14 800EEA64 E61C0060 */  swc1      $f28, 0x60($s0)
/* 87F18 800EEA68 948200B0 */  lhu       $v0, 0xB0($a0)
/* 87F1C 800EEA6C C49E002C */  lwc1      $f30, 0x2C($a0)
/* 87F20 800EEA70 00021400 */  sll       $v0, $v0, 16
/* 87F24 800EEA74 00021C03 */  sra       $v1, $v0, 16
/* 87F28 800EEA78 000217C2 */  srl       $v0, $v0, 31
/* 87F2C 800EEA7C 00621821 */  addu      $v1, $v1, $v0
/* 87F30 800EEA80 00031843 */  sra       $v1, $v1, 1
/* 87F34 800EEA84 44830000 */  mtc1      $v1, $f0
/* 87F38 800EEA88 00000000 */  nop
/* 87F3C 800EEA8C 46800020 */  cvt.s.w   $f0, $f0
/* 87F40 800EEA90 4600F780 */  add.s     $f30, $f30, $f0
/* 87F44 800EEA94 4406E000 */  mfc1      $a2, $f28
/* 87F48 800EEA98 4600D306 */  mov.s     $f12, $f26
/* 87F4C 800EEA9C E61E0064 */  swc1      $f30, 0x64($s0)
/* 87F50 800EEAA0 C4980030 */  lwc1      $f24, 0x30($a0)
/* 87F54 800EEAA4 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 87F58 800EEAA8 44810000 */  mtc1      $at, $f0
/* 87F5C 800EEAAC 4407C000 */  mfc1      $a3, $f24
/* 87F60 800EEAB0 4600B386 */  mov.s     $f14, $f22
/* 87F64 800EEAB4 3C018010 */  lui       $at, %hi(wSavedPartnerPosX)
/* 87F68 800EEAB8 E43A833C */  swc1      $f26, %lo(wSavedPartnerPosX)($at)
/* 87F6C 800EEABC 3C018010 */  lui       $at, %hi(wSavedPartnerPosY)
/* 87F70 800EEAC0 E4348340 */  swc1      $f20, %lo(wSavedPartnerPosY)($at)
/* 87F74 800EEAC4 3C018010 */  lui       $at, %hi(wSavedPartnerPosZ)
/* 87F78 800EEAC8 E4368344 */  swc1      $f22, %lo(wSavedPartnerPosZ)($at)
/* 87F7C 800EEACC E6000018 */  swc1      $f0, 0x18($s0)
/* 87F80 800EEAD0 E6020014 */  swc1      $f2, 0x14($s0)
/* 87F84 800EEAD4 0C00A7B5 */  jal       dist2D
/* 87F88 800EEAD8 E6180068 */   swc1     $f24, 0x68($s0)
/* 87F8C 800EEADC 4600D306 */  mov.s     $f12, $f26
/* 87F90 800EEAE0 4406E000 */  mfc1      $a2, $f28
/* 87F94 800EEAE4 4407C000 */  mfc1      $a3, $f24
/* 87F98 800EEAE8 4600B386 */  mov.s     $f14, $f22
/* 87F9C 800EEAEC 0C00A720 */  jal       atan2
/* 87FA0 800EEAF0 E6000010 */   swc1     $f0, 0x10($s0)
/* 87FA4 800EEAF4 2402000F */  addiu     $v0, $zero, 0xF
/* 87FA8 800EEAF8 A602008E */  sh        $v0, 0x8E($s0)
/* 87FAC 800EEAFC 8602008E */  lh        $v0, 0x8E($s0)
/* 87FB0 800EEB00 C6020014 */  lwc1      $f2, 0x14($s0)
/* 87FB4 800EEB04 44823000 */  mtc1      $v0, $f6
/* 87FB8 800EEB08 00000000 */  nop
/* 87FBC 800EEB0C 468031A0 */  cvt.s.w   $f6, $f6
/* 87FC0 800EEB10 46061082 */  mul.s     $f2, $f2, $f6
/* 87FC4 800EEB14 00000000 */  nop
/* 87FC8 800EEB18 4614F501 */  sub.s     $f20, $f30, $f20
/* 87FCC 800EEB1C 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 87FD0 800EEB20 44812000 */  mtc1      $at, $f4
/* 87FD4 800EEB24 46061082 */  mul.s     $f2, $f2, $f6
/* 87FD8 800EEB28 00000000 */  nop
/* 87FDC 800EEB2C 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 87FE0 800EEB30 44814000 */  mtc1      $at, $f8
/* 87FE4 800EEB34 3C038011 */  lui       $v1, %hi(wCurrentPartnerId)
/* 87FE8 800EEB38 8C63CFD8 */  lw        $v1, %lo(wCurrentPartnerId)($v1)
/* 87FEC 800EEB3C E600000C */  swc1      $f0, 0xC($s0)
/* 87FF0 800EEB40 46041082 */  mul.s     $f2, $f2, $f4
/* 87FF4 800EEB44 00000000 */  nop
/* 87FF8 800EEB48 000310C0 */  sll       $v0, $v1, 3
/* 87FFC 800EEB4C 00431021 */  addu      $v0, $v0, $v1
/* 88000 800EEB50 00021080 */  sll       $v0, $v0, 2
/* 88004 800EEB54 C6040010 */  lwc1      $f4, 0x10($s0)
/* 88008 800EEB58 4602A500 */  add.s     $f20, $f20, $f2
/* 8800C 800EEB5C 46082103 */  div.s     $f4, $f4, $f8
/* 88010 800EEB60 E6040018 */  swc1      $f4, 0x18($s0)
/* 88014 800EEB64 4606A503 */  div.s     $f20, $f20, $f6
/* 88018 800EEB68 E614001C */  swc1      $f20, 0x1C($s0)
/* 8801C 800EEB6C 3C018010 */  lui       $at, %hi(gPartnerAnimations + 0x8)
/* 88020 800EEB70 00220821 */  addu      $at, $at, $v0
/* 88024 800EEB74 8C228350 */  lw        $v0, %lo(gPartnerAnimations + 0x8)($at)
/* 88028 800EEB78 0200202D */  daddu     $a0, $s0, $zero
/* 8802C 800EEB7C 0C00EB49 */  jal       enable_npc_blur
/* 88030 800EEB80 AC820028 */   sw       $v0, 0x28($a0)
/* 88034 800EEB84 0803BB24 */  j         .L800EEC90
/* 88038 800EEB88 A6320000 */   sh       $s2, 0x0($s1)
.L800EEB8C:
/* 8803C 800EEB8C C600001C */  lwc1      $f0, 0x1C($s0)
/* 88040 800EEB90 C6020014 */  lwc1      $f2, 0x14($s0)
/* 88044 800EEB94 46020001 */  sub.s     $f0, $f0, $f2
/* 88048 800EEB98 C602003C */  lwc1      $f2, 0x3C($s0)
/* 8804C 800EEB9C E600001C */  swc1      $f0, 0x1C($s0)
/* 88050 800EEBA0 46000106 */  mov.s     $f4, $f0
/* 88054 800EEBA4 46001080 */  add.s     $f2, $f2, $f0
/* 88058 800EEBA8 44800000 */  mtc1      $zero, $f0
/* 8805C 800EEBAC 00000000 */  nop
/* 88060 800EEBB0 4600203E */  c.le.s    $f4, $f0
/* 88064 800EEBB4 00000000 */  nop
/* 88068 800EEBB8 4500000A */  bc1f      .L800EEBE4
/* 8806C 800EEBBC E602003C */   swc1     $f2, 0x3C($s0)
/* 88070 800EEBC0 3C028011 */  lui       $v0, %hi(wCurrentPartnerId)
/* 88074 800EEBC4 8C42CFD8 */  lw        $v0, %lo(wCurrentPartnerId)($v0)
/* 88078 800EEBC8 000218C0 */  sll       $v1, $v0, 3
/* 8807C 800EEBCC 00621821 */  addu      $v1, $v1, $v0
/* 88080 800EEBD0 00031880 */  sll       $v1, $v1, 2
/* 88084 800EEBD4 3C028010 */  lui       $v0, %hi(gPartnerAnimations + 0xC)
/* 88088 800EEBD8 00431021 */  addu      $v0, $v0, $v1
/* 8808C 800EEBDC 8C428354 */  lw        $v0, %lo(gPartnerAnimations + 0xC)($v0)
/* 88090 800EEBE0 AE020028 */  sw        $v0, 0x28($s0)
.L800EEBE4:
/* 88094 800EEBE4 8E06000C */  lw        $a2, 0xC($s0)
/* 88098 800EEBE8 8E050018 */  lw        $a1, 0x18($s0)
/* 8809C 800EEBEC 0C00EA95 */  jal       npc_move_heading
/* 880A0 800EEBF0 0200202D */   daddu    $a0, $s0, $zero
/* 880A4 800EEBF4 8602008E */  lh        $v0, 0x8E($s0)
/* 880A8 800EEBF8 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 880AC 800EEBFC 44811000 */  mtc1      $at, $f2
/* 880B0 800EEC00 44820000 */  mtc1      $v0, $f0
/* 880B4 800EEC04 00000000 */  nop
/* 880B8 800EEC08 46800020 */  cvt.s.w   $f0, $f0
/* 880BC 800EEC0C 4600103C */  c.lt.s    $f2, $f0
/* 880C0 800EEC10 00000000 */  nop
/* 880C4 800EEC14 45030001 */  bc1tl     .L800EEC1C
/* 880C8 800EEC18 46001006 */   mov.s    $f0, $f2
.L800EEC1C:
/* 880CC 800EEC1C 9602008E */  lhu       $v0, 0x8E($s0)
/* 880D0 800EEC20 46020003 */  div.s     $f0, $f0, $f2
/* 880D4 800EEC24 E6000054 */  swc1      $f0, 0x54($s0)
/* 880D8 800EEC28 46000086 */  mov.s     $f2, $f0
/* 880DC 800EEC2C E6000058 */  swc1      $f0, 0x58($s0)
/* 880E0 800EEC30 E602005C */  swc1      $f2, 0x5C($s0)
/* 880E4 800EEC34 2442FFFF */  addiu     $v0, $v0, -0x1
/* 880E8 800EEC38 A602008E */  sh        $v0, 0x8E($s0)
/* 880EC 800EEC3C 00021400 */  sll       $v0, $v0, 16
/* 880F0 800EEC40 04410014 */  bgez      $v0, .L800EEC94
/* 880F4 800EEC44 0000102D */   daddu    $v0, $zero, $zero
/* 880F8 800EEC48 24020002 */  addiu     $v0, $zero, 0x2
/* 880FC 800EEC4C 0803BB24 */  j         .L800EEC90
/* 88100 800EEC50 A6220000 */   sh       $v0, 0x0($s1)
.L800EEC54:
/* 88104 800EEC54 3C038011 */  lui       $v1, %hi(wCurrentPartnerId)
/* 88108 800EEC58 8C63CFD8 */  lw        $v1, %lo(wCurrentPartnerId)($v1)
/* 8810C 800EEC5C C6000064 */  lwc1      $f0, 0x64($s0)
/* 88110 800EEC60 000310C0 */  sll       $v0, $v1, 3
/* 88114 800EEC64 00431021 */  addu      $v0, $v0, $v1
/* 88118 800EEC68 00021080 */  sll       $v0, $v0, 2
/* 8811C 800EEC6C 3C018010 */  lui       $at, %hi(gPartnerAnimations + 0x10)
/* 88120 800EEC70 00220821 */  addu      $at, $at, $v0
/* 88124 800EEC74 8C228358 */  lw        $v0, %lo(gPartnerAnimations + 0x10)($at)
/* 88128 800EEC78 AC80001C */  sw        $zero, 0x1C($a0)
/* 8812C 800EEC7C E480003C */  swc1      $f0, 0x3C($a0)
/* 88130 800EEC80 0C00EB6B */  jal       disable_npc_blur
/* 88134 800EEC84 AC820028 */   sw       $v0, 0x28($a0)
/* 88138 800EEC88 0803BB25 */  j         .L800EEC94
/* 8813C 800EEC8C 24020001 */   addiu    $v0, $zero, 0x1
.L800EEC90:
/* 88140 800EEC90 0000102D */  daddu     $v0, $zero, $zero
.L800EEC94:
/* 88144 800EEC94 8FBF001C */  lw        $ra, 0x1C($sp)
/* 88148 800EEC98 8FB20018 */  lw        $s2, 0x18($sp)
/* 8814C 800EEC9C 8FB10014 */  lw        $s1, 0x14($sp)
/* 88150 800EECA0 8FB00010 */  lw        $s0, 0x10($sp)
/* 88154 800EECA4 D7BE0048 */  ldc1      $f30, 0x48($sp)
/* 88158 800EECA8 D7BC0040 */  ldc1      $f28, 0x40($sp)
/* 8815C 800EECAC D7BA0038 */  ldc1      $f26, 0x38($sp)
/* 88160 800EECB0 D7B80030 */  ldc1      $f24, 0x30($sp)
/* 88164 800EECB4 D7B60028 */  ldc1      $f22, 0x28($sp)
/* 88168 800EECB8 D7B40020 */  ldc1      $f20, 0x20($sp)
/* 8816C 800EECBC 03E00008 */  jr        $ra
/* 88170 800EECC0 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

s32 partner_put_away(Npc* partner) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 tempMoveToY;
    f32 tempMoveToZ;
    f32 tempPosZ;
    f32 tempMoveToX;
    f32 tempPosX;
    f32 tempPosY;
    f32 tempDuration;
    f32 divisor;

    switch (wPartnerFollowState){
        case 0:
            tempMoveToX = partner->pos.x;
            tempMoveToY = partner->pos.y;
            tempMoveToZ = partner->pos.z;
            partner->flags &= ~NPC_FLAG_GRAVITY;
            partner->flags &= ~NPC_FLAG_8;
            tempPosX = playerStatus->position.x;
            partner->moveToPos.x = tempPosX;
            tempPosY = playerStatus->position.y + (playerStatus->colliderHeight / 2);
            partner->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight / 2);
            tempPosZ = playerStatus->position.z;
            wSavedPartnerPosX = tempMoveToX;
            wSavedPartnerPosY = tempMoveToY;
            wSavedPartnerPosZ = tempMoveToZ;
            partner->moveSpeed = 4.0f;
            partner->jumpScale = 1.6f;
            partner->moveToPos.z = tempPosZ;
            partner->planarFlyDist = dist2D(tempMoveToX, tempMoveToZ, tempPosX, tempPosZ);
            partner->yaw = atan2(tempMoveToX, tempMoveToZ, tempPosX, tempPosZ);
            partner->duration = 0xF;
            divisor = 15.0f;
            partner->moveSpeed = partner->planarFlyDist / divisor;
            tempMoveToY = tempPosY - tempMoveToY;
            partner->jumpVelocity = (tempMoveToY + partner->jumpScale * partner->duration * partner->duration * 0.5f) / partner->duration;
            partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].jump;
            enable_npc_blur(partner);
            wPartnerFollowState = 1;
            break;
        case 1:
            partner->jumpVelocity -= partner->jumpScale;
            partner->pos.y += partner->jumpVelocity;
            if (partner->jumpVelocity <= 0.0f) {
                partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall;
            }
            npc_move_heading(partner, partner->moveSpeed, partner->yaw);
            tempDuration = partner->duration;
            if (partner->duration > 10.0f) {
                tempDuration = 10.0f;
            }
            partner->scale.x = tempDuration / 10.0f;
            partner->scale.y = partner->scale.x;
            partner->scale.z = partner->scale.x;
            partner->duration--;
            if (partner->duration >> 0x10 != 0) {
                wPartnerFollowState = 2;
            }
            break;
        case 2:
            partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly;
            partner->jumpVelocity = 0.0f;
            partner->pos.y = partner->moveToPos.y;
            disable_npc_blur(partner);
            return TRUE;
    }
    return FALSE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel initialize_battle
/* 16CA10 8023E130 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 16CA14 8023E134 AFB3001C */  sw        $s3, 0x1C($sp)
/* 16CA18 8023E138 3C138011 */  lui       $s3, %hi(gPlayerData)
/* 16CA1C 8023E13C 2673F290 */  addiu     $s3, $s3, %lo(gPlayerData)
/* 16CA20 8023E140 AFB40020 */  sw        $s4, 0x20($sp)
/* 16CA24 8023E144 3C14800B */  lui       $s4, %hi(gCameras + 0xAB0)
/* 16CA28 8023E148 26942830 */  addiu     $s4, $s4, %lo(gCameras + 0xAB0)
/* 16CA2C 8023E14C AFB10014 */  sw        $s1, 0x14($sp)
/* 16CA30 8023E150 2411000F */  addiu     $s1, $zero, 0xF
/* 16CA34 8023E154 3C06800E */  lui       $a2, %hi(gBattleStatus)
/* 16CA38 8023E158 24C6C070 */  addiu     $a2, $a2, %lo(gBattleStatus)
/* 16CA3C 8023E15C 24C5003C */  addiu     $a1, $a2, 0x3C
/* 16CA40 8023E160 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* 16CA44 8023E164 2484A650 */  addiu     $a0, $a0, %lo(gOverrideFlags)
/* 16CA48 8023E168 AFBF0024 */  sw        $ra, 0x24($sp)
/* 16CA4C 8023E16C AFB20018 */  sw        $s2, 0x18($sp)
/* 16CA50 8023E170 AFB00010 */  sw        $s0, 0x10($sp)
/* 16CA54 8023E174 ACC00000 */  sw        $zero, 0x0($a2)
/* 16CA58 8023E178 ACC00004 */  sw        $zero, 0x4($a2)
/* 16CA5C 8023E17C ACC00000 */  sw        $zero, 0x0($a2)
/* 16CA60 8023E180 8C820000 */  lw        $v0, 0x0($a0)
/* 16CA64 8023E184 2403FFFF */  addiu     $v1, $zero, -0x1
/* 16CA68 8023E188 ACC30224 */  sw        $v1, 0x224($a2)
/* 16CA6C 8023E18C 2403FF7F */  addiu     $v1, $zero, -0x81
/* 16CA70 8023E190 3C01802A */  lui       $at, %hi(bSavedOverrideFlags)
/* 16CA74 8023E194 AC22DA34 */  sw        $v0, %lo(bSavedOverrideFlags)($at)
/* 16CA78 8023E198 00431024 */  and       $v0, $v0, $v1
/* 16CA7C 8023E19C AC820000 */  sw        $v0, 0x0($a0)
/* 16CA80 8023E1A0 00431024 */  and       $v0, $v0, $v1
/* 16CA84 8023E1A4 AC820000 */  sw        $v0, 0x0($a0)
.L8023E1A8:
/* 16CA88 8023E1A8 ACA00330 */  sw        $zero, 0x330($a1)
/* 16CA8C 8023E1AC 2631FFFF */  addiu     $s1, $s1, -0x1
/* 16CA90 8023E1B0 0621FFFD */  bgez      $s1, .L8023E1A8
/* 16CA94 8023E1B4 24A5FFFC */   addiu    $a1, $a1, -0x4
/* 16CA98 8023E1B8 24110017 */  addiu     $s1, $zero, 0x17
/* 16CA9C 8023E1BC 24C2005C */  addiu     $v0, $a2, 0x5C
/* 16CAA0 8023E1C0 A0C00431 */  sb        $zero, 0x431($a2)
/* 16CAA4 8023E1C4 A0C00430 */  sb        $zero, 0x430($a2)
/* 16CAA8 8023E1C8 A0C00095 */  sb        $zero, 0x95($a2)
.L8023E1CC:
/* 16CAAC 8023E1CC AC4000E0 */  sw        $zero, 0xE0($v0)
/* 16CAB0 8023E1D0 2631FFFF */  addiu     $s1, $s1, -0x1
/* 16CAB4 8023E1D4 0621FFFD */  bgez      $s1, .L8023E1CC
/* 16CAB8 8023E1D8 2442FFFC */   addiu    $v0, $v0, -0x4
/* 16CABC 8023E1DC 0000882D */  daddu     $s1, $zero, $zero
/* 16CAC0 8023E1E0 2403FFFF */  addiu     $v1, $zero, -0x1
/* 16CAC4 8023E1E4 ACC000D8 */  sw        $zero, 0xD8($a2)
/* 16CAC8 8023E1E8 ACC000DC */  sw        $zero, 0xDC($a2)
/* 16CACC 8023E1EC 00D11021 */  addu      $v0, $a2, $s1
.L8023E1F0:
/* 16CAD0 8023E1F0 26310001 */  addiu     $s1, $s1, 0x1
/* 16CAD4 8023E1F4 A043004C */  sb        $v1, 0x4C($v0)
/* 16CAD8 8023E1F8 A043005C */  sb        $v1, 0x5C($v0)
/* 16CADC 8023E1FC 2A220010 */  slti      $v0, $s1, 0x10
/* 16CAE0 8023E200 5440FFFB */  bnel      $v0, $zero, .L8023E1F0
/* 16CAE4 8023E204 00D11021 */   addu     $v0, $a2, $s1
/* 16CAE8 8023E208 2411001B */  addiu     $s1, $zero, 0x1B
/* 16CAEC 8023E20C 00D11021 */  addu      $v0, $a2, $s1
.L8023E210:
/* 16CAF0 8023E210 A0400440 */  sb        $zero, 0x440($v0)
/* 16CAF4 8023E214 2631FFFF */  addiu     $s1, $s1, -0x1
/* 16CAF8 8023E218 0621FFFD */  bgez      $s1, .L8023E210
/* 16CAFC 8023E21C 2442FFFF */   addiu    $v0, $v0, -0x1
/* 16CB00 8023E220 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 16CB04 8023E224 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 16CB08 8023E228 9042007E */  lbu       $v0, 0x7E($v0)
/* 16CB0C 8023E22C 30420001 */  andi      $v0, $v0, 0x1
/* 16CB10 8023E230 10400009 */  beqz      $v0, .L8023E258
/* 16CB14 8023E234 2404FFBF */   addiu    $a0, $zero, -0x41
/* 16CB18 8023E238 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 16CB1C 8023E23C 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 16CB20 8023E240 8C620004 */  lw        $v0, 0x4($v1)
/* 16CB24 8023E244 34420040 */  ori       $v0, $v0, 0x40
/* 16CB28 8023E248 0C03A6D5 */  jal       increment_status_bar_disabled
/* 16CB2C 8023E24C AC620004 */   sw       $v0, 0x4($v1)
/* 16CB30 8023E250 0808F89B */  j         .L8023E26C
/* 16CB34 8023E254 00000000 */   nop
.L8023E258:
/* 16CB38 8023E258 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 16CB3C 8023E25C 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 16CB40 8023E260 8C430004 */  lw        $v1, 0x4($v0)
/* 16CB44 8023E264 00641824 */  and       $v1, $v1, $a0
/* 16CB48 8023E268 AC430004 */  sw        $v1, 0x4($v0)
.L8023E26C:
/* 16CB4C 8023E26C 3C058024 */  lui       $a1, %hi(btl_render_actors)
/* 16CB50 8023E270 24A5ED5C */  addiu     $a1, $a1, %lo(btl_render_actors)
/* 16CB54 8023E274 0C048C56 */  jal       create_worker_world
/* 16CB58 8023E278 0000202D */   daddu    $a0, $zero, $zero
/* 16CB5C 8023E27C 0C093B70 */  jal       func_8024EDC0
/* 16CB60 8023E280 0000882D */   daddu    $s1, $zero, $zero
/* 16CB64 8023E284 0C09A3A2 */  jal       func_80268E88
/* 16CB68 8023E288 00000000 */   nop
/* 16CB6C 8023E28C 0C051FB1 */  jal       set_windows_visible
/* 16CB70 8023E290 24040001 */   addiu    $a0, $zero, 0x1
/* 16CB74 8023E294 3C048029 */  lui       $a0, %hi(HES_HPBar)
/* 16CB78 8023E298 24841F80 */  addiu     $a0, $a0, %lo(HES_HPBar)
/* 16CB7C 8023E29C 0C050529 */  jal       hud_element_create
/* 16CB80 8023E2A0 00000000 */   nop
/* 16CB84 8023E2A4 3C01802A */  lui       $at, %hi(D_8029EFBC)
/* 16CB88 8023E2A8 AC22EFBC */  sw        $v0, %lo(D_8029EFBC)($at)
/* 16CB8C 8023E2AC 0040202D */  daddu     $a0, $v0, $zero
/* 16CB90 8023E2B0 0C051280 */  jal       hud_element_set_flags
/* 16CB94 8023E2B4 24050080 */   addiu    $a1, $zero, 0x80
/* 16CB98 8023E2B8 3C12802A */  lui       $s2, %hi(D_8029EFC0)
/* 16CB9C 8023E2BC 2652EFC0 */  addiu     $s2, $s2, %lo(D_8029EFC0)
.L8023E2C0:
/* 16CBA0 8023E2C0 3C048008 */  lui       $a0, %hi(HES_Item_StarPoint)
/* 16CBA4 8023E2C4 24840FF0 */  addiu     $a0, $a0, %lo(HES_Item_StarPoint)
/* 16CBA8 8023E2C8 0C050529 */  jal       hud_element_create
/* 16CBAC 8023E2CC 26310001 */   addiu    $s1, $s1, 0x1
/* 16CBB0 8023E2D0 AE420000 */  sw        $v0, 0x0($s2)
/* 16CBB4 8023E2D4 0040802D */  daddu     $s0, $v0, $zero
/* 16CBB8 8023E2D8 0200202D */  daddu     $a0, $s0, $zero
/* 16CBBC 8023E2DC 0C051280 */  jal       hud_element_set_flags
/* 16CBC0 8023E2E0 24050082 */   addiu    $a1, $zero, 0x82
/* 16CBC4 8023E2E4 0200202D */  daddu     $a0, $s0, $zero
/* 16CBC8 8023E2E8 0C051277 */  jal       hud_element_set_render_depth
/* 16CBCC 8023E2EC 24050014 */   addiu    $a1, $zero, 0x14
/* 16CBD0 8023E2F0 2A22000A */  slti      $v0, $s1, 0xA
/* 16CBD4 8023E2F4 1440FFF2 */  bnez      $v0, .L8023E2C0
/* 16CBD8 8023E2F8 26520004 */   addiu    $s2, $s2, 0x4
/* 16CBDC 8023E2FC 0000882D */  daddu     $s1, $zero, $zero
/* 16CBE0 8023E300 3C12802A */  lui       $s2, %hi(D_8029EFE8)
/* 16CBE4 8023E304 2652EFE8 */  addiu     $s2, $s2, %lo(D_8029EFE8)
.L8023E308:
/* 16CBE8 8023E308 3C048010 */  lui       $a0, %hi(HES_StatusSPShine)
/* 16CBEC 8023E30C 24844BEC */  addiu     $a0, $a0, %lo(HES_StatusSPShine)
/* 16CBF0 8023E310 0C050529 */  jal       hud_element_create
/* 16CBF4 8023E314 26310001 */   addiu    $s1, $s1, 0x1
/* 16CBF8 8023E318 AE420000 */  sw        $v0, 0x0($s2)
/* 16CBFC 8023E31C 0040802D */  daddu     $s0, $v0, $zero
/* 16CC00 8023E320 0200202D */  daddu     $a0, $s0, $zero
/* 16CC04 8023E324 0C051280 */  jal       hud_element_set_flags
/* 16CC08 8023E328 24050082 */   addiu    $a1, $zero, 0x82
/* 16CC0C 8023E32C 0200202D */  daddu     $a0, $s0, $zero
/* 16CC10 8023E330 0C051277 */  jal       hud_element_set_render_depth
/* 16CC14 8023E334 24050014 */   addiu    $a1, $zero, 0x14
/* 16CC18 8023E338 2A22000A */  slti      $v0, $s1, 0xA
/* 16CC1C 8023E33C 1440FFF2 */  bnez      $v0, .L8023E308
/* 16CC20 8023E340 26520004 */   addiu    $s2, $s2, 0x4
/* 16CC24 8023E344 0000882D */  daddu     $s1, $zero, $zero
/* 16CC28 8023E348 3C12802A */  lui       $s2, %hi(D_8029F010)
/* 16CC2C 8023E34C 2652F010 */  addiu     $s2, $s2, %lo(D_8029F010)
.L8023E350:
/* 16CC30 8023E350 3C048008 */  lui       $a0, %hi(HES_Item_SmallStarPoint)
/* 16CC34 8023E354 248410C8 */  addiu     $a0, $a0, %lo(HES_Item_SmallStarPoint)
/* 16CC38 8023E358 0C050529 */  jal       hud_element_create
/* 16CC3C 8023E35C 26310001 */   addiu    $s1, $s1, 0x1
/* 16CC40 8023E360 AE420000 */  sw        $v0, 0x0($s2)
/* 16CC44 8023E364 0040802D */  daddu     $s0, $v0, $zero
/* 16CC48 8023E368 0200202D */  daddu     $a0, $s0, $zero
/* 16CC4C 8023E36C 0C051280 */  jal       hud_element_set_flags
/* 16CC50 8023E370 24050082 */   addiu    $a1, $zero, 0x82
/* 16CC54 8023E374 0200202D */  daddu     $a0, $s0, $zero
/* 16CC58 8023E378 0C051277 */  jal       hud_element_set_render_depth
/* 16CC5C 8023E37C 24050014 */   addiu    $a1, $zero, 0x14
/* 16CC60 8023E380 2A22000A */  slti      $v0, $s1, 0xA
/* 16CC64 8023E384 1440FFF2 */  bnez      $v0, .L8023E350
/* 16CC68 8023E388 26520004 */   addiu    $s2, $s2, 0x4
/* 16CC6C 8023E38C 3C028024 */  lui       $v0, %hi(tattle_cam_pre_render)
/* 16CC70 8023E390 2442F088 */  addiu     $v0, $v0, %lo(tattle_cam_pre_render)
/* 16CC74 8023E394 AE8201FC */  sw        $v0, 0x1FC($s4)
/* 16CC78 8023E398 966302A2 */  lhu       $v1, 0x2A2($s3)
/* 16CC7C 8023E39C 3C028024 */  lui       $v0, %hi(func_8023FF84)
/* 16CC80 8023E3A0 2442FF84 */  addiu     $v0, $v0, %lo(func_8023FF84)
/* 16CC84 8023E3A4 AE820200 */  sw        $v0, 0x200($s4)
/* 16CC88 8023E3A8 2C62270F */  sltiu     $v0, $v1, 0x270F
/* 16CC8C 8023E3AC 10400002 */  beqz      $v0, .L8023E3B8
/* 16CC90 8023E3B0 24620001 */   addiu    $v0, $v1, 0x1
/* 16CC94 8023E3B4 A66202A2 */  sh        $v0, 0x2A2($s3)
.L8023E3B8:
/* 16CC98 8023E3B8 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x4)
/* 16CC9C 8023E3BC 8C42C074 */  lw        $v0, %lo(gBattleStatus + 0x4)($v0)
/* 16CCA0 8023E3C0 82630012 */  lb        $v1, 0x12($s3)
/* 16CCA4 8023E3C4 30420040 */  andi      $v0, $v0, 0x40
/* 16CCA8 8023E3C8 3C01802A */  lui       $at, %hi(bSavedPartner)
/* 16CCAC 8023E3CC AC23DA30 */  sw        $v1, %lo(bSavedPartner)($at)
/* 16CCB0 8023E3D0 10400002 */  beqz      $v0, .L8023E3DC
/* 16CCB4 8023E3D4 2402000B */   addiu    $v0, $zero, 0xB
/* 16CCB8 8023E3D8 A2620012 */  sb        $v0, 0x12($s3)
.L8023E3DC:
/* 16CCBC 8023E3DC 8FBF0024 */  lw        $ra, 0x24($sp)
/* 16CCC0 8023E3E0 8FB40020 */  lw        $s4, 0x20($sp)
/* 16CCC4 8023E3E4 8FB3001C */  lw        $s3, 0x1C($sp)
/* 16CCC8 8023E3E8 8FB20018 */  lw        $s2, 0x18($sp)
/* 16CCCC 8023E3EC 8FB10014 */  lw        $s1, 0x14($sp)
/* 16CCD0 8023E3F0 8FB00010 */  lw        $s0, 0x10($sp)
/* 16CCD4 8023E3F4 03E00008 */  jr        $ra
/* 16CCD8 8023E3F8 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void initialize_battle(void) {
    PlayerData* playerData = &gPlayerData;
    BattleStatus* battleStatus = &gBattleStatus;
    Camera* tattleCam = &gCameras[CAM_TATTLE];
    s32 hudElemID;
    s32 i;

    gBattleStatus.flags1 = 0;
    gBattleStatus.flags2 = 0;
    gBattleStatus.flags1 = 0;
    bSavedOverrideFlags = gOverrideFlags;
    gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;
    gBattleStatus.inputBitmask = -1;
    gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;

    for (i = 0; i < 16; i++) {
        battleStatus->pushInputBuffer[i] = 0; // @bug? why just 16
    }

    battleStatus->inputBufferPos = 0;
    battleStatus->holdInputBufferPos = 0;
    battleStatus->unk_95 = 0;

    for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
        battleStatus->enemyActors[i] = NULL;
    }

    battleStatus->playerActor = NULL;
    battleStatus->partnerActor = NULL;

    for (i = 0; i < ARRAY_COUNT(battleStatus->lastPlayerMenuSelection); i++) {
        battleStatus->lastPlayerMenuSelection[i] = -1;
        battleStatus->lastPartnerMenuSelection[i] = -1;
    }

    for (i = 0; i < ARRAY_COUNT(battleStatus->tattleFlags); i++) {
        battleStatus->tattleFlags[i] = 0;
    }

    if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) {
        gBattleStatus.flags2 |= BS_FLAGS2_PEACH_BATTLE;
        increment_status_bar_disabled();
    } else {
        gBattleStatus.flags2 &= ~BS_FLAGS2_PEACH_BATTLE;
    }

    create_worker_world(NULL, btl_render_actors);
    btl_popup_messages_init();
    func_80268E88();
    set_windows_visible(WINDOW_GROUP_1);
    D_8029EFBC = hud_element_create(&HES_HPBar);
    hud_element_set_flags(D_8029EFBC, HUD_ELEMENT_FLAG_80);

    for (i = 0; i < ARRAY_COUNT(D_8029EFC0); i++) {
        hudElemID = D_8029EFC0[i] = hud_element_create(&HES_Item_StarPoint);
        hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED);
        hud_element_set_render_depth(hudElemID, 20);
    }

    for (i = 0; i < ARRAY_COUNT(D_8029EFE8); i++) {
        hudElemID = D_8029EFE8[i] = hud_element_create(&HES_StatusSPShine);
        hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED);
        hud_element_set_render_depth(hudElemID, 20);
    }

    for (i = 0; i < ARRAY_COUNT(D_8029F010); i++) {
        hudElemID = D_8029F010[i] = hud_element_create(&HES_Item_SmallStarPoint);
        hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED);
        hud_element_set_render_depth(hudElemID, 20);
    }

    tattleCam->fpDoPreRender = tattle_cam_pre_render;
    tattleCam->fpDoPostRender = func_8023FF84;

    if (playerData->battlesCount < 9999) {
        playerData->battlesCount++;
    }

    bSavedPartner = playerData->currentPartner;
    if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
        playerData->currentPartner = PARTNER_TWINK;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel snowfall_appendGfx
/* 38CD18 E008A728 27BDFF70 */  addiu     $sp, $sp, -0x90
/* 38CD1C E008A72C AFB1006C */  sw        $s1, 0x6C($sp)
/* 38CD20 E008A730 0080882D */  daddu     $s1, $a0, $zero
/* 38CD24 E008A734 AFBF008C */  sw        $ra, 0x8C($sp)
/* 38CD28 E008A738 AFBE0088 */  sw        $fp, 0x88($sp)
/* 38CD2C E008A73C AFB70084 */  sw        $s7, 0x84($sp)
/* 38CD30 E008A740 AFB60080 */  sw        $s6, 0x80($sp)
/* 38CD34 E008A744 AFB5007C */  sw        $s5, 0x7C($sp)
/* 38CD38 E008A748 AFB40078 */  sw        $s4, 0x78($sp)
/* 38CD3C E008A74C AFB30074 */  sw        $s3, 0x74($sp)
/* 38CD40 E008A750 AFB20070 */  sw        $s2, 0x70($sp)
/* 38CD44 E008A754 AFB00068 */  sw        $s0, 0x68($sp)
/* 38CD48 E008A758 8E33000C */  lw        $s3, 0xC($s1)
/* 38CD4C E008A75C 8E620000 */  lw        $v0, 0x0($s3)
/* 38CD50 E008A760 104000AF */  beqz      $v0, .LE008AA20
/* 38CD54 E008A764 240200FF */   addiu    $v0, $zero, 0xFF
/* 38CD58 E008A768 8E690028 */  lw        $t1, 0x28($s3)
/* 38CD5C E008A76C 8E630004 */  lw        $v1, 0x4($s3)
/* 38CD60 E008A770 A3A20059 */  sb        $v0, 0x59($sp)
/* 38CD64 E008A774 3C028015 */  lui       $v0, %hi(gBackgroundFogModePtr)
/* 38CD68 E008A778 8C4212F0 */  lw        $v0, %lo(gBackgroundFogModePtr)($v0)
/* 38CD6C E008A77C 8E7E002C */  lw        $fp, 0x2C($s3)
/* 38CD70 E008A780 00031880 */  sll       $v1, $v1, 2
/* 38CD74 E008A784 90420000 */  lbu       $v0, 0x0($v0)
/* 38CD78 E008A788 3C01E009 */  lui       $at, (0xE0090000 >> 16)
/* 38CD7C E008A78C 00230821 */  addu      $at, $at, $v1
/* 38CD80 E008A790 8C23AA50 */  lw        $v1, -0x55B0($at)
/* 38CD84 E008A794 24040001 */  addiu     $a0, $zero, 0x1
/* 38CD88 E008A798 14440009 */  bne       $v0, $a0, .LE008A7C0
/* 38CD8C E008A79C AFA3005C */   sw       $v1, 0x5C($sp)
/* 38CD90 E008A7A0 27A40058 */  addiu     $a0, $sp, 0x58
/* 38CD94 E008A7A4 0080282D */  daddu     $a1, $a0, $zero
/* 38CD98 E008A7A8 0080302D */  daddu     $a2, $a0, $zero
/* 38CD9C E008A7AC 0C08019C */  jal       shim_get_background_color_blend
/* 38CDA0 E008A7B0 27A70059 */   addiu    $a3, $sp, 0x59
/* 38CDA4 E008A7B4 93A30059 */  lbu       $v1, 0x59($sp)
/* 38CDA8 E008A7B8 240200FF */  addiu     $v0, $zero, 0xFF
/* 38CDAC E008A7BC 00434823 */  subu      $t1, $v0, $v1
.LE008A7C0:
/* 38CDB0 E008A7C0 11200097 */  beqz      $t1, .LE008AA20
/* 38CDB4 E008A7C4 3C08DB06 */   lui      $t0, (0xDB060024 >> 16)
/* 38CDB8 E008A7C8 35080024 */  ori       $t0, $t0, (0xDB060024 & 0xFFFF)
/* 38CDBC E008A7CC 27A40018 */  addiu     $a0, $sp, 0x18
/* 38CDC0 E008A7D0 3C100001 */  lui       $s0, (0x11630 >> 16)
/* 38CDC4 E008A7D4 36101630 */  ori       $s0, $s0, (0x11630 & 0xFFFF)
/* 38CDC8 E008A7D8 3C16800A */  lui       $s6, %hi(gMainGfxPos)
/* 38CDCC E008A7DC 26D6A66C */  addiu     $s6, $s6, %lo(gMainGfxPos)
/* 38CDD0 E008A7E0 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 38CDD4 E008A7E4 8EC50000 */  lw        $a1, 0x0($s6)
/* 38CDD8 E008A7E8 44800000 */  mtc1      $zero, $f0
/* 38CDDC E008A7EC 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 38CDE0 E008A7F0 00A0182D */  daddu     $v1, $a1, $zero
/* 38CDE4 E008A7F4 44060000 */  mfc1      $a2, $f0
/* 38CDE8 E008A7F8 24A50008 */  addiu     $a1, $a1, 0x8
/* 38CDEC E008A7FC AEC50000 */  sw        $a1, 0x0($s6)
/* 38CDF0 E008A800 AC620000 */  sw        $v0, 0x0($v1)
/* 38CDF4 E008A804 24A20008 */  addiu     $v0, $a1, 0x8
/* 38CDF8 E008A808 AC600004 */  sw        $zero, 0x4($v1)
/* 38CDFC E008A80C AEC20000 */  sw        $v0, 0x0($s6)
/* 38CE00 E008A810 ACA80000 */  sw        $t0, 0x0($a1)
/* 38CE04 E008A814 8E230010 */  lw        $v1, 0x10($s1)
/* 38CE08 E008A818 24A20010 */  addiu     $v0, $a1, 0x10
/* 38CE0C E008A81C AEC20000 */  sw        $v0, 0x0($s6)
/* 38CE10 E008A820 8C68001C */  lw        $t0, 0x1C($v1)
/* 38CE14 E008A824 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 38CE18 E008A828 ACA20008 */  sw        $v0, 0x8($a1)
/* 38CE1C E008A82C 3C020900 */  lui       $v0, %hi(D_09000C00_415C60)
/* 38CE20 E008A830 24420C00 */  addiu     $v0, $v0, %lo(D_09000C00_415C60)
/* 38CE24 E008A834 ACA2000C */  sw        $v0, 0xC($a1)
/* 38CE28 E008A838 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 38CE2C E008A83C ACA20010 */  sw        $v0, 0x10($a1)
/* 38CE30 E008A840 2402FF00 */  addiu     $v0, $zero, -0x100
/* 38CE34 E008A844 01221025 */  or        $v0, $t1, $v0
/* 38CE38 E008A848 ACA20014 */  sw        $v0, 0x14($a1)
/* 38CE3C E008A84C 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 38CE40 E008A850 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 38CE44 E008A854 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 38CE48 E008A858 01024021 */  addu      $t0, $t0, $v0
/* 38CE4C E008A85C 00031080 */  sll       $v0, $v1, 2
/* 38CE50 E008A860 00431021 */  addu      $v0, $v0, $v1
/* 38CE54 E008A864 00021080 */  sll       $v0, $v0, 2
/* 38CE58 E008A868 00431023 */  subu      $v0, $v0, $v1
/* 38CE5C E008A86C 000218C0 */  sll       $v1, $v0, 3
/* 38CE60 E008A870 00431021 */  addu      $v0, $v0, $v1
/* 38CE64 E008A874 000210C0 */  sll       $v0, $v0, 3
/* 38CE68 E008A878 ACA80004 */  sw        $t0, 0x4($a1)
/* 38CE6C E008A87C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 38CE70 E008A880 00220821 */  addu      $at, $at, $v0
/* 38CE74 E008A884 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 38CE78 E008A888 24A50018 */  addiu     $a1, $a1, 0x18
/* 38CE7C E008A88C AEC50000 */  sw        $a1, 0x0($s6)
/* 38CE80 E008A890 46000007 */  neg.s     $f0, $f0
/* 38CE84 E008A894 44050000 */  mfc1      $a1, $f0
/* 38CE88 E008A898 26730034 */  addiu     $s3, $s3, 0x34
/* 38CE8C E008A89C 0C080104 */  jal       shim_guRotateF
/* 38CE90 E008A8A0 AFA60010 */   sw       $a2, 0x10($sp)
/* 38CE94 E008A8A4 27A40018 */  addiu     $a0, $sp, 0x18
/* 38CE98 E008A8A8 3C128007 */  lui       $s2, %hi(gMatrixListPos)
/* 38CE9C E008A8AC 265241F0 */  addiu     $s2, $s2, %lo(gMatrixListPos)
/* 38CEA0 E008A8B0 3C14800A */  lui       $s4, %hi(gDisplayContext)
/* 38CEA4 E008A8B4 2694A674 */  addiu     $s4, $s4, %lo(gDisplayContext)
/* 38CEA8 E008A8B8 96450000 */  lhu       $a1, 0x0($s2)
/* 38CEAC E008A8BC 8E820000 */  lw        $v0, 0x0($s4)
/* 38CEB0 E008A8C0 00052980 */  sll       $a1, $a1, 6
/* 38CEB4 E008A8C4 00B02821 */  addu      $a1, $a1, $s0
/* 38CEB8 E008A8C8 0C080118 */  jal       shim_guMtxF2L
/* 38CEBC E008A8CC 00452821 */   addu     $a1, $v0, $a1
/* 38CEC0 E008A8D0 96420000 */  lhu       $v0, 0x0($s2)
/* 38CEC4 E008A8D4 0000882D */  daddu     $s1, $zero, $zero
/* 38CEC8 E008A8D8 24430001 */  addiu     $v1, $v0, 0x1
/* 38CECC E008A8DC 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 38CED0 E008A8E0 00021180 */  sll       $v0, $v0, 6
/* 38CED4 E008A8E4 A6430000 */  sh        $v1, 0x0($s2)
/* 38CED8 E008A8E8 8E830000 */  lw        $v1, 0x0($s4)
/* 38CEDC E008A8EC 00501021 */  addu      $v0, $v0, $s0
/* 38CEE0 E008A8F0 00621821 */  addu      $v1, $v1, $v0
/* 38CEE4 E008A8F4 1BC00041 */  blez      $fp, .LE008A9FC
/* 38CEE8 E008A8F8 AFA30060 */   sw       $v1, 0x60($sp)
/* 38CEEC E008A8FC 0280B82D */  daddu     $s7, $s4, $zero
/* 38CEF0 E008A900 0240A82D */  daddu     $s5, $s2, $zero
/* 38CEF4 E008A904 3C140001 */  lui       $s4, (0x11630 >> 16)
/* 38CEF8 E008A908 36941630 */  ori       $s4, $s4, (0x11630 & 0xFFFF)
/* 38CEFC E008A90C 02C0902D */  daddu     $s2, $s6, $zero
/* 38CF00 E008A910 26700010 */  addiu     $s0, $s3, 0x10
.LE008A914:
/* 38CF04 E008A914 8E020020 */  lw        $v0, 0x20($s0)
/* 38CF08 E008A918 5C400035 */  bgtzl     $v0, .LE008A9F0
/* 38CF0C E008A91C 26310001 */   addiu    $s1, $s1, 0x1
/* 38CF10 E008A920 8E020018 */  lw        $v0, 0x18($s0)
/* 38CF14 E008A924 50400032 */  beql      $v0, $zero, .LE008A9F0
/* 38CF18 E008A928 26310001 */   addiu    $s1, $s1, 0x1
/* 38CF1C E008A92C 8E05FFF8 */  lw        $a1, -0x8($s0)
/* 38CF20 E008A930 8E06FFFC */  lw        $a2, -0x4($s0)
/* 38CF24 E008A934 8E070000 */  lw        $a3, 0x0($s0)
/* 38CF28 E008A938 0C080108 */  jal       shim_guTranslateF
/* 38CF2C E008A93C 27A40018 */   addiu    $a0, $sp, 0x18
/* 38CF30 E008A940 27A40018 */  addiu     $a0, $sp, 0x18
/* 38CF34 E008A944 96A50000 */  lhu       $a1, 0x0($s5)
/* 38CF38 E008A948 8EE20000 */  lw        $v0, 0x0($s7)
/* 38CF3C E008A94C 00052980 */  sll       $a1, $a1, 6
/* 38CF40 E008A950 00B42821 */  addu      $a1, $a1, $s4
/* 38CF44 E008A954 0C080118 */  jal       shim_guMtxF2L
/* 38CF48 E008A958 00452821 */   addu     $a1, $v0, $a1
/* 38CF4C E008A95C 3C02DA38 */  lui       $v0, (0xDA380002 >> 16)
/* 38CF50 E008A960 34420002 */  ori       $v0, $v0, (0xDA380002 & 0xFFFF)
/* 38CF54 E008A964 3C06DA38 */  lui       $a2, (0xDA380001 >> 16)
/* 38CF58 E008A968 34C60001 */  ori       $a2, $a2, (0xDA380001 & 0xFFFF)
/* 38CF5C E008A96C 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 38CF60 E008A970 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 38CF64 E008A974 8E440000 */  lw        $a0, 0x0($s2)
/* 38CF68 E008A978 96A30000 */  lhu       $v1, 0x0($s5)
/* 38CF6C E008A97C 0080282D */  daddu     $a1, $a0, $zero
/* 38CF70 E008A980 24840008 */  addiu     $a0, $a0, 0x8
/* 38CF74 E008A984 AE440000 */  sw        $a0, 0x0($s2)
/* 38CF78 E008A988 ACA20000 */  sw        $v0, 0x0($a1)
/* 38CF7C E008A98C 24620001 */  addiu     $v0, $v1, 0x1
/* 38CF80 E008A990 3063FFFF */  andi      $v1, $v1, 0xFFFF
/* 38CF84 E008A994 00031980 */  sll       $v1, $v1, 6
/* 38CF88 E008A998 A6A20000 */  sh        $v0, 0x0($s5)
/* 38CF8C E008A99C 8EE20000 */  lw        $v0, 0x0($s7)
/* 38CF90 E008A9A0 00741821 */  addu      $v1, $v1, $s4
/* 38CF94 E008A9A4 00431021 */  addu      $v0, $v0, $v1
/* 38CF98 E008A9A8 ACA20004 */  sw        $v0, 0x4($a1)
/* 38CF9C E008A9AC 24820008 */  addiu     $v0, $a0, 0x8
/* 38CFA0 E008A9B0 AE420000 */  sw        $v0, 0x0($s2)
/* 38CFA4 E008A9B4 AC860000 */  sw        $a2, 0x0($a0)
/* 38CFA8 E008A9B8 8FAA0060 */  lw        $t2, 0x60($sp)
/* 38CFAC E008A9BC 24820010 */  addiu     $v0, $a0, 0x10
/* 38CFB0 E008A9C0 AC8A0004 */  sw        $t2, 0x4($a0)
/* 38CFB4 E008A9C4 AE420000 */  sw        $v0, 0x0($s2)
/* 38CFB8 E008A9C8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 38CFBC E008A9CC AC820008 */  sw        $v0, 0x8($a0)
/* 38CFC0 E008A9D0 8FAA005C */  lw        $t2, 0x5C($sp)
/* 38CFC4 E008A9D4 24820018 */  addiu     $v0, $a0, 0x18
/* 38CFC8 E008A9D8 AC8A000C */  sw        $t2, 0xC($a0)
/* 38CFCC E008A9DC AE420000 */  sw        $v0, 0x0($s2)
/* 38CFD0 E008A9E0 24020040 */  addiu     $v0, $zero, 0x40
/* 38CFD4 E008A9E4 AC870010 */  sw        $a3, 0x10($a0)
/* 38CFD8 E008A9E8 AC820014 */  sw        $v0, 0x14($a0)
/* 38CFDC E008A9EC 26310001 */  addiu     $s1, $s1, 0x1
.LE008A9F0:
/* 38CFE0 E008A9F0 023E102A */  slt       $v0, $s1, $fp
/* 38CFE4 E008A9F4 1440FFC7 */  bnez      $v0, .LE008A914
/* 38CFE8 E008A9F8 26100034 */   addiu    $s0, $s0, 0x34
.LE008A9FC:
/* 38CFEC E008A9FC 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 38CFF0 E008AA00 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 38CFF4 E008AA04 8C620000 */  lw        $v0, 0x0($v1)
/* 38CFF8 E008AA08 0040202D */  daddu     $a0, $v0, $zero
/* 38CFFC E008AA0C 24420008 */  addiu     $v0, $v0, 0x8
/* 38D000 E008AA10 AC620000 */  sw        $v0, 0x0($v1)
/* 38D004 E008AA14 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 38D008 E008AA18 AC820000 */  sw        $v0, 0x0($a0)
/* 38D00C E008AA1C AC800004 */  sw        $zero, 0x4($a0)
.LE008AA20:
/* 38D010 E008AA20 8FBF008C */  lw        $ra, 0x8C($sp)
/* 38D014 E008AA24 8FBE0088 */  lw        $fp, 0x88($sp)
/* 38D018 E008AA28 8FB70084 */  lw        $s7, 0x84($sp)
/* 38D01C E008AA2C 8FB60080 */  lw        $s6, 0x80($sp)
/* 38D020 E008AA30 8FB5007C */  lw        $s5, 0x7C($sp)
/* 38D024 E008AA34 8FB40078 */  lw        $s4, 0x78($sp)
/* 38D028 E008AA38 8FB30074 */  lw        $s3, 0x74($sp)
/* 38D02C E008AA3C 8FB20070 */  lw        $s2, 0x70($sp)
/* 38D030 E008AA40 8FB1006C */  lw        $s1, 0x6C($sp)
/* 38D034 E008AA44 8FB00068 */  lw        $s0, 0x68($sp)
/* 38D038 E008AA48 03E00008 */  jr        $ra
/* 38D03C E008AA4C 27BD0090 */   addiu    $sp, $sp, 0x90

### DECOMPILED C INSTRUCTIONS:

void snowfall_appendGfx(void* effect) {
    EffectInstance* effectTemp = effect;
    SnowfallFXData* data = effectTemp->data.snowfall;
    Matrix4f sp18;
    Gfx* dlist;
    Mtx* mtx;
    u8 bgRGB;
    u8 bgAlpha;
    s32 unk_28;
    s32 unk_2C;
    s32 i;

    if (data->unk_00 != 0) {
        unk_28 = data->unk_28;
        bgAlpha = 255;
        unk_2C = data->unk_2C;
        dlist = D_E008AA50[data->unk_04];
        if (*gBackgroundFogModePtr == 1) {
            shim_get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha);
            unk_28 = 255 - bgAlpha;
        }

        if (unk_28 != 0) {
            gDPPipeSync(gMainGfxPos++);
            gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));

            gSPDisplayList(gMainGfxPos++, D_09000C00_38DC70);
            gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, unk_28);

            shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
            shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

            mtx = &gDisplayContext->matrixStack[gMatrixListPos++];

            data++;
            for (i = 0; i < unk_2C; i++, data++) {
                if (data->unk_30 <= 0 && data->unk_28 != 0) {
                    shim_guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10);
                    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

                    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                              G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
                    gSPMatrix(gMainGfxPos++, mtx,
                              G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
                    gSPDisplayList(gMainGfxPos++, dlist);
                    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
                }
            }
            gDPPipeSync(gMainGfxPos++);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel snaking_static_update
/* 3B2504 E00AE1B4 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 3B2508 E00AE1B8 AFB3001C */  sw        $s3, 0x1C($sp)
/* 3B250C E00AE1BC 0080982D */  daddu     $s3, $a0, $zero
/* 3B2510 E00AE1C0 AFBF0020 */  sw        $ra, 0x20($sp)
/* 3B2514 E00AE1C4 AFB20018 */  sw        $s2, 0x18($sp)
/* 3B2518 E00AE1C8 AFB10014 */  sw        $s1, 0x14($sp)
/* 3B251C E00AE1CC AFB00010 */  sw        $s0, 0x10($sp)
/* 3B2520 E00AE1D0 F7BC0048 */  sdc1      $f28, 0x48($sp)
/* 3B2524 E00AE1D4 F7BA0040 */  sdc1      $f26, 0x40($sp)
/* 3B2528 E00AE1D8 F7B80038 */  sdc1      $f24, 0x38($sp)
/* 3B252C E00AE1DC F7B60030 */  sdc1      $f22, 0x30($sp)
/* 3B2530 E00AE1E0 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 3B2534 E00AE1E4 8E630000 */  lw        $v1, 0x0($s3)
/* 3B2538 E00AE1E8 8E71000C */  lw        $s1, 0xC($s3)
/* 3B253C E00AE1EC 30620010 */  andi      $v0, $v1, 0x10
/* 3B2540 E00AE1F0 10400005 */  beqz      $v0, .LE00AE208
/* 3B2544 E00AE1F4 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3B2548 E00AE1F8 00621024 */  and       $v0, $v1, $v0
/* 3B254C E00AE1FC AE620000 */  sw        $v0, 0x0($s3)
/* 3B2550 E00AE200 24020010 */  addiu     $v0, $zero, 0x10
/* 3B2554 E00AE204 AE220010 */  sw        $v0, 0x10($s1)
.LE00AE208:
/* 3B2558 E00AE208 8E230010 */  lw        $v1, 0x10($s1)
/* 3B255C E00AE20C 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3B2560 E00AE210 10400002 */  beqz      $v0, .LE00AE21C
/* 3B2564 E00AE214 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3B2568 E00AE218 AE220010 */  sw        $v0, 0x10($s1)
.LE00AE21C:
/* 3B256C E00AE21C 8E220014 */  lw        $v0, 0x14($s1)
/* 3B2570 E00AE220 8E230010 */  lw        $v1, 0x10($s1)
/* 3B2574 E00AE224 24440001 */  addiu     $a0, $v0, 0x1
/* 3B2578 E00AE228 04610005 */  bgez      $v1, .LE00AE240
/* 3B257C E00AE22C AE240014 */   sw       $a0, 0x14($s1)
/* 3B2580 E00AE230 0C080128 */  jal       shim_remove_effect
/* 3B2584 E00AE234 0260202D */   daddu    $a0, $s3, $zero
/* 3B2588 E00AE238 0802B933 */  j         .LE00AE4CC
/* 3B258C E00AE23C 00000000 */   nop
.LE00AE240:
/* 3B2590 E00AE240 28620010 */  slti      $v0, $v1, 0x10
/* 3B2594 E00AE244 10400002 */  beqz      $v0, .LE00AE250
/* 3B2598 E00AE248 00031100 */   sll      $v0, $v1, 4
/* 3B259C E00AE24C AE220024 */  sw        $v0, 0x24($s1)
.LE00AE250:
/* 3B25A0 E00AE250 28820010 */  slti      $v0, $a0, 0x10
/* 3B25A4 E00AE254 10400003 */  beqz      $v0, .LE00AE264
/* 3B25A8 E00AE258 00041100 */   sll      $v0, $a0, 4
/* 3B25AC E00AE25C 2442000F */  addiu     $v0, $v0, 0xF
/* 3B25B0 E00AE260 AE220024 */  sw        $v0, 0x24($s1)
.LE00AE264:
/* 3B25B4 E00AE264 8E620008 */  lw        $v0, 0x8($s3)
/* 3B25B8 E00AE268 24120001 */  addiu     $s2, $zero, 0x1
/* 3B25BC E00AE26C 0242102A */  slt       $v0, $s2, $v0
/* 3B25C0 E00AE270 1040008B */  beqz      $v0, .LE00AE4A0
/* 3B25C4 E00AE274 26310044 */   addiu    $s1, $s1, 0x44
/* 3B25C8 E00AE278 4480E000 */  mtc1      $zero, $f28
/* 3B25CC E00AE27C 26300014 */  addiu     $s0, $s1, 0x14
.LE00AE280:
/* 3B25D0 E00AE280 8E020000 */  lw        $v0, 0x0($s0)
/* 3B25D4 E00AE284 8E03FFFC */  lw        $v1, -0x4($s0)
/* 3B25D8 E00AE288 0043102A */  slt       $v0, $v0, $v1
/* 3B25DC E00AE28C 1440000E */  bnez      $v0, .LE00AE2C8
/* 3B25E0 E00AE290 00000000 */   nop
/* 3B25E4 E00AE294 0C080138 */  jal       shim_rand_int
/* 3B25E8 E00AE298 24040032 */   addiu    $a0, $zero, 0x32
/* 3B25EC E00AE29C 24040168 */  addiu     $a0, $zero, 0x168
/* 3B25F0 E00AE2A0 24420014 */  addiu     $v0, $v0, 0x14
/* 3B25F4 E00AE2A4 AE02FFFC */  sw        $v0, -0x4($s0)
/* 3B25F8 E00AE2A8 0C080138 */  jal       shim_rand_int
/* 3B25FC E00AE2AC AE000000 */   sw       $zero, 0x0($s0)
/* 3B2600 E00AE2B0 44820000 */  mtc1      $v0, $f0
/* 3B2604 E00AE2B4 00000000 */  nop
/* 3B2608 E00AE2B8 46800020 */  cvt.s.w   $f0, $f0
/* 3B260C E00AE2BC E6000028 */  swc1      $f0, 0x28($s0)
/* 3B2610 E00AE2C0 AE00FFF0 */  sw        $zero, -0x10($s0)
/* 3B2614 E00AE2C4 AE00FFF4 */  sw        $zero, -0xC($s0)
.LE00AE2C8:
/* 3B2618 E00AE2C8 0C080138 */  jal       shim_rand_int
/* 3B261C E00AE2CC 24040064 */   addiu    $a0, $zero, 0x64
/* 3B2620 E00AE2D0 28420033 */  slti      $v0, $v0, 0x33
/* 3B2624 E00AE2D4 10400047 */  beqz      $v0, .LE00AE3F4
/* 3B2628 E00AE2D8 00000000 */   nop
/* 3B262C E00AE2DC C618FFF0 */  lwc1      $f24, -0x10($s0)
/* 3B2630 E00AE2E0 C61AFFF4 */  lwc1      $f26, -0xC($s0)
/* 3B2634 E00AE2E4 0C080138 */  jal       shim_rand_int
/* 3B2638 E00AE2E8 24040010 */   addiu    $a0, $zero, 0x10
/* 3B263C E00AE2EC 2442FFF8 */  addiu     $v0, $v0, -0x8
/* 3B2640 E00AE2F0 4482B000 */  mtc1      $v0, $f22
/* 3B2644 E00AE2F4 00000000 */  nop
/* 3B2648 E00AE2F8 4680B5A0 */  cvt.s.w   $f22, $f22
/* 3B264C E00AE2FC 0C080138 */  jal       shim_rand_int
/* 3B2650 E00AE300 24040010 */   addiu    $a0, $zero, 0x10
/* 3B2654 E00AE304 2442FFF8 */  addiu     $v0, $v0, -0x8
/* 3B2658 E00AE308 4482A000 */  mtc1      $v0, $f20
/* 3B265C E00AE30C 00000000 */  nop
/* 3B2660 E00AE310 4680A520 */  cvt.s.w   $f20, $f20
/* 3B2664 E00AE314 26230088 */  addiu     $v1, $s1, 0x88
/* 3B2668 E00AE318 26220044 */  addiu     $v0, $s1, 0x44
/* 3B266C E00AE31C 26240084 */  addiu     $a0, $s1, 0x84
.LE00AE320:
/* 3B2670 E00AE320 8C450000 */  lw        $a1, 0x0($v0)
/* 3B2674 E00AE324 8C480004 */  lw        $t0, 0x4($v0)
/* 3B2678 E00AE328 8C490008 */  lw        $t1, 0x8($v0)
/* 3B267C E00AE32C 8C4A000C */  lw        $t2, 0xC($v0)
/* 3B2680 E00AE330 AC650000 */  sw        $a1, 0x0($v1)
/* 3B2684 E00AE334 AC680004 */  sw        $t0, 0x4($v1)
/* 3B2688 E00AE338 AC690008 */  sw        $t1, 0x8($v1)
/* 3B268C E00AE33C AC6A000C */  sw        $t2, 0xC($v1)
/* 3B2690 E00AE340 24420010 */  addiu     $v0, $v0, 0x10
/* 3B2694 E00AE344 1444FFF6 */  bne       $v0, $a0, .LE00AE320
/* 3B2698 E00AE348 24630010 */   addiu    $v1, $v1, 0x10
/* 3B269C E00AE34C 8C450000 */  lw        $a1, 0x0($v0)
/* 3B26A0 E00AE350 AC650000 */  sw        $a1, 0x0($v1)
/* 3B26A4 E00AE354 26230044 */  addiu     $v1, $s1, 0x44
/* 3B26A8 E00AE358 0220102D */  daddu     $v0, $s1, $zero
/* 3B26AC E00AE35C 26240040 */  addiu     $a0, $s1, 0x40
.LE00AE360:
/* 3B26B0 E00AE360 8C450000 */  lw        $a1, 0x0($v0)
/* 3B26B4 E00AE364 8C480004 */  lw        $t0, 0x4($v0)
/* 3B26B8 E00AE368 8C490008 */  lw        $t1, 0x8($v0)
/* 3B26BC E00AE36C 8C4A000C */  lw        $t2, 0xC($v0)
/* 3B26C0 E00AE370 AC650000 */  sw        $a1, 0x0($v1)
/* 3B26C4 E00AE374 AC680004 */  sw        $t0, 0x4($v1)
/* 3B26C8 E00AE378 AC690008 */  sw        $t1, 0x8($v1)
/* 3B26CC E00AE37C AC6A000C */  sw        $t2, 0xC($v1)
/* 3B26D0 E00AE380 24420010 */  addiu     $v0, $v0, 0x10
/* 3B26D4 E00AE384 1444FFF6 */  bne       $v0, $a0, .LE00AE360
/* 3B26D8 E00AE388 24630010 */   addiu    $v1, $v1, 0x10
/* 3B26DC E00AE38C 4600E306 */  mov.s     $f12, $f28
/* 3B26E0 E00AE390 4600E386 */  mov.s     $f14, $f28
/* 3B26E4 E00AE394 4616C080 */  add.s     $f2, $f24, $f22
/* 3B26E8 E00AE398 4406B000 */  mfc1      $a2, $f22
/* 3B26EC E00AE39C 4407A000 */  mfc1      $a3, $f20
/* 3B26F0 E00AE3A0 4614D000 */  add.s     $f0, $f26, $f20
/* 3B26F4 E00AE3A4 8C450000 */  lw        $a1, 0x0($v0)
/* 3B26F8 E00AE3A8 AC650000 */  sw        $a1, 0x0($v1)
/* 3B26FC E00AE3AC E602FFF0 */  swc1      $f2, -0x10($s0)
/* 3B2700 E00AE3B0 0C080148 */  jal       shim_atan2
/* 3B2704 E00AE3B4 E600FFF4 */   swc1     $f0, -0xC($s0)
/* 3B2708 E00AE3B8 461CB032 */  c.eq.s    $f22, $f28
/* 3B270C E00AE3BC 00000000 */  nop
/* 3B2710 E00AE3C0 45000005 */  bc1f      .LE00AE3D8
/* 3B2714 E00AE3C4 E6000028 */   swc1     $f0, 0x28($s0)
/* 3B2718 E00AE3C8 461CA032 */  c.eq.s    $f20, $f28
/* 3B271C E00AE3CC 00000000 */  nop
/* 3B2720 E00AE3D0 45030008 */  bc1tl     .LE00AE3F4
/* 3B2724 E00AE3D4 E61C0020 */   swc1     $f28, 0x20($s0)
.LE00AE3D8:
/* 3B2728 E00AE3D8 4616B002 */  mul.s     $f0, $f22, $f22
/* 3B272C E00AE3DC 00000000 */  nop
/* 3B2730 E00AE3E0 4614A302 */  mul.s     $f12, $f20, $f20
/* 3B2734 E00AE3E4 00000000 */  nop
/* 3B2738 E00AE3E8 0C080154 */  jal       shim_sqrtf
/* 3B273C E00AE3EC 460C0300 */   add.s    $f12, $f0, $f12
/* 3B2740 E00AE3F0 E6000020 */  swc1      $f0, 0x20($s0)
.LE00AE3F4:
/* 3B2744 E00AE3F4 8E020000 */  lw        $v0, 0x0($s0)
/* 3B2748 E00AE3F8 00021840 */  sll       $v1, $v0, 1
/* 3B274C E00AE3FC 00621821 */  addu      $v1, $v1, $v0
/* 3B2750 E00AE400 00031100 */  sll       $v0, $v1, 4
/* 3B2754 E00AE404 00431023 */  subu      $v0, $v0, $v1
/* 3B2758 E00AE408 8E03FFFC */  lw        $v1, -0x4($s0)
/* 3B275C E00AE40C 00021080 */  sll       $v0, $v0, 2
/* 3B2760 E00AE410 14600002 */  bnez      $v1, .LE00AE41C
/* 3B2764 E00AE414 0043001A */   div      $zero, $v0, $v1
/* 3B2768 E00AE418 0007000D */  break     7
.LE00AE41C:
/* 3B276C E00AE41C 2401FFFF */  addiu     $at, $zero, -0x1
/* 3B2770 E00AE420 14610004 */  bne       $v1, $at, .LE00AE434
/* 3B2774 E00AE424 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 3B2778 E00AE428 14410002 */  bne       $v0, $at, .LE00AE434
/* 3B277C E00AE42C 00000000 */   nop
/* 3B2780 E00AE430 0006000D */  break     6
.LE00AE434:
/* 3B2784 E00AE434 00001012 */  mflo      $v0
/* 3B2788 E00AE438 44826000 */  mtc1      $v0, $f12
/* 3B278C E00AE43C 00000000 */  nop
/* 3B2790 E00AE440 0C080140 */  jal       shim_sin_deg
/* 3B2794 E00AE444 46806320 */   cvt.s.w  $f12, $f12
/* 3B2798 E00AE448 3C014480 */  lui       $at, (0x44800000 >> 16)
/* 3B279C E00AE44C 44811000 */  mtc1      $at, $f2
/* 3B27A0 E00AE450 00000000 */  nop
/* 3B27A4 E00AE454 46020002 */  mul.s     $f0, $f0, $f2
/* 3B27A8 E00AE458 00000000 */  nop
/* 3B27AC E00AE45C 4600010D */  trunc.w.s $f4, $f0
/* 3B27B0 E00AE460 44022000 */  mfc1      $v0, $f4
/* 3B27B4 E00AE464 00000000 */  nop
/* 3B27B8 E00AE468 AE020010 */  sw        $v0, 0x10($s0)
/* 3B27BC E00AE46C 28420100 */  slti      $v0, $v0, 0x100
/* 3B27C0 E00AE470 14400003 */  bnez      $v0, .LE00AE480
/* 3B27C4 E00AE474 26520003 */   addiu    $s2, $s2, 0x3
/* 3B27C8 E00AE478 240200FF */  addiu     $v0, $zero, 0xFF
/* 3B27CC E00AE47C AE020010 */  sw        $v0, 0x10($s0)
.LE00AE480:
/* 3B27D0 E00AE480 8E020000 */  lw        $v0, 0x0($s0)
/* 3B27D4 E00AE484 263100CC */  addiu     $s1, $s1, 0xCC
/* 3B27D8 E00AE488 24420001 */  addiu     $v0, $v0, 0x1
/* 3B27DC E00AE48C AE020000 */  sw        $v0, 0x0($s0)
/* 3B27E0 E00AE490 8E620008 */  lw        $v0, 0x8($s3)
/* 3B27E4 E00AE494 0242102A */  slt       $v0, $s2, $v0
/* 3B27E8 E00AE498 1440FF79 */  bnez      $v0, .LE00AE280
/* 3B27EC E00AE49C 261000CC */   addiu    $s0, $s0, 0xCC
.LE00AE4A0:
/* 3B27F0 E00AE4A0 8E71000C */  lw        $s1, 0xC($s3)
/* 3B27F4 E00AE4A4 0802B92F */  j         .LE00AE4BC
/* 3B27F8 E00AE4A8 24120001 */   addiu    $s2, $zero, 0x1
.LE00AE4AC:
/* 3B27FC E00AE4AC 0C080138 */  jal       shim_rand_int
/* 3B2800 E00AE4B0 2404000F */   addiu    $a0, $zero, 0xF
/* 3B2804 E00AE4B4 26520001 */  addiu     $s2, $s2, 0x1
/* 3B2808 E00AE4B8 AE220040 */  sw        $v0, 0x40($s1)
.LE00AE4BC:
/* 3B280C E00AE4BC 8E620008 */  lw        $v0, 0x8($s3)
/* 3B2810 E00AE4C0 0242102A */  slt       $v0, $s2, $v0
/* 3B2814 E00AE4C4 1440FFF9 */  bnez      $v0, .LE00AE4AC
/* 3B2818 E00AE4C8 26310044 */   addiu    $s1, $s1, 0x44
.LE00AE4CC:
/* 3B281C E00AE4CC 8FBF0020 */  lw        $ra, 0x20($sp)
/* 3B2820 E00AE4D0 8FB3001C */  lw        $s3, 0x1C($sp)
/* 3B2824 E00AE4D4 8FB20018 */  lw        $s2, 0x18($sp)
/* 3B2828 E00AE4D8 8FB10014 */  lw        $s1, 0x14($sp)
/* 3B282C E00AE4DC 8FB00010 */  lw        $s0, 0x10($sp)
/* 3B2830 E00AE4E0 D7BC0048 */  ldc1      $f28, 0x48($sp)
/* 3B2834 E00AE4E4 D7BA0040 */  ldc1      $f26, 0x40($sp)
/* 3B2838 E00AE4E8 D7B80038 */  ldc1      $f24, 0x38($sp)
/* 3B283C E00AE4EC D7B60030 */  ldc1      $f22, 0x30($sp)
/* 3B2840 E00AE4F0 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 3B2844 E00AE4F4 03E00008 */  jr        $ra
/* 3B2848 E00AE4F8 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void snaking_static_update(EffectInstance* effect) {
    SnakingStaticFXData* data = effect->data.snakingStatic;
    f32 tempOffsetY;
    f32 tempOffsetX;
    f32 tempPosX;
    f32 tempPosY;
    s32 lifeTime;
    s32 timeLeft;
    s32 i;

    if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
        effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        data->timeLeft = 16;
    }

    if (data->timeLeft < 1000) {
        data->timeLeft--;
    }

    timeLeft = data->timeLeft;
    data->lifeTime++;
    lifeTime = data->lifeTime;

    if (timeLeft < 0) {
        shim_remove_effect(effect);
        return;
    }
    if (timeLeft < 16) {
        data->unk_24 = timeLeft * 16;
    }
    if (lifeTime < 16) {
        data->unk_24 = (lifeTime * 16) + 15;
    }

    data++;
    for (i = 1; i < effect->numParts; i += 3, data += 3) {
        if (data->lifeTime >= data->timeLeft) {
            data->timeLeft = shim_rand_int(50) + 20;
            data->lifeTime = 0;
            data->unk_3C = shim_rand_int(360);
            data->pos.x = 0.0f;
            data->pos.y = 0.0f;
        }
        if (shim_rand_int(100) < 51) {
            tempPosX = data->pos.x;
            tempPosY = data->pos.y;
            tempOffsetX = shim_rand_int(16) - 8;
            tempOffsetY = shim_rand_int(16) - 8;
            data[2] = data[1];
            data[1] = data[0];
            data->pos.x = tempPosX + tempOffsetX;
            data->pos.y = tempPosY + tempOffsetY;
            data->unk_3C = shim_atan2(0.0f, 0.0f, tempOffsetX, tempOffsetY);
            if (tempOffsetX != 0.0f || tempOffsetY != 0.0f) {
                data->unk_34 = shim_sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY));
            } else {
                data->unk_34 = 0.0f;
            }
        }
        data->unk_24 = (shim_sin_deg(((data->lifeTime * 180) / data->timeLeft)) * 1024.0f);
        if (data->unk_24 >= 256) {
            data->unk_24 = 255;
        }
        data->lifeTime++;
    }
    data = effect->data.snakingStatic;
    data++;
    for (i = 1; i < effect->numParts; i++, data++) {
        data->unk_40 = shim_rand_int(15);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_title_screen
/* 12A38 80037638 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 12A3C 8003763C 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 12A40 80037640 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 12A44 80037644 AFBF0030 */  sw        $ra, 0x30($sp)
/* 12A48 80037648 AFB7002C */  sw        $s7, 0x2C($sp)
/* 12A4C 8003764C AFB60028 */  sw        $s6, 0x28($sp)
/* 12A50 80037650 AFB50024 */  sw        $s5, 0x24($sp)
/* 12A54 80037654 AFB40020 */  sw        $s4, 0x20($sp)
/* 12A58 80037658 AFB3001C */  sw        $s3, 0x1C($sp)
/* 12A5C 8003765C AFB20018 */  sw        $s2, 0x18($sp)
/* 12A60 80037660 AFB10014 */  sw        $s1, 0x14($sp)
/* 12A64 80037664 AFB00010 */  sw        $s0, 0x10($sp)
/* 12A68 80037668 804300AC */  lb        $v1, 0xAC($v0)
/* 12A6C 8003766C 2C620006 */  sltiu     $v0, $v1, 0x6
/* 12A70 80037670 10400029 */  beqz      $v0, .L80037718
/* 12A74 80037674 00031080 */   sll      $v0, $v1, 2
/* 12A78 80037678 3C01800A */  lui       $at, %hi(jtbl_800983E0)
/* 12A7C 8003767C 00220821 */  addu      $at, $at, $v0
/* 12A80 80037680 8C2283E0 */  lw        $v0, %lo(jtbl_800983E0)($at)
/* 12A84 80037684 00400008 */  jr        $v0
/* 12A88 80037688 00000000 */   nop
glabel .L8003768C
/* 12A8C 8003768C 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 12A90 80037690 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 12A94 80037694 804300AF */  lb        $v1, 0xAF($v0)
/* 12A98 80037698 804200B0 */  lb        $v0, 0xB0($v0)
/* 12A9C 8003769C 44836000 */  mtc1      $v1, $f12
/* 12AA0 800376A0 00000000 */  nop
/* 12AA4 800376A4 46806320 */  cvt.s.w   $f12, $f12
/* 12AA8 800376A8 44820000 */  mtc1      $v0, $f0
/* 12AAC 800376AC 00000000 */  nop
/* 12AB0 800376B0 46800020 */  cvt.s.w   $f0, $f0
/* 12AB4 800376B4 0800DDC2 */  j         .L80037708
/* 12AB8 800376B8 46006303 */   div.s    $f12, $f12, $f0
glabel .L800376BC
/* 12ABC 800376BC 44806000 */  mtc1      $zero, $f12
/* 12AC0 800376C0 0800DDC4 */  j         .L80037710
/* 12AC4 800376C4 00000000 */   nop
glabel .L800376C8
/* 12AC8 800376C8 44806000 */  mtc1      $zero, $f12
/* 12ACC 800376CC 0800DDC4 */  j         .L80037710
/* 12AD0 800376D0 00000000 */   nop
glabel .L800376D4
/* 12AD4 800376D4 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 12AD8 800376D8 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 12ADC 800376DC 806200AF */  lb        $v0, 0xAF($v1)
/* 12AE0 800376E0 806300B0 */  lb        $v1, 0xB0($v1)
/* 12AE4 800376E4 2442FFFF */  addiu     $v0, $v0, -0x1
/* 12AE8 800376E8 00621023 */  subu      $v0, $v1, $v0
/* 12AEC 800376EC 44826000 */  mtc1      $v0, $f12
/* 12AF0 800376F0 00000000 */  nop
/* 12AF4 800376F4 46806320 */  cvt.s.w   $f12, $f12
/* 12AF8 800376F8 44830000 */  mtc1      $v1, $f0
/* 12AFC 800376FC 00000000 */  nop
/* 12B00 80037700 46800020 */  cvt.s.w   $f0, $f0
/* 12B04 80037704 46006303 */  div.s     $f12, $f12, $f0
.L80037708:
/* 12B08 80037708 460C6302 */  mul.s     $f12, $f12, $f12
/* 12B0C 8003770C 00000000 */  nop
.L80037710:
/* 12B10 80037710 0C00DE5A */  jal       title_screen_draw_images
/* 12B14 80037714 46006386 */   mov.s    $f14, $f12
glabel .L80037718
/* 12B18 80037718 3C03FF10 */  lui       $v1, (0xFF10013F >> 16)
/* 12B1C 8003771C 3463013F */  ori       $v1, $v1, (0xFF10013F & 0xFFFF)
/* 12B20 80037720 3C10800A */  lui       $s0, %hi(gMainGfxPos)
/* 12B24 80037724 2610A66C */  addiu     $s0, $s0, %lo(gMainGfxPos)
/* 12B28 80037728 3C12E700 */  lui       $s2, (0xE7000000 >> 16)
/* 12B2C 8003772C 8E110000 */  lw        $s1, 0x0($s0)
/* 12B30 80037730 3C04800A */  lui       $a0, %hi(nuGfxCfb_ptr)
/* 12B34 80037734 8C84A64C */  lw        $a0, %lo(nuGfxCfb_ptr)($a0)
/* 12B38 80037738 0220102D */  daddu     $v0, $s1, $zero
/* 12B3C 8003773C 26310008 */  addiu     $s1, $s1, 0x8
/* 12B40 80037740 AE110000 */  sw        $s1, 0x0($s0)
/* 12B44 80037744 AC520000 */  sw        $s2, 0x0($v0)
/* 12B48 80037748 AC400004 */  sw        $zero, 0x4($v0)
/* 12B4C 8003774C 26220008 */  addiu     $v0, $s1, 0x8
/* 12B50 80037750 AE020000 */  sw        $v0, 0x0($s0)
/* 12B54 80037754 0C0187A4 */  jal       osVirtualToPhysical
/* 12B58 80037758 AE230000 */   sw       $v1, 0x0($s1)
/* 12B5C 8003775C 3C060050 */  lui       $a2, (0x5003C0 >> 16)
/* 12B60 80037760 34C603C0 */  ori       $a2, $a2, (0x5003C0 & 0xFFFF)
/* 12B64 80037764 3C07E300 */  lui       $a3, (0xE3000A01 >> 16)
/* 12B68 80037768 34E70A01 */  ori       $a3, $a3, (0xE3000A01 & 0xFFFF)
/* 12B6C 8003776C 3C08D9C0 */  lui       $t0, (0xD9C0F9FA >> 16)
/* 12B70 80037770 3508F9FA */  ori       $t0, $t0, (0xD9C0F9FA & 0xFFFF)
/* 12B74 80037774 3C0AD9FF */  lui       $t2, (0xD9FFFFFF >> 16)
/* 12B78 80037778 354AFFFF */  ori       $t2, $t2, (0xD9FFFFFF & 0xFFFF)
/* 12B7C 8003777C 3C090022 */  lui       $t1, (0x220005 >> 16)
/* 12B80 80037780 35290005 */  ori       $t1, $t1, (0x220005 & 0xFFFF)
/* 12B84 80037784 3C0BDC08 */  lui       $t3, (0xDC08060A >> 16)
/* 12B88 80037788 356B060A */  ori       $t3, $t3, (0xDC08060A & 0xFFFF)
/* 12B8C 8003778C 3C0CDC08 */  lui       $t4, (0xDC08090A >> 16)
/* 12B90 80037790 358C090A */  ori       $t4, $t4, (0xDC08090A & 0xFFFF)
/* 12B94 80037794 3C0DD700 */  lui       $t5, (0xD7000002 >> 16)
/* 12B98 80037798 35AD0002 */  ori       $t5, $t5, (0xD7000002 & 0xFFFF)
/* 12B9C 8003779C 3C0EE300 */  lui       $t6, (0xE3000F00 >> 16)
/* 12BA0 800377A0 35CE0F00 */  ori       $t6, $t6, (0xE3000F00 & 0xFFFF)
/* 12BA4 800377A4 3C0FE300 */  lui       $t7, (0xE3000C00 >> 16)
/* 12BA8 800377A8 35EF0C00 */  ori       $t7, $t7, (0xE3000C00 & 0xFFFF)
/* 12BAC 800377AC 3C13E300 */  lui       $s3, (0xE3001201 >> 16)
/* 12BB0 800377B0 36731201 */  ori       $s3, $s3, (0xE3001201 & 0xFFFF)
/* 12BB4 800377B4 3C14E300 */  lui       $s4, (0xE3001801 >> 16)
/* 12BB8 800377B8 36941801 */  ori       $s4, $s4, (0xE3001801 & 0xFFFF)
/* 12BBC 800377BC 3C15E300 */  lui       $s5, (0xE3000D01 >> 16)
/* 12BC0 800377C0 36B50D01 */  ori       $s5, $s5, (0xE3000D01 & 0xFFFF)
/* 12BC4 800377C4 3C16E300 */  lui       $s6, (0xE3001402 >> 16)
/* 12BC8 800377C8 36D61402 */  ori       $s6, $s6, (0xE3001402 & 0xFFFF)
/* 12BCC 800377CC 3C17E300 */  lui       $s7, (0xE3001700 >> 16)
/* 12BD0 800377D0 36F71700 */  ori       $s7, $s7, (0xE3001700 & 0xFFFF)
/* 12BD4 800377D4 3C18E200 */  lui       $t8, (0xE2001E01 >> 16)
/* 12BD8 800377D8 37181E01 */  ori       $t8, $t8, (0xE2001E01 & 0xFFFF)
/* 12BDC 800377DC 8E030000 */  lw        $v1, 0x0($s0)
/* 12BE0 800377E0 0000202D */  daddu     $a0, $zero, $zero
/* 12BE4 800377E4 AE220004 */  sw        $v0, 0x4($s1)
/* 12BE8 800377E8 3C02ED00 */  lui       $v0, (0xED000000 >> 16)
/* 12BEC 800377EC 0060282D */  daddu     $a1, $v1, $zero
/* 12BF0 800377F0 24630008 */  addiu     $v1, $v1, 0x8
/* 12BF4 800377F4 AE030000 */  sw        $v1, 0x0($s0)
/* 12BF8 800377F8 ACA20000 */  sw        $v0, 0x0($a1)
/* 12BFC 800377FC 24620008 */  addiu     $v0, $v1, 0x8
/* 12C00 80037800 ACA60004 */  sw        $a2, 0x4($a1)
/* 12C04 80037804 AE020000 */  sw        $v0, 0x0($s0)
/* 12C08 80037808 24620010 */  addiu     $v0, $v1, 0x10
/* 12C0C 8003780C AC670000 */  sw        $a3, 0x0($v1)
/* 12C10 80037810 AC600004 */  sw        $zero, 0x4($v1)
/* 12C14 80037814 AE020000 */  sw        $v0, 0x0($s0)
/* 12C18 80037818 24620018 */  addiu     $v0, $v1, 0x18
/* 12C1C 8003781C AC720008 */  sw        $s2, 0x8($v1)
/* 12C20 80037820 AC60000C */  sw        $zero, 0xC($v1)
/* 12C24 80037824 AE020000 */  sw        $v0, 0x0($s0)
/* 12C28 80037828 24620020 */  addiu     $v0, $v1, 0x20
/* 12C2C 8003782C AC680010 */  sw        $t0, 0x10($v1)
/* 12C30 80037830 AC600014 */  sw        $zero, 0x14($v1)
/* 12C34 80037834 AE020000 */  sw        $v0, 0x0($s0)
/* 12C38 80037838 24620028 */  addiu     $v0, $v1, 0x28
/* 12C3C 8003783C AC6A0018 */  sw        $t2, 0x18($v1)
/* 12C40 80037840 AC69001C */  sw        $t1, 0x1C($v1)
/* 12C44 80037844 AE020000 */  sw        $v0, 0x0($s0)
/* 12C48 80037848 3C02DB02 */  lui       $v0, (0xDB020000 >> 16)
/* 12C4C 8003784C AC620020 */  sw        $v0, 0x20($v1)
/* 12C50 80037850 24020018 */  addiu     $v0, $zero, 0x18
/* 12C54 80037854 AC620024 */  sw        $v0, 0x24($v1)
/* 12C58 80037858 24620030 */  addiu     $v0, $v1, 0x30
/* 12C5C 8003785C 3C058007 */  lui       $a1, %hi(D_80077A40)
/* 12C60 80037860 24A57A40 */  addiu     $a1, $a1, %lo(D_80077A40)
/* 12C64 80037864 AE020000 */  sw        $v0, 0x0($s0)
/* 12C68 80037868 24620038 */  addiu     $v0, $v1, 0x38
/* 12C6C 8003786C AC65002C */  sw        $a1, 0x2C($v1)
/* 12C70 80037870 24A5FFF8 */  addiu     $a1, $a1, -0x8
/* 12C74 80037874 AC6B0028 */  sw        $t3, 0x28($v1)
/* 12C78 80037878 AE020000 */  sw        $v0, 0x0($s0)
/* 12C7C 8003787C 24620040 */  addiu     $v0, $v1, 0x40
/* 12C80 80037880 AC6C0030 */  sw        $t4, 0x30($v1)
/* 12C84 80037884 AC650034 */  sw        $a1, 0x34($v1)
/* 12C88 80037888 AE020000 */  sw        $v0, 0x0($s0)
/* 12C8C 8003788C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 12C90 80037890 AC62003C */  sw        $v0, 0x3C($v1)
/* 12C94 80037894 24620048 */  addiu     $v0, $v1, 0x48
/* 12C98 80037898 AC6D0038 */  sw        $t5, 0x38($v1)
/* 12C9C 8003789C AE020000 */  sw        $v0, 0x0($s0)
/* 12CA0 800378A0 24620050 */  addiu     $v0, $v1, 0x50
/* 12CA4 800378A4 AC6E0040 */  sw        $t6, 0x40($v1)
/* 12CA8 800378A8 AC600044 */  sw        $zero, 0x44($v1)
/* 12CAC 800378AC AE020000 */  sw        $v0, 0x0($s0)
/* 12CB0 800378B0 3C020008 */  lui       $v0, (0x80000 >> 16)
/* 12CB4 800378B4 AC6F0048 */  sw        $t7, 0x48($v1)
/* 12CB8 800378B8 AC62004C */  sw        $v0, 0x4C($v1)
/* 12CBC 800378BC 24620058 */  addiu     $v0, $v1, 0x58
/* 12CC0 800378C0 AE020000 */  sw        $v0, 0x0($s0)
/* 12CC4 800378C4 24022000 */  addiu     $v0, $zero, 0x2000
/* 12CC8 800378C8 AC620054 */  sw        $v0, 0x54($v1)
/* 12CCC 800378CC 24620060 */  addiu     $v0, $v1, 0x60
/* 12CD0 800378D0 AC730050 */  sw        $s3, 0x50($v1)
/* 12CD4 800378D4 AE020000 */  sw        $v0, 0x0($s0)
/* 12CD8 800378D8 240200C0 */  addiu     $v0, $zero, 0xC0
/* 12CDC 800378DC AC62005C */  sw        $v0, 0x5C($v1)
/* 12CE0 800378E0 24620068 */  addiu     $v0, $v1, 0x68
/* 12CE4 800378E4 AC740058 */  sw        $s4, 0x58($v1)
/* 12CE8 800378E8 AE020000 */  sw        $v0, 0x0($s0)
/* 12CEC 800378EC 24620070 */  addiu     $v0, $v1, 0x70
/* 12CF0 800378F0 AC750060 */  sw        $s5, 0x60($v1)
/* 12CF4 800378F4 AC600064 */  sw        $zero, 0x64($v1)
/* 12CF8 800378F8 AE020000 */  sw        $v0, 0x0($s0)
/* 12CFC 800378FC 24020C00 */  addiu     $v0, $zero, 0xC00
/* 12D00 80037900 AC62006C */  sw        $v0, 0x6C($v1)
/* 12D04 80037904 24620078 */  addiu     $v0, $v1, 0x78
/* 12D08 80037908 AC760068 */  sw        $s6, 0x68($v1)
/* 12D0C 8003790C AE020000 */  sw        $v0, 0x0($s0)
/* 12D10 80037910 24620080 */  addiu     $v0, $v1, 0x80
/* 12D14 80037914 AC770070 */  sw        $s7, 0x70($v1)
/* 12D18 80037918 AC600074 */  sw        $zero, 0x74($v1)
/* 12D1C 8003791C AE020000 */  sw        $v0, 0x0($s0)
/* 12D20 80037920 AC780078 */  sw        $t8, 0x78($v1)
/* 12D24 80037924 0C00B5CF */  jal       render_frame
/* 12D28 80037928 AC60007C */   sw       $zero, 0x7C($v1)
/* 12D2C 8003792C 0C00B5CF */  jal       render_frame
/* 12D30 80037930 24040001 */   addiu    $a0, $zero, 0x1
/* 12D34 80037934 8FBF0030 */  lw        $ra, 0x30($sp)
/* 12D38 80037938 8FB7002C */  lw        $s7, 0x2C($sp)
/* 12D3C 8003793C 8FB60028 */  lw        $s6, 0x28($sp)
/* 12D40 80037940 8FB50024 */  lw        $s5, 0x24($sp)
/* 12D44 80037944 8FB40020 */  lw        $s4, 0x20($sp)
/* 12D48 80037948 8FB3001C */  lw        $s3, 0x1C($sp)
/* 12D4C 8003794C 8FB20018 */  lw        $s2, 0x18($sp)
/* 12D50 80037950 8FB10014 */  lw        $s1, 0x14($sp)
/* 12D54 80037954 8FB00010 */  lw        $s0, 0x10($sp)
/* 12D58 80037958 03E00008 */  jr        $ra
/* 12D5C 8003795C 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void appendGfx_title_screen(void) {
    f32 phi_f12;
    s32 temp;

    switch (gGameStatusPtr->introState) {
        case INTRO_STATE_0:
        case INTRO_STATE_3:
            break;
        case INTRO_STATE_1:
            phi_f12 = gGameStatusPtr->unk_AF;
            phi_f12 /= gGameStatusPtr->unk_B0;
            phi_f12 = SQ(phi_f12);
            title_screen_draw_images(phi_f12, phi_f12);
            break;
        case INTRO_STATE_2:
            title_screen_draw_images(0.0f, 0.0f);
            break;
        case INTRO_STATE_4:
            title_screen_draw_images(0.0f, 0.0f);
            break;
        case INTRO_STATE_5:
            temp = gGameStatusPtr->unk_AF - 1;
            phi_f12 = gGameStatusPtr->unk_B0 - temp;
            phi_f12 /= gGameStatusPtr->unk_B0;
            phi_f12 = SQ(phi_f12);
            title_screen_draw_images(phi_f12, phi_f12);
            break;
    }

    gDPPipeSync(gMainGfxPos++);
    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
    gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
    gDPPipeSync(gMainGfxPos++);
    gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING |
                            G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
    gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
    gSPSetLights1(gMainGfxPos++, D_80077A38);

    gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
    gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
    gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
    gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
    gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
    gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
    gDPSetTextureConvert(gMainGfxPos++, G_TC_FILT);
    gDPSetCombineKey(gMainGfxPos++, G_CK_NONE);
    gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
    render_frame(FALSE);
    render_frame(TRUE);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel fire_flower_update
/* 37F924 E007E204 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 37F928 E007E208 AFB1001C */  sw        $s1, 0x1C($sp)
/* 37F92C E007E20C 0080882D */  daddu     $s1, $a0, $zero
/* 37F930 E007E210 AFBF0020 */  sw        $ra, 0x20($sp)
/* 37F934 E007E214 AFB00018 */  sw        $s0, 0x18($sp)
/* 37F938 E007E218 8E30000C */  lw        $s0, 0xC($s1)
/* 37F93C E007E21C 8E050004 */  lw        $a1, 0x4($s0)
/* 37F940 E007E220 8E020044 */  lw        $v0, 0x44($s0)
/* 37F944 E007E224 8E030040 */  lw        $v1, 0x40($s0)
/* 37F948 E007E228 24420001 */  addiu     $v0, $v0, 0x1
/* 37F94C E007E22C 24630001 */  addiu     $v1, $v1, 0x1
/* 37F950 E007E230 AE020044 */  sw        $v0, 0x44($s0)
/* 37F954 E007E234 24020007 */  addiu     $v0, $zero, 0x7
/* 37F958 E007E238 14A20005 */  bne       $a1, $v0, .LE007E250
/* 37F95C E007E23C AE030040 */   sw       $v1, 0x40($s0)
/* 37F960 E007E240 0C080128 */  jal       shim_remove_effect
/* 37F964 E007E244 00000000 */   nop
/* 37F968 E007E248 0801F93D */  j         .LE007E4F4
/* 37F96C E007E24C 00000000 */   nop
.LE007E250:
/* 37F970 E007E250 2CA20007 */  sltiu     $v0, $a1, 0x7
/* 37F974 E007E254 10400075 */  beqz      $v0, .LE007E42C
/* 37F978 E007E258 00051080 */   sll      $v0, $a1, 2
/* 37F97C E007E25C 3C01E008 */  lui       $at, (0xE0080000 >> 16)
/* 37F980 E007E260 00220821 */  addu      $at, $at, $v0
/* 37F984 E007E264 8C22EC48 */  lw        $v0, -0x13B8($at)
/* 37F988 E007E268 00400008 */  jr        $v0
/* 37F98C E007E26C 00000000 */   nop
/* 37F990 E007E270 0C080150 */  jal       shim_load_effect
/* 37F994 E007E274 2404002D */   addiu    $a0, $zero, 0x2D
/* 37F998 E007E278 C6020008 */  lwc1      $f2, 0x8($s0)
/* 37F99C E007E27C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 37F9A0 E007E280 44810000 */  mtc1      $at, $f0
/* 37F9A4 E007E284 24020007 */  addiu     $v0, $zero, 0x7
/* 37F9A8 E007E288 AFA20010 */  sw        $v0, 0x10($sp)
/* 37F9AC E007E28C 24020014 */  addiu     $v0, $zero, 0x14
/* 37F9B0 E007E290 AFA20014 */  sw        $v0, 0x14($sp)
/* 37F9B4 E007E294 46001081 */  sub.s     $f2, $f2, $f0
/* 37F9B8 E007E298 8E06000C */  lw        $a2, 0xC($s0)
/* 37F9BC E007E29C 8E070010 */  lw        $a3, 0x10($s0)
/* 37F9C0 E007E2A0 44051000 */  mfc1      $a1, $f2
/* 37F9C4 E007E2A4 0C016800 */  jal       stars_spread_main
/* 37F9C8 E007E2A8 0000202D */   daddu    $a0, $zero, $zero
/* 37F9CC E007E2AC 8E020004 */  lw        $v0, 0x4($s0)
/* 37F9D0 E007E2B0 AE000034 */  sw        $zero, 0x34($s0)
/* 37F9D4 E007E2B4 AE000038 */  sw        $zero, 0x38($s0)
/* 37F9D8 E007E2B8 0801F909 */  j         .LE007E424
/* 37F9DC E007E2BC AE000040 */   sw       $zero, 0x40($s0)
/* 37F9E0 E007E2C0 28620008 */  slti      $v0, $v1, 0x8
/* 37F9E4 E007E2C4 14400004 */  bnez      $v0, .LE007E2D8
/* 37F9E8 E007E2C8 00000000 */   nop
/* 37F9EC E007E2CC 8E020004 */  lw        $v0, 0x4($s0)
/* 37F9F0 E007E2D0 0801F909 */  j         .LE007E424
/* 37F9F4 E007E2D4 AE000040 */   sw       $zero, 0x40($s0)
.LE007E2D8:
/* 37F9F8 E007E2D8 3C02E008 */  lui       $v0, (0xE0080000 >> 16)
/* 37F9FC E007E2DC 00431021 */  addu      $v0, $v0, $v1
/* 37FA00 E007E2E0 8042EC2F */  lb        $v0, -0x13D1($v0)
/* 37FA04 E007E2E4 3C01E008 */  lui       $at, (0xE0080000 >> 16)
/* 37FA08 E007E2E8 D422EC68 */  ldc1      $f2, -0x1398($at)
/* 37FA0C E007E2EC 44820000 */  mtc1      $v0, $f0
/* 37FA10 E007E2F0 00000000 */  nop
/* 37FA14 E007E2F4 46800021 */  cvt.d.w   $f0, $f0
/* 37FA18 E007E2F8 46220002 */  mul.d     $f0, $f0, $f2
/* 37FA1C E007E2FC 00000000 */  nop
/* 37FA20 E007E300 AE000034 */  sw        $zero, 0x34($s0)
/* 37FA24 E007E304 AE000038 */  sw        $zero, 0x38($s0)
/* 37FA28 E007E308 46200020 */  cvt.s.d   $f0, $f0
/* 37FA2C E007E30C 0801F90B */  j         .LE007E42C
/* 37FA30 E007E310 E6000030 */   swc1     $f0, 0x30($s0)
/* 37FA34 E007E314 28620002 */  slti      $v0, $v1, 0x2
/* 37FA38 E007E318 14400004 */  bnez      $v0, .LE007E32C
/* 37FA3C E007E31C 24020001 */   addiu    $v0, $zero, 0x1
/* 37FA40 E007E320 8E020004 */  lw        $v0, 0x4($s0)
/* 37FA44 E007E324 0801F909 */  j         .LE007E424
/* 37FA48 E007E328 AE000040 */   sw       $zero, 0x40($s0)
.LE007E32C:
/* 37FA4C E007E32C 0801F90B */  j         .LE007E42C
/* 37FA50 E007E330 AE020034 */   sw       $v0, 0x34($s0)
/* 37FA54 E007E334 2862000F */  slti      $v0, $v1, 0xF
/* 37FA58 E007E338 14400004 */  bnez      $v0, .LE007E34C
/* 37FA5C E007E33C 24020002 */   addiu    $v0, $zero, 0x2
/* 37FA60 E007E340 8E020004 */  lw        $v0, 0x4($s0)
/* 37FA64 E007E344 0801F909 */  j         .LE007E424
/* 37FA68 E007E348 AE000040 */   sw       $zero, 0x40($s0)
.LE007E34C:
/* 37FA6C E007E34C 0801F90B */  j         .LE007E42C
/* 37FA70 E007E350 AE020034 */   sw       $v0, 0x34($s0)
/* 37FA74 E007E354 2862002D */  slti      $v0, $v1, 0x2D
/* 37FA78 E007E358 14400004 */  bnez      $v0, .LE007E36C
/* 37FA7C E007E35C 24020003 */   addiu    $v0, $zero, 0x3
/* 37FA80 E007E360 8E020004 */  lw        $v0, 0x4($s0)
/* 37FA84 E007E364 0801F909 */  j         .LE007E424
/* 37FA88 E007E368 AE000040 */   sw       $zero, 0x40($s0)
.LE007E36C:
/* 37FA8C E007E36C AE020034 */  sw        $v0, 0x34($s0)
/* 37FA90 E007E370 30620001 */  andi      $v0, $v1, 0x1
/* 37FA94 E007E374 10400005 */  beqz      $v0, .LE007E38C
/* 37FA98 E007E378 AE00002C */   sw       $zero, 0x2C($s0)
/* 37FA9C E007E37C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 37FAA0 E007E380 44810000 */  mtc1      $at, $f0
/* 37FAA4 E007E384 0801F90B */  j         .LE007E42C
/* 37FAA8 E007E388 E6000030 */   swc1     $f0, 0x30($s0)
.LE007E38C:
/* 37FAAC E007E38C 3C013F86 */  lui       $at, (0x3F866666 >> 16)
/* 37FAB0 E007E390 34216666 */  ori       $at, $at, (0x3F866666 & 0xFFFF)
/* 37FAB4 E007E394 44810000 */  mtc1      $at, $f0
/* 37FAB8 E007E398 0801F90B */  j         .LE007E42C
/* 37FABC E007E39C E6000030 */   swc1     $f0, 0x30($s0)
/* 37FAC0 E007E3A0 2862000A */  slti      $v0, $v1, 0xA
/* 37FAC4 E007E3A4 54400004 */  bnel      $v0, $zero, .LE007E3B8
/* 37FAC8 E007E3A8 AE000034 */   sw       $zero, 0x34($s0)
/* 37FACC E007E3AC 8E020004 */  lw        $v0, 0x4($s0)
/* 37FAD0 E007E3B0 0801F909 */  j         .LE007E424
/* 37FAD4 E007E3B4 AE000040 */   sw       $zero, 0x40($s0)
.LE007E3B8:
/* 37FAD8 E007E3B8 3C01C120 */  lui       $at, (0xC1200000 >> 16)
/* 37FADC E007E3BC 44810000 */  mtc1      $at, $f0
/* 37FAE0 E007E3C0 0801F90B */  j         .LE007E42C
/* 37FAE4 E007E3C4 E600002C */   swc1     $f0, 0x2C($s0)
/* 37FAE8 E007E3C8 C6040028 */  lwc1      $f4, 0x28($s0)
/* 37FAEC E007E3CC 3C014210 */  lui       $at, (0x42100000 >> 16)
/* 37FAF0 E007E3D0 44810000 */  mtc1      $at, $f0
/* 37FAF4 E007E3D4 00000000 */  nop
/* 37FAF8 E007E3D8 46002100 */  add.s     $f4, $f4, $f0
/* 37FAFC E007E3DC 3C01E008 */  lui       $at, (0xE0080000 >> 16)
/* 37FB00 E007E3E0 D422EC70 */  ldc1      $f2, -0x1390($at)
/* 37FB04 E007E3E4 C600003C */  lwc1      $f0, 0x3C($s0)
/* 37FB08 E007E3E8 46800021 */  cvt.d.w   $f0, $f0
/* 37FB0C E007E3EC 46220002 */  mul.d     $f0, $f0, $f2
/* 37FB10 E007E3F0 00000000 */  nop
/* 37FB14 E007E3F4 E6040028 */  swc1      $f4, 0x28($s0)
/* 37FB18 E007E3F8 46002086 */  mov.s     $f2, $f4
/* 37FB1C E007E3FC 3C014434 */  lui       $at, (0x44340000 >> 16)
/* 37FB20 E007E400 44812000 */  mtc1      $at, $f4
/* 37FB24 E007E404 AE000034 */  sw        $zero, 0x34($s0)
/* 37FB28 E007E408 4602203E */  c.le.s    $f4, $f2
/* 37FB2C E007E40C 4620028D */  trunc.w.d $f10, $f0
/* 37FB30 E007E410 E60A003C */  swc1      $f10, 0x3C($s0)
/* 37FB34 E007E414 45000005 */  bc1f      .LE007E42C
/* 37FB38 E007E418 00000000 */   nop
/* 37FB3C E007E41C 8E020004 */  lw        $v0, 0x4($s0)
/* 37FB40 E007E420 E6040028 */  swc1      $f4, 0x28($s0)
.LE007E424:
/* 37FB44 E007E424 24420001 */  addiu     $v0, $v0, 0x1
/* 37FB48 E007E428 AE020004 */  sw        $v0, 0x4($s0)
.LE007E42C:
/* 37FB4C E007E42C 8E050004 */  lw        $a1, 0x4($s0)
/* 37FB50 E007E430 24A2FFFC */  addiu     $v0, $a1, -0x4
/* 37FB54 E007E434 2C420003 */  sltiu     $v0, $v0, 0x3
/* 37FB58 E007E438 1040002E */  beqz      $v0, .LE007E4F4
/* 37FB5C E007E43C 2610004C */   addiu    $s0, $s0, 0x4C
/* 37FB60 E007E440 8E220008 */  lw        $v0, 0x8($s1)
/* 37FB64 E007E444 24040001 */  addiu     $a0, $zero, 0x1
/* 37FB68 E007E448 0082102A */  slt       $v0, $a0, $v0
/* 37FB6C E007E44C 10400029 */  beqz      $v0, .LE007E4F4
/* 37FB70 E007E450 00000000 */   nop
/* 37FB74 E007E454 24060004 */  addiu     $a2, $zero, 0x4
/* 37FB78 E007E458 3C014348 */  lui       $at, (0x43480000 >> 16)
/* 37FB7C E007E45C 44814000 */  mtc1      $at, $f8
/* 37FB80 E007E460 26030010 */  addiu     $v1, $s0, 0x10
.LE007E464:
/* 37FB84 E007E464 8C620038 */  lw        $v0, 0x38($v1)
/* 37FB88 E007E468 18400003 */  blez      $v0, .LE007E478
/* 37FB8C E007E46C 2442FFFF */   addiu    $v0, $v0, -0x1
/* 37FB90 E007E470 1C40001B */  bgtz      $v0, .LE007E4E0
/* 37FB94 E007E474 AC620038 */   sw       $v0, 0x38($v1)
.LE007E478:
/* 37FB98 E007E478 C4620008 */  lwc1      $f2, 0x8($v1)
/* 37FB9C E007E47C C4600010 */  lwc1      $f0, 0x10($v1)
/* 37FBA0 E007E480 C466FFF8 */  lwc1      $f6, -0x8($v1)
/* 37FBA4 E007E484 46001080 */  add.s     $f2, $f2, $f0
/* 37FBA8 E007E488 C4600004 */  lwc1      $f0, 0x4($v1)
/* 37FBAC E007E48C C4640000 */  lwc1      $f4, 0x0($v1)
/* 37FBB0 E007E490 46003180 */  add.s     $f6, $f6, $f0
/* 37FBB4 E007E494 C460000C */  lwc1      $f0, 0xC($v1)
/* 37FBB8 E007E498 46002100 */  add.s     $f4, $f4, $f0
/* 37FBBC E007E49C E4620008 */  swc1      $f2, 0x8($v1)
/* 37FBC0 E007E4A0 C462FFFC */  lwc1      $f2, -0x4($v1)
/* 37FBC4 E007E4A4 C4600008 */  lwc1      $f0, 0x8($v1)
/* 37FBC8 E007E4A8 46001080 */  add.s     $f2, $f2, $f0
/* 37FBCC E007E4AC E466FFF8 */  swc1      $f6, -0x8($v1)
/* 37FBD0 E007E4B0 E4640000 */  swc1      $f4, 0x0($v1)
/* 37FBD4 E007E4B4 14A6000A */  bne       $a1, $a2, .LE007E4E0
/* 37FBD8 E007E4B8 E462FFFC */   swc1     $f2, -0x4($v1)
/* 37FBDC E007E4BC 46003006 */  mov.s     $f0, $f6
/* 37FBE0 E007E4C0 4600403C */  c.lt.s    $f8, $f0
/* 37FBE4 E007E4C4 00000000 */  nop
/* 37FBE8 E007E4C8 45020006 */  bc1fl     .LE007E4E4
/* 37FBEC E007E4CC 24840001 */   addiu    $a0, $a0, 0x1
/* 37FBF0 E007E4D0 AC60FFF8 */  sw        $zero, -0x8($v1)
/* 37FBF4 E007E4D4 AC60FFFC */  sw        $zero, -0x4($v1)
/* 37FBF8 E007E4D8 AC600008 */  sw        $zero, 0x8($v1)
/* 37FBFC E007E4DC AC600000 */  sw        $zero, 0x0($v1)
.LE007E4E0:
/* 37FC00 E007E4E0 24840001 */  addiu     $a0, $a0, 0x1
.LE007E4E4:
/* 37FC04 E007E4E4 8E220008 */  lw        $v0, 0x8($s1)
/* 37FC08 E007E4E8 0082102A */  slt       $v0, $a0, $v0
/* 37FC0C E007E4EC 1440FFDD */  bnez      $v0, .LE007E464
/* 37FC10 E007E4F0 2463004C */   addiu    $v1, $v1, 0x4C
.LE007E4F4:
/* 37FC14 E007E4F4 8FBF0020 */  lw        $ra, 0x20($sp)
/* 37FC18 E007E4F8 8FB1001C */  lw        $s1, 0x1C($sp)
/* 37FC1C E007E4FC 8FB00018 */  lw        $s0, 0x18($sp)
/* 37FC20 E007E500 03E00008 */  jr        $ra
/* 37FC24 E007E504 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void fire_flower_update(EffectInstance* effect) {
    FireFlowerFXData* part = effect->data.fireFlower;
    s32 unk_04;
    s32 unk_40X;
    s32 i;

    part->unk_40.y++;
    part->unk_40.x++;

    unk_04 = part->unk_04;
    unk_40X = part->unk_40.x;

    if (unk_04 == 7) {
        shim_remove_effect(effect);
        return;
    }

    switch (unk_04) {
        case 0:
            shim_load_effect(EFFECT_STARS_SPREAD);
            stars_spread_main(0, part->pos.x - 10.0f, part->pos.y, part->pos.z, 7, 20);
            part->unk_34 = 0;
            part->unk_38 = 0;
            part->unk_40.x = 0;
            part->unk_04++;
            break;
        case 1:
            if (unk_40X >= ARRAY_COUNT(D_E007EC30)) {
                part->unk_40.x = 0;
                part->unk_04++;
            } else {
                part->unk_30 = D_E007EC30[unk_40X - 1] * 0.01;
                part->unk_34 = 0;
                part->unk_38 = 0;
            }
            break;
        case 2:
            if (unk_40X >= 2) {
                part->unk_40.x = 0;
                part->unk_04++;
            } else {
                part->unk_34 = 1;
            }
            break;
        case 3:
            if (unk_40X >= 15) {
                part->unk_40.x = 0;
                part->unk_04++;
            } else {
                part->unk_34 = 2;
            }
            break;
        case 4:
            if (unk_40X >= 45) {
                part->unk_40.x = 0;
                part->unk_04++;
            } else {
                part->unk_34 = 3;
                part->unk_2C = 0;
                if (unk_40X % 2) {
                    part->unk_30 = 1.0f;
                } else {
                    part->unk_30 = 1.05f;
                }
            }
            break;
        case 5:
            if (unk_40X >= 10) {
                part->unk_40.x = 0;
                part->unk_04++;
            } else {
                part->unk_34 = 0;
                part->unk_2C = -10.0f;
            }
            break;
        case 6:
            part->unk_28 += 36.0f;
            part->unk_34 = 0;
            part->unk_3C *= 0.9;
            if (part->unk_28 >= 720.0f) {
                part->unk_28 = 720.0f;
                part->unk_04++;
            }
            break;
    }

    unk_04 = part->unk_04;
    part++;

    if (unk_04 == 4 || unk_04 == 5 || unk_04 == 6) {
        for (i = 1; i < effect->numParts; i++, part++) {
            if (part->unk_40.z <= 0 || --part->unk_40.z <= 0) {
                part->unk_18 += part->unk_20;
                part->pos.x += part->unk_14;
                part->pos.y += part->unk_18;
                part->pos.z += part->unk_1C;

                if (unk_04 == 4 && part->pos.x > 200.0f) {
                    part->pos.x = 0;
                    part->pos.y = 0;
                    part->unk_18 = 0;
                    part->pos.z = 0;
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_npc_blur
/* 16238 8003AE38 27BDFF08 */  addiu     $sp, $sp, -0xF8
/* 1623C 8003AE3C F7BC00E8 */  sdc1      $f28, 0xE8($sp)
/* 16240 8003AE40 4480E000 */  mtc1      $zero, $f28
/* 16244 8003AE44 F7BA00E0 */  sdc1      $f26, 0xE0($sp)
/* 16248 8003AE48 3C01800A */  lui       $at, %hi(D_800984C0)
/* 1624C 8003AE4C D43A84C0 */  ldc1      $f26, %lo(D_800984C0)($at)
/* 16250 8003AE50 AFB000A0 */  sw        $s0, 0xA0($sp)
/* 16254 8003AE54 0080802D */  daddu     $s0, $a0, $zero
/* 16258 8003AE58 AFB300AC */  sw        $s3, 0xAC($sp)
/* 1625C 8003AE5C 0000982D */  daddu     $s3, $zero, $zero
/* 16260 8003AE60 AFB500B4 */  sw        $s5, 0xB4($sp)
/* 16264 8003AE64 0260A82D */  daddu     $s5, $s3, $zero
/* 16268 8003AE68 AFB100A4 */  sw        $s1, 0xA4($sp)
/* 1626C 8003AE6C 27B10060 */  addiu     $s1, $sp, 0x60
/* 16270 8003AE70 AFB700BC */  sw        $s7, 0xBC($sp)
/* 16274 8003AE74 27B70020 */  addiu     $s7, $sp, 0x20
/* 16278 8003AE78 AFB400B0 */  sw        $s4, 0xB0($sp)
/* 1627C 8003AE7C 0260A02D */  daddu     $s4, $s3, $zero
/* 16280 8003AE80 AFBF00C0 */  sw        $ra, 0xC0($sp)
/* 16284 8003AE84 AFB600B8 */  sw        $s6, 0xB8($sp)
/* 16288 8003AE88 AFB200A8 */  sw        $s2, 0xA8($sp)
/* 1628C 8003AE8C F7BE00F0 */  sdc1      $f30, 0xF0($sp)
/* 16290 8003AE90 F7B800D8 */  sdc1      $f24, 0xD8($sp)
/* 16294 8003AE94 F7B600D0 */  sdc1      $f22, 0xD0($sp)
/* 16298 8003AE98 F7B400C8 */  sdc1      $f20, 0xC8($sp)
/* 1629C 8003AE9C 8E160020 */  lw        $s6, 0x20($s0)
/* 162A0 8003AEA0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 162A4 8003AEA4 4481F800 */  mtc1      $at, $f31
/* 162A8 8003AEA8 4480F000 */  mtc1      $zero, $f30
/* 162AC 8003AEAC 82D20001 */  lb        $s2, 0x1($s6)
/* 162B0 8003AEB0 2652FFFF */  addiu     $s2, $s2, -0x1
.L8003AEB4:
/* 162B4 8003AEB4 06410002 */  bgez      $s2, .L8003AEC0
/* 162B8 8003AEB8 26730001 */   addiu    $s3, $s3, 0x1
/* 162BC 8003AEBC 24120013 */  addiu     $s2, $zero, 0x13
.L8003AEC0:
/* 162C0 8003AEC0 82C20001 */  lb        $v0, 0x1($s6)
/* 162C4 8003AEC4 1242009C */  beq       $s2, $v0, .L8003B138
/* 162C8 8003AEC8 2A620003 */   slti     $v0, $s3, 0x3
/* 162CC 8003AECC 5440FFF9 */  bnel      $v0, $zero, .L8003AEB4
/* 162D0 8003AED0 2652FFFF */   addiu    $s2, $s2, -0x1
/* 162D4 8003AED4 0000982D */  daddu     $s3, $zero, $zero
/* 162D8 8003AED8 26B50001 */  addiu     $s5, $s5, 0x1
/* 162DC 8003AEDC 2AA20004 */  slti      $v0, $s5, 0x4
/* 162E0 8003AEE0 10400095 */  beqz      $v0, .L8003B138
/* 162E4 8003AEE4 26940014 */   addiu    $s4, $s4, 0x14
/* 162E8 8003AEE8 24050007 */  addiu     $a1, $zero, 0x7
/* 162EC 8003AEEC 240600FF */  addiu     $a2, $zero, 0xFF
/* 162F0 8003AEF0 00121080 */  sll       $v0, $s2, 2
/* 162F4 8003AEF4 02C21021 */  addu      $v0, $s6, $v0
/* 162F8 8003AEF8 C4540004 */  lwc1      $f20, 0x4($v0)
/* 162FC 8003AEFC C4560054 */  lwc1      $f22, 0x54($v0)
/* 16300 8003AF00 C45800A4 */  lwc1      $f24, 0xA4($v0)
/* 16304 8003AF04 00C0102D */  daddu     $v0, $a2, $zero
/* 16308 8003AF08 AFA20010 */  sw        $v0, 0x10($sp)
/* 1630C 8003AF0C 24020078 */  addiu     $v0, $zero, 0x78
/* 16310 8003AF10 00541023 */  subu      $v0, $v0, $s4
/* 16314 8003AF14 AFA20014 */  sw        $v0, 0x14($sp)
/* 16318 8003AF18 AFA00018 */  sw        $zero, 0x18($sp)
/* 1631C 8003AF1C 8E040024 */  lw        $a0, 0x24($s0)
/* 16320 8003AF20 0C0B7A25 */  jal       set_npc_imgfx_all
/* 16324 8003AF24 00C0382D */   daddu    $a3, $a2, $zero
/* 16328 8003AF28 4405A000 */  mfc1      $a1, $f20
/* 1632C 8003AF2C 4406B000 */  mfc1      $a2, $f22
/* 16330 8003AF30 4407C000 */  mfc1      $a3, $f24
/* 16334 8003AF34 C6140034 */  lwc1      $f20, 0x34($s0)
/* 16338 8003AF38 0C019E40 */  jal       guTranslateF
/* 1633C 8003AF3C 27A40020 */   addiu    $a0, $sp, 0x20
/* 16340 8003AF40 C6000048 */  lwc1      $f0, 0x48($s0)
/* 16344 8003AF44 461C0032 */  c.eq.s    $f0, $f28
/* 16348 8003AF48 00000000 */  nop
/* 1634C 8003AF4C 4501000B */  bc1t      .L8003AF7C
/* 16350 8003AF50 00000000 */   nop
/* 16354 8003AF54 E7BC0010 */  swc1      $f28, 0x10($sp)
/* 16358 8003AF58 8E050048 */  lw        $a1, 0x48($s0)
/* 1635C 8003AF5C 4406E000 */  mfc1      $a2, $f28
/* 16360 8003AF60 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 16364 8003AF64 0C019EC8 */  jal       guRotateF
/* 16368 8003AF68 0220202D */   daddu    $a0, $s1, $zero
/* 1636C 8003AF6C 0220202D */  daddu     $a0, $s1, $zero
/* 16370 8003AF70 27A50020 */  addiu     $a1, $sp, 0x20
/* 16374 8003AF74 0C019D80 */  jal       guMtxCatF
/* 16378 8003AF78 00A0302D */   daddu    $a2, $a1, $zero
.L8003AF7C:
/* 1637C 8003AF7C C6000044 */  lwc1      $f0, 0x44($s0)
/* 16380 8003AF80 461C0032 */  c.eq.s    $f0, $f28
/* 16384 8003AF84 00000000 */  nop
/* 16388 8003AF88 4501000B */  bc1t      .L8003AFB8
/* 1638C 8003AF8C 00000000 */   nop
/* 16390 8003AF90 E7BC0010 */  swc1      $f28, 0x10($sp)
/* 16394 8003AF94 8E050048 */  lw        $a1, 0x48($s0)
/* 16398 8003AF98 4406E000 */  mfc1      $a2, $f28
/* 1639C 8003AF9C 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 163A0 8003AFA0 0C019EC8 */  jal       guRotateF
/* 163A4 8003AFA4 0220202D */   daddu    $a0, $s1, $zero
/* 163A8 8003AFA8 0220202D */  daddu     $a0, $s1, $zero
/* 163AC 8003AFAC 27A50020 */  addiu     $a1, $sp, 0x20
/* 163B0 8003AFB0 0C019D80 */  jal       guMtxCatF
/* 163B4 8003AFB4 00A0302D */   daddu    $a2, $a1, $zero
.L8003AFB8:
/* 163B8 8003AFB8 C600004C */  lwc1      $f0, 0x4C($s0)
/* 163BC 8003AFBC 461C0032 */  c.eq.s    $f0, $f28
/* 163C0 8003AFC0 00000000 */  nop
/* 163C4 8003AFC4 4501000B */  bc1t      .L8003AFF4
/* 163C8 8003AFC8 00000000 */   nop
/* 163CC 8003AFCC E7BC0010 */  swc1      $f28, 0x10($sp)
/* 163D0 8003AFD0 8E050048 */  lw        $a1, 0x48($s0)
/* 163D4 8003AFD4 4406E000 */  mfc1      $a2, $f28
/* 163D8 8003AFD8 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 163DC 8003AFDC 0C019EC8 */  jal       guRotateF
/* 163E0 8003AFE0 0220202D */   daddu    $a0, $s1, $zero
/* 163E4 8003AFE4 0220202D */  daddu     $a0, $s1, $zero
/* 163E8 8003AFE8 27A50020 */  addiu     $a1, $sp, 0x20
/* 163EC 8003AFEC 0C019D80 */  jal       guMtxCatF
/* 163F0 8003AFF0 00A0302D */   daddu    $a2, $a1, $zero
.L8003AFF4:
/* 163F4 8003AFF4 C6000054 */  lwc1      $f0, 0x54($s0)
/* 163F8 8003AFF8 46000021 */  cvt.d.s   $f0, $f0
/* 163FC 8003AFFC 463A0002 */  mul.d     $f0, $f0, $f26
/* 16400 8003B000 00000000 */  nop
/* 16404 8003B004 463E0032 */  c.eq.d    $f0, $f30
/* 16408 8003B008 00000000 */  nop
/* 1640C 8003B00C 45000014 */  bc1f      .L8003B060
/* 16410 8003B010 00000000 */   nop
/* 16414 8003B014 C6000058 */  lwc1      $f0, 0x58($s0)
/* 16418 8003B018 C6020320 */  lwc1      $f2, 0x320($s0)
/* 1641C 8003B01C 46020002 */  mul.s     $f0, $f0, $f2
/* 16420 8003B020 00000000 */  nop
/* 16424 8003B024 46000021 */  cvt.d.s   $f0, $f0
/* 16428 8003B028 463A0002 */  mul.d     $f0, $f0, $f26
/* 1642C 8003B02C 00000000 */  nop
/* 16430 8003B030 463E0032 */  c.eq.d    $f0, $f30
/* 16434 8003B034 00000000 */  nop
/* 16438 8003B038 45000009 */  bc1f      .L8003B060
/* 1643C 8003B03C 00000000 */   nop
/* 16440 8003B040 C600005C */  lwc1      $f0, 0x5C($s0)
/* 16444 8003B044 46000021 */  cvt.d.s   $f0, $f0
/* 16448 8003B048 463A0002 */  mul.d     $f0, $f0, $f26
/* 1644C 8003B04C 00000000 */  nop
/* 16450 8003B050 463E0032 */  c.eq.d    $f0, $f30
/* 16454 8003B054 00000000 */  nop
/* 16458 8003B058 4501001C */  bc1t      .L8003B0CC
/* 1645C 8003B05C 00000000 */   nop
.L8003B060:
/* 16460 8003B060 C6060054 */  lwc1      $f6, 0x54($s0)
/* 16464 8003B064 460031A1 */  cvt.d.s   $f6, $f6
/* 16468 8003B068 463A3182 */  mul.d     $f6, $f6, $f26
/* 1646C 8003B06C 00000000 */  nop
/* 16470 8003B070 C604005C */  lwc1      $f4, 0x5C($s0)
/* 16474 8003B074 46002121 */  cvt.d.s   $f4, $f4
/* 16478 8003B078 463A2102 */  mul.d     $f4, $f4, $f26
/* 1647C 8003B07C 00000000 */  nop
/* 16480 8003B080 C6000058 */  lwc1      $f0, 0x58($s0)
/* 16484 8003B084 C6020320 */  lwc1      $f2, 0x320($s0)
/* 16488 8003B088 46020002 */  mul.s     $f0, $f0, $f2
/* 1648C 8003B08C 00000000 */  nop
/* 16490 8003B090 46000021 */  cvt.d.s   $f0, $f0
/* 16494 8003B094 463A0002 */  mul.d     $f0, $f0, $f26
/* 16498 8003B098 00000000 */  nop
/* 1649C 8003B09C 462031A0 */  cvt.s.d   $f6, $f6
/* 164A0 8003B0A0 46202120 */  cvt.s.d   $f4, $f4
/* 164A4 8003B0A4 44053000 */  mfc1      $a1, $f6
/* 164A8 8003B0A8 44072000 */  mfc1      $a3, $f4
/* 164AC 8003B0AC 46200020 */  cvt.s.d   $f0, $f0
/* 164B0 8003B0B0 44060000 */  mfc1      $a2, $f0
/* 164B4 8003B0B4 0C019DF0 */  jal       guScaleF
/* 164B8 8003B0B8 0220202D */   daddu    $a0, $s1, $zero
/* 164BC 8003B0BC 0220202D */  daddu     $a0, $s1, $zero
/* 164C0 8003B0C0 27A50020 */  addiu     $a1, $sp, 0x20
/* 164C4 8003B0C4 0C019D80 */  jal       guMtxCatF
/* 164C8 8003B0C8 00A0302D */   daddu    $a2, $a1, $zero
.L8003B0CC:
/* 164CC 8003B0CC 8E030000 */  lw        $v1, 0x0($s0)
/* 164D0 8003B0D0 3C024000 */  lui       $v0, (0x40000000 >> 16)
/* 164D4 8003B0D4 00621024 */  and       $v0, $v1, $v0
/* 164D8 8003B0D8 5440000E */  bnel      $v0, $zero, .L8003B114
/* 164DC 8003B0DC AFB70010 */   sw       $s7, 0x10($sp)
/* 164E0 8003B0E0 3C020100 */  lui       $v0, (0x1000000 >> 16)
/* 164E4 8003B0E4 00621024 */  and       $v0, $v1, $v0
/* 164E8 8003B0E8 5440FF72 */  bnel      $v0, $zero, .L8003AEB4
/* 164EC 8003B0EC 2652FFFF */   addiu    $s2, $s2, -0x1
/* 164F0 8003B0F0 4600A20D */  trunc.w.s $f8, $f20
/* 164F4 8003B0F4 44054000 */  mfc1      $a1, $f8
/* 164F8 8003B0F8 0000302D */  daddu     $a2, $zero, $zero
/* 164FC 8003B0FC AFB70010 */  sw        $s7, 0x10($sp)
/* 16500 8003B100 8E040024 */  lw        $a0, 0x24($s0)
/* 16504 8003B104 0C0B78F6 */  jal       spr_draw_npc_sprite
/* 16508 8003B108 00C0382D */   daddu    $a3, $a2, $zero
/* 1650C 8003B10C 0800EBAD */  j         .L8003AEB4
/* 16510 8003B110 2652FFFF */   addiu    $s2, $s2, -0x1
.L8003B114:
/* 16514 8003B114 3C044000 */  lui       $a0, (0x40000001 >> 16)
/* 16518 8003B118 34840001 */  ori       $a0, $a0, (0x40000001 & 0xFFFF)
/* 1651C 8003B11C 4600A20D */  trunc.w.s $f8, $f20
/* 16520 8003B120 44054000 */  mfc1      $a1, $f8
/* 16524 8003B124 0000302D */  daddu     $a2, $zero, $zero
/* 16528 8003B128 0C0B7710 */  jal       spr_draw_player_sprite
/* 1652C 8003B12C 00C0382D */   daddu    $a3, $a2, $zero
/* 16530 8003B130 0800EBAD */  j         .L8003AEB4
/* 16534 8003B134 2652FFFF */   addiu    $s2, $s2, -0x1
.L8003B138:
/* 16538 8003B138 0C00F4EF */  jal       npc_imgfx_update
/* 1653C 8003B13C 0200202D */   daddu    $a0, $s0, $zero
/* 16540 8003B140 8FBF00C0 */  lw        $ra, 0xC0($sp)
/* 16544 8003B144 8FB700BC */  lw        $s7, 0xBC($sp)
/* 16548 8003B148 8FB600B8 */  lw        $s6, 0xB8($sp)
/* 1654C 8003B14C 8FB500B4 */  lw        $s5, 0xB4($sp)
/* 16550 8003B150 8FB400B0 */  lw        $s4, 0xB0($sp)
/* 16554 8003B154 8FB300AC */  lw        $s3, 0xAC($sp)
/* 16558 8003B158 8FB200A8 */  lw        $s2, 0xA8($sp)
/* 1655C 8003B15C 8FB100A4 */  lw        $s1, 0xA4($sp)
/* 16560 8003B160 8FB000A0 */  lw        $s0, 0xA0($sp)
/* 16564 8003B164 D7BE00F0 */  ldc1      $f30, 0xF0($sp)
/* 16568 8003B168 D7BC00E8 */  ldc1      $f28, 0xE8($sp)
/* 1656C 8003B16C D7BA00E0 */  ldc1      $f26, 0xE0($sp)
/* 16570 8003B170 D7B800D8 */  ldc1      $f24, 0xD8($sp)
/* 16574 8003B174 D7B600D0 */  ldc1      $f22, 0xD0($sp)
/* 16578 8003B178 D7B400C8 */  ldc1      $f20, 0xC8($sp)
/* 1657C 8003B17C 03E00008 */  jr        $ra
/* 16580 8003B180 27BD00F8 */   addiu    $sp, $sp, 0xF8

### DECOMPILED C INSTRUCTIONS:

void appendGfx_npc_blur(void* data) {
    Npc* npc = (Npc*) data;
    Matrix4f sp20, sp60;
    f32 x, y, z;
    f32 yaw;
    s32 var_s3;
    s32 var_s5;
    s32 index;
    NpcMotionBlur* blur;

    var_s3 = 0;
    var_s5 = 0;
    blur = npc->blur.motion;
    index = blur->index;

    while (TRUE) {
        index--;
        var_s3++;
        if (index < 0) {
            index = ARRAY_COUNT(blur->x) - 1;
        }
        if (index == blur->index) {
            break;
        }

        if (var_s3 >= 3) {
            var_s3 = 0;
            var_s5++;
            if (var_s5 >= 4) {
                break;
            }

            x = blur->x[index];
            y = blur->y[index];
            z = blur->z[index];
            set_npc_imgfx_all(npc->spriteInstanceID, IMGFX_SET_ALPHA, 255, 255, 255, 120 - (var_s5 * 20), 0);
            yaw = npc->renderYaw;
            guTranslateF(sp20, x, y, z);

            if (npc->rotation.y != 0.0f) {
                guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f);
                guMtxCatF(sp60, sp20, sp20);
            }
            if (npc->rotation.x != 0.0f) {
                guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f);
                guMtxCatF(sp60, sp20, sp20);
            }
            if (npc->rotation.z != 0.0f) {
                guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f);
                guMtxCatF(sp60, sp20, sp20);
            }

            if (
                (npc->scale.x * SPRITE_WORLD_SCALE_D) != 1.0 ||
                ((npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D) != 1.0 ||
                (npc->scale.z * SPRITE_WORLD_SCALE_D) != 1.0)
            {
                guScaleF(
                    sp60,
                    npc->scale.x * SPRITE_WORLD_SCALE_D,
                    (npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D,
                    npc->scale.z * SPRITE_WORLD_SCALE_D
                );
                guMtxCatF(sp60, sp20, sp20);
            }

            if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
                    spr_draw_npc_sprite(npc->spriteInstanceID, (s32) yaw, 0, 0, sp20);
                }
            } else {
                spr_draw_player_sprite(PLAYER_SPRITE_AUX1 | DRAW_SPRITE_OVERRIDE_YAW, (s32) yaw, 0, 0, sp20);
            }
        }
    }
    npc_imgfx_update(npc);
}