### RAW ASSEMBLY INSTRUCTIONS:

glabel update_npcs
/* 14D30 80039930 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 14D34 80039934 3C02FFFF */  lui       $v0, (0xFFFF7FFF >> 16)
/* 14D38 80039938 34427FFF */  ori       $v0, $v0, (0xFFFF7FFF & 0xFFFF)
/* 14D3C 8003993C AFB3003C */  sw        $s3, 0x3C($sp)
/* 14D40 80039940 3C138011 */  lui       $s3, %hi(gPlayerStatus)
/* 14D44 80039944 2673EFC8 */  addiu     $s3, $s3, %lo(gPlayerStatus)
/* 14D48 80039948 AFBF0040 */  sw        $ra, 0x40($sp)
/* 14D4C 8003994C AFB20038 */  sw        $s2, 0x38($sp)
/* 14D50 80039950 AFB10034 */  sw        $s1, 0x34($sp)
/* 14D54 80039954 AFB00030 */  sw        $s0, 0x30($sp)
/* 14D58 80039958 F7B40048 */  sdc1      $f20, 0x48($sp)
/* 14D5C 8003995C 8E630004 */  lw        $v1, 0x4($s3)
/* 14D60 80039960 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* 14D64 80039964 8C84A650 */  lw        $a0, %lo(gOverrideFlags)($a0)
/* 14D68 80039968 00621824 */  and       $v1, $v1, $v0
/* 14D6C 8003996C 30840C00 */  andi      $a0, $a0, 0xC00
/* 14D70 80039970 14800104 */  bnez      $a0, .L80039D84
/* 14D74 80039974 AE630004 */   sw       $v1, 0x4($s3)
/* 14D78 80039978 0000902D */  daddu     $s2, $zero, $zero
/* 14D7C 8003997C 4480A000 */  mtc1      $zero, $f20
.L80039980:
/* 14D80 80039980 3C03800A */  lui       $v1, %hi(gCurrentNpcListPtr)
/* 14D84 80039984 8C630B90 */  lw        $v1, %lo(gCurrentNpcListPtr)($v1)
/* 14D88 80039988 00121080 */  sll       $v0, $s2, 2
/* 14D8C 8003998C 00431021 */  addu      $v0, $v0, $v1
/* 14D90 80039990 8C500000 */  lw        $s0, 0x0($v0)
/* 14D94 80039994 520000F8 */  beql      $s0, $zero, .L80039D78
/* 14D98 80039998 26520001 */   addiu    $s2, $s2, 0x1
/* 14D9C 8003999C 8E030000 */  lw        $v1, 0x0($s0)
/* 14DA0 800399A0 506000F5 */  beql      $v1, $zero, .L80039D78
/* 14DA4 800399A4 26520001 */   addiu    $s2, $s2, 0x1
/* 14DA8 800399A8 3C028000 */  lui       $v0, (0x80000004 >> 16)
/* 14DAC 800399AC 34420004 */  ori       $v0, $v0, (0x80000004 & 0xFFFF)
/* 14DB0 800399B0 00621024 */  and       $v0, $v1, $v0
/* 14DB4 800399B4 10400005 */  beqz      $v0, .L800399CC
/* 14DB8 800399B8 00000000 */   nop
/* 14DBC 800399BC 0C00E2BF */  jal       npc_do_world_collision
/* 14DC0 800399C0 0200202D */   daddu    $a0, $s0, $zero
/* 14DC4 800399C4 0800E75E */  j         .L80039D78
/* 14DC8 800399C8 26520001 */   addiu    $s2, $s2, 0x1
.L800399CC:
/* 14DCC 800399CC 8E020004 */  lw        $v0, 0x4($s0)
/* 14DD0 800399D0 0040F809 */  jalr      $v0
/* 14DD4 800399D4 0200202D */   daddu    $a0, $s0, $zero
/* 14DD8 800399D8 8E020000 */  lw        $v0, 0x0($s0)
/* 14DDC 800399DC 30428000 */  andi      $v0, $v0, 0x8000
/* 14DE0 800399E0 10400004 */  beqz      $v0, .L800399F4
/* 14DE4 800399E4 3C030004 */   lui      $v1, (0x40000 >> 16)
/* 14DE8 800399E8 8E020080 */  lw        $v0, 0x80($s0)
/* 14DEC 800399EC 0800E681 */  j         .L80039A04
/* 14DF0 800399F0 00431025 */   or       $v0, $v0, $v1
.L800399F4:
/* 14DF4 800399F4 3C03FFFB */  lui       $v1, (0xFFFBFFFF >> 16)
/* 14DF8 800399F8 8E020080 */  lw        $v0, 0x80($s0)
/* 14DFC 800399FC 3463FFFF */  ori       $v1, $v1, (0xFFFBFFFF & 0xFFFF)
/* 14E00 80039A00 00431024 */  and       $v0, $v0, $v1
.L80039A04:
/* 14E04 80039A04 AE020080 */  sw        $v0, 0x80($s0)
/* 14E08 80039A08 0200202D */  daddu     $a0, $s0, $zero
/* 14E0C 80039A0C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 14E10 80039A10 A6020084 */  sh        $v0, 0x84($s0)
/* 14E14 80039A14 A6020086 */  sh        $v0, 0x86($s0)
/* 14E18 80039A18 8E020000 */  lw        $v0, 0x0($s0)
/* 14E1C 80039A1C 24039FFF */  addiu     $v1, $zero, -0x6001
/* 14E20 80039A20 00431024 */  and       $v0, $v0, $v1
/* 14E24 80039A24 0C00E2BF */  jal       npc_do_world_collision
/* 14E28 80039A28 AE020000 */   sw       $v0, 0x0($s0)
/* 14E2C 80039A2C 0C00E5A2 */  jal       npc_try_apply_gravity
/* 14E30 80039A30 0200202D */   daddu    $a0, $s0, $zero
/* 14E34 80039A34 4405A000 */  mfc1      $a1, $f20
/* 14E38 80039A38 0C00E5FA */  jal       npc_try_snap_to_ground
/* 14E3C 80039A3C 0200202D */   daddu    $a0, $s0, $zero
/* 14E40 80039A40 0C00E4B6 */  jal       npc_do_player_collision
/* 14E44 80039A44 0200202D */   daddu    $a0, $s0, $zero
/* 14E48 80039A48 0C00E403 */  jal       npc_do_other_npc_collision
/* 14E4C 80039A4C 0200202D */   daddu    $a0, $s0, $zero
/* 14E50 80039A50 8E020000 */  lw        $v0, 0x0($s0)
/* 14E54 80039A54 3C030010 */  lui       $v1, (0x100000 >> 16)
/* 14E58 80039A58 00431024 */  and       $v0, $v0, $v1
/* 14E5C 80039A5C 10400003 */  beqz      $v0, .L80039A6C
/* 14E60 80039A60 00000000 */   nop
/* 14E64 80039A64 0C00EB7E */  jal       update_npc_blur
/* 14E68 80039A68 0200202D */   daddu    $a0, $s0, $zero
.L80039A6C:
/* 14E6C 80039A6C C602003C */  lwc1      $f2, 0x3C($s0)
/* 14E70 80039A70 3C01C4FA */  lui       $at, (0xC4FA0000 >> 16)
/* 14E74 80039A74 44810000 */  mtc1      $at, $f0
/* 14E78 80039A78 00000000 */  nop
/* 14E7C 80039A7C 4600103C */  c.lt.s    $f2, $f0
/* 14E80 80039A80 00000000 */  nop
/* 14E84 80039A84 4500000D */  bc1f      .L80039ABC
/* 14E88 80039A88 3C030400 */   lui      $v1, (0x4000000 >> 16)
/* 14E8C 80039A8C 8E020000 */  lw        $v0, 0x0($s0)
/* 14E90 80039A90 00431024 */  and       $v0, $v0, $v1
/* 14E94 80039A94 14400009 */  bnez      $v0, .L80039ABC
/* 14E98 80039A98 2403F7FF */   addiu    $v1, $zero, -0x801
/* 14E9C 80039A9C C660002C */  lwc1      $f0, 0x2C($s3)
/* 14EA0 80039AA0 8E020000 */  lw        $v0, 0x0($s0)
/* 14EA4 80039AA4 E614001C */  swc1      $f20, 0x1C($s0)
/* 14EA8 80039AA8 E6140018 */  swc1      $f20, 0x18($s0)
/* 14EAC 80039AAC E6140014 */  swc1      $f20, 0x14($s0)
/* 14EB0 80039AB0 00431024 */  and       $v0, $v0, $v1
/* 14EB4 80039AB4 E600003C */  swc1      $f0, 0x3C($s0)
/* 14EB8 80039AB8 AE020000 */  sw        $v0, 0x0($s0)
.L80039ABC:
/* 14EBC 80039ABC 8E030000 */  lw        $v1, 0x0($s0)
/* 14EC0 80039AC0 3C024000 */  lui       $v0, (0x40000000 >> 16)
/* 14EC4 80039AC4 00621024 */  and       $v0, $v1, $v0
/* 14EC8 80039AC8 1440000E */  bnez      $v0, .L80039B04
/* 14ECC 80039ACC 3C020100 */   lui      $v0, (0x1000000 >> 16)
/* 14ED0 80039AD0 00621024 */  and       $v0, $v1, $v0
/* 14ED4 80039AD4 1440000F */  bnez      $v0, .L80039B14
/* 14ED8 80039AD8 00000000 */   nop
/* 14EDC 80039ADC 8E050028 */  lw        $a1, 0x28($s0)
/* 14EE0 80039AE0 10A0000C */  beqz      $a1, .L80039B14
/* 14EE4 80039AE4 00000000 */   nop
/* 14EE8 80039AE8 8E040024 */  lw        $a0, 0x24($s0)
/* 14EEC 80039AEC 04800009 */  bltz      $a0, .L80039B14
/* 14EF0 80039AF0 00000000 */   nop
/* 14EF4 80039AF4 0C0B78AB */  jal       spr_update_sprite
/* 14EF8 80039AF8 8E060030 */   lw       $a2, 0x30($s0)
/* 14EFC 80039AFC 0800E6C5 */  j         .L80039B14
/* 14F00 80039B00 00000000 */   nop
.L80039B04:
/* 14F04 80039B04 8E050028 */  lw        $a1, 0x28($s0)
/* 14F08 80039B08 8E060030 */  lw        $a2, 0x30($s0)
/* 14F0C 80039B0C 0C0B76A3 */  jal       spr_update_player_sprite
/* 14F10 80039B10 24040001 */   addiu    $a0, $zero, 0x1
.L80039B14:
/* 14F14 80039B14 8E020000 */  lw        $v0, 0x0($s0)
/* 14F18 80039B18 30420010 */  andi      $v0, $v0, 0x10
/* 14F1C 80039B1C 10400072 */  beqz      $v0, .L80039CE8
/* 14F20 80039B20 00000000 */   nop
/* 14F24 80039B24 0C044181 */  jal       get_shadow_by_index
/* 14F28 80039B28 8E040078 */   lw       $a0, 0x78($s0)
/* 14F2C 80039B2C 84440008 */  lh        $a0, 0x8($v0)
/* 14F30 80039B30 0C048B77 */  jal       get_entity_model
/* 14F34 80039B34 0040882D */   daddu    $s1, $v0, $zero
/* 14F38 80039B38 0040202D */  daddu     $a0, $v0, $zero
/* 14F3C 80039B3C 8C430000 */  lw        $v1, 0x0($v0)
/* 14F40 80039B40 2402FDFF */  addiu     $v0, $zero, -0x201
/* 14F44 80039B44 00622824 */  and       $a1, $v1, $v0
/* 14F48 80039B48 AC850000 */  sw        $a1, 0x0($a0)
/* 14F4C 80039B4C 8E020000 */  lw        $v0, 0x0($s0)
/* 14F50 80039B50 3C030002 */  lui       $v1, (0x20000 >> 16)
/* 14F54 80039B54 00431024 */  and       $v0, $v0, $v1
/* 14F58 80039B58 10400002 */  beqz      $v0, .L80039B64
/* 14F5C 80039B5C 34A20200 */   ori      $v0, $a1, 0x200
/* 14F60 80039B60 AC820000 */  sw        $v0, 0x0($a0)
.L80039B64:
/* 14F64 80039B64 C6020038 */  lwc1      $f2, 0x38($s0)
/* 14F68 80039B68 C604003C */  lwc1      $f4, 0x3C($s0)
/* 14F6C 80039B6C 8E030000 */  lw        $v1, 0x0($s0)
/* 14F70 80039B70 C6060040 */  lwc1      $f6, 0x40($s0)
/* 14F74 80039B74 30620020 */  andi      $v0, $v1, 0x20
/* 14F78 80039B78 E7A20018 */  swc1      $f2, 0x18($sp)
/* 14F7C 80039B7C E7A4001C */  swc1      $f4, 0x1C($sp)
/* 14F80 80039B80 1440004D */  bnez      $v0, .L80039CB8
/* 14F84 80039B84 E7A60020 */   swc1     $f6, 0x20($sp)
/* 14F88 80039B88 C600006C */  lwc1      $f0, 0x6C($s0)
/* 14F8C 80039B8C 46001032 */  c.eq.s    $f2, $f0
/* 14F90 80039B90 00000000 */  nop
/* 14F94 80039B94 4500000E */  bc1f      .L80039BD0
/* 14F98 80039B98 27A40018 */   addiu    $a0, $sp, 0x18
/* 14F9C 80039B9C C6000070 */  lwc1      $f0, 0x70($s0)
/* 14FA0 80039BA0 46002032 */  c.eq.s    $f4, $f0
/* 14FA4 80039BA4 00000000 */  nop
/* 14FA8 80039BA8 4502000A */  bc1fl     .L80039BD4
/* 14FAC 80039BAC 27A5001C */   addiu    $a1, $sp, 0x1C
/* 14FB0 80039BB0 C6000074 */  lwc1      $f0, 0x74($s0)
/* 14FB4 80039BB4 46003032 */  c.eq.s    $f6, $f0
/* 14FB8 80039BB8 00000000 */  nop
/* 14FBC 80039BBC 45000004 */  bc1f      .L80039BD0
/* 14FC0 80039BC0 3C020001 */   lui      $v0, (0x10000 >> 16)
/* 14FC4 80039BC4 00621024 */  and       $v0, $v1, $v0
/* 14FC8 80039BC8 10400047 */  beqz      $v0, .L80039CE8
/* 14FCC 80039BCC 00000000 */   nop
.L80039BD0:
/* 14FD0 80039BD0 27A5001C */  addiu     $a1, $sp, 0x1C
.L80039BD4:
/* 14FD4 80039BD4 27A60020 */  addiu     $a2, $sp, 0x20
/* 14FD8 80039BD8 27A70024 */  addiu     $a3, $sp, 0x24
/* 14FDC 80039BDC C6000038 */  lwc1      $f0, 0x38($s0)
/* 14FE0 80039BE0 960300A8 */  lhu       $v1, 0xA8($s0)
/* 14FE4 80039BE4 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* 14FE8 80039BE8 44812000 */  mtc1      $at, $f4
/* 14FEC 80039BEC 00031C00 */  sll       $v1, $v1, 16
/* 14FF0 80039BF0 00031403 */  sra       $v0, $v1, 16
/* 14FF4 80039BF4 00031FC2 */  srl       $v1, $v1, 31
/* 14FF8 80039BF8 00431021 */  addu      $v0, $v0, $v1
/* 14FFC 80039BFC 00021043 */  sra       $v0, $v0, 1
/* 15000 80039C00 44823000 */  mtc1      $v0, $f6
/* 15004 80039C04 00000000 */  nop
/* 15008 80039C08 468031A0 */  cvt.s.w   $f6, $f6
/* 1500C 80039C0C 27A20028 */  addiu     $v0, $sp, 0x28
/* 15010 80039C10 E7A00018 */  swc1      $f0, 0x18($sp)
/* 15014 80039C14 C600003C */  lwc1      $f0, 0x3C($s0)
/* 15018 80039C18 C6020040 */  lwc1      $f2, 0x40($s0)
/* 1501C 80039C1C 46060000 */  add.s     $f0, $f0, $f6
/* 15020 80039C20 E7A4002C */  swc1      $f4, 0x2C($sp)
/* 15024 80039C24 E7A20020 */  swc1      $f2, 0x20($sp)
/* 15028 80039C28 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 1502C 80039C2C AFA20010 */  sw        $v0, 0x10($sp)
/* 15030 80039C30 27A2002C */  addiu     $v0, $sp, 0x2C
/* 15034 80039C34 0C04497A */  jal       entity_raycast_down
/* 15038 80039C38 AFA20014 */   sw       $v0, 0x14($sp)
/* 1503C 80039C3C 860200A6 */  lh        $v0, 0xA6($s0)
/* 15040 80039C40 8FA5002C */  lw        $a1, 0x2C($sp)
/* 15044 80039C44 44824000 */  mtc1      $v0, $f8
/* 15048 80039C48 00000000 */  nop
/* 1504C 80039C4C 46804220 */  cvt.s.w   $f8, $f8
/* 15050 80039C50 44064000 */  mfc1      $a2, $f8
/* 15054 80039C54 0C044A40 */  jal       set_npc_shadow_scale
/* 15058 80039C58 0220202D */   daddu    $a0, $s1, $zero
/* 1505C 80039C5C C7A00018 */  lwc1      $f0, 0x18($sp)
/* 15060 80039C60 C7A2001C */  lwc1      $f2, 0x1C($sp)
/* 15064 80039C64 C7A40020 */  lwc1      $f4, 0x20($sp)
/* 15068 80039C68 C7A60024 */  lwc1      $f6, 0x24($sp)
/* 1506C 80039C6C E6200010 */  swc1      $f0, 0x10($s1)
/* 15070 80039C70 E6220014 */  swc1      $f2, 0x14($s1)
/* 15074 80039C74 E6240018 */  swc1      $f4, 0x18($s1)
/* 15078 80039C78 E6260028 */  swc1      $f6, 0x28($s1)
/* 1507C 80039C7C C6020034 */  lwc1      $f2, 0x34($s0)
/* 15080 80039C80 C7A00028 */  lwc1      $f0, 0x28($sp)
/* 15084 80039C84 E622002C */  swc1      $f2, 0x2C($s1)
/* 15088 80039C88 C622001C */  lwc1      $f2, 0x1C($s1)
/* 1508C 80039C8C E6200030 */  swc1      $f0, 0x30($s1)
/* 15090 80039C90 C600007C */  lwc1      $f0, 0x7C($s0)
/* 15094 80039C94 46001082 */  mul.s     $f2, $f2, $f0
/* 15098 80039C98 00000000 */  nop
/* 1509C 80039C9C 3C03FFFE */  lui       $v1, (0xFFFEFFFF >> 16)
/* 150A0 80039CA0 E622001C */  swc1      $f2, 0x1C($s1)
/* 150A4 80039CA4 8E020000 */  lw        $v0, 0x0($s0)
/* 150A8 80039CA8 3463FFFF */  ori       $v1, $v1, (0xFFFEFFFF & 0xFFFF)
/* 150AC 80039CAC 00431024 */  and       $v0, $v0, $v1
/* 150B0 80039CB0 0800E73A */  j         .L80039CE8
/* 150B4 80039CB4 AE020000 */   sw       $v0, 0x0($s0)
.L80039CB8:
/* 150B8 80039CB8 30620400 */  andi      $v0, $v1, 0x400
/* 150BC 80039CBC 10400004 */  beqz      $v0, .L80039CD0
/* 150C0 80039CC0 00000000 */   nop
/* 150C4 80039CC4 C6000038 */  lwc1      $f0, 0x38($s0)
/* 150C8 80039CC8 0800E738 */  j         .L80039CE0
/* 150CC 80039CCC E6200010 */   swc1     $f0, 0x10($s1)
.L80039CD0:
/* 150D0 80039CD0 C6000038 */  lwc1      $f0, 0x38($s0)
/* 150D4 80039CD4 E6200010 */  swc1      $f0, 0x10($s1)
/* 150D8 80039CD8 C600003C */  lwc1      $f0, 0x3C($s0)
/* 150DC 80039CDC E6200014 */  swc1      $f0, 0x14($s1)
.L80039CE0:
/* 150E0 80039CE0 C6000040 */  lwc1      $f0, 0x40($s0)
/* 150E4 80039CE4 E6200018 */  swc1      $f0, 0x18($s1)
.L80039CE8:
/* 150E8 80039CE8 C6000038 */  lwc1      $f0, 0x38($s0)
/* 150EC 80039CEC C602003C */  lwc1      $f2, 0x3C($s0)
/* 150F0 80039CF0 C6040040 */  lwc1      $f4, 0x40($s0)
/* 150F4 80039CF4 0200202D */  daddu     $a0, $s0, $zero
/* 150F8 80039CF8 E600006C */  swc1      $f0, 0x6C($s0)
/* 150FC 80039CFC E6020070 */  swc1      $f2, 0x70($s0)
/* 15100 80039D00 0C00F111 */  jal       npc_update_decorations
/* 15104 80039D04 E6040074 */   swc1     $f4, 0x74($s0)
/* 15108 80039D08 8E030000 */  lw        $v1, 0x0($s0)
/* 1510C 80039D0C 3C024000 */  lui       $v0, (0x40000000 >> 16)
/* 15110 80039D10 00621024 */  and       $v0, $v1, $v0
/* 15114 80039D14 54400018 */  bnel      $v0, $zero, .L80039D78
/* 15118 80039D18 26520001 */   addiu    $s2, $s2, 0x1
/* 1511C 80039D1C 3C020100 */  lui       $v0, (0x1000000 >> 16)
/* 15120 80039D20 00621024 */  and       $v0, $v1, $v0
/* 15124 80039D24 54400014 */  bnel      $v0, $zero, .L80039D78
/* 15128 80039D28 26520001 */   addiu    $s2, $s2, 0x1
/* 1512C 80039D2C 8E030024 */  lw        $v1, 0x24($s0)
/* 15130 80039D30 04630011 */  bgezl     $v1, .L80039D78
/* 15134 80039D34 26520001 */   addiu    $s2, $s2, 0x1
/* 15138 80039D38 24630001 */  addiu     $v1, $v1, 0x1
/* 1513C 80039D3C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 15140 80039D40 1462000C */  bne       $v1, $v0, .L80039D74
/* 15144 80039D44 AE030024 */   sw       $v1, 0x24($s0)
/* 15148 80039D48 8E040028 */  lw        $a0, 0x28($s0)
/* 1514C 80039D4C 0C0B783B */  jal       spr_load_npc_sprite
/* 15150 80039D50 8E0500B0 */   lw       $a1, 0xB0($s0)
/* 15154 80039D54 04410003 */  bgez      $v0, .L80039D64
/* 15158 80039D58 AE020024 */   sw       $v0, 0x24($s0)
.L80039D5C:
/* 1515C 80039D5C 0800E757 */  j         .L80039D5C
/* 15160 80039D60 00000000 */   nop
.L80039D64:
/* 15164 80039D64 8E040024 */  lw        $a0, 0x24($s0)
/* 15168 80039D68 8E050028 */  lw        $a1, 0x28($s0)
/* 1516C 80039D6C 0C0B78AB */  jal       spr_update_sprite
/* 15170 80039D70 8E060030 */   lw       $a2, 0x30($s0)
.L80039D74:
/* 15174 80039D74 26520001 */  addiu     $s2, $s2, 0x1
.L80039D78:
/* 15178 80039D78 2A420040 */  slti      $v0, $s2, 0x40
/* 1517C 80039D7C 1440FF00 */  bnez      $v0, .L80039980
/* 15180 80039D80 00000000 */   nop
.L80039D84:
/* 15184 80039D84 8FBF0040 */  lw        $ra, 0x40($sp)
/* 15188 80039D88 8FB3003C */  lw        $s3, 0x3C($sp)
/* 1518C 80039D8C 8FB20038 */  lw        $s2, 0x38($sp)
/* 15190 80039D90 8FB10034 */  lw        $s1, 0x34($sp)
/* 15194 80039D94 8FB00030 */  lw        $s0, 0x30($sp)
/* 15198 80039D98 D7B40048 */  ldc1      $f20, 0x48($sp)
/* 1519C 80039D9C 03E00008 */  jr        $ra
/* 151A0 80039DA0 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void update_npcs(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 x, y, z;
    f32 hitYaw, hitPitch, hitLength;

    playerStatus->animFlags &= ~PA_FLAG_NPC_COLLIDED;
    if (!(gOverrideFlags & (GLOBAL_OVERRIDES_800 | GLOBAL_OVERRIDES_400))) {
        s32 i;

        for (i = 0; i < MAX_NPCS; i++) {
            Npc* npc = (*gCurrentNpcListPtr)[i];

            if (npc != NULL) {
                if (npc->flags != 0) {
                    if (npc->flags & (NPC_FLAG_SUSPENDED | NPC_FLAG_INACTIVE)) {
                        npc_do_world_collision(npc);
                        continue;
                    }

                    npc->onUpdate(npc);
                    if (npc->flags & NPC_FLAG_IGNORE_ENTITY_COLLISION) {
                        npc->collisionChannel |= COLLISION_IGNORE_ENTITIES;
                    } else {
                        npc->collisionChannel &= ~COLLISION_IGNORE_ENTITIES;
                    }

                    npc->currentFloor = NO_COLLIDER;
                    npc->currentWall = NO_COLLIDER;
                    npc->flags &= ~(NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD);

                    npc_do_world_collision(npc);
                    npc_try_apply_gravity(npc);
                    npc_try_snap_to_ground(npc, 0.0f);
                    npc_do_player_collision(npc);
                    npc_do_other_npc_collision(npc);

                    if (npc->flags & NPC_FLAG_MOTION_BLUR) {
                        update_npc_blur(npc);
                    }

                    if ((npc->pos.y < -2000.0f) && !(npc->flags & NPC_FLAG_PARTNER)) {
                        npc->pos.y = playerStatus->position.y;
                        npc->jumpVelocity = 0.0f;
                        npc->moveSpeed = 0.0f;
                        npc->jumpScale = 0.0f;
                        npc->flags &= ~NPC_FLAG_JUMPING;
                    }

                    if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                        if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
                            if (npc->currentAnim != 0) {
                                if (npc->spriteInstanceID >= 0) {
                                    spr_update_sprite(npc->spriteInstanceID, npc->currentAnim, npc->animationSpeed);
                                }
                            }
                        }
                    } else {
                        spr_update_player_sprite(PLAYER_SPRITE_AUX1, npc->currentAnim, npc->animationSpeed);
                    }

                    if (npc->flags & NPC_FLAG_HAS_SHADOW) {
                        Shadow* shadow = get_shadow_by_index(npc->shadowIndex);
                        EntityModel* entityModel = get_entity_model(shadow->entityModelID);

                        entityModel->flags &= ~ENTITY_MODEL_FLAG_REFLECT;
                        if (npc->flags & NPC_FLAG_REFLECT_WALL) {
                            entityModel->flags |= ENTITY_MODEL_FLAG_REFLECT;
                        }

                        x = npc->pos.x;
                        y = npc->pos.y;
                        z = npc->pos.z;
                        if (!(npc->flags & NPC_FLAG_NO_SHADOW_RAYCAST)) {
                            if (   x != npc->colliderPos.x
                                || y != npc->colliderPos.y
                                || z != npc->colliderPos.z
                                || (npc->flags & NPC_FLAG_DIRTY_SHADOW)
                            ) {
                                x = npc->pos.x;
                                y = npc->pos.y + (npc->collisionHeight / 2);
                                z = npc->pos.z;
                                hitLength = 1000.0f;
                                entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitLength);
                                set_npc_shadow_scale(shadow, hitLength, npc->collisionDiameter);
                                shadow->position.x = x;
                                shadow->position.y = y;
                                shadow->position.z = z;
                                shadow->rotation.x = hitYaw;
                                shadow->rotation.y = npc->renderYaw;
                                shadow->rotation.z = hitPitch;
                                shadow->scale.x *= npc->shadowScale;
                                npc->flags &= ~NPC_FLAG_DIRTY_SHADOW;
                            }
                        } else {
                            if (npc->flags & NPC_FLAG_DONT_UPDATE_SHADOW_Y) {
                                shadow->position.x = npc->pos.x;
                                shadow->position.z = npc->pos.z;
                            } else {
                                shadow->position.x = npc->pos.x;
                                shadow->position.y = npc->pos.y;
                                shadow->position.z = npc->pos.z;
                            }
                        }
                    }

                    npc->colliderPos.x = npc->pos.x;
                    npc->colliderPos.y = npc->pos.y;
                    npc->colliderPos.z = npc->pos.z;
                    npc_update_decorations(npc);

                    if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                        if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
                            if (npc->spriteInstanceID < 0) {
                                npc->spriteInstanceID++;
                                if (npc->spriteInstanceID == -1) {
                                    npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, npc->extraAnimList);
                                    ASSERT(npc->spriteInstanceID >= 0);
                                    spr_update_sprite(npc->spriteInstanceID, npc->currentAnim, npc->animationSpeed);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel npc_do_world_collision
/* 13EFC 80038AFC 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 13F00 80038B00 AFB00030 */  sw        $s0, 0x30($sp)
/* 13F04 80038B04 0080802D */  daddu     $s0, $a0, $zero
/* 13F08 80038B08 AFBF0034 */  sw        $ra, 0x34($sp)
/* 13F0C 80038B0C 8E030000 */  lw        $v1, 0x0($s0)
/* 13F10 80038B10 30620040 */  andi      $v0, $v1, 0x40
/* 13F14 80038B14 10400003 */  beqz      $v0, .L80038B24
/* 13F18 80038B18 3C020800 */   lui      $v0, (0x8000000 >> 16)
/* 13F1C 80038B1C 0800E3FE */  j         .L80038FF8
/* 13F20 80038B20 00621025 */   or       $v0, $v1, $v0
.L80038B24:
/* 13F24 80038B24 C6020038 */  lwc1      $f2, 0x38($s0)
/* 13F28 80038B28 C600006C */  lwc1      $f0, 0x6C($s0)
/* 13F2C 80038B2C 46001032 */  c.eq.s    $f2, $f0
/* 13F30 80038B30 00000000 */  nop
/* 13F34 80038B34 45020011 */  bc1fl     .L80038B7C
/* 13F38 80038B38 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
/* 13F3C 80038B3C C602003C */  lwc1      $f2, 0x3C($s0)
/* 13F40 80038B40 C6000070 */  lwc1      $f0, 0x70($s0)
/* 13F44 80038B44 46001032 */  c.eq.s    $f2, $f0
/* 13F48 80038B48 00000000 */  nop
/* 13F4C 80038B4C 4502000B */  bc1fl     .L80038B7C
/* 13F50 80038B50 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
/* 13F54 80038B54 C6020040 */  lwc1      $f2, 0x40($s0)
/* 13F58 80038B58 C6000074 */  lwc1      $f0, 0x74($s0)
/* 13F5C 80038B5C 46001032 */  c.eq.s    $f2, $f0
/* 13F60 80038B60 00000000 */  nop
/* 13F64 80038B64 45000004 */  bc1f      .L80038B78
/* 13F68 80038B68 3C020800 */   lui      $v0, (0x8000000 >> 16)
/* 13F6C 80038B6C 00621024 */  and       $v0, $v1, $v0
/* 13F70 80038B70 10400122 */  beqz      $v0, .L80038FFC
/* 13F74 80038B74 00000000 */   nop
.L80038B78:
/* 13F78 80038B78 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
.L80038B7C:
/* 13F7C 80038B7C 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
/* 13F80 80038B80 8E020000 */  lw        $v0, 0x0($s0)
/* 13F84 80038B84 C60C000C */  lwc1      $f12, 0xC($s0)
/* 13F88 80038B88 00431024 */  and       $v0, $v0, $v1
/* 13F8C 80038B8C 0C00A6C9 */  jal       clamp_angle
/* 13F90 80038B90 AE020000 */   sw       $v0, 0x0($s0)
/* 13F94 80038B94 C6020038 */  lwc1      $f2, 0x38($s0)
/* 13F98 80038B98 C604003C */  lwc1      $f4, 0x3C($s0)
/* 13F9C 80038B9C C6060040 */  lwc1      $f6, 0x40($s0)
/* 13FA0 80038BA0 E7A20020 */  swc1      $f2, 0x20($sp)
/* 13FA4 80038BA4 E7A40024 */  swc1      $f4, 0x24($sp)
/* 13FA8 80038BA8 E7A60028 */  swc1      $f6, 0x28($sp)
/* 13FAC 80038BAC 8E020000 */  lw        $v0, 0x0($s0)
/* 13FB0 80038BB0 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* 13FB4 80038BB4 00431024 */  and       $v0, $v0, $v1
/* 13FB8 80038BB8 14400013 */  bnez      $v0, .L80038C08
/* 13FBC 80038BBC AFA00010 */   sw       $zero, 0x10($sp)
/* 13FC0 80038BC0 E7A00014 */  swc1      $f0, 0x14($sp)
/* 13FC4 80038BC4 860200A8 */  lh        $v0, 0xA8($s0)
/* 13FC8 80038BC8 27A50020 */  addiu     $a1, $sp, 0x20
/* 13FCC 80038BCC 44820000 */  mtc1      $v0, $f0
/* 13FD0 80038BD0 00000000 */  nop
/* 13FD4 80038BD4 46800020 */  cvt.s.w   $f0, $f0
/* 13FD8 80038BD8 E7A00018 */  swc1      $f0, 0x18($sp)
/* 13FDC 80038BDC 860200A6 */  lh        $v0, 0xA6($s0)
/* 13FE0 80038BE0 27A60024 */  addiu     $a2, $sp, 0x24
/* 13FE4 80038BE4 44820000 */  mtc1      $v0, $f0
/* 13FE8 80038BE8 00000000 */  nop
/* 13FEC 80038BEC 46800020 */  cvt.s.w   $f0, $f0
/* 13FF0 80038BF0 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 13FF4 80038BF4 8E040080 */  lw        $a0, 0x80($s0)
/* 13FF8 80038BF8 0C037711 */  jal       npc_test_move_simple_with_slipping
/* 13FFC 80038BFC 27A70028 */   addiu    $a3, $sp, 0x28
/* 14000 80038C00 0800E312 */  j         .L80038C48
/* 14004 80038C04 00000000 */   nop
.L80038C08:
/* 14008 80038C08 E7A00014 */  swc1      $f0, 0x14($sp)
/* 1400C 80038C0C 860200A8 */  lh        $v0, 0xA8($s0)
/* 14010 80038C10 27A50020 */  addiu     $a1, $sp, 0x20
/* 14014 80038C14 44820000 */  mtc1      $v0, $f0
/* 14018 80038C18 00000000 */  nop
/* 1401C 80038C1C 46800020 */  cvt.s.w   $f0, $f0
/* 14020 80038C20 E7A00018 */  swc1      $f0, 0x18($sp)
/* 14024 80038C24 860200A6 */  lh        $v0, 0xA6($s0)
/* 14028 80038C28 27A60024 */  addiu     $a2, $sp, 0x24
/* 1402C 80038C2C 44820000 */  mtc1      $v0, $f0
/* 14030 80038C30 00000000 */  nop
/* 14034 80038C34 46800020 */  cvt.s.w   $f0, $f0
/* 14038 80038C38 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 1403C 80038C3C 8E040080 */  lw        $a0, 0x80($s0)
/* 14040 80038C40 0C037765 */  jal       npc_test_move_complex_with_slipping
/* 14044 80038C44 27A70028 */   addiu    $a3, $sp, 0x28
.L80038C48:
/* 14048 80038C48 1040000C */  beqz      $v0, .L80038C7C
/* 1404C 80038C4C 24039FFF */   addiu    $v1, $zero, -0x6001
/* 14050 80038C50 8E020000 */  lw        $v0, 0x0($s0)
/* 14054 80038C54 3C038011 */  lui       $v1, %hi(D_8010C97A)
/* 14058 80038C58 9463C97A */  lhu       $v1, %lo(D_8010C97A)($v1)
/* 1405C 80038C5C C7A00020 */  lwc1      $f0, 0x20($sp)
/* 14060 80038C60 C7A20028 */  lwc1      $f2, 0x28($sp)
/* 14064 80038C64 34426000 */  ori       $v0, $v0, 0x6000
/* 14068 80038C68 AE020000 */  sw        $v0, 0x0($s0)
/* 1406C 80038C6C A6030086 */  sh        $v1, 0x86($s0)
/* 14070 80038C70 E6000038 */  swc1      $f0, 0x38($s0)
/* 14074 80038C74 0800E322 */  j         .L80038C88
/* 14078 80038C78 E6020040 */   swc1     $f2, 0x40($s0)
.L80038C7C:
/* 1407C 80038C7C 8E020000 */  lw        $v0, 0x0($s0)
/* 14080 80038C80 00431024 */  and       $v0, $v0, $v1
/* 14084 80038C84 AE020000 */  sw        $v0, 0x0($s0)
.L80038C88:
/* 14088 80038C88 C600000C */  lwc1      $f0, 0xC($s0)
/* 1408C 80038C8C 3C014234 */  lui       $at, (0x42340000 >> 16)
/* 14090 80038C90 44816000 */  mtc1      $at, $f12
/* 14094 80038C94 0C00A6C9 */  jal       clamp_angle
/* 14098 80038C98 460C0300 */   add.s    $f12, $f0, $f12
/* 1409C 80038C9C C6020038 */  lwc1      $f2, 0x38($s0)
/* 140A0 80038CA0 C604003C */  lwc1      $f4, 0x3C($s0)
/* 140A4 80038CA4 C6060040 */  lwc1      $f6, 0x40($s0)
/* 140A8 80038CA8 E7A20020 */  swc1      $f2, 0x20($sp)
/* 140AC 80038CAC E7A40024 */  swc1      $f4, 0x24($sp)
/* 140B0 80038CB0 E7A60028 */  swc1      $f6, 0x28($sp)
/* 140B4 80038CB4 8E020000 */  lw        $v0, 0x0($s0)
/* 140B8 80038CB8 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* 140BC 80038CBC 00431024 */  and       $v0, $v0, $v1
/* 140C0 80038CC0 14400013 */  bnez      $v0, .L80038D10
/* 140C4 80038CC4 AFA00010 */   sw       $zero, 0x10($sp)
/* 140C8 80038CC8 E7A00014 */  swc1      $f0, 0x14($sp)
/* 140CC 80038CCC 860200A8 */  lh        $v0, 0xA8($s0)
/* 140D0 80038CD0 27A50020 */  addiu     $a1, $sp, 0x20
/* 140D4 80038CD4 44820000 */  mtc1      $v0, $f0
/* 140D8 80038CD8 00000000 */  nop
/* 140DC 80038CDC 46800020 */  cvt.s.w   $f0, $f0
/* 140E0 80038CE0 E7A00018 */  swc1      $f0, 0x18($sp)
/* 140E4 80038CE4 860200A6 */  lh        $v0, 0xA6($s0)
/* 140E8 80038CE8 27A60024 */  addiu     $a2, $sp, 0x24
/* 140EC 80038CEC 44820000 */  mtc1      $v0, $f0
/* 140F0 80038CF0 00000000 */  nop
/* 140F4 80038CF4 46800020 */  cvt.s.w   $f0, $f0
/* 140F8 80038CF8 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 140FC 80038CFC 8E040080 */  lw        $a0, 0x80($s0)
/* 14100 80038D00 0C037711 */  jal       npc_test_move_simple_with_slipping
/* 14104 80038D04 27A70028 */   addiu    $a3, $sp, 0x28
/* 14108 80038D08 0800E354 */  j         .L80038D50
/* 1410C 80038D0C 00000000 */   nop
.L80038D10:
/* 14110 80038D10 E7A00014 */  swc1      $f0, 0x14($sp)
/* 14114 80038D14 860200A8 */  lh        $v0, 0xA8($s0)
/* 14118 80038D18 27A50020 */  addiu     $a1, $sp, 0x20
/* 1411C 80038D1C 44820000 */  mtc1      $v0, $f0
/* 14120 80038D20 00000000 */  nop
/* 14124 80038D24 46800020 */  cvt.s.w   $f0, $f0
/* 14128 80038D28 E7A00018 */  swc1      $f0, 0x18($sp)
/* 1412C 80038D2C 860200A6 */  lh        $v0, 0xA6($s0)
/* 14130 80038D30 27A60024 */  addiu     $a2, $sp, 0x24
/* 14134 80038D34 44820000 */  mtc1      $v0, $f0
/* 14138 80038D38 00000000 */  nop
/* 1413C 80038D3C 46800020 */  cvt.s.w   $f0, $f0
/* 14140 80038D40 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 14144 80038D44 8E040080 */  lw        $a0, 0x80($s0)
/* 14148 80038D48 0C0376B9 */  jal       npc_test_move_taller_with_slipping
/* 1414C 80038D4C 27A70028 */   addiu    $a3, $sp, 0x28
.L80038D50:
/* 14150 80038D50 10400009 */  beqz      $v0, .L80038D78
/* 14154 80038D54 2403DFFF */   addiu    $v1, $zero, -0x2001
/* 14158 80038D58 8E020000 */  lw        $v0, 0x0($s0)
/* 1415C 80038D5C C7A00020 */  lwc1      $f0, 0x20($sp)
/* 14160 80038D60 C7A20028 */  lwc1      $f2, 0x28($sp)
/* 14164 80038D64 34422000 */  ori       $v0, $v0, 0x2000
/* 14168 80038D68 AE020000 */  sw        $v0, 0x0($s0)
/* 1416C 80038D6C E6000038 */  swc1      $f0, 0x38($s0)
/* 14170 80038D70 0800E361 */  j         .L80038D84
/* 14174 80038D74 E6020040 */   swc1     $f2, 0x40($s0)
.L80038D78:
/* 14178 80038D78 8E020000 */  lw        $v0, 0x0($s0)
/* 1417C 80038D7C 00431024 */  and       $v0, $v0, $v1
/* 14180 80038D80 AE020000 */  sw        $v0, 0x0($s0)
.L80038D84:
/* 14184 80038D84 C600000C */  lwc1      $f0, 0xC($s0)
/* 14188 80038D88 3C014234 */  lui       $at, (0x42340000 >> 16)
/* 1418C 80038D8C 44816000 */  mtc1      $at, $f12
/* 14190 80038D90 0C00A6C9 */  jal       clamp_angle
/* 14194 80038D94 460C0301 */   sub.s    $f12, $f0, $f12
/* 14198 80038D98 C6020038 */  lwc1      $f2, 0x38($s0)
/* 1419C 80038D9C C604003C */  lwc1      $f4, 0x3C($s0)
/* 141A0 80038DA0 C6060040 */  lwc1      $f6, 0x40($s0)
/* 141A4 80038DA4 E7A20020 */  swc1      $f2, 0x20($sp)
/* 141A8 80038DA8 E7A40024 */  swc1      $f4, 0x24($sp)
/* 141AC 80038DAC E7A60028 */  swc1      $f6, 0x28($sp)
/* 141B0 80038DB0 8E020000 */  lw        $v0, 0x0($s0)
/* 141B4 80038DB4 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* 141B8 80038DB8 00431024 */  and       $v0, $v0, $v1
/* 141BC 80038DBC 14400013 */  bnez      $v0, .L80038E0C
/* 141C0 80038DC0 AFA00010 */   sw       $zero, 0x10($sp)
/* 141C4 80038DC4 E7A00014 */  swc1      $f0, 0x14($sp)
/* 141C8 80038DC8 860200A8 */  lh        $v0, 0xA8($s0)
/* 141CC 80038DCC 27A50020 */  addiu     $a1, $sp, 0x20
/* 141D0 80038DD0 44820000 */  mtc1      $v0, $f0
/* 141D4 80038DD4 00000000 */  nop
/* 141D8 80038DD8 46800020 */  cvt.s.w   $f0, $f0
/* 141DC 80038DDC E7A00018 */  swc1      $f0, 0x18($sp)
/* 141E0 80038DE0 860200A6 */  lh        $v0, 0xA6($s0)
/* 141E4 80038DE4 27A60024 */  addiu     $a2, $sp, 0x24
/* 141E8 80038DE8 44820000 */  mtc1      $v0, $f0
/* 141EC 80038DEC 00000000 */  nop
/* 141F0 80038DF0 46800020 */  cvt.s.w   $f0, $f0
/* 141F4 80038DF4 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 141F8 80038DF8 8E040080 */  lw        $a0, 0x80($s0)
/* 141FC 80038DFC 0C037711 */  jal       npc_test_move_simple_with_slipping
/* 14200 80038E00 27A70028 */   addiu    $a3, $sp, 0x28
/* 14204 80038E04 0800E393 */  j         .L80038E4C
/* 14208 80038E08 00000000 */   nop
.L80038E0C:
/* 1420C 80038E0C E7A00014 */  swc1      $f0, 0x14($sp)
/* 14210 80038E10 860200A8 */  lh        $v0, 0xA8($s0)
/* 14214 80038E14 27A50020 */  addiu     $a1, $sp, 0x20
/* 14218 80038E18 44820000 */  mtc1      $v0, $f0
/* 1421C 80038E1C 00000000 */  nop
/* 14220 80038E20 46800020 */  cvt.s.w   $f0, $f0
/* 14224 80038E24 E7A00018 */  swc1      $f0, 0x18($sp)
/* 14228 80038E28 860200A6 */  lh        $v0, 0xA6($s0)
/* 1422C 80038E2C 27A60024 */  addiu     $a2, $sp, 0x24
/* 14230 80038E30 44820000 */  mtc1      $v0, $f0
/* 14234 80038E34 00000000 */  nop
/* 14238 80038E38 46800020 */  cvt.s.w   $f0, $f0
/* 1423C 80038E3C E7A0001C */  swc1      $f0, 0x1C($sp)
/* 14240 80038E40 8E040080 */  lw        $a0, 0x80($s0)
/* 14244 80038E44 0C0376B9 */  jal       npc_test_move_taller_with_slipping
/* 14248 80038E48 27A70028 */   addiu    $a3, $sp, 0x28
.L80038E4C:
/* 1424C 80038E4C 10400009 */  beqz      $v0, .L80038E74
/* 14250 80038E50 2403DFFF */   addiu    $v1, $zero, -0x2001
/* 14254 80038E54 8E020000 */  lw        $v0, 0x0($s0)
/* 14258 80038E58 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 1425C 80038E5C C7A20028 */  lwc1      $f2, 0x28($sp)
/* 14260 80038E60 34422000 */  ori       $v0, $v0, 0x2000
/* 14264 80038E64 AE020000 */  sw        $v0, 0x0($s0)
/* 14268 80038E68 E6000038 */  swc1      $f0, 0x38($s0)
/* 1426C 80038E6C 0800E3A0 */  j         .L80038E80
/* 14270 80038E70 E6020040 */   swc1     $f2, 0x40($s0)
.L80038E74:
/* 14274 80038E74 8E020000 */  lw        $v0, 0x0($s0)
/* 14278 80038E78 00431024 */  and       $v0, $v0, $v1
/* 1427C 80038E7C AE020000 */  sw        $v0, 0x0($s0)
.L80038E80:
/* 14280 80038E80 8E020000 */  lw        $v0, 0x0($s0)
/* 14284 80038E84 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* 14288 80038E88 00431024 */  and       $v0, $v0, $v1
/* 1428C 80038E8C 1040005B */  beqz      $v0, .L80038FFC
/* 14290 80038E90 00000000 */   nop
/* 14294 80038E94 C60C000C */  lwc1      $f12, 0xC($s0)
/* 14298 80038E98 3C014234 */  lui       $at, (0x42340000 >> 16)
/* 1429C 80038E9C 44810000 */  mtc1      $at, $f0
/* 142A0 80038EA0 00000000 */  nop
/* 142A4 80038EA4 46006300 */  add.s     $f12, $f12, $f0
/* 142A8 80038EA8 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 142AC 80038EAC 44810000 */  mtc1      $at, $f0
/* 142B0 80038EB0 0C00A6C9 */  jal       clamp_angle
/* 142B4 80038EB4 46006300 */   add.s    $f12, $f12, $f0
/* 142B8 80038EB8 C6020038 */  lwc1      $f2, 0x38($s0)
/* 142BC 80038EBC C604003C */  lwc1      $f4, 0x3C($s0)
/* 142C0 80038EC0 C6060040 */  lwc1      $f6, 0x40($s0)
/* 142C4 80038EC4 E7A20020 */  swc1      $f2, 0x20($sp)
/* 142C8 80038EC8 E7A40024 */  swc1      $f4, 0x24($sp)
/* 142CC 80038ECC E7A60028 */  swc1      $f6, 0x28($sp)
/* 142D0 80038ED0 AFA00010 */  sw        $zero, 0x10($sp)
/* 142D4 80038ED4 E7A00014 */  swc1      $f0, 0x14($sp)
/* 142D8 80038ED8 860200A8 */  lh        $v0, 0xA8($s0)
/* 142DC 80038EDC 27A50020 */  addiu     $a1, $sp, 0x20
/* 142E0 80038EE0 44820000 */  mtc1      $v0, $f0
/* 142E4 80038EE4 00000000 */  nop
/* 142E8 80038EE8 46800020 */  cvt.s.w   $f0, $f0
/* 142EC 80038EEC E7A00018 */  swc1      $f0, 0x18($sp)
/* 142F0 80038EF0 860200A6 */  lh        $v0, 0xA6($s0)
/* 142F4 80038EF4 27A60024 */  addiu     $a2, $sp, 0x24
/* 142F8 80038EF8 44820000 */  mtc1      $v0, $f0
/* 142FC 80038EFC 00000000 */  nop
/* 14300 80038F00 46800020 */  cvt.s.w   $f0, $f0
/* 14304 80038F04 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 14308 80038F08 8E040080 */  lw        $a0, 0x80($s0)
/* 1430C 80038F0C 0C037711 */  jal       npc_test_move_simple_with_slipping
/* 14310 80038F10 27A70028 */   addiu    $a3, $sp, 0x28
/* 14314 80038F14 10400009 */  beqz      $v0, .L80038F3C
/* 14318 80038F18 2403DFFF */   addiu    $v1, $zero, -0x2001
/* 1431C 80038F1C 8E020000 */  lw        $v0, 0x0($s0)
/* 14320 80038F20 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 14324 80038F24 C7A20028 */  lwc1      $f2, 0x28($sp)
/* 14328 80038F28 34422000 */  ori       $v0, $v0, 0x2000
/* 1432C 80038F2C AE020000 */  sw        $v0, 0x0($s0)
/* 14330 80038F30 E6000038 */  swc1      $f0, 0x38($s0)
/* 14334 80038F34 0800E3D2 */  j         .L80038F48
/* 14338 80038F38 E6020040 */   swc1     $f2, 0x40($s0)
.L80038F3C:
/* 1433C 80038F3C 8E020000 */  lw        $v0, 0x0($s0)
/* 14340 80038F40 00431024 */  and       $v0, $v0, $v1
/* 14344 80038F44 AE020000 */  sw        $v0, 0x0($s0)
.L80038F48:
/* 14348 80038F48 C60C000C */  lwc1      $f12, 0xC($s0)
/* 1434C 80038F4C 3C014234 */  lui       $at, (0x42340000 >> 16)
/* 14350 80038F50 44810000 */  mtc1      $at, $f0
/* 14354 80038F54 00000000 */  nop
/* 14358 80038F58 46006301 */  sub.s     $f12, $f12, $f0
/* 1435C 80038F5C 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 14360 80038F60 44810000 */  mtc1      $at, $f0
/* 14364 80038F64 0C00A6C9 */  jal       clamp_angle
/* 14368 80038F68 46006300 */   add.s    $f12, $f12, $f0
/* 1436C 80038F6C C6020038 */  lwc1      $f2, 0x38($s0)
/* 14370 80038F70 C604003C */  lwc1      $f4, 0x3C($s0)
/* 14374 80038F74 C6060040 */  lwc1      $f6, 0x40($s0)
/* 14378 80038F78 E7A20020 */  swc1      $f2, 0x20($sp)
/* 1437C 80038F7C E7A40024 */  swc1      $f4, 0x24($sp)
/* 14380 80038F80 E7A60028 */  swc1      $f6, 0x28($sp)
/* 14384 80038F84 AFA00010 */  sw        $zero, 0x10($sp)
/* 14388 80038F88 E7A00014 */  swc1      $f0, 0x14($sp)
/* 1438C 80038F8C 860200A8 */  lh        $v0, 0xA8($s0)
/* 14390 80038F90 27A50020 */  addiu     $a1, $sp, 0x20
/* 14394 80038F94 44820000 */  mtc1      $v0, $f0
/* 14398 80038F98 00000000 */  nop
/* 1439C 80038F9C 46800020 */  cvt.s.w   $f0, $f0
/* 143A0 80038FA0 E7A00018 */  swc1      $f0, 0x18($sp)
/* 143A4 80038FA4 860200A6 */  lh        $v0, 0xA6($s0)
/* 143A8 80038FA8 27A60024 */  addiu     $a2, $sp, 0x24
/* 143AC 80038FAC 44820000 */  mtc1      $v0, $f0
/* 143B0 80038FB0 00000000 */  nop
/* 143B4 80038FB4 46800020 */  cvt.s.w   $f0, $f0
/* 143B8 80038FB8 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 143BC 80038FBC 8E040080 */  lw        $a0, 0x80($s0)
/* 143C0 80038FC0 0C037711 */  jal       npc_test_move_simple_with_slipping
/* 143C4 80038FC4 27A70028 */   addiu    $a3, $sp, 0x28
/* 143C8 80038FC8 10400009 */  beqz      $v0, .L80038FF0
/* 143CC 80038FCC 2403DFFF */   addiu    $v1, $zero, -0x2001
/* 143D0 80038FD0 8E020000 */  lw        $v0, 0x0($s0)
/* 143D4 80038FD4 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 143D8 80038FD8 C7A20028 */  lwc1      $f2, 0x28($sp)
/* 143DC 80038FDC 34422000 */  ori       $v0, $v0, 0x2000
/* 143E0 80038FE0 AE020000 */  sw        $v0, 0x0($s0)
/* 143E4 80038FE4 E6000038 */  swc1      $f0, 0x38($s0)
/* 143E8 80038FE8 0800E3FF */  j         .L80038FFC
/* 143EC 80038FEC E6020040 */   swc1     $f2, 0x40($s0)
.L80038FF0:
/* 143F0 80038FF0 8E020000 */  lw        $v0, 0x0($s0)
/* 143F4 80038FF4 00431024 */  and       $v0, $v0, $v1
.L80038FF8:
/* 143F8 80038FF8 AE020000 */  sw        $v0, 0x0($s0)
.L80038FFC:
/* 143FC 80038FFC 8FBF0034 */  lw        $ra, 0x34($sp)
/* 14400 80039000 8FB00030 */  lw        $s0, 0x30($sp)
/* 14404 80039004 03E00008 */  jr        $ra
/* 14408 80039008 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void npc_do_world_collision(Npc* npc) {
    f32 testAngle;
    s32 hit;
    f32 testX;
    f32 testY;
    f32 testZ;

    if (npc->flags & NPC_FLAG_IGNORE_WORLD_COLLISION) {
        npc->flags |= NPC_FLAG_WORLD_COLLISION_DIRTY;
    } else if (
           (npc->pos.x != npc->colliderPos.x)
        || (npc->pos.y != npc->colliderPos.y)
        || (npc->pos.z != npc->colliderPos.z)
        || npc->flags & NPC_FLAG_WORLD_COLLISION_DIRTY
    ) {
        npc->flags &= ~NPC_FLAG_WORLD_COLLISION_DIRTY;
        testAngle = clamp_angle(npc->yaw);
        testX = npc->pos.x;
        testY = npc->pos.y;
        testZ = npc->pos.z;

        if (!(npc->flags & NPC_FLAG_PARTNER)) {
            hit = npc_test_move_simple_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight, npc->collisionDiameter);
        } else {
            hit = npc_test_move_complex_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight, npc->collisionDiameter);
        }

        if (hit) {
            npc->flags |= (NPC_FLAG_COLLDING_WITH_WORLD | NPC_FLAG_COLLDING_FORWARD_WITH_WORLD);
            npc->currentWall = NpcHitQueryColliderID;
            npc->pos.x = testX;
            npc->pos.z = testZ;
        } else {
            npc->flags &= ~(NPC_FLAG_COLLDING_WITH_WORLD | NPC_FLAG_COLLDING_FORWARD_WITH_WORLD);
        }

        testAngle = clamp_angle(npc->yaw + 45.0f);
        testX = npc->pos.x;
        testY = npc->pos.y;
        testZ = npc->pos.z;

        if (!(npc->flags & NPC_FLAG_PARTNER)) {
            hit = npc_test_move_simple_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight, npc->collisionDiameter);
        } else {
            hit = npc_test_move_taller_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight, npc->collisionDiameter);
        }

        if (hit) {
            npc->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
            npc->pos.x = testX;
            npc->pos.z = testZ;
        } else {
            npc->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
        }

        testAngle = clamp_angle(npc->yaw - 45.0f);
        testX = npc->pos.x;
        testY = npc->pos.y;
        testZ = npc->pos.z;
        if (!(npc->flags & NPC_FLAG_PARTNER)) {
            hit = npc_test_move_simple_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight, npc->collisionDiameter);
        } else {
            hit = npc_test_move_taller_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight, npc->collisionDiameter);
        }

        if (hit != 0) {
            npc->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
            npc->pos.x = testX;
            npc->pos.z = testZ;
        } else {
            npc->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
        }

        if (npc->flags & NPC_FLAG_PARTNER) {
            testAngle = clamp_angle(npc->yaw + 45.0f + 180.0f);
            testX = npc->pos.x;
            testY = npc->pos.y;
            testZ = npc->pos.z;
            if (npc_test_move_simple_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight,
                              npc->collisionDiameter) != 0) {
                npc->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
                npc->pos.x = testX;
                npc->pos.z = testZ;
            } else {
                npc->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
            }

            testAngle = clamp_angle((npc->yaw - 45.0f) + 180.0f);
            testX = npc->pos.x;
            testY = npc->pos.y;
            testZ = npc->pos.z;
            if (npc_test_move_simple_with_slipping(npc->collisionChannel, &testX, &testY, &testZ, 0, testAngle, npc->collisionHeight,
                              npc->collisionDiameter) != 0) {
                npc->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
                npc->pos.x = testX;
                npc->pos.z = testZ;
                return;
            }
            npc->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel shattering_stones_appendGfx
/* 340294 E002C414 27BDFEA0 */  addiu     $sp, $sp, -0x160
/* 340298 E002C418 3C02DB06 */  lui       $v0, (0xDB060024 >> 16)
/* 34029C E002C41C 34420024 */  ori       $v0, $v0, (0xDB060024 & 0xFFFF)
/* 3402A0 E002C420 AFB40138 */  sw        $s4, 0x138($sp)
/* 3402A4 E002C424 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 3402A8 E002C428 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 3402AC E002C42C AFA40160 */  sw        $a0, 0x160($sp)
/* 3402B0 E002C430 8FA80160 */  lw        $t0, 0x160($sp)
/* 3402B4 E002C434 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3402B8 E002C438 AFBF014C */  sw        $ra, 0x14C($sp)
/* 3402BC E002C43C AFBE0148 */  sw        $fp, 0x148($sp)
/* 3402C0 E002C440 AFB70144 */  sw        $s7, 0x144($sp)
/* 3402C4 E002C444 AFB60140 */  sw        $s6, 0x140($sp)
/* 3402C8 E002C448 AFB5013C */  sw        $s5, 0x13C($sp)
/* 3402CC E002C44C AFB30134 */  sw        $s3, 0x134($sp)
/* 3402D0 E002C450 AFB20130 */  sw        $s2, 0x130($sp)
/* 3402D4 E002C454 AFB1012C */  sw        $s1, 0x12C($sp)
/* 3402D8 E002C458 AFB00128 */  sw        $s0, 0x128($sp)
/* 3402DC E002C45C F7B60158 */  sdc1      $f22, 0x158($sp)
/* 3402E0 E002C460 F7B40150 */  sdc1      $f20, 0x150($sp)
/* 3402E4 E002C464 8E840000 */  lw        $a0, 0x0($s4)
/* 3402E8 E002C468 8D13000C */  lw        $s3, 0xC($t0)
/* 3402EC E002C46C 0080282D */  daddu     $a1, $a0, $zero
/* 3402F0 E002C470 ACA20000 */  sw        $v0, 0x0($a1)
/* 3402F4 E002C474 8D020010 */  lw        $v0, 0x10($t0)
/* 3402F8 E002C478 24840008 */  addiu     $a0, $a0, 0x8
/* 3402FC E002C47C AE840000 */  sw        $a0, 0x0($s4)
/* 340300 E002C480 8C42001C */  lw        $v0, 0x1C($v0)
/* 340304 E002C484 3C15DE00 */  lui       $s5, (0xDE000000 >> 16)
/* 340308 E002C488 00431021 */  addu      $v0, $v0, $v1
/* 34030C E002C48C ACA20004 */  sw        $v0, 0x4($a1)
/* 340310 E002C490 3C020900 */  lui       $v0, %hi(D_09000C00_415C60)
/* 340314 E002C494 24420C00 */  addiu     $v0, $v0, %lo(D_09000C00_415C60)
/* 340318 E002C498 AC950000 */  sw        $s5, 0x0($a0)
/* 34031C E002C49C AC820004 */  sw        $v0, 0x4($a0)
/* 340320 E002C4A0 8E620024 */  lw        $v0, 0x24($s3)
/* 340324 E002C4A4 24840008 */  addiu     $a0, $a0, 0x8
/* 340328 E002C4A8 1440007E */  bnez      $v0, .LE002C6A4
/* 34032C E002C4AC AE840000 */   sw       $a0, 0x0($s4)
/* 340330 E002C4B0 27A40020 */  addiu     $a0, $sp, 0x20
/* 340334 E002C4B4 8E650000 */  lw        $a1, 0x0($s3)
/* 340338 E002C4B8 8E660004 */  lw        $a2, 0x4($s3)
/* 34033C E002C4BC 8E670008 */  lw        $a3, 0x8($s3)
/* 340340 E002C4C0 0C080108 */  jal       shim_guTranslateF
/* 340344 E002C4C4 3C120001 */   lui      $s2, (0x11630 >> 16)
/* 340348 E002C4C8 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* 34034C E002C4CC 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* 340350 E002C4D0 44810000 */  mtc1      $at, $f0
/* 340354 E002C4D4 27B10060 */  addiu     $s1, $sp, 0x60
/* 340358 E002C4D8 44050000 */  mfc1      $a1, $f0
/* 34035C E002C4DC 0220202D */  daddu     $a0, $s1, $zero
/* 340360 E002C4E0 00A0302D */  daddu     $a2, $a1, $zero
/* 340364 E002C4E4 0C080110 */  jal       shim_guScaleF
/* 340368 E002C4E8 00A0382D */   daddu    $a3, $a1, $zero
/* 34036C E002C4EC 0220202D */  daddu     $a0, $s1, $zero
/* 340370 E002C4F0 27A50020 */  addiu     $a1, $sp, 0x20
/* 340374 E002C4F4 27B000A0 */  addiu     $s0, $sp, 0xA0
/* 340378 E002C4F8 0C080114 */  jal       shim_guMtxCatF
/* 34037C E002C4FC 0200302D */   daddu    $a2, $s0, $zero
/* 340380 E002C500 4480A000 */  mtc1      $zero, $f20
/* 340384 E002C504 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 340388 E002C508 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 34038C E002C50C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 340390 E002C510 4481B000 */  mtc1      $at, $f22
/* 340394 E002C514 00031080 */  sll       $v0, $v1, 2
/* 340398 E002C518 00431021 */  addu      $v0, $v0, $v1
/* 34039C E002C51C 00021080 */  sll       $v0, $v0, 2
/* 3403A0 E002C520 00431023 */  subu      $v0, $v0, $v1
/* 3403A4 E002C524 000218C0 */  sll       $v1, $v0, 3
/* 3403A8 E002C528 00431021 */  addu      $v0, $v0, $v1
/* 3403AC E002C52C 000210C0 */  sll       $v0, $v0, 3
/* 3403B0 E002C530 4406A000 */  mfc1      $a2, $f20
/* 3403B4 E002C534 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3403B8 E002C538 00220821 */  addu      $at, $at, $v0
/* 3403BC E002C53C C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 3403C0 E002C540 4407B000 */  mfc1      $a3, $f22
/* 3403C4 E002C544 46000007 */  neg.s     $f0, $f0
/* 3403C8 E002C548 44050000 */  mfc1      $a1, $f0
/* 3403CC E002C54C 0220202D */  daddu     $a0, $s1, $zero
/* 3403D0 E002C550 0C080104 */  jal       shim_guRotateF
/* 3403D4 E002C554 E7B40010 */   swc1     $f20, 0x10($sp)
/* 3403D8 E002C558 0220202D */  daddu     $a0, $s1, $zero
/* 3403DC E002C55C 0200282D */  daddu     $a1, $s0, $zero
/* 3403E0 E002C560 0C080114 */  jal       shim_guMtxCatF
/* 3403E4 E002C564 0200302D */   daddu    $a2, $s0, $zero
/* 3403E8 E002C568 E7B60010 */  swc1      $f22, 0x10($sp)
/* 3403EC E002C56C 8E650034 */  lw        $a1, 0x34($s3)
/* 3403F0 E002C570 4406A000 */  mfc1      $a2, $f20
/* 3403F4 E002C574 4407A000 */  mfc1      $a3, $f20
/* 3403F8 E002C578 0C080104 */  jal       shim_guRotateF
/* 3403FC E002C57C 0220202D */   daddu    $a0, $s1, $zero
/* 340400 E002C580 0220202D */  daddu     $a0, $s1, $zero
/* 340404 E002C584 0200282D */  daddu     $a1, $s0, $zero
/* 340408 E002C588 0C080114 */  jal       shim_guMtxCatF
/* 34040C E002C58C 0200302D */   daddu    $a2, $s0, $zero
/* 340410 E002C590 E7B40010 */  swc1      $f20, 0x10($sp)
/* 340414 E002C594 8E65002C */  lw        $a1, 0x2C($s3)
/* 340418 E002C598 4406B000 */  mfc1      $a2, $f22
/* 34041C E002C59C 4407A000 */  mfc1      $a3, $f20
/* 340420 E002C5A0 0C080104 */  jal       shim_guRotateF
/* 340424 E002C5A4 0220202D */   daddu    $a0, $s1, $zero
/* 340428 E002C5A8 0220202D */  daddu     $a0, $s1, $zero
/* 34042C E002C5AC 0200282D */  daddu     $a1, $s0, $zero
/* 340430 E002C5B0 0C080114 */  jal       shim_guMtxCatF
/* 340434 E002C5B4 0200302D */   daddu    $a2, $s0, $zero
/* 340438 E002C5B8 E7B40010 */  swc1      $f20, 0x10($sp)
/* 34043C E002C5BC 8E650030 */  lw        $a1, 0x30($s3)
/* 340440 E002C5C0 4406A000 */  mfc1      $a2, $f20
/* 340444 E002C5C4 4407B000 */  mfc1      $a3, $f22
/* 340448 E002C5C8 0C080104 */  jal       shim_guRotateF
/* 34044C E002C5CC 0220202D */   daddu    $a0, $s1, $zero
/* 340450 E002C5D0 0220202D */  daddu     $a0, $s1, $zero
/* 340454 E002C5D4 0200282D */  daddu     $a1, $s0, $zero
/* 340458 E002C5D8 0C080114 */  jal       shim_guMtxCatF
/* 34045C E002C5DC 0200302D */   daddu    $a2, $s0, $zero
/* 340460 E002C5E0 0200202D */  daddu     $a0, $s0, $zero
/* 340464 E002C5E4 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 340468 E002C5E8 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 34046C E002C5EC 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* 340470 E002C5F0 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* 340474 E002C5F4 96050000 */  lhu       $a1, 0x0($s0)
/* 340478 E002C5F8 8E220000 */  lw        $v0, 0x0($s1)
/* 34047C E002C5FC 00052980 */  sll       $a1, $a1, 6
/* 340480 E002C600 00B22821 */  addu      $a1, $a1, $s2
/* 340484 E002C604 0C080118 */  jal       shim_guMtxF2L
/* 340488 E002C608 00452821 */   addu     $a1, $v0, $a1
/* 34048C E002C60C 3C06666D */  lui       $a2, (0x666D7B00 >> 16)
/* 340490 E002C610 34C67B00 */  ori       $a2, $a2, (0x666D7B00 & 0xFFFF)
/* 340494 E002C614 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 340498 E002C618 8E840000 */  lw        $a0, 0x0($s4)
/* 34049C E002C61C 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 3404A0 E002C620 0080282D */  daddu     $a1, $a0, $zero
/* 3404A4 E002C624 24840008 */  addiu     $a0, $a0, 0x8
/* 3404A8 E002C628 AE840000 */  sw        $a0, 0x0($s4)
/* 3404AC E002C62C 96020000 */  lhu       $v0, 0x0($s0)
/* 3404B0 E002C630 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 3404B4 E002C634 ACA30000 */  sw        $v1, 0x0($a1)
/* 3404B8 E002C638 24430001 */  addiu     $v1, $v0, 0x1
/* 3404BC E002C63C 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3404C0 E002C640 00021180 */  sll       $v0, $v0, 6
/* 3404C4 E002C644 A6030000 */  sh        $v1, 0x0($s0)
/* 3404C8 E002C648 8E230000 */  lw        $v1, 0x0($s1)
/* 3404CC E002C64C 00521021 */  addu      $v0, $v0, $s2
/* 3404D0 E002C650 00621821 */  addu      $v1, $v1, $v0
/* 3404D4 E002C654 24820008 */  addiu     $v0, $a0, 0x8
/* 3404D8 E002C658 ACA30004 */  sw        $v1, 0x4($a1)
/* 3404DC E002C65C AE820000 */  sw        $v0, 0x0($s4)
/* 3404E0 E002C660 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3404E4 E002C664 AC820000 */  sw        $v0, 0x0($a0)
/* 3404E8 E002C668 9263002B */  lbu       $v1, 0x2B($s3)
/* 3404EC E002C66C 24820010 */  addiu     $v0, $a0, 0x10
/* 3404F0 E002C670 AE820000 */  sw        $v0, 0x0($s4)
/* 3404F4 E002C674 AC950008 */  sw        $s5, 0x8($a0)
/* 3404F8 E002C678 00661825 */  or        $v1, $v1, $a2
/* 3404FC E002C67C AC830004 */  sw        $v1, 0x4($a0)
/* 340500 E002C680 3C03E003 */  lui       $v1, (0xE0030000 >> 16)
/* 340504 E002C684 8C63C940 */  lw        $v1, -0x36C0($v1)
/* 340508 E002C688 24820018 */  addiu     $v0, $a0, 0x18
/* 34050C E002C68C AE820000 */  sw        $v0, 0x0($s4)
/* 340510 E002C690 24020040 */  addiu     $v0, $zero, 0x40
/* 340514 E002C694 AC870010 */  sw        $a3, 0x10($a0)
/* 340518 E002C698 AC820014 */  sw        $v0, 0x14($a0)
/* 34051C E002C69C 0800B241 */  j         .LE002C904
/* 340520 E002C6A0 AC83000C */   sw       $v1, 0xC($a0)
.LE002C6A4:
/* 340524 E002C6A4 8E650000 */  lw        $a1, 0x0($s3)
/* 340528 E002C6A8 8E660004 */  lw        $a2, 0x4($s3)
/* 34052C E002C6AC 8E670008 */  lw        $a3, 0x8($s3)
/* 340530 E002C6B0 8E760028 */  lw        $s6, 0x28($s3)
/* 340534 E002C6B4 0C080108 */  jal       shim_guTranslateF
/* 340538 E002C6B8 27A40020 */   addiu    $a0, $sp, 0x20
/* 34053C E002C6BC 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* 340540 E002C6C0 44810000 */  mtc1      $at, $f0
/* 340544 E002C6C4 27B10060 */  addiu     $s1, $sp, 0x60
/* 340548 E002C6C8 44050000 */  mfc1      $a1, $f0
/* 34054C E002C6CC 0220202D */  daddu     $a0, $s1, $zero
/* 340550 E002C6D0 00A0302D */  daddu     $a2, $a1, $zero
/* 340554 E002C6D4 0C080110 */  jal       shim_guScaleF
/* 340558 E002C6D8 00A0382D */   daddu    $a3, $a1, $zero
/* 34055C E002C6DC 0220202D */  daddu     $a0, $s1, $zero
/* 340560 E002C6E0 27A50020 */  addiu     $a1, $sp, 0x20
/* 340564 E002C6E4 27B000A0 */  addiu     $s0, $sp, 0xA0
/* 340568 E002C6E8 0C080114 */  jal       shim_guMtxCatF
/* 34056C E002C6EC 0200302D */   daddu    $a2, $s0, $zero
/* 340570 E002C6F0 4480B000 */  mtc1      $zero, $f22
/* 340574 E002C6F4 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 340578 E002C6F8 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 34057C E002C6FC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 340580 E002C700 4481A000 */  mtc1      $at, $f20
/* 340584 E002C704 00031080 */  sll       $v0, $v1, 2
/* 340588 E002C708 00431021 */  addu      $v0, $v0, $v1
/* 34058C E002C70C 00021080 */  sll       $v0, $v0, 2
/* 340590 E002C710 00431023 */  subu      $v0, $v0, $v1
/* 340594 E002C714 000218C0 */  sll       $v1, $v0, 3
/* 340598 E002C718 00431021 */  addu      $v0, $v0, $v1
/* 34059C E002C71C 000210C0 */  sll       $v0, $v0, 3
/* 3405A0 E002C720 4406B000 */  mfc1      $a2, $f22
/* 3405A4 E002C724 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3405A8 E002C728 00220821 */  addu      $at, $at, $v0
/* 3405AC E002C72C C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 3405B0 E002C730 4407A000 */  mfc1      $a3, $f20
/* 3405B4 E002C734 46000007 */  neg.s     $f0, $f0
/* 3405B8 E002C738 44050000 */  mfc1      $a1, $f0
/* 3405BC E002C73C 0220202D */  daddu     $a0, $s1, $zero
/* 3405C0 E002C740 0C080104 */  jal       shim_guRotateF
/* 3405C4 E002C744 E7B60010 */   swc1     $f22, 0x10($sp)
/* 3405C8 E002C748 0220202D */  daddu     $a0, $s1, $zero
/* 3405CC E002C74C 0200282D */  daddu     $a1, $s0, $zero
/* 3405D0 E002C750 0C080114 */  jal       shim_guMtxCatF
/* 3405D4 E002C754 00A0302D */   daddu    $a2, $a1, $zero
/* 3405D8 E002C758 E7B60010 */  swc1      $f22, 0x10($sp)
/* 3405DC E002C75C 8E65002C */  lw        $a1, 0x2C($s3)
/* 3405E0 E002C760 4406A000 */  mfc1      $a2, $f20
/* 3405E4 E002C764 4407B000 */  mfc1      $a3, $f22
/* 3405E8 E002C768 0C080104 */  jal       shim_guRotateF
/* 3405EC E002C76C 27A400E0 */   addiu    $a0, $sp, 0xE0
/* 3405F0 E002C770 8FA80160 */  lw        $t0, 0x160($sp)
/* 3405F4 E002C774 24150001 */  addiu     $s5, $zero, 0x1
/* 3405F8 E002C778 8D020008 */  lw        $v0, 0x8($t0)
/* 3405FC E002C77C 02A2102A */  slt       $v0, $s5, $v0
/* 340600 E002C780 10400060 */  beqz      $v0, .LE002C904
/* 340604 E002C784 26730040 */   addiu    $s3, $s3, 0x40
/* 340608 E002C788 0220902D */  daddu     $s2, $s1, $zero
/* 34060C E002C78C 4600B506 */  mov.s     $f20, $f22
/* 340610 E002C790 3C1E8007 */  lui       $fp, %hi(gMatrixListPos)
/* 340614 E002C794 27DE41F0 */  addiu     $fp, $fp, %lo(gMatrixListPos)
/* 340618 E002C798 3C170001 */  lui       $s7, (0x11630 >> 16)
/* 34061C E002C79C 36F71630 */  ori       $s7, $s7, (0x11630 & 0xFFFF)
/* 340620 E002C7A0 3C039696 */  lui       $v1, (0x9696C800 >> 16)
/* 340624 E002C7A4 3463C800 */  ori       $v1, $v1, (0x9696C800 & 0xFFFF)
/* 340628 E002C7A8 32C200FF */  andi      $v0, $s6, 0xFF
/* 34062C E002C7AC 00431025 */  or        $v0, $v0, $v1
/* 340630 E002C7B0 AFA20120 */  sw        $v0, 0x120($sp)
/* 340634 E002C7B4 26710034 */  addiu     $s1, $s3, 0x34
/* 340638 E002C7B8 3C16E003 */  lui       $s6, %hi(D_E002C944)
/* 34063C E002C7BC 26D6C944 */  addiu     $s6, $s6, %lo(D_E002C944)
.LE002C7C0:
/* 340640 E002C7C0 8E650000 */  lw        $a1, 0x0($s3)
/* 340644 E002C7C4 8E26FFD0 */  lw        $a2, -0x30($s1)
/* 340648 E002C7C8 8E27FFD4 */  lw        $a3, -0x2C($s1)
/* 34064C E002C7CC 8ED00000 */  lw        $s0, 0x0($s6)
/* 340650 E002C7D0 0C080108 */  jal       shim_guTranslateF
/* 340654 E002C7D4 0240202D */   daddu    $a0, $s2, $zero
/* 340658 E002C7D8 0240202D */  daddu     $a0, $s2, $zero
/* 34065C E002C7DC 27A500A0 */  addiu     $a1, $sp, 0xA0
/* 340660 E002C7E0 0C080114 */  jal       shim_guMtxCatF
/* 340664 E002C7E4 27A60020 */   addiu    $a2, $sp, 0x20
/* 340668 E002C7E8 27A400E0 */  addiu     $a0, $sp, 0xE0
/* 34066C E002C7EC 27A50020 */  addiu     $a1, $sp, 0x20
/* 340670 E002C7F0 0C080114 */  jal       shim_guMtxCatF
/* 340674 E002C7F4 00A0302D */   daddu    $a2, $a1, $zero
/* 340678 E002C7F8 4406A000 */  mfc1      $a2, $f20
/* 34067C E002C7FC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 340680 E002C800 44810000 */  mtc1      $at, $f0
/* 340684 E002C804 26D60004 */  addiu     $s6, $s6, 0x4
/* 340688 E002C808 E7A00010 */  swc1      $f0, 0x10($sp)
/* 34068C E002C80C C620FFE4 */  lwc1      $f0, -0x1C($s1)
/* 340690 E002C810 26B50001 */  addiu     $s5, $s5, 0x1
/* 340694 E002C814 E7A00014 */  swc1      $f0, 0x14($sp)
/* 340698 E002C818 C620FFE8 */  lwc1      $f0, -0x18($s1)
/* 34069C E002C81C 26730040 */  addiu     $s3, $s3, 0x40
/* 3406A0 E002C820 E7B4001C */  swc1      $f20, 0x1C($sp)
/* 3406A4 E002C824 E7A00018 */  swc1      $f0, 0x18($sp)
/* 3406A8 E002C828 8E25FFF8 */  lw        $a1, -0x8($s1)
/* 3406AC E002C82C 8E270000 */  lw        $a3, 0x0($s1)
/* 3406B0 E002C830 0C080180 */  jal       shim_guPositionF
/* 3406B4 E002C834 0240202D */   daddu    $a0, $s2, $zero
/* 3406B8 E002C838 0240202D */  daddu     $a0, $s2, $zero
/* 3406BC E002C83C 27A50020 */  addiu     $a1, $sp, 0x20
/* 3406C0 E002C840 0C080114 */  jal       shim_guMtxCatF
/* 3406C4 E002C844 00A0302D */   daddu    $a2, $a1, $zero
/* 3406C8 E002C848 27A40020 */  addiu     $a0, $sp, 0x20
/* 3406CC E002C84C 97C50000 */  lhu       $a1, 0x0($fp)
/* 3406D0 E002C850 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 3406D4 E002C854 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 3406D8 E002C858 00052980 */  sll       $a1, $a1, 6
/* 3406DC E002C85C 00B72821 */  addu      $a1, $a1, $s7
/* 3406E0 E002C860 0C080118 */  jal       shim_guMtxF2L
/* 3406E4 E002C864 00452821 */   addu     $a1, $v0, $a1
/* 3406E8 E002C868 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 3406EC E002C86C 8E840000 */  lw        $a0, 0x0($s4)
/* 3406F0 E002C870 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3406F4 E002C874 0080282D */  daddu     $a1, $a0, $zero
/* 3406F8 E002C878 24840008 */  addiu     $a0, $a0, 0x8
/* 3406FC E002C87C AE840000 */  sw        $a0, 0x0($s4)
/* 340700 E002C880 97C20000 */  lhu       $v0, 0x0($fp)
/* 340704 E002C884 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 340708 E002C888 ACA30000 */  sw        $v1, 0x0($a1)
/* 34070C E002C88C 24430001 */  addiu     $v1, $v0, 0x1
/* 340710 E002C890 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 340714 E002C894 00021180 */  sll       $v0, $v0, 6
/* 340718 E002C898 A7C30000 */  sh        $v1, 0x0($fp)
/* 34071C E002C89C 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* 340720 E002C8A0 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* 340724 E002C8A4 00571021 */  addu      $v0, $v0, $s7
/* 340728 E002C8A8 00621821 */  addu      $v1, $v1, $v0
/* 34072C E002C8AC 24820008 */  addiu     $v0, $a0, 0x8
/* 340730 E002C8B0 ACA30004 */  sw        $v1, 0x4($a1)
/* 340734 E002C8B4 AE820000 */  sw        $v0, 0x0($s4)
/* 340738 E002C8B8 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 34073C E002C8BC AC820000 */  sw        $v0, 0x0($a0)
/* 340740 E002C8C0 8FA80120 */  lw        $t0, 0x120($sp)
/* 340744 E002C8C4 24820010 */  addiu     $v0, $a0, 0x10
/* 340748 E002C8C8 AC880004 */  sw        $t0, 0x4($a0)
/* 34074C E002C8CC AE820000 */  sw        $v0, 0x0($s4)
/* 340750 E002C8D0 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 340754 E002C8D4 AC820008 */  sw        $v0, 0x8($a0)
/* 340758 E002C8D8 24020040 */  addiu     $v0, $zero, 0x40
/* 34075C E002C8DC AC90000C */  sw        $s0, 0xC($a0)
/* 340760 E002C8E0 AC860010 */  sw        $a2, 0x10($a0)
/* 340764 E002C8E4 AC820014 */  sw        $v0, 0x14($a0)
/* 340768 E002C8E8 8FA80160 */  lw        $t0, 0x160($sp)
/* 34076C E002C8EC 26310040 */  addiu     $s1, $s1, 0x40
/* 340770 E002C8F0 8D020008 */  lw        $v0, 0x8($t0)
/* 340774 E002C8F4 24840018 */  addiu     $a0, $a0, 0x18
/* 340778 E002C8F8 02A2102A */  slt       $v0, $s5, $v0
/* 34077C E002C8FC 1440FFB0 */  bnez      $v0, .LE002C7C0
/* 340780 E002C900 AE840000 */   sw       $a0, 0x0($s4)
.LE002C904:
/* 340784 E002C904 8FBF014C */  lw        $ra, 0x14C($sp)
/* 340788 E002C908 8FBE0148 */  lw        $fp, 0x148($sp)
/* 34078C E002C90C 8FB70144 */  lw        $s7, 0x144($sp)
/* 340790 E002C910 8FB60140 */  lw        $s6, 0x140($sp)
/* 340794 E002C914 8FB5013C */  lw        $s5, 0x13C($sp)
/* 340798 E002C918 8FB40138 */  lw        $s4, 0x138($sp)
/* 34079C E002C91C 8FB30134 */  lw        $s3, 0x134($sp)
/* 3407A0 E002C920 8FB20130 */  lw        $s2, 0x130($sp)
/* 3407A4 E002C924 8FB1012C */  lw        $s1, 0x12C($sp)
/* 3407A8 E002C928 8FB00128 */  lw        $s0, 0x128($sp)
/* 3407AC E002C92C D7B60158 */  ldc1      $f22, 0x158($sp)
/* 3407B0 E002C930 D7B40150 */  ldc1      $f20, 0x150($sp)
/* 3407B4 E002C934 03E00008 */  jr        $ra
/* 3407B8 E002C938 27BD0160 */   addiu    $sp, $sp, 0x160
/* 3407BC E002C93C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void shattering_stones_appendGfx(void* effect) {
    ShatteringStonesFXData* part = ((EffectInstance*)effect)->data.shatteringStones;
    Matrix4f sp20;
    Matrix4f sp60;
    Matrix4f spA0;
    Matrix4f spE0;
    s32 i;

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

    if (part->unk_24 == 0) {
        shim_guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08);
        shim_guScaleF(sp60, 1.5f, 1.5f, 1.5f);
        shim_guMtxCatF(sp60, sp20, spA0);
        shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
        shim_guMtxCatF(sp60, spA0, spA0);
        shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f);
        shim_guMtxCatF(sp60, spA0, spA0);
        shim_guRotateF(sp60, part->unk_2C, 1.0f, 0.0f, 0.0f);
        shim_guMtxCatF(sp60, spA0, spA0);
        shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f);
        shim_guMtxCatF(sp60, spA0, spA0);
        shim_guMtxF2L(spA0, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gDPSetPrimColor(gMainGfxPos++, 0, 0, 102, 109, 123, part->unk_28);
        gSPDisplayList(gMainGfxPos++, D_E002C940[0]);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    } else {
        s32 unk_28 = part->unk_28;

        shim_guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08);
        shim_guScaleF(sp60, 1.5f, 1.5f, 1.5f);
        shim_guMtxCatF(sp60, sp20, spA0);
        shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
        shim_guMtxCatF(sp60, spA0, spA0);
        shim_guRotateF(spE0, part->unk_2C, 1.0f, 0.0f, 0.0f);

        part++;
        for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
            Gfx* dlist = D_E002C940[i];

            shim_guTranslateF(sp60, part->unk_00, part->unk_04, part->unk_08);
            shim_guMtxCatF(sp60, spA0, sp20);
            shim_guMtxCatF(spE0, sp20, sp20);
            shim_guPositionF(sp60, part->unk_2C, 0.0f, part->unk_34, 1.0f, part->unk_18, part->unk_1C, 0.0f);
            shim_guMtxCatF(sp60, sp20, sp20);
            shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gDPSetPrimColor(gMainGfxPos++, 0, 0, 150, 150, 200, unk_28);
            gSPDisplayList(gMainGfxPos++, dlist);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel sparkles_main
/* 337240 E0022000 27BDFF80 */  addiu     $sp, $sp, -0x80
/* 337244 E0022004 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 337248 E0022008 4485A000 */  mtc1      $a1, $f20
/* 33724C E002200C AFB5003C */  sw        $s5, 0x3C($sp)
/* 337250 E0022010 0080A82D */  daddu     $s5, $a0, $zero
/* 337254 E0022014 F7B60058 */  sdc1      $f22, 0x58($sp)
/* 337258 E0022018 4486B000 */  mtc1      $a2, $f22
/* 33725C E002201C F7B80060 */  sdc1      $f24, 0x60($sp)
/* 337260 E0022020 4487C000 */  mtc1      $a3, $f24
/* 337264 E0022024 24020001 */  addiu     $v0, $zero, 0x1
/* 337268 E0022028 AFBF0048 */  sw        $ra, 0x48($sp)
/* 33726C E002202C AFB70044 */  sw        $s7, 0x44($sp)
/* 337270 E0022030 AFB60040 */  sw        $s6, 0x40($sp)
/* 337274 E0022034 AFB40038 */  sw        $s4, 0x38($sp)
/* 337278 E0022038 AFB30034 */  sw        $s3, 0x34($sp)
/* 33727C E002203C AFB20030 */  sw        $s2, 0x30($sp)
/* 337280 E0022040 AFB1002C */  sw        $s1, 0x2C($sp)
/* 337284 E0022044 AFB00028 */  sw        $s0, 0x28($sp)
/* 337288 E0022048 F7BE0078 */  sdc1      $f30, 0x78($sp)
/* 33728C E002204C F7BC0070 */  sdc1      $f28, 0x70($sp)
/* 337290 E0022050 F7BA0068 */  sdc1      $f26, 0x68($sp)
/* 337294 E0022054 12A20011 */  beq       $s5, $v0, .LE002209C
/* 337298 E0022058 27A40010 */   addiu    $a0, $sp, 0x10
/* 33729C E002205C 2AA20002 */  slti      $v0, $s5, 0x2
/* 3372A0 E0022060 10400005 */  beqz      $v0, .LE0022078
/* 3372A4 E0022064 24020002 */   addiu    $v0, $zero, 0x2
/* 3372A8 E0022068 12A00009 */  beqz      $s5, .LE0022090
/* 3372AC E002206C 24120008 */   addiu    $s2, $zero, 0x8
/* 3372B0 E0022070 0800882E */  j         .LE00220B8
/* 3372B4 E0022074 00000000 */   nop
.LE0022078:
/* 3372B8 E0022078 12A2000B */  beq       $s5, $v0, .LE00220A8
/* 3372BC E002207C 24020003 */   addiu    $v0, $zero, 0x3
/* 3372C0 E0022080 12A2000C */  beq       $s5, $v0, .LE00220B4
/* 3372C4 E0022084 24120008 */   addiu    $s2, $zero, 0x8
/* 3372C8 E0022088 0800882E */  j         .LE00220B8
/* 3372CC E002208C 00000000 */   nop
.LE0022090:
/* 3372D0 E0022090 C7BE0090 */  lwc1      $f30, 0x90($sp)
/* 3372D4 E0022094 08008830 */  j         .LE00220C0
/* 3372D8 E0022098 24120024 */   addiu    $s2, $zero, 0x24
.LE002209C:
/* 3372DC E002209C C7BE0090 */  lwc1      $f30, 0x90($sp)
/* 3372E0 E00220A0 08008830 */  j         .LE00220C0
/* 3372E4 E00220A4 24120004 */   addiu    $s2, $zero, 0x4
.LE00220A8:
/* 3372E8 E00220A8 C7BE0090 */  lwc1      $f30, 0x90($sp)
/* 3372EC E00220AC 08008830 */  j         .LE00220C0
/* 3372F0 E00220B0 24120008 */   addiu    $s2, $zero, 0x8
.LE00220B4:
/* 3372F4 E00220B4 24120004 */  addiu     $s2, $zero, 0x4
.LE00220B8:
/* 3372F8 E00220B8 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 3372FC E00220BC 4481F000 */  mtc1      $at, $f30
.LE00220C0:
/* 337300 E00220C0 26520001 */  addiu     $s2, $s2, 0x1
/* 337304 E00220C4 3C02E002 */  lui       $v0, %hi(sparkles_init)
/* 337308 E00220C8 24422544 */  addiu     $v0, $v0, %lo(sparkles_init)
/* 33730C E00220CC AC820008 */  sw        $v0, 0x8($a0)
/* 337310 E00220D0 3C02E002 */  lui       $v0, %hi(sparkles_update)
/* 337314 E00220D4 2442254C */  addiu     $v0, $v0, %lo(sparkles_update)
/* 337318 E00220D8 AC82000C */  sw        $v0, 0xC($a0)
/* 33731C E00220DC 3C02E002 */  lui       $v0, %hi(sparkles_render)
/* 337320 E00220E0 24422960 */  addiu     $v0, $v0, %lo(sparkles_render)
/* 337324 E00220E4 AC820010 */  sw        $v0, 0x10($a0)
/* 337328 E00220E8 24020011 */  addiu     $v0, $zero, 0x11
/* 33732C E00220EC AC800000 */  sw        $zero, 0x0($a0)
/* 337330 E00220F0 AC800014 */  sw        $zero, 0x14($a0)
/* 337334 E00220F4 0C080124 */  jal       shim_create_effect_instance
/* 337338 E00220F8 AC820004 */   sw       $v0, 0x4($a0)
/* 33733C E00220FC 00122040 */  sll       $a0, $s2, 1
/* 337340 E0022100 00922021 */  addu      $a0, $a0, $s2
/* 337344 E0022104 00042100 */  sll       $a0, $a0, 4
/* 337348 E0022108 0040802D */  daddu     $s0, $v0, $zero
/* 33734C E002210C 0C08012C */  jal       shim_general_heap_malloc
/* 337350 E0022110 AE120008 */   sw       $s2, 0x8($s0)
/* 337354 E0022114 0040202D */  daddu     $a0, $v0, $zero
/* 337358 E0022118 14800003 */  bnez      $a0, .LE0022128
/* 33735C E002211C AE04000C */   sw       $a0, 0xC($s0)
.LE0022120:
/* 337360 E0022120 08008848 */  j         .LE0022120
/* 337364 E0022124 00000000 */   nop
.LE0022128:
/* 337368 E0022128 2402001E */  addiu     $v0, $zero, 0x1E
/* 33736C E002212C E4940004 */  swc1      $f20, 0x4($a0)
/* 337370 E0022130 E4960008 */  swc1      $f22, 0x8($a0)
/* 337374 E0022134 E498000C */  swc1      $f24, 0xC($a0)
/* 337378 E0022138 AC800020 */  sw        $zero, 0x20($a0)
/* 33737C E002213C AC950000 */  sw        $s5, 0x0($a0)
/* 337380 E0022140 AC820024 */  sw        $v0, 0x24($a0)
/* 337384 E0022144 24110001 */  addiu     $s1, $zero, 0x1
/* 337388 E0022148 0232102A */  slt       $v0, $s1, $s2
/* 33738C E002214C 104000EC */  beqz      $v0, .LE0022500
/* 337390 E0022150 24840030 */   addiu    $a0, $a0, 0x30
/* 337394 E0022154 3C03E002 */  lui       $v1, %hi(jtbl_E0022D30)
/* 337398 E0022158 24632D30 */  addiu     $v1, $v1, %lo(jtbl_E0022D30)
/* 33739C E002215C 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* 3373A0 E0022160 4481E000 */  mtc1      $at, $f28
/* 3373A4 E0022164 C7A60090 */  lwc1      $f6, 0x90($sp)
/* 3373A8 E0022168 00151080 */  sll       $v0, $s5, 2
/* 3373AC E002216C 461C3002 */  mul.s     $f0, $f6, $f28
/* 3373B0 E0022170 00000000 */  nop
/* 3373B4 E0022174 0043B821 */  addu      $s7, $v0, $v1
/* 3373B8 E0022178 2654FFFF */  addiu     $s4, $s2, -0x1
/* 3373BC E002217C 24900020 */  addiu     $s0, $a0, 0x20
/* 3373C0 E0022180 24130002 */  addiu     $s3, $zero, 0x2
/* 3373C4 E0022184 4600018D */  trunc.w.s $f6, $f0
/* 3373C8 E0022188 44163000 */  mfc1      $s6, $f6
.LE002218C:
/* 3373CC E002218C 0C080138 */  jal       shim_rand_int
/* 3373D0 E0022190 02C0202D */   daddu    $a0, $s6, $zero
/* 3373D4 E0022194 461CF002 */  mul.s     $f0, $f30, $f28
/* 3373D8 E0022198 00000000 */  nop
/* 3373DC E002219C 4600018D */  trunc.w.s $f6, $f0
/* 3373E0 E00221A0 44043000 */  mfc1      $a0, $f6
/* 3373E4 E00221A4 44820000 */  mtc1      $v0, $f0
/* 3373E8 E00221A8 00000000 */  nop
/* 3373EC E00221AC 46800020 */  cvt.s.w   $f0, $f0
/* 3373F0 E00221B0 0C080138 */  jal       shim_rand_int
/* 3373F4 E00221B4 461C0503 */   div.s    $f20, $f0, $f28
/* 3373F8 E00221B8 44820000 */  mtc1      $v0, $f0
/* 3373FC E00221BC 00000000 */  nop
/* 337400 E00221C0 46800020 */  cvt.s.w   $f0, $f0
/* 337404 E00221C4 2EA20005 */  sltiu     $v0, $s5, 0x5
/* 337408 E00221C8 10400088 */  beqz      $v0, .LE00223EC
/* 33740C E00221CC 461C0583 */   div.s    $f22, $f0, $f28
/* 337410 E00221D0 8EE20000 */  lw        $v0, 0x0($s7)
/* 337414 E00221D4 00400008 */  jr        $v0
/* 337418 E00221D8 00000000 */   nop
glabel .LE00221DC
/* 33741C E00221DC 44942000 */  mtc1      $s4, $f4
/* 337420 E00221E0 00000000 */  nop
/* 337424 E00221E4 46802120 */  cvt.s.w   $f4, $f4
/* 337428 E00221E8 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 33742C E00221EC 44813000 */  mtc1      $at, $f6
/* 337430 E00221F0 44911000 */  mtc1      $s1, $f2
/* 337434 E00221F4 00000000 */  nop
/* 337438 E00221F8 468010A0 */  cvt.s.w   $f2, $f2
/* 33743C E00221FC 46043003 */  div.s     $f0, $f6, $f4
/* 337440 E0022200 46020682 */  mul.s     $f26, $f0, $f2
/* 337444 E0022204 00000000 */  nop
/* 337448 E0022208 3C0144E1 */  lui       $at, (0x44E10000 >> 16)
/* 33744C E002220C 4481B000 */  mtc1      $at, $f22
/* 337450 E0022210 00000000 */  nop
/* 337454 E0022214 4604B583 */  div.s     $f22, $f22, $f4
/* 337458 E0022218 4602B582 */  mul.s     $f22, $f22, $f2
/* 33745C E002221C 00000000 */  nop
/* 337460 E0022220 AE00FFF8 */  sw        $zero, -0x8($s0)
/* 337464 E0022224 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 337468 E0022228 44810000 */  mtc1      $at, $f0
/* 33746C E002222C 4600D306 */  mov.s     $f12, $f26
/* 337470 E0022230 0C080140 */  jal       shim_sin_deg
/* 337474 E0022234 4600B581 */   sub.s    $f22, $f22, $f0
/* 337478 E0022238 46000506 */  mov.s     $f20, $f0
/* 33747C E002223C 0C080140 */  jal       shim_sin_deg
/* 337480 E0022240 4600B306 */   mov.s    $f12, $f22
/* 337484 E0022244 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 337488 E0022248 44813000 */  mtc1      $at, $f6
/* 33748C E002224C 00000000 */  nop
/* 337490 E0022250 46060002 */  mul.s     $f0, $f0, $f6
/* 337494 E0022254 00000000 */  nop
/* 337498 E0022258 32230001 */  andi      $v1, $s1, 0x1
/* 33749C E002225C 3C0142AA */  lui       $at, (0x42AA0000 >> 16)
/* 3374A0 E0022260 44813000 */  mtc1      $at, $f6
/* 3374A4 E0022264 00031080 */  sll       $v0, $v1, 2
/* 3374A8 E0022268 46003001 */  sub.s     $f0, $f6, $f0
/* 3374AC E002226C 00431021 */  addu      $v0, $v0, $v1
/* 3374B0 E0022270 4482C000 */  mtc1      $v0, $f24
/* 3374B4 E0022274 00000000 */  nop
/* 3374B8 E0022278 4680C620 */  cvt.s.w   $f24, $f24
/* 3374BC E002227C 46180001 */  sub.s     $f0, $f0, $f24
/* 3374C0 E0022280 4600A502 */  mul.s     $f20, $f20, $f0
/* 3374C4 E0022284 00000000 */  nop
/* 3374C8 E0022288 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 3374CC E002228C 44813000 */  mtc1      $at, $f6
/* 3374D0 E0022290 00000000 */  nop
/* 3374D4 E0022294 4606A503 */  div.s     $f20, $f20, $f6
/* 3374D8 E0022298 C7A60090 */  lwc1      $f6, 0x90($sp)
/* 3374DC E002229C 4606A502 */  mul.s     $f20, $f20, $f6
/* 3374E0 E00222A0 00000000 */  nop
/* 3374E4 E00222A4 4600D306 */  mov.s     $f12, $f26
/* 3374E8 E00222A8 0C080144 */  jal       shim_cos_deg
/* 3374EC E00222AC E614FFF0 */   swc1     $f20, -0x10($s0)
/* 3374F0 E00222B0 4600B306 */  mov.s     $f12, $f22
/* 3374F4 E00222B4 0C080140 */  jal       shim_sin_deg
/* 3374F8 E00222B8 46000506 */   mov.s    $f20, $f0
/* 3374FC E00222BC 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 337500 E00222C0 44813000 */  mtc1      $at, $f6
/* 337504 E00222C4 00000000 */  nop
/* 337508 E00222C8 46060002 */  mul.s     $f0, $f0, $f6
/* 33750C E00222CC 00000000 */  nop
/* 337510 E00222D0 3C0142AA */  lui       $at, (0x42AA0000 >> 16)
/* 337514 E00222D4 44813000 */  mtc1      $at, $f6
/* 337518 E00222D8 00000000 */  nop
/* 33751C E00222DC 46003001 */  sub.s     $f0, $f6, $f0
/* 337520 E00222E0 46180001 */  sub.s     $f0, $f0, $f24
/* 337524 E00222E4 4600A502 */  mul.s     $f20, $f20, $f0
/* 337528 E00222E8 00000000 */  nop
/* 33752C E00222EC 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 337530 E00222F0 44813000 */  mtc1      $at, $f6
/* 337534 E00222F4 00000000 */  nop
/* 337538 E00222F8 4606A503 */  div.s     $f20, $f20, $f6
/* 33753C E00222FC C7A60090 */  lwc1      $f6, 0x90($sp)
/* 337540 E0022300 4606A502 */  mul.s     $f20, $f20, $f6
/* 337544 E0022304 00000000 */  nop
/* 337548 E0022308 AE00FFEC */  sw        $zero, -0x14($s0)
/* 33754C E002230C AE000008 */  sw        $zero, 0x8($s0)
/* 337550 E0022310 0800893B */  j         .LE00224EC
/* 337554 E0022314 E614FFF4 */   swc1     $f20, -0xC($s0)
glabel .LE0022318
/* 337558 E0022318 0C080138 */  jal       shim_rand_int
/* 33755C E002231C 24040167 */   addiu    $a0, $zero, 0x167
/* 337560 E0022320 44941000 */  mtc1      $s4, $f2
/* 337564 E0022324 00000000 */  nop
/* 337568 E0022328 468010A0 */  cvt.s.w   $f2, $f2
/* 33756C E002232C 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 337570 E0022330 44813000 */  mtc1      $at, $f6
/* 337574 E0022334 44910000 */  mtc1      $s1, $f0
/* 337578 E0022338 00000000 */  nop
/* 33757C E002233C 46800020 */  cvt.s.w   $f0, $f0
/* 337580 E0022340 46023083 */  div.s     $f2, $f6, $f2
/* 337584 E0022344 46001082 */  mul.s     $f2, $f2, $f0
/* 337588 E0022348 00000000 */  nop
/* 33758C E002234C 44820000 */  mtc1      $v0, $f0
/* 337590 E0022350 00000000 */  nop
/* 337594 E0022354 46800020 */  cvt.s.w   $f0, $f0
/* 337598 E0022358 32220001 */  andi      $v0, $s1, 0x1
/* 33759C E002235C 10400014 */  beqz      $v0, .LE00223B0
/* 3375A0 E0022360 46001680 */   add.s    $f26, $f2, $f0
/* 3375A4 E0022364 0C080138 */  jal       shim_rand_int
/* 3375A8 E0022368 24040032 */   addiu    $a0, $zero, 0x32
/* 3375AC E002236C 3C031062 */  lui       $v1, (0x10624DD3 >> 16)
/* 3375B0 E0022370 34634DD3 */  ori       $v1, $v1, (0x10624DD3 & 0xFFFF)
/* 3375B4 E0022374 00430018 */  mult      $v0, $v1
/* 3375B8 E0022378 000217C3 */  sra       $v0, $v0, 31
/* 3375BC E002237C 3C01E002 */  lui       $at, (0xE0022D48 >> 16)
/* 3375C0 E0022380 D4222D48 */  ldc1      $f2, (0xE0022D48 & 0xFFFF)($at)
/* 3375C4 E0022384 00004010 */  mfhi      $t0
/* 3375C8 E0022388 00081983 */  sra       $v1, $t0, 6
/* 3375CC E002238C 00621823 */  subu      $v1, $v1, $v0
/* 3375D0 E0022390 44830000 */  mtc1      $v1, $f0
/* 3375D4 E0022394 00000000 */  nop
/* 3375D8 E0022398 46800021 */  cvt.d.w   $f0, $f0
/* 3375DC E002239C 46220000 */  add.d     $f0, $f0, $f2
/* 3375E0 E00223A0 46200007 */  neg.d     $f0, $f0
/* 3375E4 E00223A4 46200020 */  cvt.s.d   $f0, $f0
/* 3375E8 E00223A8 080088ED */  j         .LE00223B4
/* 3375EC E00223AC E600FFF8 */   swc1     $f0, -0x8($s0)
.LE00223B0:
/* 3375F0 E00223B0 AE00FFF8 */  sw        $zero, -0x8($s0)
.LE00223B4:
/* 3375F4 E00223B4 4600D306 */  mov.s     $f12, $f26
/* 3375F8 E00223B8 AE00FFF0 */  sw        $zero, -0x10($s0)
/* 3375FC E00223BC 0C080140 */  jal       shim_sin_deg
/* 337600 E00223C0 AE00FFF4 */   sw       $zero, -0xC($s0)
/* 337604 E00223C4 4600A002 */  mul.s     $f0, $f20, $f0
/* 337608 E00223C8 00000000 */  nop
/* 33760C E00223CC 4600D306 */  mov.s     $f12, $f26
/* 337610 E00223D0 0C080144 */  jal       shim_cos_deg
/* 337614 E00223D4 E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 337618 E00223D8 3C035555 */  lui       $v1, (0x55555556 >> 16)
/* 33761C E00223DC 34635556 */  ori       $v1, $v1, (0x55555556 & 0xFFFF)
/* 337620 E00223E0 02230018 */  mult      $s1, $v1
/* 337624 E00223E4 0800892B */  j         .LE00224AC
/* 337628 E00223E8 2662001E */   addiu    $v0, $s3, 0x1E
glabel .LE00223EC
/* 33762C E00223EC 0C080138 */  jal       shim_rand_int
/* 337630 E00223F0 24040167 */   addiu    $a0, $zero, 0x167
/* 337634 E00223F4 44941000 */  mtc1      $s4, $f2
/* 337638 E00223F8 00000000 */  nop
/* 33763C E00223FC 468010A0 */  cvt.s.w   $f2, $f2
/* 337640 E0022400 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 337644 E0022404 44813000 */  mtc1      $at, $f6
/* 337648 E0022408 44910000 */  mtc1      $s1, $f0
/* 33764C E002240C 00000000 */  nop
/* 337650 E0022410 46800020 */  cvt.s.w   $f0, $f0
/* 337654 E0022414 46023083 */  div.s     $f2, $f6, $f2
/* 337658 E0022418 46001082 */  mul.s     $f2, $f2, $f0
/* 33765C E002241C 00000000 */  nop
/* 337660 E0022420 24040032 */  addiu     $a0, $zero, 0x32
/* 337664 E0022424 44820000 */  mtc1      $v0, $f0
/* 337668 E0022428 00000000 */  nop
/* 33766C E002242C 46800020 */  cvt.s.w   $f0, $f0
/* 337670 E0022430 0C080138 */  jal       shim_rand_int
/* 337674 E0022434 46001680 */   add.s    $f26, $f2, $f0
/* 337678 E0022438 3C031062 */  lui       $v1, (0x10624DD3 >> 16)
/* 33767C E002243C 34634DD3 */  ori       $v1, $v1, (0x10624DD3 & 0xFFFF)
/* 337680 E0022440 00430018 */  mult      $v0, $v1
/* 337684 E0022444 3C01E002 */  lui       $at, (0xE0022D50 >> 16)
/* 337688 E0022448 D4222D50 */  ldc1      $f2, (0xE0022D50 & 0xFFFF)($at)
/* 33768C E002244C 000217C3 */  sra       $v0, $v0, 31
/* 337690 E0022450 AE00FFF0 */  sw        $zero, -0x10($s0)
/* 337694 E0022454 00004010 */  mfhi      $t0
/* 337698 E0022458 00081983 */  sra       $v1, $t0, 6
/* 33769C E002245C 00621823 */  subu      $v1, $v1, $v0
/* 3376A0 E0022460 44830000 */  mtc1      $v1, $f0
/* 3376A4 E0022464 00000000 */  nop
/* 3376A8 E0022468 46800021 */  cvt.d.w   $f0, $f0
/* 3376AC E002246C 46220000 */  add.d     $f0, $f0, $f2
/* 3376B0 E0022470 AE00FFF4 */  sw        $zero, -0xC($s0)
/* 3376B4 E0022474 4600D306 */  mov.s     $f12, $f26
/* 3376B8 E0022478 46200007 */  neg.d     $f0, $f0
/* 3376BC E002247C 46200020 */  cvt.s.d   $f0, $f0
/* 3376C0 E0022480 0C080140 */  jal       shim_sin_deg
/* 3376C4 E0022484 E600FFF8 */   swc1     $f0, -0x8($s0)
/* 3376C8 E0022488 4600A002 */  mul.s     $f0, $f20, $f0
/* 3376CC E002248C 00000000 */  nop
/* 3376D0 E0022490 4600D306 */  mov.s     $f12, $f26
/* 3376D4 E0022494 0C080144 */  jal       shim_cos_deg
/* 3376D8 E0022498 E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 3376DC E002249C 3C035555 */  lui       $v1, (0x55555556 >> 16)
/* 3376E0 E00224A0 34635556 */  ori       $v1, $v1, (0x55555556 & 0xFFFF)
/* 3376E4 E00224A4 02230018 */  mult      $s1, $v1
/* 3376E8 E00224A8 26620012 */  addiu     $v0, $s3, 0x12
.LE00224AC:
/* 3376EC E00224AC 00111FC3 */  sra       $v1, $s1, 31
/* 3376F0 E00224B0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3376F4 E00224B4 44811000 */  mtc1      $at, $f2
/* 3376F8 E00224B8 4600B002 */  mul.s     $f0, $f22, $f0
/* 3376FC E00224BC 00000000 */  nop
/* 337700 E00224C0 AE00FFEC */  sw        $zero, -0x14($s0)
/* 337704 E00224C4 AE020004 */  sw        $v0, 0x4($s0)
/* 337708 E00224C8 AE000000 */  sw        $zero, 0x0($s0)
/* 33770C E00224CC E602FFFC */  swc1      $f2, -0x4($s0)
/* 337710 E00224D0 00004010 */  mfhi      $t0
/* 337714 E00224D4 01031823 */  subu      $v1, $t0, $v1
/* 337718 E00224D8 00031040 */  sll       $v0, $v1, 1
/* 33771C E00224DC 00431021 */  addu      $v0, $v0, $v1
/* 337720 E00224E0 02221023 */  subu      $v0, $s1, $v0
/* 337724 E00224E4 E600FFE8 */  swc1      $f0, -0x18($s0)
/* 337728 E00224E8 AE020008 */  sw        $v0, 0x8($s0)
.LE00224EC:
/* 33772C E00224EC 26730002 */  addiu     $s3, $s3, 0x2
/* 337730 E00224F0 26310001 */  addiu     $s1, $s1, 0x1
/* 337734 E00224F4 0232102A */  slt       $v0, $s1, $s2
/* 337738 E00224F8 1440FF24 */  bnez      $v0, .LE002218C
/* 33773C E00224FC 26100030 */   addiu    $s0, $s0, 0x30
.LE0022500:
/* 337740 E0022500 8FBF0048 */  lw        $ra, 0x48($sp)
/* 337744 E0022504 8FB70044 */  lw        $s7, 0x44($sp)
/* 337748 E0022508 8FB60040 */  lw        $s6, 0x40($sp)
/* 33774C E002250C 8FB5003C */  lw        $s5, 0x3C($sp)
/* 337750 E0022510 8FB40038 */  lw        $s4, 0x38($sp)
/* 337754 E0022514 8FB30034 */  lw        $s3, 0x34($sp)
/* 337758 E0022518 8FB20030 */  lw        $s2, 0x30($sp)
/* 33775C E002251C 8FB1002C */  lw        $s1, 0x2C($sp)
/* 337760 E0022520 8FB00028 */  lw        $s0, 0x28($sp)
/* 337764 E0022524 D7BE0078 */  ldc1      $f30, 0x78($sp)
/* 337768 E0022528 D7BC0070 */  ldc1      $f28, 0x70($sp)
/* 33776C E002252C D7BA0068 */  ldc1      $f26, 0x68($sp)
/* 337770 E0022530 D7B80060 */  ldc1      $f24, 0x60($sp)
/* 337774 E0022534 D7B60058 */  ldc1      $f22, 0x58($sp)
/* 337778 E0022538 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 33777C E002253C 03E00008 */  jr        $ra
/* 337780 E0022540 27BD0080 */   addiu    $sp, $sp, 0x80

### DECOMPILED C INSTRUCTIONS:

void sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    SparklesFXData* part;
    s32 numParts;
    f32 var_f30;
    f32 angle;
    f32 angle2;
    s32 i;

    switch (arg0) {
        case 0:
            numParts = 36;
            var_f30 = arg4;
            break;
        case 1:
            numParts = 4;
            var_f30 = arg4;
            break;
        case 2:
            numParts = 8;
            var_f30 = arg4;
            break;
        case 3:
            numParts = 4;
            var_f30 = 8.0f;
            break;
        default:
            numParts = 8;
            var_f30 = 8.0f;
            break;
    }

    numParts++;

    bpPtr->init = sparkles_init;
    bpPtr->update = sparkles_update;
    bpPtr->renderWorld = sparkles_render;
    bpPtr->unk_00 = 0;
    bpPtr->renderUI = NULL;
    bpPtr->effectID = EFFECT_SPARKLES;

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

    part->unk_04 = arg1;
    part->unk_08 = arg2;
    part->unk_0C = arg3;
    part->unk_20 = 0;
    part->unk_00 = arg0;
    part->unk_24 = 30;

    part++;
    for (i = 1; i < numParts; i++, part++) {
        f32 rand1 = shim_rand_int(arg4 * 1000.0f) / 1000.0f;
        f32 rand2 = shim_rand_int(var_f30 * 1000.0f) / 1000.0f;

        switch (arg0) {
            case 0:
                angle = (360.0f / (numParts - 1)) * i;
                angle2 = (1800.0f / (numParts - 1)) * i - 90.0f;
                part->unk_18 = 0.0f;
                part->unk_10 = (shim_sin_deg(angle) * (85.0f - shim_sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4;
                part->unk_14 = (shim_cos_deg(angle) * (85.0f - shim_sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4;
                part->unk_0C = 0;
                part->unk_28 = 0;
                break;
            case 1:
            case 2:
                angle = (360.0f / (numParts - 1)) * i + shim_rand_int(359);
                if (i & 1) {
                    part->unk_18 = -(shim_rand_int(50) / 1000 + 0.05);
                } else {
                    part->unk_18 = 0;
                }
                part->unk_10 = 0;
                part->unk_14 = 0;
                part->unk_04 = rand1 * shim_sin_deg(angle);
                part->unk_08 = rand2 * shim_cos_deg(angle);
                part->unk_0C = 0;
                part->unk_1C = 1.0f;
                part->unk_24 = i * 2 + 30;
                part->unk_28 = i % 3;
                part->unk_20 = 0;
                break;
            case 3:
            case 4:
            default:
                angle = (360.0f / (numParts - 1)) * i + shim_rand_int(359);
                part->unk_18 = -(shim_rand_int(50) / 1000 + 0.05);
                part->unk_10 = 0.0f;
                part->unk_14 = 0.0f;
                part->unk_04 = rand1 * shim_sin_deg(angle);
                part->unk_08 = rand2 * shim_cos_deg(angle);
                part->unk_0C = 0;
                part->unk_1C = 1.0f;
                part->unk_24 = i * 2 + 18;
                part->unk_28 = i % 3;
                part->unk_20 = 0;
                break;
        }
    }
}