### RAW ASSEMBLY INSTRUCTIONS:

glabel parasol_get_npc
/* E2A340 802B6000 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* E2A344 802B6004 AFB1001C */  sw        $s1, 0x1C($sp)
/* E2A348 802B6008 3C118011 */  lui       $s1, %hi(gPlayerStatus)
/* E2A34C 802B600C 2631EFC8 */  addiu     $s1, $s1, %lo(gPlayerStatus)
/* E2A350 802B6010 AFBF0024 */  sw        $ra, 0x24($sp)
/* E2A354 802B6014 AFB20020 */  sw        $s2, 0x20($sp)
.L802B6018:
/* E2A358 802B6018 AFB00018 */  sw        $s0, 0x18($sp)
/* E2A35C 802B601C F7B40028 */  sdc1      $f20, 0x28($sp)
/* E2A360 802B6020 8E230000 */  lw        $v1, 0x0($s1)
/* E2A364 802B6024 3C128011 */  lui       $s2, %hi(TweesterTouchingPlayer)
/* E2A368 802B6028 8E52C934 */  lw        $s2, %lo(TweesterTouchingPlayer)($s2)
/* E2A36C 802B602C 0461002F */  bgez      $v1, .L802B60EC
/* E2A370 802B6030 3C027FFF */   lui      $v0, (0x7FFFFFFF >> 16)
/* E2A374 802B6034 3442FFFF */  ori       $v0, $v0, (0x7FFFFFFF & 0xFFFF)
/* E2A378 802B6038 00621024 */  and       $v0, $v1, $v0
/* E2A37C 802B603C 0C038045 */  jal       disable_player_static_collisions
.L802B6040:
/* E2A380 802B6040 AE220000 */   sw       $v0, 0x0($s1)
.L802B6044:
/* E2A384 802B6044 0C03805E */  jal       disable_player_input
glabel action_hammer_play_hit_fx
/* E2A388 802B6048 00000000 */   nop
.L802B604C:
/* E2A38C 802B604C 3C030010 */  lui       $v1, (0x100008 >> 16)
.L802B6050:
/* E2A390 802B6050 34630008 */  ori       $v1, $v1, (0x100008 & 0xFFFF)
/* E2A394 802B6054 3C040008 */  lui       $a0, (0x8001F >> 16)
.L802B6058:
/* E2A398 802B6058 8E220000 */  lw        $v0, 0x0($s1)
/* E2A39C 802B605C 3484001F */  ori       $a0, $a0, (0x8001F & 0xFFFF)
glabel action_update_sliding
/* E2A3A0 802B6060 00431025 */  or        $v0, $v0, $v1
/* E2A3A4 802B6064 0C037FBF */  jal       suggest_player_anim_allow_backward
.L802B6068:
/* E2A3A8 802B6068 AE220000 */   sw       $v0, 0x0($s1)
/* E2A3AC 802B606C 3C10802B */  lui       $s0, %hi(PlayerTweesterPhysicsPtr)
/* E2A3B0 802B6070 26106350 */  addiu     $s0, $s0, %lo(PlayerTweesterPhysicsPtr)
.L802B6074:
/* E2A3B4 802B6074 8E040000 */  lw        $a0, 0x0($s0)
/* E2A3B8 802B6078 2405001C */  addiu     $a1, $zero, 0x1C
glabel .L802B607C
/* E2A3BC 802B607C 0C00A580 */  jal       mem_clear
.L802B6080:
/* E2A3C0 802B6080 A22000B6 */   sb       $zero, 0xB6($s1)
/* E2A3C4 802B6084 C62C0028 */  lwc1      $f12, 0x28($s1)
/* E2A3C8 802B6088 C62E0030 */  lwc1      $f14, 0x30($s1)
.L802B608C:
/* E2A3CC 802B608C 8E460048 */  lw        $a2, 0x48($s2)
.L802B6090:
/* E2A3D0 802B6090 0C00A7B5 */  jal       dist2D
.L802B6094:
/* E2A3D4 802B6094 8E470050 */   lw       $a3, 0x50($s2)
/* E2A3D8 802B6098 8E020000 */  lw        $v0, 0x0($s0)
glabel action_update_state_23
/* E2A3DC 802B609C 46000005 */  abs.s     $f0, $f0
/* E2A3E0 802B60A0 E440000C */  swc1      $f0, 0xC($v0)
glabel action_update_use_spinning_flower
/* E2A3E4 802B60A4 C64C0048 */  lwc1      $f12, 0x48($s2)
.L802B60A8:
/* E2A3E8 802B60A8 C64E0050 */  lwc1      $f14, 0x50($s2)
.L802B60AC:
/* E2A3EC 802B60AC 8E260028 */  lw        $a2, 0x28($s1)
/* E2A3F0 802B60B0 0C00A720 */  jal       atan2
glabel action_update_jump
/* E2A3F4 802B60B4 8E270030 */   lw       $a3, 0x30($s1)
/* E2A3F8 802B60B8 240402F6 */  addiu     $a0, $zero, 0x2F6
/* E2A3FC 802B60BC 0000282D */  daddu     $a1, $zero, $zero
/* E2A400 802B60C0 8E030000 */  lw        $v1, 0x0($s0)
/* E2A404 802B60C4 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
.L802B60C8:
/* E2A408 802B60C8 44811000 */  mtc1      $at, $f2
/* E2A40C 802B60CC 3C014248 */  lui       $at, (0x42480000 >> 16)
glabel .L802B60D0
/* E2A410 802B60D0 44812000 */  mtc1      $at, $f4
.L802B60D4:
/* E2A414 802B60D4 24020078 */  addiu     $v0, $zero, 0x78
/* E2A418 802B60D8 E4600010 */  swc1      $f0, 0x10($v1)
/* E2A41C 802B60DC E4620014 */  swc1      $f2, 0x14($v1)
/* E2A420 802B60E0 E4640018 */  swc1      $f4, 0x18($v1)
/* E2A424 802B60E4 0C052736 */  jal       sfx_play_sound_at_player
.L802B60E8:
/* E2A428 802B60E8 AC620000 */   sw       $v0, 0x0($v1)
.L802B60EC:
/* E2A42C 802B60EC 822300B6 */  lb        $v1, 0xB6($s1)
.L802B60F0:
/* E2A430 802B60F0 10600005 */  beqz      $v1, .L802B6108
glabel .L802B60F4
/* E2A434 802B60F4 24020001 */   addiu    $v0, $zero, 0x1
/* E2A438 802B60F8 1062007A */  beq       $v1, $v0, .L802B62E4
/* E2A43C 802B60FC 00000000 */   nop
.L802B6100:
/* E2A440 802B6100 080AD8CB */  j         .L802B632C
.L802B6104:
/* E2A444 802B6104 00000000 */   nop
.L802B6108:
/* E2A448 802B6108 3C10802B */  lui       $s0, %hi(PlayerTweesterPhysicsPtr)
glabel .L802B610C
/* E2A44C 802B610C 26106350 */  addiu     $s0, $s0, %lo(PlayerTweesterPhysicsPtr)
.L802B6110:
/* E2A450 802B6110 8E020000 */  lw        $v0, 0x0($s0)
/* E2A454 802B6114 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
.L802B6118:
/* E2A458 802B6118 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* E2A45C 802B611C 44810000 */  mtc1      $at, $f0
glabel action_update_parasol
/* E2A460 802B6120 C44C0010 */  lwc1      $f12, 0x10($v0)
.L802B6124:
/* E2A464 802B6124 46006302 */  mul.s     $f12, $f12, $f0
.L802B6128:
/* E2A468 802B6128 00000000 */  nop
/* E2A46C 802B612C 27A50010 */  addiu     $a1, $sp, 0x10
/* E2A470 802B6130 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
glabel .L802B6134
/* E2A474 802B6134 44810000 */  mtc1      $at, $f0
/* E2A478 802B6138 27A60014 */  addiu     $a2, $sp, 0x14
.L802B613C:
/* E2A47C 802B613C 0C00A82D */  jal       sin_cos_rad
.L802B6140:
/* E2A480 802B6140 46006303 */   div.s    $f12, $f12, $f0
.L802B6144:
/* E2A484 802B6144 8E020000 */  lw        $v0, 0x0($s0)
/* E2A488 802B6148 C7A20010 */  lwc1      $f2, 0x10($sp)
.L802B614C:
/* E2A48C 802B614C C440000C */  lwc1      $f0, 0xC($v0)
.L802B6150:
/* E2A490 802B6150 46001082 */  mul.s     $f2, $f2, $f0
.L802B6154:
/* E2A494 802B6154 00000000 */  nop
.L802B6158:
/* E2A498 802B6158 C6400048 */  lwc1      $f0, 0x48($s2)
.L802B615C:
/* E2A49C 802B615C 46020000 */  add.s     $f0, $f0, $f2
/* E2A4A0 802B6160 E6200028 */  swc1      $f0, 0x28($s1)
.L802B6164:
/* E2A4A4 802B6164 C7A20014 */  lwc1      $f2, 0x14($sp)
.L802B6168:
/* E2A4A8 802B6168 C440000C */  lwc1      $f0, 0xC($v0)
/* E2A4AC 802B616C 46001082 */  mul.s     $f2, $f2, $f0
glabel .L802B6170
/* E2A4B0 802B6170 00000000 */  nop
glabel .L802B6174
/* E2A4B4 802B6174 C6400050 */  lwc1      $f0, 0x50($s2)
/* E2A4B8 802B6178 46020001 */  sub.s     $f0, $f0, $f2
.L802B617C:
/* E2A4BC 802B617C E6200030 */  swc1      $f0, 0x30($s1)
.L802B6180:
/* E2A4C0 802B6180 C4400010 */  lwc1      $f0, 0x10($v0)
glabel .L802B6184
/* E2A4C4 802B6184 C44C0014 */  lwc1      $f12, 0x14($v0)
.L802B6188:
/* E2A4C8 802B6188 0C00A6C9 */  jal       clamp_angle
.L802B618C:
/* E2A4CC 802B618C 460C0301 */   sub.s    $f12, $f0, $f12
.L802B6190:
/* E2A4D0 802B6190 8E100000 */  lw        $s0, 0x0($s0)
.L802B6194:
/* E2A4D4 802B6194 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
glabel func_802B6198
/* E2A4D8 802B6198 44811000 */  mtc1      $at, $f2
/* E2A4DC 802B619C C604000C */  lwc1      $f4, 0xC($s0)
.L802B61A0:
/* E2A4E0 802B61A0 4604103C */  c.lt.s    $f2, $f4
.L802B61A4:
/* E2A4E4 802B61A4 00000000 */  nop
.L802B61A8:
/* E2A4E8 802B61A8 45000005 */  bc1f      func_802B61C0
.L802B61AC:
/* E2A4EC 802B61AC E6000010 */   swc1     $f0, 0x10($s0)
.L802B61B0:
/* E2A4F0 802B61B0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
.L802B61B4:
/* E2A4F4 802B61B4 44810000 */  mtc1      $at, $f0
/* E2A4F8 802B61B8 080AD87B */  j         .L802B61EC
/* E2A4FC 802B61BC 46002001 */   sub.s    $f0, $f4, $f0
glabel func_802B61C0
/* E2A500 802B61C0 3C014198 */  lui       $at, (0x41980000 >> 16)
/* E2A504 802B61C4 44810000 */  mtc1      $at, $f0
.L802B61C8:
/* E2A508 802B61C8 00000000 */  nop
.L802B61CC:
/* E2A50C 802B61CC 4600203C */  c.lt.s    $f4, $f0
/* E2A510 802B61D0 00000000 */  nop
.L802B61D4:
/* E2A514 802B61D4 45000006 */  bc1f      .L802B61F0
.L802B61D8:
/* E2A518 802B61D8 00000000 */   nop
.L802B61DC:
/* E2A51C 802B61DC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* E2A520 802B61E0 44810000 */  mtc1      $at, $f0
glabel func_802B61E4
/* E2A524 802B61E4 00000000 */  nop
.L802B61E8:
/* E2A528 802B61E8 46002000 */  add.s     $f0, $f4, $f0
.L802B61EC:
/* E2A52C 802B61EC E600000C */  swc1      $f0, 0xC($s0)
.L802B61F0:
/* E2A530 802B61F0 3C10802B */  lui       $s0, %hi(PlayerTweesterPhysicsPtr)
.L802B61F4:
/* E2A534 802B61F4 26106350 */  addiu     $s0, $s0, %lo(PlayerTweesterPhysicsPtr)
.L802B61F8:
/* E2A538 802B61F8 8E020000 */  lw        $v0, 0x0($s0)
.L802B61FC:
/* E2A53C 802B61FC 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
.L802B6200:
/* E2A540 802B6200 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
.L802B6204:
/* E2A544 802B6204 44810000 */  mtc1      $at, $f0
glabel .L802B6208
/* E2A548 802B6208 C44C0018 */  lwc1      $f12, 0x18($v0)
/* E2A54C 802B620C 46006302 */  mul.s     $f12, $f12, $f0
.L802B6210:
/* E2A550 802B6210 00000000 */  nop
.L802B6214:
/* E2A554 802B6214 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
glabel .L802B6218
/* E2A558 802B6218 4481A000 */  mtc1      $at, $f20
/* E2A55C 802B621C 0C00A85B */  jal       sin_rad
.L802B6220:
/* E2A560 802B6220 46146303 */   div.s    $f12, $f12, $f20
.L802B6224:
/* E2A564 802B6224 8E020000 */  lw        $v0, 0x0($s0)
glabel .L802B6228
/* E2A568 802B6228 3C014040 */  lui       $at, (0x40400000 >> 16)
.L802B622C:
/* E2A56C 802B622C 44812000 */  mtc1      $at, $f4
glabel action_update_step_up_peach
/* E2A570 802B6230 C4420018 */  lwc1      $f2, 0x18($v0)
/* E2A574 802B6234 46041080 */  add.s     $f2, $f2, $f4
glabel .L802B6238
/* E2A578 802B6238 3C014316 */  lui       $at, (0x43160000 >> 16)
glabel .L802B623C
/* E2A57C 802B623C 44813000 */  mtc1      $at, $f6
glabel .L802B6240
/* E2A580 802B6240 00000000 */  nop
glabel .L802B6244
/* E2A584 802B6244 4602303C */  c.lt.s    $f6, $f2
glabel .L802B6248
/* E2A588 802B6248 E4420018 */  swc1      $f2, 0x18($v0)
/* E2A58C 802B624C 46040082 */  mul.s     $f2, $f0, $f4
glabel .L802B6250
/* E2A590 802B6250 00000000 */  nop
.L802B6254:
/* E2A594 802B6254 45030001 */  bc1tl     .L802B625C
glabel .L802B6258
/* E2A598 802B6258 E4460018 */   swc1     $f6, 0x18($v0)
.L802B625C:
/* E2A59C 802B625C C620002C */  lwc1      $f0, 0x2C($s1)
/* E2A5A0 802B6260 46020000 */  add.s     $f0, $f0, $f2
/* E2A5A4 802B6264 8E020000 */  lw        $v0, 0x0($s0)
.L802B6268:
/* E2A5A8 802B6268 E620002C */  swc1      $f0, 0x2C($s1)
.L802B626C:
/* E2A5AC 802B626C C44C0010 */  lwc1      $f12, 0x10($v0)
/* E2A5B0 802B6270 0C00A6C9 */  jal       clamp_angle
.L802B6274:
/* E2A5B4 802B6274 460CA301 */   sub.s    $f12, $f20, $f12
glabel .L802B6278
/* E2A5B8 802B6278 8E020000 */  lw        $v0, 0x0($s0)
/* E2A5BC 802B627C E62000A8 */  swc1      $f0, 0xA8($s1)
.L802B6280:
/* E2A5C0 802B6280 C4400014 */  lwc1      $f0, 0x14($v0)
.L802B6284:
/* E2A5C4 802B6284 3C01802B */  lui       $at, %hi(D_802B6360)
glabel action_update_run
/* E2A5C8 802B6288 D4226360 */  ldc1      $f2, %lo(D_802B6360)($at)
/* E2A5CC 802B628C 46000021 */  cvt.d.s   $f0, $f0
.L802B6290:
/* E2A5D0 802B6290 46220000 */  add.d     $f0, $f0, $f2
glabel func_802B6294
/* E2A5D4 802B6294 3C014220 */  lui       $at, (0x42200000 >> 16)
glabel .L802B6298
/* E2A5D8 802B6298 44811000 */  mtc1      $at, $f2
/* E2A5DC 802B629C 46200020 */  cvt.s.d   $f0, $f0
/* E2A5E0 802B62A0 4600103C */  c.lt.s    $f2, $f0
glabel func_802B62A4
/* E2A5E4 802B62A4 00000000 */  nop
.L802B62A8:
/* E2A5E8 802B62A8 45000002 */  bc1f      .L802B62B4
/* E2A5EC 802B62AC E4400014 */   swc1     $f0, 0x14($v0)
jtbl_802B62B0:
/* E2A5F0 802B62B0 E4420014 */  swc1      $f2, 0x14($v0)
.L802B62B4:
/* E2A5F4 802B62B4 8E030000 */  lw        $v1, 0x0($s0)
glabel .L802B62B8
/* E2A5F8 802B62B8 8C620000 */  lw        $v0, 0x0($v1)
/* E2A5FC 802B62BC 2442FFFF */  addiu     $v0, $v0, -0x1
/* E2A600 802B62C0 1440001A */  bnez      $v0, .L802B632C
/* E2A604 802B62C4 AC620000 */   sw       $v0, 0x0($v1)
.L802B62C8:
/* E2A608 802B62C8 922200B6 */  lbu       $v0, 0xB6($s1)
glabel action_update_peach_land
/* E2A60C 802B62CC 0240202D */  daddu     $a0, $s2, $zero
Munchlesia_LaunchVelocity:
/* E2A610 802B62D0 24420001 */  addiu     $v0, $v0, 0x1
Munchlesia_LateralVelocity:
/* E2A614 802B62D4 0C04419E */  jal       entity_start_script
Munchlesia_LaunchAccel:
/* E2A618 802B62D8 A22200B6 */   sb       $v0, 0xB6($s1)
Munchlesia_LaunchYaw:
/* E2A61C 802B62DC 080AD8CB */  j         .L802B632C
D_802B62E0:
/* E2A620 802B62E0 00000000 */   nop
.L802B62E4:
/* E2A624 802B62E4 0C038039 */  jal       disable_player_shadow
/* E2A628 802B62E8 00000000 */   nop
/* E2A62C 802B62EC 3C048011 */  lui       $a0, %hi(wPartnerNpc)
/* E2A630 802B62F0 8C84C930 */  lw        $a0, %lo(wPartnerNpc)($a0)
/* E2A634 802B62F4 0C00EAFF */  jal       disable_npc_shadow
glabel func_802B62F8
/* E2A638 802B62F8 00000000 */   nop
.L802B62FC:
/* E2A63C 802B62FC 24020032 */  addiu     $v0, $zero, 0x32
D_802B6300:
/* E2A640 802B6300 0C038050 */  jal       enable_player_static_collisions
/* E2A644 802B6304 A6220010 */   sh       $v0, 0x10($s1)
.L802B6308:
/* E2A648 802B6308 0C038069 */  jal       enable_player_input
.L802B630C:
/* E2A64C 802B630C 00000000 */   nop
.L802B6310:
/* E2A650 802B6310 3C03FFEF */  lui       $v1, (0xFFEFFFF7 >> 16)
/* E2A654 802B6314 3463FFF7 */  ori       $v1, $v1, (0xFFEFFFF7 & 0xFFFF)
/* E2A658 802B6318 8E220000 */  lw        $v0, 0x0($s1)
glabel .L802B631C
/* E2A65C 802B631C 0000202D */  daddu     $a0, $zero, $zero
.L802B6320:
/* E2A660 802B6320 00431024 */  and       $v0, $v0, $v1
glabel .L802B6324
/* E2A664 802B6324 0C039769 */  jal       set_action_state
.L802B6328:
/* E2A668 802B6328 AE220000 */   sw       $v0, 0x0($s1)
glabel .L802B632C
/* E2A66C 802B632C 8FBF0024 */  lw        $ra, 0x24($sp)
.L802B6330:
/* E2A670 802B6330 8FB20020 */  lw        $s2, 0x20($sp)
/* E2A674 802B6334 8FB1001C */  lw        $s1, 0x1C($sp)
.L802B6338:
/* E2A678 802B6338 8FB00018 */  lw        $s0, 0x18($sp)
/* E2A67C 802B633C D7B40028 */  ldc1      $f20, 0x28($sp)
.L802B6340:
/* E2A680 802B6340 03E00008 */  jr        $ra
/* E2A684 802B6344 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void action_update_use_tweester(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 sinAngle, cosAngle, liftoffVelocity;
    Entity* entity;

    entity = TweesterTouchingPlayer;
    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
        disable_player_static_collisions();
        disable_player_input();
        playerStatus->flags |= (PS_FLAG_ROTATION_LOCKED | PS_FLAG_FLYING);
        suggest_player_anim_allow_backward(ANIM_MarioW2_FlailArms);
        playerStatus->actionSubstate = SUBSTATE_LAUNCH;
        mem_clear(PlayerTweesterPhysicsPtr, sizeof(*PlayerTweesterPhysicsPtr));
        PlayerTweesterPhysicsPtr->radius = fabsf(dist2D(playerStatus->position.x, playerStatus->position.z, entity->position.x, entity->position.z));
        PlayerTweesterPhysicsPtr->angle = atan2(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z);
        PlayerTweesterPhysicsPtr->angularVelocity = 6.0f;
        PlayerTweesterPhysicsPtr->liftoffVelocityPhase = 50.0f;
        PlayerTweesterPhysicsPtr->countdown = 120;
        sfx_play_sound_at_player(SOUND_TWEESTER_LAUNCH, SOUND_SPACE_MODE_0);
    }

    switch (playerStatus->actionSubstate) {
        case SUBSTATE_LAUNCH:
            sin_cos_rad(DEG_TO_RAD(PlayerTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);

            playerStatus->position.x = entity->position.x + (sinAngle * PlayerTweesterPhysicsPtr->radius);
            playerStatus->position.z = entity->position.z - (cosAngle * PlayerTweesterPhysicsPtr->radius);

            PlayerTweesterPhysicsPtr->angle = clamp_angle(PlayerTweesterPhysicsPtr->angle - PlayerTweesterPhysicsPtr->angularVelocity);

            if (PlayerTweesterPhysicsPtr->radius > 20.0f) {
                PlayerTweesterPhysicsPtr->radius--;
            } else if (PlayerTweesterPhysicsPtr->radius < 19.0f) {
                PlayerTweesterPhysicsPtr->radius++;
            }

            liftoffVelocity = sin_rad(DEG_TO_RAD(PlayerTweesterPhysicsPtr->liftoffVelocityPhase))  * 3.0f;
            PlayerTweesterPhysicsPtr->liftoffVelocityPhase += 3.0f;
            if (PlayerTweesterPhysicsPtr->liftoffVelocityPhase > 150.0f) {
                PlayerTweesterPhysicsPtr->liftoffVelocityPhase = 150.0f;
            }

            playerStatus->position.y += liftoffVelocity;
            playerStatus->spriteFacingAngle = clamp_angle(360.0f - PlayerTweesterPhysicsPtr->angle);
            PlayerTweesterPhysicsPtr->angularVelocity += 0.6;
            if (PlayerTweesterPhysicsPtr->angularVelocity > 40.0f) {
                PlayerTweesterPhysicsPtr->angularVelocity = 40.0f;
            }
            if (--PlayerTweesterPhysicsPtr->countdown == 0) {
                playerStatus->actionSubstate++; // SUBSTATE_DONE
                entity_start_script(entity);
            }
            break;
        case SUBSTATE_DONE:
            disable_player_shadow();
            disable_npc_shadow(wPartnerNpc);
            playerStatus->blinkTimer = 50;
            enable_player_static_collisions();
            enable_player_input();
            playerStatus->flags &= ~(PS_FLAG_ROTATION_LOCKED | PS_FLAG_FLYING);
            set_action_state(ACTION_STATE_IDLE);
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel D_802470B0
/* 13A3F0 802470B0 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 13A3F4 802470B4 AFB00010 */  sw        $s0, 0x10($sp)
D_802470B8:
/* 13A3F8 802470B8 3C108011 */  lui       $s0, %hi(gPlayerData)
D_802470BC:
/* 13A3FC 802470BC 2610F290 */  addiu     $s0, $s0, %lo(gPlayerData)
D_802470C0:
/* 13A400 802470C0 26040208 */  addiu     $a0, $s0, 0x208
glabel .L802470C4
/* 13A404 802470C4 3C068024 */  lui       $a2, %hi(func_80246FE0)
D_802470C8:
/* 13A408 802470C8 24C66FE0 */  addiu     $a2, $a2, %lo(func_80246FE0)
glabel .L802470CC
/* 13A40C 802470CC AFBF0014 */  sw        $ra, 0x14($sp)
/* 13A410 802470D0 0C091293 */  jal       func_80244A4C
glabel .L802470D4
/* 13A414 802470D4 24050040 */   addiu    $a1, $zero, 0x40
/* 13A418 802470D8 0000182D */  daddu     $v1, $zero, $zero
glabel .L802470DC
/* 13A41C 802470DC 86020208 */  lh        $v0, 0x208($s0)
/* 13A420 802470E0 10400005 */  beqz      $v0, .L802470F8
glabel .L802470E4
/* 13A424 802470E4 00000000 */   nop
/* 13A428 802470E8 24630001 */  addiu     $v1, $v1, 0x1
glabel .L802470EC
/* 13A42C 802470EC 28620040 */  slti      $v0, $v1, 0x40
/* 13A430 802470F0 1440FFFA */  bnez      $v0, .L802470DC
glabel .L802470F4
/* 13A434 802470F4 26100002 */   addiu    $s0, $s0, 0x2
.L802470F8:
/* 13A438 802470F8 8FBF0014 */  lw        $ra, 0x14($sp)
.L802470FC:
/* 13A43C 802470FC 8FB00010 */  lw        $s0, 0x10($sp)
/* 13A440 80247100 0060102D */  daddu     $v0, $v1, $zero
/* 13A444 80247104 03E00008 */  jr        $ra
/* 13A448 80247108 27BD0018 */   addiu    $sp, $sp, 0x18
glabel func_8024710C
/* 13A44C 8024710C 00041040 */  sll       $v0, $a0, 1
/* 13A450 80247110 00441021 */  addu      $v0, $v0, $a0
/* 13A454 80247114 00021080 */  sll       $v0, $v0, 2
/* 13A458 80247118 3C018027 */  lui       $at, %hi(D_8027028A)
/* 13A45C 8024711C 00220821 */  addu      $at, $at, $v0
D_80247120:
/* 13A460 80247120 9022028A */  lbu       $v0, %lo(D_8027028A)($at)
/* 13A464 80247124 14400002 */  bnez      $v0, .L80247130
.L80247128:
/* 13A468 80247128 00A2001A */   div      $zero, $a1, $v0
D_8024712C:
/* 13A46C 8024712C 0007000D */  break     7
.L80247130:
/* 13A470 80247130 2401FFFF */  addiu     $at, $zero, -0x1
.L80247134:
/* 13A474 80247134 14410004 */  bne       $v0, $at, .L80247148
/* 13A478 80247138 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 13A47C 8024713C 14A10002 */  bne       $a1, $at, .L80247148
/* 13A480 80247140 00000000 */   nop
/* 13A484 80247144 0006000D */  break     6
.L80247148:
/* 13A488 80247148 00001810 */  mfhi      $v1
/* 13A48C 8024714C 000310C0 */  sll       $v0, $v1, 3
/* 13A490 80247150 00431021 */  addu      $v0, $v0, $v1
D_80247154:
/* 13A494 80247154 00021080 */  sll       $v0, $v0, 2
.L80247158:
/* 13A498 80247158 00431023 */  subu      $v0, $v0, $v1
D_8024715C:
/* 13A49C 8024715C 00021080 */  sll       $v0, $v0, 2
D_80247160:
/* 13A4A0 80247160 03E00008 */  jr        $ra
.L80247164:
/* 13A4A4 80247164 00431021 */   addu     $v0, $v0, $v1
glabel func_80247168
/* 13A4A8 80247168 3C028027 */  lui       $v0, %hi(gPauseBadgesPages)
D_8024716C:
/* 13A4AC 8024716C 24420288 */  addiu     $v0, $v0, %lo(gPauseBadgesPages)
/* 13A4B0 80247170 00041840 */  sll       $v1, $a0, 1
/* 13A4B4 80247174 00641821 */  addu      $v1, $v1, $a0
.L80247178:
/* 13A4B8 80247178 00031880 */  sll       $v1, $v1, 2
D_8024717C:
/* 13A4BC 8024717C 00621821 */  addu      $v1, $v1, $v0
/* 13A4C0 80247180 90620002 */  lbu       $v0, 0x2($v1)
D_80247184:
/* 13A4C4 80247184 14400002 */  bnez      $v0, .L80247190
/* 13A4C8 80247188 00A2001A */   div      $zero, $a1, $v0
.L8024718C:
/* 13A4CC 8024718C 0007000D */  break     7
.L80247190:
/* 13A4D0 80247190 2401FFFF */  addiu     $at, $zero, -0x1
D_80247194:
/* 13A4D4 80247194 14410004 */  bne       $v0, $at, .L802471A8
glabel func_80247198
/* 13A4D8 80247198 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 13A4DC 8024719C 14A10002 */  bne       $a1, $at, .L802471A8
/* 13A4E0 802471A0 00000000 */   nop
/* 13A4E4 802471A4 0006000D */  break     6
.L802471A8:
/* 13A4E8 802471A8 00002812 */  mflo      $a1
.L802471AC:
/* 13A4EC 802471AC 24840001 */  addiu     $a0, $a0, 0x1
.L802471B0:
/* 13A4F0 802471B0 90630001 */  lbu       $v1, 0x1($v1)
.L802471B4:
/* 13A4F4 802471B4 00041040 */  sll       $v0, $a0, 1
/* 13A4F8 802471B8 00441021 */  addu      $v0, $v0, $a0
D_802471BC:
/* 13A4FC 802471BC 00021080 */  sll       $v0, $v0, 2
/* 13A500 802471C0 00441023 */  subu      $v0, $v0, $a0
D_802471C4:
/* 13A504 802471C4 00031900 */  sll       $v1, $v1, 4
/* 13A508 802471C8 00431021 */  addu      $v0, $v0, $v1
D_802471CC:
/* 13A50C 802471CC 00052900 */  sll       $a1, $a1, 4
/* 13A510 802471D0 03E00008 */  jr        $ra
D_802471D4:
/* 13A514 802471D4 00451021 */   addu     $v0, $v0, $a1
glabel func_802471D8
/* 13A518 802471D8 00041040 */  sll       $v0, $a0, 1
/* 13A51C 802471DC 00441021 */  addu      $v0, $v0, $a0
D_802471E0:
/* 13A520 802471E0 00021080 */  sll       $v0, $v0, 2
D_802471E4:
/* 13A524 802471E4 3C018027 */  lui       $at, %hi(D_8027028A)
jtbl_802471E8:
/* 13A528 802471E8 00220821 */  addu      $at, $at, $v0
glabel func_802471EC
/* 13A52C 802471EC 9022028A */  lbu       $v0, %lo(D_8027028A)($at)
.L802471F0:
/* 13A530 802471F0 14400002 */  bnez      $v0, .L802471FC
D_802471F4:
/* 13A534 802471F4 00A2001A */   div      $zero, $a1, $v0
/* 13A538 802471F8 0007000D */  break     7
.L802471FC:
/* 13A53C 802471FC 2401FFFF */  addiu     $at, $zero, -0x1
/* 13A540 80247200 14410004 */  bne       $v0, $at, func_80247214
/* 13A544 80247204 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 13A548 80247208 14A10002 */  bne       $a1, $at, func_80247214
D_8024720C:
/* 13A54C 8024720C 00000000 */   nop
/* 13A550 80247210 0006000D */  break     6
glabel func_80247214
/* 13A554 80247214 00001010 */  mfhi      $v0
/* 13A558 80247218 03E00008 */  jr        $ra
glabel func_8024721C
/* 13A55C 8024721C 00000000 */   nop
glabel func_80247220
/* 13A560 80247220 3C038027 */  lui       $v1, %hi(gPauseBadgesPages)
/* 13A564 80247224 24630288 */  addiu     $v1, $v1, %lo(gPauseBadgesPages)
/* 13A568 80247228 00041040 */  sll       $v0, $a0, 1
/* 13A56C 8024722C 00441021 */  addu      $v0, $v0, $a0
/* 13A570 80247230 00021080 */  sll       $v0, $v0, 2
/* 13A574 80247234 00431021 */  addu      $v0, $v0, $v1
.L80247238:
/* 13A578 80247238 90430002 */  lbu       $v1, 0x2($v0)
/* 13A57C 8024723C 14600002 */  bnez      $v1, jtbl_80247248
D_80247240:
/* 13A580 80247240 00A3001A */   div      $zero, $a1, $v1
/* 13A584 80247244 0007000D */  break     7
jtbl_80247248:
/* 13A588 80247248 2401FFFF */  addiu     $at, $zero, -0x1
/* 13A58C 8024724C 14610004 */  bne       $v1, $at, .L80247260
D_80247250:
/* 13A590 80247250 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 13A594 80247254 14A10002 */  bne       $a1, $at, .L80247260
/* 13A598 80247258 00000000 */   nop
/* 13A59C 8024725C 0006000D */  break     6
.L80247260:
/* 13A5A0 80247260 00002812 */  mflo      $a1
/* 13A5A4 80247264 90420001 */  lbu       $v0, 0x1($v0)
/* 13A5A8 80247268 03E00008 */  jr        $ra
/* 13A5AC 8024726C 00451021 */   addu     $v0, $v0, $a1
D_80247270:
/* 13A5B0 80247270 3C038027 */  lui       $v1, %hi(gPauseBadgesCurrentScrollPos)
/* 13A5B4 80247274 8C63038C */  lw        $v1, %lo(gPauseBadgesCurrentScrollPos)($v1)
jtbl_80247278:
/* 13A5B8 80247278 2462FFE0 */  addiu     $v0, $v1, -0x20
.L8024727C:
/* 13A5BC 8024727C 0082102A */  slt       $v0, $a0, $v0
/* 13A5C0 80247280 14400003 */  bnez      $v0, .L80247290
/* 13A5C4 80247284 24620080 */   addiu    $v0, $v1, 0x80
.L80247288:
/* 13A5C8 80247288 03E00008 */  jr        $ra
.L8024728C:
/* 13A5CC 8024728C 0082102A */   slt      $v0, $a0, $v0
.L80247290:
/* 13A5D0 80247290 03E00008 */  jr        $ra
.L80247294:
/* 13A5D4 80247294 0000102D */   daddu    $v0, $zero, $zero
glabel func_80247298
/* 13A5D8 80247298 3C028027 */  lui       $v0, %hi(gPauseBadgesCurrentScrollPos)
/* 13A5DC 8024729C 8C42038C */  lw        $v0, %lo(gPauseBadgesCurrentScrollPos)($v0)
/* 13A5E0 802472A0 03E00008 */  jr        $ra
glabel func_802472A4
/* 13A5E4 802472A4 00821023 */   subu     $v0, $a0, $v0
glabel func_802472A8
/* 13A5E8 802472A8 03E00008 */  jr        $ra
D_802472AC:
/* 13A5EC 802472AC 0080102D */   daddu    $v0, $a0, $zero
glabel func_802472B0
/* 13A5F0 802472B0 3C068011 */  lui       $a2, %hi(gPlayerData + 0x208)
/* 13A5F4 802472B4 24C6F498 */  addiu     $a2, $a2, %lo(gPlayerData + 0x208)
/* 13A5F8 802472B8 00C0182D */  daddu     $v1, $a2, $zero
/* 13A5FC 802472BC 00042400 */  sll       $a0, $a0, 16
/* 13A600 802472C0 00042403 */  sra       $a0, $a0, 16
D_802472C4:
/* 13A604 802472C4 24027FFF */  addiu     $v0, $zero, 0x7FFF
/* 13A608 802472C8 14820005 */  bne       $a0, $v0, .L802472E0
/* 13A60C 802472CC 0000382D */   daddu    $a3, $zero, $zero
/* 13A610 802472D0 03E00008 */  jr        $ra
/* 13A614 802472D4 00E0102D */   daddu    $v0, $a3, $zero
.L802472D8:
/* 13A618 802472D8 08091CC5 */  j         .L80247314
.L802472DC:
/* 13A61C 802472DC 24070001 */   addiu    $a3, $zero, 0x1
.L802472E0:
/* 13A620 802472E0 0000282D */  daddu     $a1, $zero, $zero
.L802472E4:
/* 13A624 802472E4 84620000 */  lh        $v0, 0x0($v1)
/* 13A628 802472E8 5082FFFB */  beql      $a0, $v0, .L802472D8
/* 13A62C 802472EC 0060302D */   daddu    $a2, $v1, $zero
/* 13A630 802472F0 24A50001 */  addiu     $a1, $a1, 0x1
.L802472F4:
/* 13A634 802472F4 28A20040 */  slti      $v0, $a1, 0x40
/* 13A638 802472F8 1440FFFA */  bnez      $v0, .L802472E4
/* 13A63C 802472FC 24630002 */   addiu    $v1, $v1, 0x2
/* 13A640 80247300 08091CC6 */  j         .L80247318
/* 13A644 80247304 28A2003F */   slti     $v0, $a1, 0x3F
.L80247308:
/* 13A648 80247308 94620002 */  lhu       $v0, 0x2($v1)
/* 13A64C 8024730C A4620000 */  sh        $v0, 0x0($v1)
D_80247310:
/* 13A650 80247310 24630002 */  addiu     $v1, $v1, 0x2
.L80247314:
/* 13A654 80247314 28A2003F */  slti      $v0, $a1, 0x3F
.L80247318:
/* 13A658 80247318 5440FFFB */  bnel      $v0, $zero, .L80247308
.L8024731C:
/* 13A65C 8024731C 24A50001 */   addiu    $a1, $a1, 0x1
/* 13A660 80247320 A4600000 */  sh        $zero, 0x0($v1)
/* 13A664 80247324 84C20000 */  lh        $v0, 0x0($a2)
/* 13A668 80247328 50400001 */  beql      $v0, $zero, .L80247330
/* 13A66C 8024732C 24070002 */   addiu    $a3, $zero, 0x2
.L80247330:
/* 13A670 80247330 03E00008 */  jr        $ra
/* 13A674 80247334 00E0102D */   daddu    $v0, $a3, $zero
glabel func_80247338
/* 13A678 80247338 27BDFFE0 */  addiu     $sp, $sp, -0x20
D_8024733C:
/* 13A67C 8024733C AFB00010 */  sw        $s0, 0x10($sp)
/* 13A680 80247340 0080802D */  daddu     $s0, $a0, $zero
D_80247344:
/* 13A684 80247344 AFB10014 */  sw        $s1, 0x14($sp)
/* 13A688 80247348 3C118011 */  lui       $s1, %hi(gPlayerData)
.L8024734C:
/* 13A68C 8024734C 2631F290 */  addiu     $s1, $s1, %lo(gPlayerData)
/* 13A690 80247350 26250208 */  addiu     $a1, $s1, 0x208
.L80247354:
/* 13A694 80247354 00042400 */  sll       $a0, $a0, 16
/* 13A698 80247358 00042403 */  sra       $a0, $a0, 16
/* 13A69C 8024735C 24027FFE */  addiu     $v0, $zero, 0x7FFE
D_80247360:
/* 13A6A0 80247360 14820002 */  bne       $a0, $v0, .L8024736C
/* 13A6A4 80247364 AFBF0018 */   sw       $ra, 0x18($sp)
.L80247368:
/* 13A6A8 80247368 0000802D */  daddu     $s0, $zero, $zero
.L8024736C:
/* 13A6AC 8024736C 00101400 */  sll       $v0, $s0, 16
glabel .L80247370
/* 13A6B0 80247370 00021403 */  sra       $v0, $v0, 16
/* 13A6B4 80247374 24037FFF */  addiu     $v1, $zero, 0x7FFF
/* 13A6B8 80247378 50430001 */  beql      $v0, $v1, .L80247380
.L8024737C:
/* 13A6BC 8024737C 0000802D */   daddu    $s0, $zero, $zero
.L80247380:
/* 13A6C0 80247380 00101400 */  sll       $v0, $s0, 16
/* 13A6C4 80247384 00021403 */  sra       $v0, $v0, 16
/* 13A6C8 80247388 1040001D */  beqz      $v0, D_80247400
/* 13A6CC 8024738C 0000202D */   daddu    $a0, $zero, $zero
D_80247390:
/* 13A6D0 80247390 0040182D */  daddu     $v1, $v0, $zero
.L80247394:
/* 13A6D4 80247394 84A20000 */  lh        $v0, 0x0($a1)
/* 13A6D8 80247398 1043001B */  beq       $v0, $v1, D_80247408
/* 13A6DC 8024739C 24840001 */   addiu    $a0, $a0, 0x1
/* 13A6E0 802473A0 28820040 */  slti      $v0, $a0, 0x40
/* 13A6E4 802473A4 1440FFFB */  bnez      $v0, .L80247394
/* 13A6E8 802473A8 24A50002 */   addiu    $a1, $a1, 0x2
.L802473AC:
/* 13A6EC 802473AC 0C0911FD */  jal       func_802447F4
D_802473B0:
/* 13A6F0 802473B0 00000000 */   nop
D_802473B4:
/* 13A6F4 802473B4 0040202D */  daddu     $a0, $v0, $zero
.L802473B8:
/* 13A6F8 802473B8 00101400 */  sll       $v0, $s0, 16
/* 13A6FC 802473BC 00021403 */  sra       $v0, $v0, 16
D_802473C0:
/* 13A700 802473C0 10400013 */  beqz      $v0, D_80247410
.L802473C4:
/* 13A704 802473C4 00021140 */   sll      $v0, $v0, 5
D_802473C8:
/* 13A708 802473C8 3C038008 */  lui       $v1, %hi(gItemTable + 0x1A)
/* 13A70C 802473CC 00621821 */  addu      $v1, $v1, $v0
.L802473D0:
/* 13A710 802473D0 906378FA */  lbu       $v1, %lo(gItemTable + 0x1A)($v1)
/* 13A714 802473D4 00031080 */  sll       $v0, $v1, 2
D_802473D8:
/* 13A718 802473D8 00431021 */  addu      $v0, $v0, $v1
D_802473DC:
/* 13A71C 802473DC 00021080 */  sll       $v0, $v0, 2
D_802473E0:
/* 13A720 802473E0 3C018009 */  lui       $at, %hi(D_8008F072)
.L802473E4:
/* 13A724 802473E4 00220821 */  addu      $at, $at, $v0
D_802473E8:
/* 13A728 802473E8 8022F072 */  lb        $v0, %lo(D_8008F072)($at)
.L802473EC:
/* 13A72C 802473EC 82230008 */  lb        $v1, 0x8($s1)
D_802473F0:
/* 13A730 802473F0 00821021 */  addu      $v0, $a0, $v0
/* 13A734 802473F4 0062182A */  slt       $v1, $v1, $v0
D_802473F8:
/* 13A738 802473F8 10600006 */  beqz      $v1, .L80247414
/* 13A73C 802473FC 26250208 */   addiu    $a1, $s1, 0x208
D_80247400:
/* 13A740 80247400 08091D11 */  j         D_80247444
/* 13A744 80247404 24020001 */   addiu    $v0, $zero, 0x1
D_80247408:
/* 13A748 80247408 08091D11 */  j         D_80247444
/* 13A74C 8024740C 0000102D */   daddu    $v0, $zero, $zero
D_80247410:
/* 13A750 80247410 26250208 */  addiu     $a1, $s1, 0x208
.L80247414:
/* 13A754 80247414 0000202D */  daddu     $a0, $zero, $zero
D_80247418:
/* 13A758 80247418 84A20000 */  lh        $v0, 0x0($a1)
/* 13A75C 8024741C 50400005 */  beql      $v0, $zero, .L80247434
D_80247420:
/* 13A760 80247420 A4B00000 */   sh       $s0, 0x0($a1)
/* 13A764 80247424 24840001 */  addiu     $a0, $a0, 0x1
D_80247428:
/* 13A768 80247428 28820040 */  slti      $v0, $a0, 0x40
/* 13A76C 8024742C 1440FFFA */  bnez      $v0, D_80247418
D_80247430:
/* 13A770 80247430 24A50002 */   addiu    $a1, $a1, 0x2
.L80247434:
/* 13A774 80247434 24030040 */  addiu     $v1, $zero, 0x40
D_80247438:
/* 13A778 80247438 10830002 */  beq       $a0, $v1, D_80247444
/* 13A77C 8024743C 24020002 */   addiu    $v0, $zero, 0x2
jtbl_80247440:
/* 13A780 80247440 24020003 */  addiu     $v0, $zero, 0x3
D_80247444:
/* 13A784 80247444 8FBF0018 */  lw        $ra, 0x18($sp)
D_80247448:
/* 13A788 80247448 8FB10014 */  lw        $s1, 0x14($sp)
/* 13A78C 8024744C 8FB00010 */  lw        $s0, 0x10($sp)
/* 13A790 80247450 03E00008 */  jr        $ra
/* 13A794 80247454 27BD0020 */   addiu    $sp, $sp, 0x20
D_80247458:
/* 13A798 80247458 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 13A79C 8024745C AFBF0028 */  sw        $ra, 0x28($sp)
/* 13A7A0 80247460 00A0182D */  daddu     $v1, $a1, $zero
/* 13A7A4 80247464 00C0382D */  daddu     $a3, $a2, $zero
/* 13A7A8 80247468 10800006 */  beqz      $a0, D_80247484
/* 13A7AC 8024746C 24080008 */   addiu    $t0, $zero, 0x8
D_80247470:
/* 13A7B0 80247470 24020001 */  addiu     $v0, $zero, 0x1
/* 13A7B4 80247474 1082000B */  beq       $a0, $v0, .L802474A4
/* 13A7B8 80247478 00032080 */   sll      $a0, $v1, 2
/* 13A7BC 8024747C 08091D33 */  j         .L802474CC
.L80247480:
/* 13A7C0 80247480 00072880 */   sll      $a1, $a3, 2
D_80247484:
/* 13A7C4 80247484 00032080 */  sll       $a0, $v1, 2
D_80247488:
/* 13A7C8 80247488 00072880 */  sll       $a1, $a3, 2
.L8024748C:
/* 13A7CC 8024748C 24660008 */  addiu     $a2, $v1, 0x8
/* 13A7D0 80247490 00063080 */  sll       $a2, $a2, 2
/* 13A7D4 80247494 24E70008 */  addiu     $a3, $a3, 0x8
/* 13A7D8 80247498 00073880 */  sll       $a3, $a3, 2
D_8024749C:
/* 13A7DC 8024749C 08091D38 */  j         D_802474E0
D_802474A0:
/* 13A7E0 802474A0 24020100 */   addiu    $v0, $zero, 0x100
.L802474A4:
/* 13A7E4 802474A4 00072880 */  sll       $a1, $a3, 2
/* 13A7E8 802474A8 24660008 */  addiu     $a2, $v1, 0x8
/* 13A7EC 802474AC 00063080 */  sll       $a2, $a2, 2
D_802474B0:
/* 13A7F0 802474B0 24E70008 */  addiu     $a3, $a3, 0x8
/* 13A7F4 802474B4 00073880 */  sll       $a3, $a3, 2
/* 13A7F8 802474B8 24020400 */  addiu     $v0, $zero, 0x400
/* 13A7FC 802474BC AFA00010 */  sw        $zero, 0x10($sp)
jtbl_802474C0:
/* 13A800 802474C0 AFA00014 */  sw        $zero, 0x14($sp)
/* 13A804 802474C4 08091D3C */  j         .L802474F0
D_802474C8:
/* 13A808 802474C8 AFA00018 */   sw       $zero, 0x18($sp)
.L802474CC:
/* 13A80C 802474CC 00683021 */  addu      $a2, $v1, $t0

### DECOMPILED C INSTRUCTIONS:

s32 pause_badges_count_equipped(void) {
    PlayerData* playerData = &gPlayerData;
    s32 i;

    pause_sort_item_list(playerData->equippedBadges, ARRAY_COUNT(playerData->equippedBadges), &pause_badges_comparator);

    for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
        if (playerData->equippedBadges[i] == 0) {
            break;
        }
    }

    return i;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel misc_particles_appendGfx
/* 3DE95C E00E495C 27BDFF20 */  addiu     $sp, $sp, -0xE0
/* 3DE960 E00E4960 AFB700BC */  sw        $s7, 0xBC($sp)
/* 3DE964 E00E4964 0080B82D */  daddu     $s7, $a0, $zero
/* 3DE968 E00E4968 3C05DB06 */  lui       $a1, (0xDB060024 >> 16)
/* 3DE96C E00E496C 34A50024 */  ori       $a1, $a1, (0xDB060024 & 0xFFFF)
/* 3DE970 E00E4970 AFB200A8 */  sw        $s2, 0xA8($sp)
/* 3DE974 E00E4974 24120001 */  addiu     $s2, $zero, 0x1
/* 3DE978 E00E4978 3C09800A */  lui       $t1, %hi(gMainGfxPos)
/* 3DE97C E00E497C 2529A66C */  addiu     $t1, $t1, %lo(gMainGfxPos)
/* 3DE980 E00E4980 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3DE984 E00E4984 AFBF00C4 */  sw        $ra, 0xC4($sp)
/* 3DE988 E00E4988 AFBE00C0 */  sw        $fp, 0xC0($sp)
/* 3DE98C E00E498C AFB600B8 */  sw        $s6, 0xB8($sp)
/* 3DE990 E00E4990 AFB500B4 */  sw        $s5, 0xB4($sp)
/* 3DE994 E00E4994 AFB400B0 */  sw        $s4, 0xB0($sp)
/* 3DE998 E00E4998 AFB300AC */  sw        $s3, 0xAC($sp)
/* 3DE99C E00E499C AFB100A4 */  sw        $s1, 0xA4($sp)
/* 3DE9A0 E00E49A0 AFB000A0 */  sw        $s0, 0xA0($sp)
/* 3DE9A4 E00E49A4 F7B800D8 */  sdc1      $f24, 0xD8($sp)
/* 3DE9A8 E00E49A8 F7B600D0 */  sdc1      $f22, 0xD0($sp)
/* 3DE9AC E00E49AC F7B400C8 */  sdc1      $f20, 0xC8($sp)
/* 3DE9B0 E00E49B0 8D240000 */  lw        $a0, 0x0($t1)
/* 3DE9B4 E00E49B4 8EE8000C */  lw        $t0, 0xC($s7)
/* 3DE9B8 E00E49B8 3C01437F */  lui       $at, (0x437F0000 >> 16)
/* 3DE9BC E00E49BC 44810000 */  mtc1      $at, $f0
/* 3DE9C0 E00E49C0 0080182D */  daddu     $v1, $a0, $zero
/* 3DE9C4 E00E49C4 24840008 */  addiu     $a0, $a0, 0x8
/* 3DE9C8 E00E49C8 AD240000 */  sw        $a0, 0x0($t1)
/* 3DE9CC E00E49CC 8D140000 */  lw        $s4, 0x0($t0)
/* 3DE9D0 E00E49D0 C5040058 */  lwc1      $f4, 0x58($t0)
/* 3DE9D4 E00E49D4 C5020044 */  lwc1      $f2, 0x44($t0)
/* 3DE9D8 E00E49D8 468010A0 */  cvt.s.w   $f2, $f2
/* 3DE9DC E00E49DC AC620000 */  sw        $v0, 0x0($v1)
/* 3DE9E0 E00E49E0 24820008 */  addiu     $v0, $a0, 0x8
/* 3DE9E4 E00E49E4 AC600004 */  sw        $zero, 0x4($v1)
/* 3DE9E8 E00E49E8 AD220000 */  sw        $v0, 0x0($t1)
/* 3DE9EC E00E49EC AC850000 */  sw        $a1, 0x0($a0)
/* 3DE9F0 E00E49F0 8EE30010 */  lw        $v1, 0x10($s7)
/* 3DE9F4 E00E49F4 24820010 */  addiu     $v0, $a0, 0x10
/* 3DE9F8 E00E49F8 AD220000 */  sw        $v0, 0x0($t1)
/* 3DE9FC E00E49FC 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 3DEA00 E00E4A00 8C63001C */  lw        $v1, 0x1C($v1)
/* 3DEA04 E00E4A04 46001083 */  div.s     $f2, $f2, $f0
/* 3DEA08 E00E4A08 AC820008 */  sw        $v0, 0x8($a0)
/* 3DEA0C E00E4A0C 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 3DEA10 E00E4A10 46041502 */  mul.s     $f20, $f2, $f4
/* 3DEA14 E00E4A14 00000000 */  nop
/* 3DEA18 E00E4A18 00621821 */  addu      $v1, $v1, $v0
/* 3DEA1C E00E4A1C AC830004 */  sw        $v1, 0x4($a0)
/* 3DEA20 E00E4A20 9102004B */  lbu       $v0, 0x4B($t0)
/* 3DEA24 E00E4A24 9105004F */  lbu       $a1, 0x4F($t0)
/* 3DEA28 E00E4A28 91060053 */  lbu       $a2, 0x53($t0)
/* 3DEA2C E00E4A2C 91070057 */  lbu       $a3, 0x57($t0)
/* 3DEA30 E00E4A30 3C03DE00 */  lui       $v1, (0xDE000000 >> 16)
/* 3DEA34 E00E4A34 AC830010 */  sw        $v1, 0x10($a0)
/* 3DEA38 E00E4A38 00021600 */  sll       $v0, $v0, 24
/* 3DEA3C E00E4A3C 00052C00 */  sll       $a1, $a1, 16
/* 3DEA40 E00E4A40 00451025 */  or        $v0, $v0, $a1
/* 3DEA44 E00E4A44 00063200 */  sll       $a2, $a2, 8
/* 3DEA48 E00E4A48 00461025 */  or        $v0, $v0, $a2
/* 3DEA4C E00E4A4C 00471025 */  or        $v0, $v0, $a3
/* 3DEA50 E00E4A50 AC82000C */  sw        $v0, 0xC($a0)
/* 3DEA54 E00E4A54 00141080 */  sll       $v0, $s4, 2
/* 3DEA58 E00E4A58 3C03E00E */  lui       $v1, (0xE00E4DA8 >> 16)
/* 3DEA5C E00E4A5C 00621821 */  addu      $v1, $v1, $v0
/* 3DEA60 E00E4A60 8C634DA8 */  lw        $v1, (0xE00E4DA8 & 0xFFFF)($v1)
/* 3DEA64 E00E4A64 24820018 */  addiu     $v0, $a0, 0x18
/* 3DEA68 E00E4A68 AD220000 */  sw        $v0, 0x0($t1)
/* 3DEA6C E00E4A6C AC830014 */  sw        $v1, 0x14($a0)
/* 3DEA70 E00E4A70 8EE20008 */  lw        $v0, 0x8($s7)
/* 3DEA74 E00E4A74 0242102A */  slt       $v0, $s2, $v0
/* 3DEA78 E00E4A78 104000B6 */  beqz      $v0, .LE00E4D54
/* 3DEA7C E00E4A7C 25080064 */   addiu    $t0, $t0, 0x64
/* 3DEA80 E00E4A80 3C16800A */  lui       $s6, %hi(gDisplayContext)
/* 3DEA84 E00E4A84 26D6A674 */  addiu     $s6, $s6, %lo(gDisplayContext)
/* 3DEA88 E00E4A88 3C158007 */  lui       $s5, %hi(gMatrixListPos)
/* 3DEA8C E00E4A8C 26B541F0 */  addiu     $s5, $s5, %lo(gMatrixListPos)
/* 3DEA90 E00E4A90 3C130001 */  lui       $s3, (0x11630 >> 16)
/* 3DEA94 E00E4A94 36731630 */  ori       $s3, $s3, (0x11630 & 0xFFFF)
/* 3DEA98 E00E4A98 0120882D */  daddu     $s1, $t1, $zero
/* 3DEA9C E00E4A9C 3C1EE00E */  lui       $fp, %hi(D_E00E4D90)
/* 3DEAA0 E00E4AA0 27DE4D90 */  addiu     $fp, $fp, %lo(D_E00E4D90)
/* 3DEAA4 E00E4AA4 25100060 */  addiu     $s0, $t0, 0x60
/* 3DEAA8 E00E4AA8 4480C000 */  mtc1      $zero, $f24
/* 3DEAAC E00E4AAC 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 3DEAB0 E00E4AB0 4481B000 */  mtc1      $at, $f22
.LE00E4AB4:
/* 3DEAB4 E00E4AB4 8E02FFCC */  lw        $v0, -0x34($s0)
/* 3DEAB8 E00E4AB8 044000A1 */  bltz      $v0, .LE00E4D40
/* 3DEABC E00E4ABC 27A40020 */   addiu    $a0, $sp, 0x20
/* 3DEAC0 E00E4AC0 3C0A800B */  lui       $t2, %hi(gCameras)
/* 3DEAC4 E00E4AC4 254A1D80 */  addiu     $t2, $t2, %lo(gCameras)
/* 3DEAC8 E00E4AC8 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3DEACC E00E4ACC 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3DEAD0 E00E4AD0 4405C000 */  mfc1      $a1, $f24
/* 3DEAD4 E00E4AD4 C600FFF8 */  lwc1      $f0, -0x8($s0)
/* 3DEAD8 E00E4AD8 00031080 */  sll       $v0, $v1, 2
/* 3DEADC E00E4ADC 00431021 */  addu      $v0, $v0, $v1
/* 3DEAE0 E00E4AE0 00021080 */  sll       $v0, $v0, 2
/* 3DEAE4 E00E4AE4 00431023 */  subu      $v0, $v0, $v1
/* 3DEAE8 E00E4AE8 000218C0 */  sll       $v1, $v0, 3
/* 3DEAEC E00E4AEC 00431021 */  addu      $v0, $v0, $v1
/* 3DEAF0 E00E4AF0 46140002 */  mul.s     $f0, $f0, $f20
/* 3DEAF4 E00E4AF4 00000000 */  nop
/* 3DEAF8 E00E4AF8 000210C0 */  sll       $v0, $v0, 3
/* 3DEAFC E00E4AFC 004A1021 */  addu      $v0, $v0, $t2
/* 3DEB00 E00E4B00 C442006C */  lwc1      $f2, 0x6C($v0)
/* 3DEB04 E00E4B04 4407C000 */  mfc1      $a3, $f24
/* 3DEB08 E00E4B08 46001087 */  neg.s     $f2, $f2
/* 3DEB0C E00E4B0C 44061000 */  mfc1      $a2, $f2
/* 3DEB10 E00E4B10 E7A00010 */  swc1      $f0, 0x10($sp)
/* 3DEB14 E00E4B14 C600FFA4 */  lwc1      $f0, -0x5C($s0)
/* 3DEB18 E00E4B18 E7A00014 */  swc1      $f0, 0x14($sp)
/* 3DEB1C E00E4B1C C600FFA8 */  lwc1      $f0, -0x58($s0)
/* 3DEB20 E00E4B20 E7A00018 */  swc1      $f0, 0x18($sp)
/* 3DEB24 E00E4B24 C600FFAC */  lwc1      $f0, -0x54($s0)
/* 3DEB28 E00E4B28 0C080180 */  jal       shim_guPositionF
/* 3DEB2C E00E4B2C E7A0001C */   swc1     $f0, 0x1C($sp)
/* 3DEB30 E00E4B30 27A40020 */  addiu     $a0, $sp, 0x20
/* 3DEB34 E00E4B34 96A50000 */  lhu       $a1, 0x0($s5)
/* 3DEB38 E00E4B38 8EC20000 */  lw        $v0, 0x0($s6)
/* 3DEB3C E00E4B3C 00052980 */  sll       $a1, $a1, 6
/* 3DEB40 E00E4B40 00B32821 */  addu      $a1, $a1, $s3
/* 3DEB44 E00E4B44 0C080118 */  jal       shim_guMtxF2L
/* 3DEB48 E00E4B48 00452821 */   addu     $a1, $v0, $a1
/* 3DEB4C E00E4B4C 8E240000 */  lw        $a0, 0x0($s1)
/* 3DEB50 E00E4B50 0080282D */  daddu     $a1, $a0, $zero
/* 3DEB54 E00E4B54 24840008 */  addiu     $a0, $a0, 0x8
/* 3DEB58 E00E4B58 AE240000 */  sw        $a0, 0x0($s1)
/* 3DEB5C E00E4B5C 96A20000 */  lhu       $v0, 0x0($s5)
/* 3DEB60 E00E4B60 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 3DEB64 E00E4B64 ACA30000 */  sw        $v1, 0x0($a1)
/* 3DEB68 E00E4B68 24430001 */  addiu     $v1, $v0, 0x1
/* 3DEB6C E00E4B6C 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3DEB70 E00E4B70 00021180 */  sll       $v0, $v0, 6
/* 3DEB74 E00E4B74 A6A30000 */  sh        $v1, 0x0($s5)
/* 3DEB78 E00E4B78 8EC30000 */  lw        $v1, 0x0($s6)
/* 3DEB7C E00E4B7C 00531021 */  addu      $v0, $v0, $s3
/* 3DEB80 E00E4B80 00621821 */  addu      $v1, $v1, $v0
/* 3DEB84 E00E4B84 24820008 */  addiu     $v0, $a0, 0x8
/* 3DEB88 E00E4B88 ACA30004 */  sw        $v1, 0x4($a1)
/* 3DEB8C E00E4B8C AE220000 */  sw        $v0, 0x0($s1)
/* 3DEB90 E00E4B90 24020050 */  addiu     $v0, $zero, 0x50
/* 3DEB94 E00E4B94 8E03FFCC */  lw        $v1, -0x34($s0)
/* 3DEB98 E00E4B98 24850004 */  addiu     $a1, $a0, 0x4
/* 3DEB9C E00E4B9C 00431023 */  subu      $v0, $v0, $v1
/* 3DEBA0 E00E4BA0 304200FF */  andi      $v0, $v0, 0xFF
/* 3DEBA4 E00E4BA4 3C03FA00 */  lui       $v1, (0xFA000000 >> 16)
/* 3DEBA8 E00E4BA8 00431025 */  or        $v0, $v0, $v1
/* 3DEBAC E00E4BAC AC820000 */  sw        $v0, 0x0($a0)
/* 3DEBB0 E00E4BB0 C600FFE4 */  lwc1      $f0, -0x1C($s0)
/* 3DEBB4 E00E4BB4 46800020 */  cvt.s.w   $f0, $f0
/* 3DEBB8 E00E4BB8 4600A002 */  mul.s     $f0, $f20, $f0
/* 3DEBBC E00E4BBC 00000000 */  nop
/* 3DEBC0 E00E4BC0 9203FFDB */  lbu       $v1, -0x25($s0)
/* 3DEBC4 E00E4BC4 9204FFDF */  lbu       $a0, -0x21($s0)
/* 3DEBC8 E00E4BC8 9202FFE3 */  lbu       $v0, -0x1D($s0)
/* 3DEBCC E00E4BCC 00031E00 */  sll       $v1, $v1, 24
/* 3DEBD0 E00E4BD0 00042400 */  sll       $a0, $a0, 16
/* 3DEBD4 E00E4BD4 00641825 */  or        $v1, $v1, $a0
/* 3DEBD8 E00E4BD8 00021200 */  sll       $v0, $v0, 8
/* 3DEBDC E00E4BDC 4600B03E */  c.le.s    $f22, $f0
/* 3DEBE0 E00E4BE0 00000000 */  nop
/* 3DEBE4 E00E4BE4 45010005 */  bc1t      .LE00E4BFC
/* 3DEBE8 E00E4BE8 00621825 */   or       $v1, $v1, $v0
/* 3DEBEC E00E4BEC 4600018D */  trunc.w.s $f6, $f0
/* 3DEBF0 E00E4BF0 44043000 */  mfc1      $a0, $f6
/* 3DEBF4 E00E4BF4 08039306 */  j         .LE00E4C18
/* 3DEBF8 E00E4BF8 308200FF */   andi     $v0, $a0, 0xFF
.LE00E4BFC:
/* 3DEBFC E00E4BFC 46160001 */  sub.s     $f0, $f0, $f22
/* 3DEC00 E00E4C00 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 3DEC04 E00E4C04 4600018D */  trunc.w.s $f6, $f0
/* 3DEC08 E00E4C08 44043000 */  mfc1      $a0, $f6
/* 3DEC0C E00E4C0C 00000000 */  nop
/* 3DEC10 E00E4C10 00822025 */  or        $a0, $a0, $v0
/* 3DEC14 E00E4C14 308200FF */  andi      $v0, $a0, 0xFF
.LE00E4C18:
/* 3DEC18 E00E4C18 00621025 */  or        $v0, $v1, $v0
/* 3DEC1C E00E4C1C 8E260000 */  lw        $a2, 0x0($s1)
/* 3DEC20 E00E4C20 3C03F200 */  lui       $v1, (0xF2000000 >> 16)
/* 3DEC24 E00E4C24 ACA20000 */  sw        $v0, 0x0($a1)
/* 3DEC28 E00E4C28 C600FFFC */  lwc1      $f0, -0x4($s0)
/* 3DEC2C E00E4C2C 00C0282D */  daddu     $a1, $a2, $zero
/* 3DEC30 E00E4C30 4600018D */  trunc.w.s $f6, $f0
/* 3DEC34 E00E4C34 44043000 */  mfc1      $a0, $f6
/* 3DEC38 E00E4C38 00000000 */  nop
/* 3DEC3C E00E4C3C 00042080 */  sll       $a0, $a0, 2
/* 3DEC40 E00E4C40 30840FFF */  andi      $a0, $a0, 0xFFF
/* 3DEC44 E00E4C44 00042300 */  sll       $a0, $a0, 12
/* 3DEC48 E00E4C48 C6000000 */  lwc1      $f0, 0x0($s0)
/* 3DEC4C E00E4C4C 24C60008 */  addiu     $a2, $a2, 0x8
/* 3DEC50 E00E4C50 4600018D */  trunc.w.s $f6, $f0
/* 3DEC54 E00E4C54 44023000 */  mfc1      $v0, $f6
/* 3DEC58 E00E4C58 00000000 */  nop
/* 3DEC5C E00E4C5C 00021080 */  sll       $v0, $v0, 2
/* 3DEC60 E00E4C60 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3DEC64 E00E4C64 00431025 */  or        $v0, $v0, $v1
/* 3DEC68 E00E4C68 00822025 */  or        $a0, $a0, $v0
/* 3DEC6C E00E4C6C ACA40000 */  sw        $a0, 0x0($a1)
/* 3DEC70 E00E4C70 C600FFFC */  lwc1      $f0, -0x4($s0)
/* 3DEC74 E00E4C74 3C030100 */  lui       $v1, (0x1000000 >> 16)
/* 3DEC78 E00E4C78 AE260000 */  sw        $a2, 0x0($s1)
/* 3DEC7C E00E4C7C 4600018D */  trunc.w.s $f6, $f0
/* 3DEC80 E00E4C80 44043000 */  mfc1      $a0, $f6
/* 3DEC84 E00E4C84 00000000 */  nop
/* 3DEC88 E00E4C88 2484000F */  addiu     $a0, $a0, 0xF
/* 3DEC8C E00E4C8C 00042080 */  sll       $a0, $a0, 2
/* 3DEC90 E00E4C90 30840FFF */  andi      $a0, $a0, 0xFFF
/* 3DEC94 E00E4C94 C6000000 */  lwc1      $f0, 0x0($s0)
/* 3DEC98 E00E4C98 00042300 */  sll       $a0, $a0, 12
/* 3DEC9C E00E4C9C 4600018D */  trunc.w.s $f6, $f0
/* 3DECA0 E00E4CA0 44023000 */  mfc1      $v0, $f6
/* 3DECA4 E00E4CA4 00000000 */  nop
/* 3DECA8 E00E4CA8 2442000F */  addiu     $v0, $v0, 0xF
/* 3DECAC E00E4CAC 00021080 */  sll       $v0, $v0, 2
/* 3DECB0 E00E4CB0 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3DECB4 E00E4CB4 00431025 */  or        $v0, $v0, $v1
/* 3DECB8 E00E4CB8 00822025 */  or        $a0, $a0, $v0
/* 3DECBC E00E4CBC 24020002 */  addiu     $v0, $zero, 0x2
/* 3DECC0 E00E4CC0 1682000E */  bne       $s4, $v0, .LE00E4CFC
/* 3DECC4 E00E4CC4 ACA40004 */   sw       $a0, 0x4($a1)
/* 3DECC8 E00E4CC8 3C04F200 */  lui       $a0, (0xF200007C >> 16)
/* 3DECCC E00E4CCC 3484007C */  ori       $a0, $a0, (0xF200007C & 0xFFFF)
/* 3DECD0 E00E4CD0 24C20008 */  addiu     $v0, $a2, 0x8
/* 3DECD4 E00E4CD4 3243001F */  andi      $v1, $s2, 0x1F
/* 3DECD8 E00E4CD8 AE220000 */  sw        $v0, 0x0($s1)
/* 3DECDC E00E4CDC 000314C0 */  sll       $v0, $v1, 19
/* 3DECE0 E00E4CE0 00441025 */  or        $v0, $v0, $a0
/* 3DECE4 E00E4CE4 000319C0 */  sll       $v1, $v1, 7
/* 3DECE8 E00E4CE8 3463007C */  ori       $v1, $v1, 0x7C
/* 3DECEC E00E4CEC 00031B00 */  sll       $v1, $v1, 12
/* 3DECF0 E00E4CF0 3463007C */  ori       $v1, $v1, 0x7C
/* 3DECF4 E00E4CF4 ACC20000 */  sw        $v0, 0x0($a2)
/* 3DECF8 E00E4CF8 ACC30004 */  sw        $v1, 0x4($a2)
.LE00E4CFC:
/* 3DECFC E00E4CFC 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 3DED00 E00E4D00 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3DED04 E00E4D04 8E230000 */  lw        $v1, 0x0($s1)
/* 3DED08 E00E4D08 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3DED0C E00E4D0C 0060282D */  daddu     $a1, $v1, $zero
/* 3DED10 E00E4D10 24630008 */  addiu     $v1, $v1, 0x8
/* 3DED14 E00E4D14 AE230000 */  sw        $v1, 0x0($s1)
/* 3DED18 E00E4D18 ACA20000 */  sw        $v0, 0x0($a1)
/* 3DED1C E00E4D1C 00141080 */  sll       $v0, $s4, 2
/* 3DED20 E00E4D20 005E1021 */  addu      $v0, $v0, $fp
/* 3DED24 E00E4D24 8C440000 */  lw        $a0, 0x0($v0)
/* 3DED28 E00E4D28 24620008 */  addiu     $v0, $v1, 0x8
/* 3DED2C E00E4D2C AE220000 */  sw        $v0, 0x0($s1)
/* 3DED30 E00E4D30 24020040 */  addiu     $v0, $zero, 0x40
/* 3DED34 E00E4D34 ACA40004 */  sw        $a0, 0x4($a1)
/* 3DED38 E00E4D38 AC660000 */  sw        $a2, 0x0($v1)
/* 3DED3C E00E4D3C AC620004 */  sw        $v0, 0x4($v1)
.LE00E4D40:
/* 3DED40 E00E4D40 26520001 */  addiu     $s2, $s2, 0x1
/* 3DED44 E00E4D44 8EE20008 */  lw        $v0, 0x8($s7)
/* 3DED48 E00E4D48 0242102A */  slt       $v0, $s2, $v0
/* 3DED4C E00E4D4C 1440FF59 */  bnez      $v0, .LE00E4AB4
/* 3DED50 E00E4D50 26100064 */   addiu    $s0, $s0, 0x64
.LE00E4D54:
/* 3DED54 E00E4D54 8FBF00C4 */  lw        $ra, 0xC4($sp)
/* 3DED58 E00E4D58 8FBE00C0 */  lw        $fp, 0xC0($sp)
/* 3DED5C E00E4D5C 8FB700BC */  lw        $s7, 0xBC($sp)
/* 3DED60 E00E4D60 8FB600B8 */  lw        $s6, 0xB8($sp)
/* 3DED64 E00E4D64 8FB500B4 */  lw        $s5, 0xB4($sp)
/* 3DED68 E00E4D68 8FB400B0 */  lw        $s4, 0xB0($sp)
/* 3DED6C E00E4D6C 8FB300AC */  lw        $s3, 0xAC($sp)
/* 3DED70 E00E4D70 8FB200A8 */  lw        $s2, 0xA8($sp)
/* 3DED74 E00E4D74 8FB100A4 */  lw        $s1, 0xA4($sp)
/* 3DED78 E00E4D78 8FB000A0 */  lw        $s0, 0xA0($sp)
/* 3DED7C E00E4D7C D7B800D8 */  ldc1      $f24, 0xD8($sp)
/* 3DED80 E00E4D80 D7B600D0 */  ldc1      $f22, 0xD0($sp)
/* 3DED84 E00E4D84 D7B400C8 */  ldc1      $f20, 0xC8($sp)
/* 3DED88 E00E4D88 03E00008 */  jr        $ra
/* 3DED8C E00E4D8C 27BD00E0 */   addiu    $sp, $sp, 0xE0

### DECOMPILED C INSTRUCTIONS:

void misc_particles_appendGfx(void* effect) {
    MiscParticlesFXData* particle = ((EffectInstance*)effect)->data.miscParticles;
    s32 variation = particle->variation;
    f32 alphaScale = (particle->innerColor.a / 255.0f) * particle->scale;
    Matrix4f mtxTransform;
    Matrix4f unused;
    s32 i;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
    gDPSetEnvColor(gMainGfxPos++, particle->glowColor.r, particle->glowColor.g, particle->glowColor.b, particle->glowColor.a);
    gSPDisplayList(gMainGfxPos++, D_E00E4DA8[variation]);

    particle++;
    for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, particle++) {
        if (particle->animTime >= 0) {
            shim_guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z);
            shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);

            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gDPSetPrimColor(gMainGfxPos++, 0, 80 - particle->animTime, particle->innerColor.r, particle->innerColor.g, particle->innerColor.b, alphaScale * particle->innerColor.a);
            gDPSetTileSize(gMainGfxPos++, 1,
                (s32) particle->unk_5C * 4,
                (s32) particle->unk_60 * 4,
                ((s32) particle->unk_5C + 15) * 4,
                ((s32) particle->unk_60 + 15) * 4);

            if (variation == 2) {
                gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE,
                    ((i & 0x1F) * 32     ) * 4, 31 * 4,
                    ((i & 0x1F) * 32 + 31) * 4, 31 * 4);
            }

            gSPDisplayList(gMainGfxPos++, D_E00E4D90[variation]);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel underwater_update
/* 3B8D44 E00BA174 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 3B8D48 E00BA178 AFBF0024 */  sw        $ra, 0x24($sp)
/* 3B8D4C E00BA17C AFB40020 */  sw        $s4, 0x20($sp)
/* 3B8D50 E00BA180 AFB3001C */  sw        $s3, 0x1C($sp)
/* 3B8D54 E00BA184 AFB20018 */  sw        $s2, 0x18($sp)
/* 3B8D58 E00BA188 AFB10014 */  sw        $s1, 0x14($sp)
/* 3B8D5C E00BA18C AFB00010 */  sw        $s0, 0x10($sp)
/* 3B8D60 E00BA190 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 3B8D64 E00BA194 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 3B8D68 E00BA198 8C830000 */  lw        $v1, 0x0($a0)
/* 3B8D6C E00BA19C 8C90000C */  lw        $s0, 0xC($a0)
/* 3B8D70 E00BA1A0 30620010 */  andi      $v0, $v1, 0x10
/* 3B8D74 E00BA1A4 10400005 */  beqz      $v0, .LE00BA1BC
/* 3B8D78 E00BA1A8 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3B8D7C E00BA1AC 00621024 */  and       $v0, $v1, $v0
/* 3B8D80 E00BA1B0 AC820000 */  sw        $v0, 0x0($a0)
/* 3B8D84 E00BA1B4 24020020 */  addiu     $v0, $zero, 0x20
/* 3B8D88 E00BA1B8 AE020010 */  sw        $v0, 0x10($s0)
.LE00BA1BC:
/* 3B8D8C E00BA1BC 8E030010 */  lw        $v1, 0x10($s0)
/* 3B8D90 E00BA1C0 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3B8D94 E00BA1C4 10400002 */  beqz      $v0, .LE00BA1D0
/* 3B8D98 E00BA1C8 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3B8D9C E00BA1CC AE020010 */  sw        $v0, 0x10($s0)
.LE00BA1D0:
/* 3B8DA0 E00BA1D0 8E020014 */  lw        $v0, 0x14($s0)
/* 3B8DA4 E00BA1D4 8E030010 */  lw        $v1, 0x10($s0)
/* 3B8DA8 E00BA1D8 24420001 */  addiu     $v0, $v0, 0x1
/* 3B8DAC E00BA1DC 04610005 */  bgez      $v1, .LE00BA1F4
/* 3B8DB0 E00BA1E0 AE020014 */   sw       $v0, 0x14($s0)
/* 3B8DB4 E00BA1E4 0C080128 */  jal       shim_remove_effect
/* 3B8DB8 E00BA1E8 00000000 */   nop
/* 3B8DBC E00BA1EC 0802E96D */  j         .LE00BA5B4
/* 3B8DC0 E00BA1F0 00000000 */   nop
.LE00BA1F4:
/* 3B8DC4 E00BA1F4 0060A02D */  daddu     $s4, $v1, $zero
/* 3B8DC8 E00BA1F8 0040982D */  daddu     $s3, $v0, $zero
/* 3B8DCC E00BA1FC 2A820020 */  slti      $v0, $s4, 0x20
/* 3B8DD0 E00BA200 10400002 */  beqz      $v0, .LE00BA20C
/* 3B8DD4 E00BA204 240400FF */   addiu    $a0, $zero, 0xFF
/* 3B8DD8 E00BA208 001420C0 */  sll       $a0, $s4, 3
.LE00BA20C:
/* 3B8DDC E00BA20C 2A620010 */  slti      $v0, $s3, 0x10
/* 3B8DE0 E00BA210 10400002 */  beqz      $v0, .LE00BA21C
/* 3B8DE4 E00BA214 00131100 */   sll      $v0, $s3, 4
/* 3B8DE8 E00BA218 2444000F */  addiu     $a0, $v0, 0xF
.LE00BA21C:
/* 3B8DEC E00BA21C 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 3B8DF0 E00BA220 44811000 */  mtc1      $at, $f2
/* 3B8DF4 E00BA224 44840000 */  mtc1      $a0, $f0
/* 3B8DF8 E00BA228 00000000 */  nop
/* 3B8DFC E00BA22C 46800020 */  cvt.s.w   $f0, $f0
/* 3B8E00 E00BA230 4600103E */  c.le.s    $f2, $f0
/* 3B8E04 E00BA234 00000000 */  nop
/* 3B8E08 E00BA238 45010005 */  bc1t      .LE00BA250
/* 3B8E0C E00BA23C 2605001F */   addiu    $a1, $s0, 0x1F
/* 3B8E10 E00BA240 4600038D */  trunc.w.s $f14, $f0
/* 3B8E14 E00BA244 44037000 */  mfc1      $v1, $f14
/* 3B8E18 E00BA248 0802E89B */  j         .LE00BA26C
/* 3B8E1C E00BA24C 24120001 */   addiu    $s2, $zero, 0x1
.LE00BA250:
/* 3B8E20 E00BA250 46020001 */  sub.s     $f0, $f0, $f2
/* 3B8E24 E00BA254 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 3B8E28 E00BA258 4600038D */  trunc.w.s $f14, $f0
/* 3B8E2C E00BA25C 44037000 */  mfc1      $v1, $f14
/* 3B8E30 E00BA260 00000000 */  nop
/* 3B8E34 E00BA264 00621825 */  or        $v1, $v1, $v0
/* 3B8E38 E00BA268 24120001 */  addiu     $s2, $zero, 0x1
.LE00BA26C:
/* 3B8E3C E00BA26C 2611000D */  addiu     $s1, $s0, 0xD
/* 3B8E40 E00BA270 3C01C280 */  lui       $at, (0xC2800000 >> 16)
/* 3B8E44 E00BA274 4481B000 */  mtc1      $at, $f22
/* 3B8E48 E00BA278 3C01437F */  lui       $at, (0x437F0000 >> 16)
/* 3B8E4C E00BA27C 44811000 */  mtc1      $at, $f2
/* 3B8E50 E00BA280 44840000 */  mtc1      $a0, $f0
/* 3B8E54 E00BA284 00000000 */  nop
/* 3B8E58 E00BA288 46800020 */  cvt.s.w   $f0, $f0
/* 3B8E5C E00BA28C A0A30000 */  sb        $v1, 0x0($a1)
/* 3B8E60 E00BA290 46020503 */  div.s     $f20, $f0, $f2
.LE00BA294:
/* 3B8E64 E00BA294 02721823 */  subu      $v1, $s3, $s2
/* 3B8E68 E00BA298 00031080 */  sll       $v0, $v1, 2
/* 3B8E6C E00BA29C 00431021 */  addu      $v0, $v0, $v1
/* 3B8E70 E00BA2A0 00021080 */  sll       $v0, $v0, 2
/* 3B8E74 E00BA2A4 00021023 */  negu      $v0, $v0
/* 3B8E78 E00BA2A8 44826000 */  mtc1      $v0, $f12
/* 3B8E7C E00BA2AC 00000000 */  nop
/* 3B8E80 E00BA2B0 46806320 */  cvt.s.w   $f12, $f12
/* 3B8E84 E00BA2B4 0C080140 */  jal       shim_sin_deg
/* 3B8E88 E00BA2B8 26520001 */   addiu    $s2, $s2, 0x1
/* 3B8E8C E00BA2BC 46160002 */  mul.s     $f0, $f0, $f22
/* 3B8E90 E00BA2C0 00000000 */  nop
/* 3B8E94 E00BA2C4 46140002 */  mul.s     $f0, $f0, $f20
/* 3B8E98 E00BA2C8 00000000 */  nop
/* 3B8E9C E00BA2CC 4600038D */  trunc.w.s $f14, $f0
/* 3B8EA0 E00BA2D0 44027000 */  mfc1      $v0, $f14
/* 3B8EA4 E00BA2D4 00000000 */  nop
/* 3B8EA8 E00BA2D8 A2220029 */  sb        $v0, 0x29($s1)
/* 3B8EAC E00BA2DC 2A420012 */  slti      $v0, $s2, 0x12
/* 3B8EB0 E00BA2E0 1440FFEC */  bnez      $v0, .LE00BA294
/* 3B8EB4 E00BA2E4 2631000D */   addiu    $s1, $s1, 0xD
/* 3B8EB8 E00BA2E8 24120001 */  addiu     $s2, $zero, 0x1
/* 3B8EBC E00BA2EC 240F001A */  addiu     $t7, $zero, 0x1A
/* 3B8EC0 E00BA2F0 240EFFFF */  addiu     $t6, $zero, -0x1
/* 3B8EC4 E00BA2F4 240D0019 */  addiu     $t5, $zero, 0x19
/* 3B8EC8 E00BA2F8 0000602D */  daddu     $t4, $zero, $zero
/* 3B8ECC E00BA2FC 01E0582D */  daddu     $t3, $t7, $zero
/* 3B8ED0 E00BA300 240A000D */  addiu     $t2, $zero, 0xD
.LE00BA304:
/* 3B8ED4 E00BA304 24050001 */  addiu     $a1, $zero, 0x1
/* 3B8ED8 E00BA308 0140382D */  daddu     $a3, $t2, $zero
/* 3B8EDC E00BA30C 0160482D */  daddu     $t1, $t3, $zero
/* 3B8EE0 E00BA310 0180402D */  daddu     $t0, $t4, $zero
/* 3B8EE4 E00BA314 01A0982D */  daddu     $s3, $t5, $zero
/* 3B8EE8 E00BA318 01C0882D */  daddu     $s1, $t6, $zero
/* 3B8EEC E00BA31C 25E60002 */  addiu     $a2, $t7, 0x2
.LE00BA320:
/* 3B8EF0 E00BA320 25220001 */  addiu     $v0, $t1, 0x1
/* 3B8EF4 E00BA324 00A21021 */  addu      $v0, $a1, $v0
/* 3B8EF8 E00BA328 02021021 */  addu      $v0, $s0, $v0
/* 3B8EFC E00BA32C 00A72021 */  addu      $a0, $a1, $a3
/* 3B8F00 E00BA330 00B31821 */  addu      $v1, $a1, $s3
/* 3B8F04 E00BA334 02031821 */  addu      $v1, $s0, $v1
/* 3B8F08 E00BA338 80420023 */  lb        $v0, 0x23($v0)
/* 3B8F0C E00BA33C 80630023 */  lb        $v1, 0x23($v1)
/* 3B8F10 E00BA340 44822000 */  mtc1      $v0, $f4
/* 3B8F14 E00BA344 00000000 */  nop
/* 3B8F18 E00BA348 46802120 */  cvt.s.w   $f4, $f4
/* 3B8F1C E00BA34C 25020001 */  addiu     $v0, $t0, 0x1
/* 3B8F20 E00BA350 00A21021 */  addu      $v0, $a1, $v0
/* 3B8F24 E00BA354 02021021 */  addu      $v0, $s0, $v0
/* 3B8F28 E00BA358 80420023 */  lb        $v0, 0x23($v0)
/* 3B8F2C E00BA35C 44831000 */  mtc1      $v1, $f2
/* 3B8F30 E00BA360 00000000 */  nop
/* 3B8F34 E00BA364 468010A0 */  cvt.s.w   $f2, $f2
/* 3B8F38 E00BA368 44820000 */  mtc1      $v0, $f0
/* 3B8F3C E00BA36C 00000000 */  nop
/* 3B8F40 E00BA370 46800020 */  cvt.s.w   $f0, $f0
/* 3B8F44 E00BA374 00B11021 */  addu      $v0, $a1, $s1
/* 3B8F48 E00BA378 46002100 */  add.s     $f4, $f4, $f0
/* 3B8F4C E00BA37C 02021021 */  addu      $v0, $s0, $v0
/* 3B8F50 E00BA380 80420023 */  lb        $v0, 0x23($v0)
/* 3B8F54 E00BA384 46022100 */  add.s     $f4, $f4, $f2
/* 3B8F58 E00BA388 02042021 */  addu      $a0, $s0, $a0
/* 3B8F5C E00BA38C 44820000 */  mtc1      $v0, $f0
/* 3B8F60 E00BA390 00000000 */  nop
/* 3B8F64 E00BA394 46800020 */  cvt.s.w   $f0, $f0
/* 3B8F68 E00BA398 46002100 */  add.s     $f4, $f4, $f0
/* 3B8F6C E00BA39C 80830023 */  lb        $v1, 0x23($a0)
/* 3B8F70 E00BA3A0 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3B8F74 E00BA3A4 44810800 */  mtc1      $at, $f1
/* 3B8F78 E00BA3A8 44800000 */  mtc1      $zero, $f0
/* 3B8F7C E00BA3AC 46002121 */  cvt.d.s   $f4, $f4
/* 3B8F80 E00BA3B0 46202102 */  mul.d     $f4, $f4, $f0
/* 3B8F84 E00BA3B4 00000000 */  nop
/* 3B8F88 E00BA3B8 44835000 */  mtc1      $v1, $f10
/* 3B8F8C E00BA3BC 00000000 */  nop
/* 3B8F90 E00BA3C0 468052A0 */  cvt.s.w   $f10, $f10
/* 3B8F94 E00BA3C4 00A81821 */  addu      $v1, $a1, $t0
/* 3B8F98 E00BA3C8 02031821 */  addu      $v1, $s0, $v1
/* 3B8F9C E00BA3CC 00A91021 */  addu      $v0, $a1, $t1
/* 3B8FA0 E00BA3D0 02021021 */  addu      $v0, $s0, $v0
/* 3B8FA4 E00BA3D4 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3B8FA8 E00BA3D8 44810000 */  mtc1      $at, $f0
/* 3B8FAC E00BA3DC 80420023 */  lb        $v0, 0x23($v0)
/* 3B8FB0 E00BA3E0 46005282 */  mul.s     $f10, $f10, $f0
/* 3B8FB4 E00BA3E4 00000000 */  nop
/* 3B8FB8 E00BA3E8 44821000 */  mtc1      $v0, $f2
/* 3B8FBC E00BA3EC 00000000 */  nop
/* 3B8FC0 E00BA3F0 468010A0 */  cvt.s.w   $f2, $f2
/* 3B8FC4 E00BA3F4 24E20001 */  addiu     $v0, $a3, 0x1
/* 3B8FC8 E00BA3F8 00A21021 */  addu      $v0, $a1, $v0
/* 3B8FCC E00BA3FC 3C01E00C */  lui       $at, (0xE00C0000 >> 16)
/* 3B8FD0 E00BA400 D420AE80 */  ldc1      $f0, -0x5180($at)
/* 3B8FD4 E00BA404 460051A1 */  cvt.d.s   $f6, $f10
/* 3B8FD8 E00BA408 46203182 */  mul.d     $f6, $f6, $f0
/* 3B8FDC E00BA40C 00000000 */  nop
/* 3B8FE0 E00BA410 02021021 */  addu      $v0, $s0, $v0
/* 3B8FE4 E00BA414 80420023 */  lb        $v0, 0x23($v0)
/* 3B8FE8 E00BA418 80630023 */  lb        $v1, 0x23($v1)
/* 3B8FEC E00BA41C 44824000 */  mtc1      $v0, $f8
/* 3B8FF0 E00BA420 00000000 */  nop
/* 3B8FF4 E00BA424 46804220 */  cvt.s.w   $f8, $f8
/* 3B8FF8 E00BA428 24E2FFFF */  addiu     $v0, $a3, -0x1
/* 3B8FFC E00BA42C 00A21021 */  addu      $v0, $a1, $v0
/* 3B9000 E00BA430 44830000 */  mtc1      $v1, $f0
/* 3B9004 E00BA434 00000000 */  nop
/* 3B9008 E00BA438 46800020 */  cvt.s.w   $f0, $f0
/* 3B900C E00BA43C 46001080 */  add.s     $f2, $f2, $f0
/* 3B9010 E00BA440 02021021 */  addu      $v0, $s0, $v0
/* 3B9014 E00BA444 80420023 */  lb        $v0, 0x23($v0)
/* 3B9018 E00BA448 46081080 */  add.s     $f2, $f2, $f8
/* 3B901C E00BA44C 44820000 */  mtc1      $v0, $f0
/* 3B9020 E00BA450 00000000 */  nop
/* 3B9024 E00BA454 46800020 */  cvt.s.w   $f0, $f0
/* 3B9028 E00BA458 46001080 */  add.s     $f2, $f2, $f0
/* 3B902C E00BA45C 460A1081 */  sub.s     $f2, $f2, $f10
/* 3B9030 E00BA460 46202120 */  cvt.s.d   $f4, $f4
/* 3B9034 E00BA464 46041080 */  add.s     $f2, $f2, $f4
/* 3B9038 E00BA468 02061821 */  addu      $v1, $s0, $a2
/* 3B903C E00BA46C 8462011A */  lh        $v0, 0x11A($v1)
/* 3B9040 E00BA470 460010A1 */  cvt.d.s   $f2, $f2
/* 3B9044 E00BA474 46261081 */  sub.d     $f2, $f2, $f6
/* 3B9048 E00BA478 44820000 */  mtc1      $v0, $f0
/* 3B904C E00BA47C 00000000 */  nop
/* 3B9050 E00BA480 46800021 */  cvt.d.w   $f0, $f0
/* 3B9054 E00BA484 46220000 */  add.d     $f0, $f0, $f2
/* 3B9058 E00BA488 3C01E00C */  lui       $at, (0xE00C0000 >> 16)
/* 3B905C E00BA48C D422AE88 */  ldc1      $f2, -0x5178($at)
/* 3B9060 E00BA490 4620038D */  trunc.w.d $f14, $f0
/* 3B9064 E00BA494 44027000 */  mfc1      $v0, $f14
/* 3B9068 E00BA498 00000000 */  nop
/* 3B906C E00BA49C 00021400 */  sll       $v0, $v0, 16
/* 3B9070 E00BA4A0 00021403 */  sra       $v0, $v0, 16
/* 3B9074 E00BA4A4 44820000 */  mtc1      $v0, $f0
/* 3B9078 E00BA4A8 00000000 */  nop
/* 3B907C E00BA4AC 46800021 */  cvt.d.w   $f0, $f0
/* 3B9080 E00BA4B0 46220002 */  mul.d     $f0, $f0, $f2
/* 3B9084 E00BA4B4 00000000 */  nop
/* 3B9088 E00BA4B8 4620038D */  trunc.w.d $f14, $f0
/* 3B908C E00BA4BC 44027000 */  mfc1      $v0, $f14
/* 3B9090 E00BA4C0 00000000 */  nop
/* 3B9094 E00BA4C4 A462011A */  sh        $v0, 0x11A($v1)
/* 3B9098 E00BA4C8 2A820020 */  slti      $v0, $s4, 0x20
/* 3B909C E00BA4CC 1040000B */  beqz      $v0, .LE00BA4FC
/* 3B90A0 E00BA4D0 24A50001 */   addiu    $a1, $a1, 0x1
/* 3B90A4 E00BA4D4 80820023 */  lb        $v0, 0x23($a0)
/* 3B90A8 E00BA4D8 44820000 */  mtc1      $v0, $f0
/* 3B90AC E00BA4DC 00000000 */  nop
/* 3B90B0 E00BA4E0 46800020 */  cvt.s.w   $f0, $f0
/* 3B90B4 E00BA4E4 46140002 */  mul.s     $f0, $f0, $f20
/* 3B90B8 E00BA4E8 00000000 */  nop
/* 3B90BC E00BA4EC 4600038D */  trunc.w.s $f14, $f0
/* 3B90C0 E00BA4F0 44027000 */  mfc1      $v0, $f14
/* 3B90C4 E00BA4F4 00000000 */  nop
/* 3B90C8 E00BA4F8 A0820023 */  sb        $v0, 0x23($a0)
.LE00BA4FC:
/* 3B90CC E00BA4FC 28A2000C */  slti      $v0, $a1, 0xC
/* 3B90D0 E00BA500 1440FF87 */  bnez      $v0, .LE00BA320
/* 3B90D4 E00BA504 24C60002 */   addiu    $a2, $a2, 0x2
/* 3B90D8 E00BA508 25EF001A */  addiu     $t7, $t7, 0x1A
/* 3B90DC E00BA50C 25CE000D */  addiu     $t6, $t6, 0xD
/* 3B90E0 E00BA510 25AD000D */  addiu     $t5, $t5, 0xD
/* 3B90E4 E00BA514 258C000D */  addiu     $t4, $t4, 0xD
/* 3B90E8 E00BA518 256B000D */  addiu     $t3, $t3, 0xD
/* 3B90EC E00BA51C 26520001 */  addiu     $s2, $s2, 0x1
/* 3B90F0 E00BA520 2A420012 */  slti      $v0, $s2, 0x12
/* 3B90F4 E00BA524 1440FF77 */  bnez      $v0, .LE00BA304
/* 3B90F8 E00BA528 254A000D */   addiu    $t2, $t2, 0xD
/* 3B90FC E00BA52C 24120001 */  addiu     $s2, $zero, 0x1
/* 3B9100 E00BA530 3C01E00C */  lui       $at, (0xE00C0000 >> 16)
/* 3B9104 E00BA534 D424AE90 */  ldc1      $f4, -0x5170($at)
/* 3B9108 E00BA538 2407001A */  addiu     $a3, $zero, 0x1A
/* 3B910C E00BA53C 2406000D */  addiu     $a2, $zero, 0xD
.LE00BA540:
/* 3B9110 E00BA540 24050001 */  addiu     $a1, $zero, 0x1
/* 3B9114 E00BA544 24E40002 */  addiu     $a0, $a3, 0x2
.LE00BA548:
/* 3B9118 E00BA548 02041021 */  addu      $v0, $s0, $a0
/* 3B911C E00BA54C 8442011A */  lh        $v0, 0x11A($v0)
/* 3B9120 E00BA550 44821000 */  mtc1      $v0, $f2
/* 3B9124 E00BA554 00000000 */  nop
/* 3B9128 E00BA558 468010A1 */  cvt.d.w   $f2, $f2
/* 3B912C E00BA55C 46241082 */  mul.d     $f2, $f2, $f4
/* 3B9130 E00BA560 00000000 */  nop
/* 3B9134 E00BA564 00A61821 */  addu      $v1, $a1, $a2
/* 3B9138 E00BA568 02031821 */  addu      $v1, $s0, $v1
/* 3B913C E00BA56C 80620023 */  lb        $v0, 0x23($v1)
/* 3B9140 E00BA570 44820000 */  mtc1      $v0, $f0
/* 3B9144 E00BA574 00000000 */  nop
/* 3B9148 E00BA578 46800021 */  cvt.d.w   $f0, $f0
/* 3B914C E00BA57C 46220000 */  add.d     $f0, $f0, $f2
/* 3B9150 E00BA580 24A50001 */  addiu     $a1, $a1, 0x1
/* 3B9154 E00BA584 4620038D */  trunc.w.d $f14, $f0
/* 3B9158 E00BA588 44027000 */  mfc1      $v0, $f14
/* 3B915C E00BA58C 00000000 */  nop
/* 3B9160 E00BA590 A0620023 */  sb        $v0, 0x23($v1)
/* 3B9164 E00BA594 28A2000C */  slti      $v0, $a1, 0xC
/* 3B9168 E00BA598 1440FFEB */  bnez      $v0, .LE00BA548
/* 3B916C E00BA59C 24840002 */   addiu    $a0, $a0, 0x2
/* 3B9170 E00BA5A0 24E7001A */  addiu     $a3, $a3, 0x1A
/* 3B9174 E00BA5A4 26520001 */  addiu     $s2, $s2, 0x1
/* 3B9178 E00BA5A8 2A420012 */  slti      $v0, $s2, 0x12
/* 3B917C E00BA5AC 1440FFE4 */  bnez      $v0, .LE00BA540
/* 3B9180 E00BA5B0 24C6000D */   addiu    $a2, $a2, 0xD
.LE00BA5B4:
/* 3B9184 E00BA5B4 8FBF0024 */  lw        $ra, 0x24($sp)
/* 3B9188 E00BA5B8 8FB40020 */  lw        $s4, 0x20($sp)
/* 3B918C E00BA5BC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 3B9190 E00BA5C0 8FB20018 */  lw        $s2, 0x18($sp)
/* 3B9194 E00BA5C4 8FB10014 */  lw        $s1, 0x14($sp)
/* 3B9198 E00BA5C8 8FB00010 */  lw        $s0, 0x10($sp)
/* 3B919C E00BA5CC D7B60030 */  ldc1      $f22, 0x30($sp)
/* 3B91A0 E00BA5D0 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 3B91A4 E00BA5D4 03E00008 */  jr        $ra
/* 3B91A8 E00BA5D8 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void underwater_update(EffectInstance* effect) {
    UnderwaterFXData* data = effect->data.underwater;
    s32 timeLeft;
    s32 lifeTime;
    s32 alpha;
    f32 factor;
    s32 i;
    s32 j;

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

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

    data->lifeTime++;

    if (data->timeLeft < 0) {
        shim_remove_effect(effect);
        return;
    }

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

    alpha = 255;
    if (timeLeft < 32) {
        alpha = timeLeft * 8;
    }
    if (lifeTime < 16) {
        alpha = lifeTime * 16 + 15;
    }

    data->waterColor.a = (f32) alpha;
    factor = (f32) alpha / 255.0f;

    for (i = 1; i < ARRAY_COUNT(data->unk_23) - 1; i++) {
        data->unk_23[i][6] = shim_sin_deg(-((lifeTime - i) * 20)) * -64.0f * factor;
    }

    for (i = 1; i < ARRAY_COUNT(data->unk_23) - 1; i++) {
        for (j = 1; j < ARRAY_COUNT(data->unk_23[0]) - 1; j++) {
            f32 m11 = data->unk_23[i][j] * 4.0f;
            f32 m21 = data->unk_23[i + 1][j];
            f32 m01 = data->unk_23[i - 1][j];
            f32 m12 = data->unk_23[i][j + 1];
            f32 m10 = data->unk_23[i][j - 1];
            f32 m22 = data->unk_23[i + 1][j + 1];
            f32 m02 = data->unk_23[i - 1][j + 1];
            f32 m20 = data->unk_23[i + 1][j - 1];
            f32 m00 = data->unk_23[i - 1][j - 1];
            f32 temp1 = m21 + m01 + m12 + m10 - m11;
            f32 temp2 = (m22 + m02 + m20 + m00) * 0.5;

            data->unk_11A[i][j] += temp1 + temp2 - m11 * 0.7;
            data->unk_11A[i][j] *= 0.98;

            if (timeLeft < 32) {
                data->unk_23[i][j] *= factor;
            }
        }
    }

    for (i = 1; i < ARRAY_COUNT(data->unk_23) - 1; i++) {
        for (j = 1; j < ARRAY_COUNT(data->unk_23[0]) - 1; j++) {
            data->unk_23[i][j] += data->unk_11A[i][j] * 0.02;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel __umoddi3
/* 49C70 8006E870 27BDFFF8 */  addiu     $sp, $sp, -0x8
/* 49C74 8006E874 00E0402D */  daddu     $t0, $a3, $zero
/* 49C78 8006E878 00C0482D */  daddu     $t1, $a2, $zero
/* 49C7C 8006E87C 00A0582D */  daddu     $t3, $a1, $zero
/* 49C80 8006E880 0080502D */  daddu     $t2, $a0, $zero
/* 49C84 8006E884 152000A6 */  bnez      $t1, .L8006EB20
/* 49C88 8006E888 03A0C82D */   daddu    $t9, $sp, $zero
/* 49C8C 8006E88C 0148102B */  sltu      $v0, $t2, $t0
/* 49C90 8006E890 1040001D */  beqz      $v0, .L8006E908
/* 49C94 8006E894 3402FFFF */   ori      $v0, $zero, 0xFFFF
/* 49C98 8006E898 0048102B */  sltu      $v0, $v0, $t0
/* 49C9C 8006E89C 14400005 */  bnez      $v0, .L8006E8B4
/* 49CA0 8006E8A0 00E0302D */   daddu    $a2, $a3, $zero
/* 49CA4 8006E8A4 2D020100 */  sltiu     $v0, $t0, 0x100
/* 49CA8 8006E8A8 38420001 */  xori      $v0, $v0, 0x1
/* 49CAC 8006E8AC 0801BA33 */  j         .L8006E8CC
/* 49CB0 8006E8B0 000218C0 */   sll      $v1, $v0, 3
.L8006E8B4:
/* 49CB4 8006E8B4 3C0200FF */  lui       $v0, (0xFFFFFF >> 16)
/* 49CB8 8006E8B8 3442FFFF */  ori       $v0, $v0, (0xFFFFFF & 0xFFFF)
/* 49CBC 8006E8BC 0048102B */  sltu      $v0, $v0, $t0
/* 49CC0 8006E8C0 14400002 */  bnez      $v0, .L8006E8CC
/* 49CC4 8006E8C4 24030018 */   addiu    $v1, $zero, 0x18
/* 49CC8 8006E8C8 24030010 */  addiu     $v1, $zero, 0x10
.L8006E8CC:
/* 49CCC 8006E8CC 00661006 */  srlv      $v0, $a2, $v1
/* 49CD0 8006E8D0 3C01800A */  lui       $at, %hi(D_8009A140)
/* 49CD4 8006E8D4 00220821 */  addu      $at, $at, $v0
/* 49CD8 8006E8D8 9022A140 */  lbu       $v0, %lo(D_8009A140)($at)
/* 49CDC 8006E8DC 24040020 */  addiu     $a0, $zero, 0x20
/* 49CE0 8006E8E0 00431021 */  addu      $v0, $v0, $v1
/* 49CE4 8006E8E4 00826823 */  subu      $t5, $a0, $v0
/* 49CE8 8006E8E8 11A0005B */  beqz      $t5, .L8006EA58
/* 49CEC 8006E8EC 01AA1804 */   sllv     $v1, $t2, $t5
/* 49CF0 8006E8F0 01A84004 */  sllv      $t0, $t0, $t5
/* 49CF4 8006E8F4 008D1023 */  subu      $v0, $a0, $t5
/* 49CF8 8006E8F8 004B1006 */  srlv      $v0, $t3, $v0
/* 49CFC 8006E8FC 00625025 */  or        $t2, $v1, $v0
/* 49D00 8006E900 0801BA96 */  j         .L8006EA58
/* 49D04 8006E904 01AB5804 */   sllv     $t3, $t3, $t5
.L8006E908:
/* 49D08 8006E908 15000008 */  bnez      $t0, .L8006E92C
/* 49D0C 8006E90C 0048102B */   sltu     $v0, $v0, $t0
/* 49D10 8006E910 24020001 */  addiu     $v0, $zero, 0x1
/* 49D14 8006E914 15200002 */  bnez      $t1, .L8006E920
/* 49D18 8006E918 0049001B */   divu     $zero, $v0, $t1
/* 49D1C 8006E91C 0007000D */  break     7
.L8006E920:
/* 49D20 8006E920 00004012 */  mflo      $t0
/* 49D24 8006E924 3402FFFF */  ori       $v0, $zero, 0xFFFF
/* 49D28 8006E928 0048102B */  sltu      $v0, $v0, $t0
.L8006E92C:
/* 49D2C 8006E92C 14400005 */  bnez      $v0, .L8006E944
/* 49D30 8006E930 0100202D */   daddu    $a0, $t0, $zero
/* 49D34 8006E934 2D020100 */  sltiu     $v0, $t0, 0x100
/* 49D38 8006E938 38420001 */  xori      $v0, $v0, 0x1
/* 49D3C 8006E93C 0801BA57 */  j         .L8006E95C
/* 49D40 8006E940 000218C0 */   sll      $v1, $v0, 3
.L8006E944:
/* 49D44 8006E944 3C0200FF */  lui       $v0, (0xFFFFFF >> 16)
/* 49D48 8006E948 3442FFFF */  ori       $v0, $v0, (0xFFFFFF & 0xFFFF)
/* 49D4C 8006E94C 0048102B */  sltu      $v0, $v0, $t0
/* 49D50 8006E950 14400002 */  bnez      $v0, .L8006E95C
/* 49D54 8006E954 24030018 */   addiu    $v1, $zero, 0x18
/* 49D58 8006E958 24030010 */  addiu     $v1, $zero, 0x10
.L8006E95C:
/* 49D5C 8006E95C 00641006 */  srlv      $v0, $a0, $v1
/* 49D60 8006E960 3C01800A */  lui       $at, %hi(D_8009A140)
/* 49D64 8006E964 00220821 */  addu      $at, $at, $v0
/* 49D68 8006E968 9022A140 */  lbu       $v0, %lo(D_8009A140)($at)
/* 49D6C 8006E96C 00431021 */  addu      $v0, $v0, $v1
/* 49D70 8006E970 24030020 */  addiu     $v1, $zero, 0x20
/* 49D74 8006E974 00626823 */  subu      $t5, $v1, $v0
/* 49D78 8006E978 15A00003 */  bnez      $t5, .L8006E988
/* 49D7C 8006E97C 006DC023 */   subu     $t8, $v1, $t5
/* 49D80 8006E980 0801BA96 */  j         .L8006EA58
/* 49D84 8006E984 01485023 */   subu     $t2, $t2, $t0
.L8006E988:
/* 49D88 8006E988 01A84004 */  sllv      $t0, $t0, $t5
/* 49D8C 8006E98C 030A2006 */  srlv      $a0, $t2, $t8
/* 49D90 8006E990 01AA1804 */  sllv      $v1, $t2, $t5
/* 49D94 8006E994 030B1006 */  srlv      $v0, $t3, $t8
/* 49D98 8006E998 00625025 */  or        $t2, $v1, $v0
/* 49D9C 8006E99C 00082C02 */  srl       $a1, $t0, 16
/* 49DA0 8006E9A0 14A00002 */  bnez      $a1, .L8006E9AC
/* 49DA4 8006E9A4 0085001B */   divu     $zero, $a0, $a1
/* 49DA8 8006E9A8 0007000D */  break     7
.L8006E9AC:
/* 49DAC 8006E9AC 00001012 */  mflo      $v0
/* 49DB0 8006E9B0 00001810 */  mfhi      $v1
/* 49DB4 8006E9B4 3106FFFF */  andi      $a2, $t0, 0xFFFF
/* 49DB8 8006E9B8 00000000 */  nop
/* 49DBC 8006E9BC 00460018 */  mult      $v0, $a2
/* 49DC0 8006E9C0 00031C00 */  sll       $v1, $v1, 16
/* 49DC4 8006E9C4 000A1402 */  srl       $v0, $t2, 16
/* 49DC8 8006E9C8 00621825 */  or        $v1, $v1, $v0
/* 49DCC 8006E9CC 00002012 */  mflo      $a0
/* 49DD0 8006E9D0 0064102B */  sltu      $v0, $v1, $a0
/* 49DD4 8006E9D4 10400008 */  beqz      $v0, .L8006E9F8
/* 49DD8 8006E9D8 01AB5804 */   sllv     $t3, $t3, $t5
/* 49DDC 8006E9DC 00681821 */  addu      $v1, $v1, $t0
/* 49DE0 8006E9E0 0068102B */  sltu      $v0, $v1, $t0
/* 49DE4 8006E9E4 54400005 */  bnel      $v0, $zero, .L8006E9FC
/* 49DE8 8006E9E8 00641823 */   subu     $v1, $v1, $a0
/* 49DEC 8006E9EC 0064102B */  sltu      $v0, $v1, $a0
/* 49DF0 8006E9F0 54400001 */  bnel      $v0, $zero, .L8006E9F8
/* 49DF4 8006E9F4 00681821 */   addu     $v1, $v1, $t0
.L8006E9F8:
/* 49DF8 8006E9F8 00641823 */  subu      $v1, $v1, $a0
.L8006E9FC:
/* 49DFC 8006E9FC 14A00002 */  bnez      $a1, .L8006EA08
/* 49E00 8006EA00 0065001B */   divu     $zero, $v1, $a1
/* 49E04 8006EA04 0007000D */  break     7
.L8006EA08:
/* 49E08 8006EA08 00001012 */  mflo      $v0
/* 49E0C 8006EA0C 00001810 */  mfhi      $v1
/* 49E10 8006EA10 00000000 */  nop
/* 49E14 8006EA14 00000000 */  nop
/* 49E18 8006EA18 00460018 */  mult      $v0, $a2
/* 49E1C 8006EA1C 00031C00 */  sll       $v1, $v1, 16
/* 49E20 8006EA20 3142FFFF */  andi      $v0, $t2, 0xFFFF
/* 49E24 8006EA24 00621825 */  or        $v1, $v1, $v0
/* 49E28 8006EA28 00002012 */  mflo      $a0
/* 49E2C 8006EA2C 0064102B */  sltu      $v0, $v1, $a0
/* 49E30 8006EA30 50400009 */  beql      $v0, $zero, .L8006EA58
/* 49E34 8006EA34 00645023 */   subu     $t2, $v1, $a0
/* 49E38 8006EA38 00681821 */  addu      $v1, $v1, $t0
/* 49E3C 8006EA3C 0068102B */  sltu      $v0, $v1, $t0
/* 49E40 8006EA40 14400005 */  bnez      $v0, .L8006EA58
/* 49E44 8006EA44 00645023 */   subu     $t2, $v1, $a0
/* 49E48 8006EA48 0064102B */  sltu      $v0, $v1, $a0
/* 49E4C 8006EA4C 54400001 */  bnel      $v0, $zero, .L8006EA54
/* 49E50 8006EA50 00681821 */   addu     $v1, $v1, $t0
.L8006EA54:
/* 49E54 8006EA54 00645023 */  subu      $t2, $v1, $a0
.L8006EA58:
/* 49E58 8006EA58 00082C02 */  srl       $a1, $t0, 16
/* 49E5C 8006EA5C 14A00002 */  bnez      $a1, .L8006EA68
/* 49E60 8006EA60 0145001B */   divu     $zero, $t2, $a1
/* 49E64 8006EA64 0007000D */  break     7
.L8006EA68:
/* 49E68 8006EA68 00001012 */  mflo      $v0
/* 49E6C 8006EA6C 00001810 */  mfhi      $v1
/* 49E70 8006EA70 3106FFFF */  andi      $a2, $t0, 0xFFFF
/* 49E74 8006EA74 00000000 */  nop
/* 49E78 8006EA78 00460018 */  mult      $v0, $a2
/* 49E7C 8006EA7C 00031C00 */  sll       $v1, $v1, 16
/* 49E80 8006EA80 000B1402 */  srl       $v0, $t3, 16
/* 49E84 8006EA84 00621825 */  or        $v1, $v1, $v0
/* 49E88 8006EA88 00002012 */  mflo      $a0
/* 49E8C 8006EA8C 0064102B */  sltu      $v0, $v1, $a0
/* 49E90 8006EA90 50400009 */  beql      $v0, $zero, .L8006EAB8
/* 49E94 8006EA94 00641823 */   subu     $v1, $v1, $a0
/* 49E98 8006EA98 00681821 */  addu      $v1, $v1, $t0
/* 49E9C 8006EA9C 0068102B */  sltu      $v0, $v1, $t0
/* 49EA0 8006EAA0 54400005 */  bnel      $v0, $zero, .L8006EAB8
/* 49EA4 8006EAA4 00641823 */   subu     $v1, $v1, $a0
/* 49EA8 8006EAA8 0064102B */  sltu      $v0, $v1, $a0
/* 49EAC 8006EAAC 54400001 */  bnel      $v0, $zero, .L8006EAB4
/* 49EB0 8006EAB0 00681821 */   addu     $v1, $v1, $t0
.L8006EAB4:
/* 49EB4 8006EAB4 00641823 */  subu      $v1, $v1, $a0
.L8006EAB8:
/* 49EB8 8006EAB8 14A00002 */  bnez      $a1, .L8006EAC4
/* 49EBC 8006EABC 0065001B */   divu     $zero, $v1, $a1
/* 49EC0 8006EAC0 0007000D */  break     7
.L8006EAC4:
/* 49EC4 8006EAC4 00001012 */  mflo      $v0
/* 49EC8 8006EAC8 00001810 */  mfhi      $v1
/* 49ECC 8006EACC 00000000 */  nop
/* 49ED0 8006EAD0 00000000 */  nop
/* 49ED4 8006EAD4 00460018 */  mult      $v0, $a2
/* 49ED8 8006EAD8 00031C00 */  sll       $v1, $v1, 16
/* 49EDC 8006EADC 3162FFFF */  andi      $v0, $t3, 0xFFFF
/* 49EE0 8006EAE0 00621825 */  or        $v1, $v1, $v0
/* 49EE4 8006EAE4 00002012 */  mflo      $a0
/* 49EE8 8006EAE8 0064102B */  sltu      $v0, $v1, $a0
/* 49EEC 8006EAEC 10400007 */  beqz      $v0, .L8006EB0C
/* 49EF0 8006EAF0 00000000 */   nop
/* 49EF4 8006EAF4 00681821 */  addu      $v1, $v1, $t0
/* 49EF8 8006EAF8 0068102B */  sltu      $v0, $v1, $t0
/* 49EFC 8006EAFC 14400003 */  bnez      $v0, .L8006EB0C
/* 49F00 8006EB00 0064102B */   sltu     $v0, $v1, $a0
/* 49F04 8006EB04 54400001 */  bnel      $v0, $zero, .L8006EB0C
/* 49F08 8006EB08 00681821 */   addu     $v1, $v1, $t0
.L8006EB0C:
/* 49F0C 8006EB0C 13200087 */  beqz      $t9, .L8006ED2C
/* 49F10 8006EB10 00645823 */   subu     $t3, $v1, $a0
/* 49F14 8006EB14 01AB7806 */  srlv      $t7, $t3, $t5
/* 49F18 8006EB18 0801BB49 */  j         .L8006ED24
/* 49F1C 8006EB1C 0000702D */   daddu    $t6, $zero, $zero
.L8006EB20:
/* 49F20 8006EB20 0149102B */  sltu      $v0, $t2, $t1
/* 49F24 8006EB24 10400007 */  beqz      $v0, .L8006EB44
/* 49F28 8006EB28 3402FFFF */   ori      $v0, $zero, 0xFFFF
/* 49F2C 8006EB2C 00A0782D */  daddu     $t7, $a1, $zero
/* 49F30 8006EB30 0140702D */  daddu     $t6, $t2, $zero
/* 49F34 8006EB34 AFAE0000 */  sw        $t6, 0x0($sp)
/* 49F38 8006EB38 AFAF0004 */  sw        $t7, 0x4($sp)
/* 49F3C 8006EB3C 0801BB4B */  j         .L8006ED2C
/* 49F40 8006EB40 00000000 */   nop
.L8006EB44:
/* 49F44 8006EB44 0049102B */  sltu      $v0, $v0, $t1
/* 49F48 8006EB48 14400005 */  bnez      $v0, .L8006EB60
/* 49F4C 8006EB4C 0120202D */   daddu    $a0, $t1, $zero
/* 49F50 8006EB50 2D220100 */  sltiu     $v0, $t1, 0x100
/* 49F54 8006EB54 38420001 */  xori      $v0, $v0, 0x1
/* 49F58 8006EB58 0801BADE */  j         .L8006EB78
/* 49F5C 8006EB5C 000218C0 */   sll      $v1, $v0, 3
.L8006EB60:
/* 49F60 8006EB60 3C0200FF */  lui       $v0, (0xFFFFFF >> 16)
/* 49F64 8006EB64 3442FFFF */  ori       $v0, $v0, (0xFFFFFF & 0xFFFF)
/* 49F68 8006EB68 0049102B */  sltu      $v0, $v0, $t1
/* 49F6C 8006EB6C 14400002 */  bnez      $v0, .L8006EB78
/* 49F70 8006EB70 24030018 */   addiu    $v1, $zero, 0x18
/* 49F74 8006EB74 24030010 */  addiu     $v1, $zero, 0x10
.L8006EB78:
/* 49F78 8006EB78 00641006 */  srlv      $v0, $a0, $v1
/* 49F7C 8006EB7C 3C01800A */  lui       $at, %hi(D_8009A140)
/* 49F80 8006EB80 00220821 */  addu      $at, $at, $v0
/* 49F84 8006EB84 9022A140 */  lbu       $v0, %lo(D_8009A140)($at)
/* 49F88 8006EB88 00431021 */  addu      $v0, $v0, $v1
/* 49F8C 8006EB8C 24030020 */  addiu     $v1, $zero, 0x20
/* 49F90 8006EB90 00626823 */  subu      $t5, $v1, $v0
/* 49F94 8006EB94 15A0000F */  bnez      $t5, .L8006EBD4
/* 49F98 8006EB98 006DC023 */   subu     $t8, $v1, $t5
/* 49F9C 8006EB9C 012A102B */  sltu      $v0, $t1, $t2
/* 49FA0 8006EBA0 14400004 */  bnez      $v0, .L8006EBB4
/* 49FA4 8006EBA4 01682023 */   subu     $a0, $t3, $t0
/* 49FA8 8006EBA8 0168102B */  sltu      $v0, $t3, $t0
/* 49FAC 8006EBAC 14400005 */  bnez      $v0, .L8006EBC4
/* 49FB0 8006EBB0 00000000 */   nop
.L8006EBB4:
/* 49FB4 8006EBB4 01491823 */  subu      $v1, $t2, $t1
/* 49FB8 8006EBB8 0164102B */  sltu      $v0, $t3, $a0
/* 49FBC 8006EBBC 00625023 */  subu      $t2, $v1, $v0
/* 49FC0 8006EBC0 0080582D */  daddu     $t3, $a0, $zero
.L8006EBC4:
/* 49FC4 8006EBC4 13200059 */  beqz      $t9, .L8006ED2C
/* 49FC8 8006EBC8 0160782D */   daddu    $t7, $t3, $zero
/* 49FCC 8006EBCC 0801BB49 */  j         .L8006ED24
/* 49FD0 8006EBD0 0140702D */   daddu    $t6, $t2, $zero
.L8006EBD4:
/* 49FD4 8006EBD4 01A91804 */  sllv      $v1, $t1, $t5
/* 49FD8 8006EBD8 03081006 */  srlv      $v0, $t0, $t8
/* 49FDC 8006EBDC 00624825 */  or        $t1, $v1, $v0
/* 49FE0 8006EBE0 01A84004 */  sllv      $t0, $t0, $t5
/* 49FE4 8006EBE4 030A2006 */  srlv      $a0, $t2, $t8
/* 49FE8 8006EBE8 01AA1804 */  sllv      $v1, $t2, $t5
/* 49FEC 8006EBEC 030B1006 */  srlv      $v0, $t3, $t8
/* 49FF0 8006EBF0 00625025 */  or        $t2, $v1, $v0
/* 49FF4 8006EBF4 00093402 */  srl       $a2, $t1, 16
/* 49FF8 8006EBF8 14C00002 */  bnez      $a2, .L8006EC04
/* 49FFC 8006EBFC 0086001B */   divu     $zero, $a0, $a2
/* 4A000 8006EC00 0007000D */  break     7
.L8006EC04:
/* 4A004 8006EC04 00003812 */  mflo      $a3
/* 4A008 8006EC08 00001810 */  mfhi      $v1
/* 4A00C 8006EC0C 312CFFFF */  andi      $t4, $t1, 0xFFFF
/* 4A010 8006EC10 00000000 */  nop
/* 4A014 8006EC14 00EC0018 */  mult      $a3, $t4
/* 4A018 8006EC18 000A1402 */  srl       $v0, $t2, 16
/* 4A01C 8006EC1C 00031C00 */  sll       $v1, $v1, 16
/* 4A020 8006EC20 00621825 */  or        $v1, $v1, $v0
/* 4A024 8006EC24 00002812 */  mflo      $a1
/* 4A028 8006EC28 0065102B */  sltu      $v0, $v1, $a1
/* 4A02C 8006EC2C 1040000A */  beqz      $v0, .L8006EC58
/* 4A030 8006EC30 01AB5804 */   sllv     $t3, $t3, $t5
/* 4A034 8006EC34 00691821 */  addu      $v1, $v1, $t1
/* 4A038 8006EC38 0069102B */  sltu      $v0, $v1, $t1
/* 4A03C 8006EC3C 14400006 */  bnez      $v0, .L8006EC58
/* 4A040 8006EC40 24E7FFFF */   addiu    $a3, $a3, -0x1
/* 4A044 8006EC44 0065102B */  sltu      $v0, $v1, $a1
/* 4A048 8006EC48 50400004 */  beql      $v0, $zero, .L8006EC5C
/* 4A04C 8006EC4C 00651823 */   subu     $v1, $v1, $a1
/* 4A050 8006EC50 24E7FFFF */  addiu     $a3, $a3, -0x1
/* 4A054 8006EC54 00691821 */  addu      $v1, $v1, $t1
.L8006EC58:
/* 4A058 8006EC58 00651823 */  subu      $v1, $v1, $a1
.L8006EC5C:
/* 4A05C 8006EC5C 14C00002 */  bnez      $a2, .L8006EC68
/* 4A060 8006EC60 0066001B */   divu     $zero, $v1, $a2
/* 4A064 8006EC64 0007000D */  break     7
.L8006EC68:
/* 4A068 8006EC68 00002012 */  mflo      $a0
/* 4A06C 8006EC6C 00001810 */  mfhi      $v1
/* 4A070 8006EC70 00000000 */  nop
/* 4A074 8006EC74 00000000 */  nop
/* 4A078 8006EC78 008C0018 */  mult      $a0, $t4
/* 4A07C 8006EC7C 3142FFFF */  andi      $v0, $t2, 0xFFFF
/* 4A080 8006EC80 00031C00 */  sll       $v1, $v1, 16
/* 4A084 8006EC84 00621825 */  or        $v1, $v1, $v0
/* 4A088 8006EC88 00002812 */  mflo      $a1
/* 4A08C 8006EC8C 0065102B */  sltu      $v0, $v1, $a1
/* 4A090 8006EC90 5040000B */  beql      $v0, $zero, .L8006ECC0
/* 4A094 8006EC94 00655023 */   subu     $t2, $v1, $a1
/* 4A098 8006EC98 00691821 */  addu      $v1, $v1, $t1
/* 4A09C 8006EC9C 0069102B */  sltu      $v0, $v1, $t1
/* 4A0A0 8006ECA0 14400006 */  bnez      $v0, .L8006ECBC
/* 4A0A4 8006ECA4 2484FFFF */   addiu    $a0, $a0, -0x1
/* 4A0A8 8006ECA8 0065102B */  sltu      $v0, $v1, $a1
/* 4A0AC 8006ECAC 10400004 */  beqz      $v0, .L8006ECC0
/* 4A0B0 8006ECB0 00655023 */   subu     $t2, $v1, $a1
/* 4A0B4 8006ECB4 2484FFFF */  addiu     $a0, $a0, -0x1
/* 4A0B8 8006ECB8 00691821 */  addu      $v1, $v1, $t1
.L8006ECBC:
/* 4A0BC 8006ECBC 00655023 */  subu      $t2, $v1, $a1
.L8006ECC0:
/* 4A0C0 8006ECC0 00071400 */  sll       $v0, $a3, 16
/* 4A0C4 8006ECC4 00441025 */  or        $v0, $v0, $a0
/* 4A0C8 8006ECC8 00480019 */  multu     $v0, $t0
/* 4A0CC 8006ECCC 00003010 */  mfhi      $a2
/* 4A0D0 8006ECD0 0146102B */  sltu      $v0, $t2, $a2
/* 4A0D4 8006ECD4 00002812 */  mflo      $a1
/* 4A0D8 8006ECD8 54400005 */  bnel      $v0, $zero, .L8006ECF0
/* 4A0DC 8006ECDC 00A82023 */   subu     $a0, $a1, $t0
/* 4A0E0 8006ECE0 14CA0007 */  bne       $a2, $t2, .L8006ED00
/* 4A0E4 8006ECE4 0165102B */   sltu     $v0, $t3, $a1
/* 4A0E8 8006ECE8 10400005 */  beqz      $v0, .L8006ED00
/* 4A0EC 8006ECEC 00A82023 */   subu     $a0, $a1, $t0
.L8006ECF0:
/* 4A0F0 8006ECF0 00C91823 */  subu      $v1, $a2, $t1
/* 4A0F4 8006ECF4 00A4102B */  sltu      $v0, $a1, $a0
/* 4A0F8 8006ECF8 00623023 */  subu      $a2, $v1, $v0
/* 4A0FC 8006ECFC 0080282D */  daddu     $a1, $a0, $zero
.L8006ED00:
/* 4A100 8006ED00 1320000A */  beqz      $t9, .L8006ED2C
/* 4A104 8006ED04 01651823 */   subu     $v1, $t3, $a1
/* 4A108 8006ED08 01462023 */  subu      $a0, $t2, $a2
/* 4A10C 8006ED0C 0163102B */  sltu      $v0, $t3, $v1
/* 4A110 8006ED10 00825023 */  subu      $t2, $a0, $v0
/* 4A114 8006ED14 030A1004 */  sllv      $v0, $t2, $t8
/* 4A118 8006ED18 01A31806 */  srlv      $v1, $v1, $t5
/* 4A11C 8006ED1C 00437825 */  or        $t7, $v0, $v1
/* 4A120 8006ED20 01AA7006 */  srlv      $t6, $t2, $t5
.L8006ED24:
/* 4A124 8006ED24 AF2E0000 */  sw        $t6, 0x0($t9)
/* 4A128 8006ED28 AF2F0004 */  sw        $t7, 0x4($t9)
.L8006ED2C:
/* 4A12C 8006ED2C 8FA20000 */  lw        $v0, 0x0($sp)
/* 4A130 8006ED30 8FA30004 */  lw        $v1, 0x4($sp)
/* 4A134 8006ED34 03E00008 */  jr        $ra
/* 4A138 8006ED38 27BD0008 */   addiu    $sp, $sp, 0x8
/* 4A13C 8006ED3C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

UDItype __umoddi3(UDItype u, UDItype v) {
    UDItype w;

    __udivmoddi4(u, v, &w);

    return w;
}