### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_80250EA4
/* 17F784 80250EA4 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 17F788 80250EA8 AFB30034 */  sw        $s3, 0x34($sp)
/* 17F78C 80250EAC 0080982D */  daddu     $s3, $a0, $zero
/* 17F790 80250EB0 AFBF003C */  sw        $ra, 0x3C($sp)
/* 17F794 80250EB4 AFB40038 */  sw        $s4, 0x38($sp)
/* 17F798 80250EB8 AFB20030 */  sw        $s2, 0x30($sp)
/* 17F79C 80250EBC AFB1002C */  sw        $s1, 0x2C($sp)
/* 17F7A0 80250EC0 AFB00028 */  sw        $s0, 0x28($sp)
/* 17F7A4 80250EC4 86630012 */  lh        $v1, 0x12($s3)
/* 17F7A8 80250EC8 2C620055 */  sltiu     $v0, $v1, 0x55
/* 17F7AC 80250ECC 104000F1 */  beqz      $v0, .L80251294
/* 17F7B0 80250ED0 24140050 */   addiu    $s4, $zero, 0x50
/* 17F7B4 80250ED4 00031080 */  sll       $v0, $v1, 2
/* 17F7B8 80250ED8 3C01802A */  lui       $at, %hi(jtbl_8029D1F0)
/* 17F7BC 80250EDC 00220821 */  addu      $at, $at, $v0
/* 17F7C0 80250EE0 8C22D1F0 */  lw        $v0, %lo(jtbl_8029D1F0)($at)
/* 17F7C4 80250EE4 00400008 */  jr        $v0
/* 17F7C8 80250EE8 00000000 */   nop
glabel .L80250EEC
/* 17F7CC 80250EEC 82620017 */  lb        $v0, 0x17($s3)
end_00_CreditsProjMatrices:
/* 17F7D0 80250EF0 104000E8 */  beqz      $v0, .L80251294
/* 17F7D4 80250EF4 0000282D */   daddu    $a1, $zero, $zero
/* 17F7D8 80250EF8 86620012 */  lh        $v0, 0x12($s3)
/* 17F7DC 80250EFC A2600017 */  sb        $zero, 0x17($s3)
/* 17F7E0 80250F00 00021080 */  sll       $v0, $v0, 2
/* 17F7E4 80250F04 3C108028 */  lui       $s0, %hi(bMessages)
/* 17F7E8 80250F08 02028021 */  addu      $s0, $s0, $v0
/* 17F7EC 80250F0C 8E103770 */  lw        $s0, %lo(bMessages)($s0)
/* 17F7F0 80250F10 0C04991D */  jal       get_msg_width
/* 17F7F4 80250F14 0200202D */   daddu    $a0, $s0, $zero
/* 17F7F8 80250F18 2447001E */  addiu     $a3, $v0, 0x1E
/* 17F7FC 80250F1C 000717C2 */  srl       $v0, $a3, 31
/* 17F800 80250F20 00E21021 */  addu      $v0, $a3, $v0
/* 17F804 80250F24 00021043 */  sra       $v0, $v0, 1
/* 17F808 80250F28 240300A0 */  addiu     $v1, $zero, 0xA0
/* 17F80C 80250F2C 00628823 */  subu      $s1, $v1, $v0
/* 17F810 80250F30 00E0902D */  daddu     $s2, $a3, $zero
/* 17F814 80250F34 0C04992C */  jal       get_msg_lines
/* 17F818 80250F38 0200202D */   daddu    $a0, $s0, $zero
/* 17F81C 80250F3C 2442FFFF */  addiu     $v0, $v0, -0x1
D_80250F40_C0E7C0:
/* 17F820 80250F40 24040009 */  addiu     $a0, $zero, 0x9
/* 17F824 80250F44 0220282D */  daddu     $a1, $s1, $zero
/* 17F828 80250F48 0280302D */  daddu     $a2, $s4, $zero
/* 17F82C 80250F4C 00021040 */  sll       $v0, $v0, 1
/* 17F830 80250F50 0240382D */  daddu     $a3, $s2, $zero
/* 17F834 80250F54 3C088028 */  lui       $t0, %hi(bMsgHeights)
/* 17F838 80250F58 01024021 */  addu      $t0, $t0, $v0
/* 17F83C 80250F5C 850835D0 */  lh        $t0, %lo(bMsgHeights)($t0)
/* 17F840 80250F60 3C028025 */  lui       $v0, %hi(func_80250818)
/* 17F844 80250F64 24420818 */  addiu     $v0, $v0, %lo(func_80250818)
/* 17F848 80250F68 AFA20018 */  sw        $v0, 0x18($sp)
/* 17F84C 80250F6C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 17F850 80250F70 AFA00014 */  sw        $zero, 0x14($sp)
/* 17F854 80250F74 AFB3001C */  sw        $s3, 0x1C($sp)
/* 17F858 80250F78 AFA20020 */  sw        $v0, 0x20($sp)
/* 17F85C 80250F7C 0C051F32 */  jal       set_window_properties
/* 17F860 80250F80 AFA80010 */   sw       $t0, 0x10($sp)
/* 17F864 80250F84 24040009 */  addiu     $a0, $zero, 0x9
/* 17F868 80250F88 080944A3 */  j         .L8025128C
/* 17F86C 80250F8C 24050001 */   addiu    $a1, $zero, 0x1
glabel .L80250F90
/* 17F870 80250F90 82620017 */  lb        $v0, 0x17($s3)
/* 17F874 80250F94 104000BF */  beqz      $v0, .L80251294
/* 17F878 80250F98 00000000 */   nop
/* 17F87C 80250F9C 86620012 */  lh        $v0, 0x12($s3)
/* 17F880 80250FA0 A2600017 */  sb        $zero, 0x17($s3)
/* 17F884 80250FA4 00021080 */  sll       $v0, $v0, 2
/* 17F888 80250FA8 3C048028 */  lui       $a0, %hi(bMessages)
/* 17F88C 80250FAC 00822021 */  addu      $a0, $a0, $v0
/* 17F890 80250FB0 8C843770 */  lw        $a0, %lo(bMessages)($a0)
/* 17F894 80250FB4 0C04991D */  jal       get_msg_width
/* 17F898 80250FB8 0000282D */   daddu    $a1, $zero, $zero
/* 17F89C 80250FBC 24470037 */  addiu     $a3, $v0, 0x37
D_80250FC0:
/* 17F8A0 80250FC0 24080028 */  addiu     $t0, $zero, 0x28
/* 17F8A4 80250FC4 24040009 */  addiu     $a0, $zero, 0x9
D_80250FC8_C0E848:
/* 17F8A8 80250FC8 00072FC2 */  srl       $a1, $a3, 31
/* 17F8AC 80250FCC 00E52821 */  addu      $a1, $a3, $a1
/* 17F8B0 80250FD0 00052843 */  sra       $a1, $a1, 1
/* 17F8B4 80250FD4 240200A0 */  addiu     $v0, $zero, 0xA0
/* 17F8B8 80250FD8 00452823 */  subu      $a1, $v0, $a1
/* 17F8BC 80250FDC 0280302D */  daddu     $a2, $s4, $zero
/* 17F8C0 80250FE0 3C028025 */  lui       $v0, %hi(func_80250818)
/* 17F8C4 80250FE4 24420818 */  addiu     $v0, $v0, %lo(func_80250818)
/* 17F8C8 80250FE8 AFA20018 */  sw        $v0, 0x18($sp)
/* 17F8CC 80250FEC 2402FFFF */  addiu     $v0, $zero, -0x1
/* 17F8D0 80250FF0 AFA80010 */  sw        $t0, 0x10($sp)
/* 17F8D4 80250FF4 AFA00014 */  sw        $zero, 0x14($sp)
/* 17F8D8 80250FF8 AFB3001C */  sw        $s3, 0x1C($sp)
/* 17F8DC 80250FFC 0C051F32 */  jal       set_window_properties
/* 17F8E0 80251000 AFA20020 */   sw       $v0, 0x20($sp)
/* 17F8E4 80251004 24040009 */  addiu     $a0, $zero, 0x9
/* 17F8E8 80251008 080944A3 */  j         .L8025128C
/* 17F8EC 8025100C 24050001 */   addiu    $a1, $zero, 0x1
glabel .L80251010
/* 17F8F0 80251010 82620017 */  lb        $v0, 0x17($s3)
/* 17F8F4 80251014 1040009F */  beqz      $v0, .L80251294
/* 17F8F8 80251018 00000000 */   nop
/* 17F8FC 8025101C 86620012 */  lh        $v0, 0x12($s3)
/* 17F900 80251020 A2600017 */  sb        $zero, 0x17($s3)
/* 17F904 80251024 3C04802A */  lui       $a0, %hi(D_8029F640)
/* 17F908 80251028 8484F640 */  lh        $a0, %lo(D_8029F640)($a0)
/* 17F90C 8025102C 00021080 */  sll       $v0, $v0, 2
/* 17F910 80251030 3C108028 */  lui       $s0, %hi(bMessages)
/* 17F914 80251034 02028021 */  addu      $s0, $s0, $v0
/* 17F918 80251038 8E103770 */  lw        $s0, %lo(bMessages)($s0)
/* 17F91C 8025103C 0C0496FA */  jal       set_message_value
/* 17F920 80251040 0000282D */   daddu    $a1, $zero, $zero
/* 17F924 80251044 0000282D */  daddu     $a1, $zero, $zero
/* 17F928 80251048 0C04991D */  jal       get_msg_width
/* 17F92C 8025104C 0200202D */   daddu    $a0, $s0, $zero
D_80251050_C0E8D0:
/* 17F930 80251050 2447001F */  addiu     $a3, $v0, 0x1F
/* 17F934 80251054 000717C2 */  srl       $v0, $a3, 31
/* 17F938 80251058 00E21021 */  addu      $v0, $a3, $v0
/* 17F93C 8025105C 00021043 */  sra       $v0, $v0, 1
/* 17F940 80251060 240300A0 */  addiu     $v1, $zero, 0xA0
/* 17F944 80251064 00628823 */  subu      $s1, $v1, $v0
/* 17F948 80251068 00E0902D */  daddu     $s2, $a3, $zero
/* 17F94C 8025106C 0C04992C */  jal       get_msg_lines
/* 17F950 80251070 0200202D */   daddu    $a0, $s0, $zero
/* 17F954 80251074 2442FFFF */  addiu     $v0, $v0, -0x1
/* 17F958 80251078 24040009 */  addiu     $a0, $zero, 0x9
/* 17F95C 8025107C 0220282D */  daddu     $a1, $s1, $zero
/* 17F960 80251080 0280302D */  daddu     $a2, $s4, $zero
/* 17F964 80251084 00021040 */  sll       $v0, $v0, 1
/* 17F968 80251088 0240382D */  daddu     $a3, $s2, $zero
/* 17F96C 8025108C 3C088028 */  lui       $t0, %hi(bMsgHeights)
/* 17F970 80251090 01024021 */  addu      $t0, $t0, $v0
/* 17F974 80251094 850835D0 */  lh        $t0, %lo(bMsgHeights)($t0)
/* 17F978 80251098 3C028025 */  lui       $v0, %hi(func_80250818)
/* 17F97C 8025109C 24420818 */  addiu     $v0, $v0, %lo(func_80250818)
/* 17F980 802510A0 AFA20018 */  sw        $v0, 0x18($sp)
/* 17F984 802510A4 2402FFFF */  addiu     $v0, $zero, -0x1
/* 17F988 802510A8 AFA00014 */  sw        $zero, 0x14($sp)
/* 17F98C 802510AC AFB3001C */  sw        $s3, 0x1C($sp)
D_802510B0:
/* 17F990 802510B0 AFA20020 */  sw        $v0, 0x20($sp)
/* 17F994 802510B4 0C051F32 */  jal       set_window_properties
D_802510B8:
/* 17F998 802510B8 AFA80010 */   sw       $t0, 0x10($sp)
/* 17F99C 802510BC 24040009 */  addiu     $a0, $zero, 0x9
D_802510C0:
/* 17F9A0 802510C0 080944A3 */  j         .L8025128C
/* 17F9A4 802510C4 24050001 */   addiu    $a1, $zero, 0x1
D_802510C8_C0E948:
/* 17F9A8 802510C8 82620017 */  lb        $v0, 0x17($s3)
/* 17F9AC 802510CC 10400071 */  beqz      $v0, .L80251294
/* 17F9B0 802510D0 00000000 */   nop
/* 17F9B4 802510D4 A2600017 */  sb        $zero, 0x17($s3)
/* 17F9B8 802510D8 3C03802A */  lui       $v1, %hi(D_8029F640)
/* 17F9BC 802510DC 8463F640 */  lh        $v1, %lo(D_8029F640)($v1)
/* 17F9C0 802510E0 86620012 */  lh        $v0, 0x12($s3)
/* 17F9C4 802510E4 00031880 */  sll       $v1, $v1, 2
/* 17F9C8 802510E8 00021080 */  sll       $v0, $v0, 2
/* 17F9CC 802510EC 3C048028 */  lui       $a0, %hi(bActorMessages)
/* 17F9D0 802510F0 00832021 */  addu      $a0, $a0, $v1
/* 17F9D4 802510F4 8C8438C4 */  lw        $a0, %lo(bActorMessages)($a0)
/* 17F9D8 802510F8 3C108028 */  lui       $s0, %hi(bMessages)
/* 17F9DC 802510FC 02028021 */  addu      $s0, $s0, $v0
/* 17F9E0 80251100 8E103770 */  lw        $s0, %lo(bMessages)($s0)
/* 17F9E4 80251104 0C0496CF */  jal       set_message_msg
/* 17F9E8 80251108 0000282D */   daddu    $a1, $zero, $zero
/* 17F9EC 8025110C 0200202D */  daddu     $a0, $s0, $zero
/* 17F9F0 80251110 0C04991D */  jal       get_msg_width
/* 17F9F4 80251114 0000282D */   daddu    $a1, $zero, $zero
/* 17F9F8 80251118 2447001F */  addiu     $a3, $v0, 0x1F
/* 17F9FC 8025111C 000717C2 */  srl       $v0, $a3, 31
/* 17FA00 80251120 00E21021 */  addu      $v0, $a3, $v0
/* 17FA04 80251124 00021043 */  sra       $v0, $v0, 1
/* 17FA08 80251128 240300A0 */  addiu     $v1, $zero, 0xA0
/* 17FA0C 8025112C 00628823 */  subu      $s1, $v1, $v0
/* 17FA10 80251130 00E0902D */  daddu     $s2, $a3, $zero
/* 17FA14 80251134 0C04992C */  jal       get_msg_lines
/* 17FA18 80251138 0200202D */   daddu    $a0, $s0, $zero
/* 17FA1C 8025113C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 17FA20 80251140 24040009 */  addiu     $a0, $zero, 0x9
/* 17FA24 80251144 0220282D */  daddu     $a1, $s1, $zero
/* 17FA28 80251148 0280302D */  daddu     $a2, $s4, $zero
/* 17FA2C 8025114C 00021040 */  sll       $v0, $v0, 1
/* 17FA30 80251150 0240382D */  daddu     $a3, $s2, $zero
/* 17FA34 80251154 3C088028 */  lui       $t0, %hi(bMsgHeights)
/* 17FA38 80251158 01024021 */  addu      $t0, $t0, $v0
/* 17FA3C 8025115C 850835D0 */  lh        $t0, %lo(bMsgHeights)($t0)
/* 17FA40 80251160 3C028025 */  lui       $v0, %hi(func_80250818)
/* 17FA44 80251164 24420818 */  addiu     $v0, $v0, %lo(func_80250818)
/* 17FA48 80251168 AFA20018 */  sw        $v0, 0x18($sp)
/* 17FA4C 8025116C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 17FA50 80251170 AFA00014 */  sw        $zero, 0x14($sp)
/* 17FA54 80251174 AFB3001C */  sw        $s3, 0x1C($sp)
/* 17FA58 80251178 AFA20020 */  sw        $v0, 0x20($sp)
/* 17FA5C 8025117C 0C051F32 */  jal       set_window_properties
/* 17FA60 80251180 AFA80010 */   sw       $t0, 0x10($sp)
/* 17FA64 80251184 24040009 */  addiu     $a0, $zero, 0x9
/* 17FA68 80251188 080944A3 */  j         .L8025128C
/* 17FA6C 8025118C 24050001 */   addiu    $a1, $zero, 0x1
glabel .L80251190
/* 17FA70 80251190 82620017 */  lb        $v0, 0x17($s3)
/* 17FA74 80251194 1040003F */  beqz      $v0, .L80251294
/* 17FA78 80251198 0000282D */   daddu    $a1, $zero, $zero
/* 17FA7C 8025119C 86620012 */  lh        $v0, 0x12($s3)
/* 17FA80 802511A0 A2600017 */  sb        $zero, 0x17($s3)
/* 17FA84 802511A4 00021080 */  sll       $v0, $v0, 2
/* 17FA88 802511A8 3C108028 */  lui       $s0, %hi(bMessages)
/* 17FA8C 802511AC 02028021 */  addu      $s0, $s0, $v0
/* 17FA90 802511B0 8E103770 */  lw        $s0, %lo(bMessages)($s0)
/* 17FA94 802511B4 241400C0 */  addiu     $s4, $zero, 0xC0
/* 17FA98 802511B8 0C04991D */  jal       get_msg_width
/* 17FA9C 802511BC 0200202D */   daddu    $a0, $s0, $zero
/* 17FAA0 802511C0 2447001F */  addiu     $a3, $v0, 0x1F
/* 17FAA4 802511C4 000717C2 */  srl       $v0, $a3, 31
/* 17FAA8 802511C8 00E21021 */  addu      $v0, $a3, $v0
/* 17FAAC 802511CC 00021043 */  sra       $v0, $v0, 1
/* 17FAB0 802511D0 240300A0 */  addiu     $v1, $zero, 0xA0
/* 17FAB4 802511D4 00628823 */  subu      $s1, $v1, $v0
/* 17FAB8 802511D8 00E0902D */  daddu     $s2, $a3, $zero
/* 17FABC 802511DC 0C04992C */  jal       get_msg_lines
/* 17FAC0 802511E0 0200202D */   daddu    $a0, $s0, $zero
/* 17FAC4 802511E4 2442FFFF */  addiu     $v0, $v0, -0x1
/* 17FAC8 802511E8 00021840 */  sll       $v1, $v0, 1
/* 17FACC 802511EC 2410003B */  addiu     $s0, $zero, 0x3B
/* 17FAD0 802511F0 86620012 */  lh        $v0, 0x12($s3)
/* 17FAD4 802511F4 3C088028 */  lui       $t0, %hi(bMsgHeights)
/* 17FAD8 802511F8 01034021 */  addu      $t0, $t0, $v1
/* 17FADC 802511FC 850835D0 */  lh        $t0, %lo(bMsgHeights)($t0)
/* 17FAE0 80251200 14500005 */  bne       $v0, $s0, .L80251218
/* 17FAE4 80251204 24040009 */   addiu    $a0, $zero, 0x9
/* 17FAE8 80251208 24140078 */  addiu     $s4, $zero, 0x78
/* 17FAEC 8025120C 24020001 */  addiu     $v0, $zero, 0x1
/* 17FAF0 80251210 3C01802A */  lui       $at, %hi(D_8029F64C)
/* 17FAF4 80251214 A422F64C */  sh        $v0, %lo(D_8029F64C)($at)
.L80251218:
/* 17FAF8 80251218 0220282D */  daddu     $a1, $s1, $zero
/* 17FAFC 8025121C 0240382D */  daddu     $a3, $s2, $zero
/* 17FB00 80251220 3C018028 */  lui       $at, %hi(D_802835D8)
/* 17FB04 80251224 00230821 */  addu      $at, $at, $v1
/* 17FB08 80251228 942335D8 */  lhu       $v1, %lo(D_802835D8)($at)
/* 17FB0C 8025122C 3C028025 */  lui       $v0, %hi(func_80250818)
/* 17FB10 80251230 24420818 */  addiu     $v0, $v0, %lo(func_80250818)
/* 17FB14 80251234 AFA20018 */  sw        $v0, 0x18($sp)
/* 17FB18 80251238 2402FFFF */  addiu     $v0, $zero, -0x1
/* 17FB1C 8025123C AFA20020 */  sw        $v0, 0x20($sp)
/* 17FB20 80251240 00141400 */  sll       $v0, $s4, 16
/* 17FB24 80251244 00021403 */  sra       $v0, $v0, 16
/* 17FB28 80251248 3C01802A */  lui       $at, %hi(D_8029F64E)
/* 17FB2C 8025124C A434F64E */  sh        $s4, %lo(D_8029F64E)($at)
/* 17FB30 80251250 AFA80010 */  sw        $t0, 0x10($sp)
/* 17FB34 80251254 AFA00014 */  sw        $zero, 0x14($sp)
/* 17FB38 80251258 AFB3001C */  sw        $s3, 0x1C($sp)
/* 17FB3C 8025125C 00033400 */  sll       $a2, $v1, 16
/* 17FB40 80251260 00063403 */  sra       $a2, $a2, 16
/* 17FB44 80251264 3C01802A */  lui       $at, %hi(D_8029F650)
/* 17FB48 80251268 A423F650 */  sh        $v1, %lo(D_8029F650)($at)
/* 17FB4C 8025126C 0C051F32 */  jal       set_window_properties
/* 17FB50 80251270 00463021 */   addu     $a2, $v0, $a2
/* 17FB54 80251274 86620012 */  lh        $v0, 0x12($s3)
/* 17FB58 80251278 14500003 */  bne       $v0, $s0, .L80251288
/* 17FB5C 8025127C 24040009 */   addiu    $a0, $zero, 0x9
/* 17FB60 80251280 080944A3 */  j         .L8025128C
/* 17FB64 80251284 24050001 */   addiu    $a1, $zero, 0x1
.L80251288:
/* 17FB68 80251288 24050008 */  addiu     $a1, $zero, 0x8
.L8025128C:
/* 17FB6C 8025128C 0C051F9F */  jal       set_window_update
/* 17FB70 80251290 00000000 */   nop
.L80251294:
/* 17FB74 80251294 8FBF003C */  lw        $ra, 0x3C($sp)
/* 17FB78 80251298 8FB40038 */  lw        $s4, 0x38($sp)
/* 17FB7C 8025129C 8FB30034 */  lw        $s3, 0x34($sp)
/* 17FB80 802512A0 8FB20030 */  lw        $s2, 0x30($sp)
/* 17FB84 802512A4 8FB1002C */  lw        $s1, 0x2C($sp)
/* 17FB88 802512A8 8FB00028 */  lw        $s0, 0x28($sp)
/* 17FB8C 802512AC 03E00008 */  jr        $ra
/* 17FB90 802512B0 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void btl_show_message_popup(void* data) {
    PopupMessage* popup = data;
    s32 numLines;
    s32 posX;
    s32 posY = 80;
    s32 width;
    s32 msgWidth;
    s32 height;

    switch (popup->messageIndex) {
        case BTL_MSG_MERLEE_ATK_UP:
        case BTL_MSG_MERLEE_DEF_UP:
        case BTL_MSG_MERLEE_EXP_UP:
        case BTL_MSG_MERLEE_DONE:
        case BTL_MSG_CANT_CHARGE:
        case BTL_MSG_ENEMY_MISSED:
        case BTL_MSG_PLAYER_DAZED:
        case BTL_MSG_PLAYER_ASLEEP:
        case BTL_MSG_PLAYER_FROZEN:
        case BTL_MSG_PLAYER_POISONED:
        case BTL_MSG_PLAYER_SHRUNK:
        case BTL_MSG_PLAYER_PARALYZED:
        case BTL_MSG_PLAYER_CHARGED:
        case BTL_MSG_PLAYER_TRANSPARENT:
        case BTL_MSG_ENEMY_DAZED:
        case BTL_MSG_ENEMY_ASLEEP:
        case BTL_MSG_ENEMY_FROZEN:
        case BTL_MSG_ENEMY_POISONED:
        case BTL_MSG_ENEMY_SHRUNK:
        case BTL_MSG_ENEMY_PARALYZED:
        case BTL_MSG_ENEMY_ELECTRIFIED:
        case BTL_MSG_ENEMY_CANT_MOVE:
        case BTL_MSG_STAR_POWER_RECHARGED:
        case BTL_MSG_STAR_POWER_MAXED:
        case BTL_MSG_STAR_POWER_FILLED:
        case BTL_MSG_PARTNER_INJURED:
        case BTL_MSG_CHARGE_GOOMBARIO:
        case BTL_MSG_CHARGE_GOOMBARIO_MORE:
        case BTL_MSG_WATER_BLOCK_BEGIN:
        case BTL_MSG_WATER_BLOCK_END:
        case BTL_MSG_CLOUD_NINE_BEGIN:
        case BTL_MSG_CLOUD_NINE_END:
        case BTL_MSG_TURBO_CHARGE_BEGIN:
        case BTL_MSG_TURBO_CHARGE_END:
        case BTL_MSG_CHILL_OUT_BEGIN:
        case BTL_MSG_UNUSED_CLOUD_NINE:
        case BTL_MSG_NO_JUMP_TARGET:
        case BTL_MSG_NO_HAMMER_TARGET:
        case BTL_MSG_NO_ITEM_TARGET:
        case BTL_MSG_46:
        case BTL_MSG_47:
        case BTL_MSG_CANT_SELECT_NOW:
        case BTL_MSG_CANT_SWITCH:
        case BTL_MSG_CANT_SWITCH_UNUSED:
        case BTL_MSG_CANT_MOVE_UNUSED:
        case BTL_MSG_CANT_SELECT_NOW_ALT:
            if (popup->needsInit) {
                s32 messageID;

                popup->needsInit = FALSE;
                messageID = bMessages[popup->messageIndex];
                msgWidth = get_msg_width(messageID, 0) + 30;
                posX = 160 - (msgWidth / 2);
                width = msgWidth;
                numLines = get_msg_lines(messageID) - 1;
                height = bMsgHeights[numLines];
                set_window_properties(WINDOW_ID_BATTLE_POPUP, posX, posY, width, height, WINDOW_PRIORITY_0, func_80250818, popup, -1);
                set_window_update(WINDOW_ID_BATTLE_POPUP, WINDOW_UPDATE_SHOW);
            }
            break;
        case BTL_MSG_HAMMER_DISABLED_1:
        case BTL_MSG_HAMMER_DISABLED_2:
        case BTL_MSG_HAMMER_DISABLED_3:
        case BTL_MSG_JUMP_DISABLED_1:
        case BTL_MSG_JUMP_DISABLED_2:
        case BTL_MSG_JUMP_DISABLED_3:
        case BTL_MSG_ITEMS_DISABLED:
            if (popup->needsInit) {
                popup->needsInit = FALSE;
                msgWidth = get_msg_width(bMessages[popup->messageIndex], 0) + 55;
                posX = 160 - (msgWidth / 2);
                width = msgWidth;
                height = 40;
                set_window_properties(WINDOW_ID_BATTLE_POPUP, posX, posY, width, height, WINDOW_PRIORITY_0, func_80250818, popup, -1);
                set_window_update(WINDOW_ID_BATTLE_POPUP, WINDOW_UPDATE_SHOW);
            }
            break;
        case BTL_MSG_CHARGE_HAMMER:
        case BTL_MSG_CHARGE_HAMMER_MORE:
        case BTL_MSG_CHARGE_JUMP:
        case BTL_MSG_CHARGE_JUMP_MORE:
        case BTL_MSG_ATTACK_UP:
        case BTL_MSG_DEFENCE_UP:
        case BTL_MSG_1F:
        case BTL_MSG_20:
        case BTL_MSG_ENEMY_TRANSPARENT:
        case BTL_MSG_ENEMY_CHARGED:
            if (popup->needsInit) {
                s32 messageID;

                popup->needsInit = FALSE;
                messageID = bMessages[popup->messageIndex];
                set_message_value(D_8029F640, 0);
                msgWidth = get_msg_width(messageID, 0) + 31;
                posX = 160 - (msgWidth / 2);
                width = msgWidth;
                numLines = get_msg_lines(messageID) - 1;
                height = bMsgHeights[numLines];
                set_window_properties(WINDOW_ID_BATTLE_POPUP, posX, posY, width, height, WINDOW_PRIORITY_0, func_80250818, popup, -1);
                set_window_update(WINDOW_ID_BATTLE_POPUP, WINDOW_UPDATE_SHOW);
            }
            break;
        case BTL_MSG_CANT_MOVE:
            if (popup->needsInit) {
                s32 messageID;

                popup->needsInit = FALSE;
                messageID = bMessages[popup->messageIndex];
                set_message_msg(bActorMessages[D_8029F640], 0);
                msgWidth = get_msg_width(messageID, 0) + 31;
                posX = 160 - (msgWidth / 2);
                width = msgWidth;
                numLines = get_msg_lines(messageID) - 1;
                height = bMsgHeights[numLines];
                set_window_properties(WINDOW_ID_BATTLE_POPUP, posX, posY, width, height, WINDOW_PRIORITY_0, func_80250818, popup, -1);
                set_window_update(WINDOW_ID_BATTLE_POPUP, WINDOW_UPDATE_SHOW);
            }
            break;
        case BTL_MSG_ACTION_TIP_00:
        case BTL_MSG_ACTION_TIP_01:
        case BTL_MSG_ACTION_TIP_02:
        case BTL_MSG_ACTION_TIP_03:
        case BTL_MSG_ACTION_TIP_04:
        case BTL_MSG_ACTION_TIP_05:
        case BTL_MSG_ACTION_TIP_06:
        case BTL_MSG_ACTION_TIP_07:
        case BTL_MSG_ACTION_TIP_08:
        case BTL_MSG_ACTION_TIP_09:
        case BTL_MSG_ACTION_TIP_0A:
        case BTL_MSG_ACTION_TIP_0B:
        case BTL_MSG_ACTION_TIP_0C:
        case BTL_MSG_ACTION_TIP_0D:
        case BTL_MSG_ACTION_TIP_0E:
        case BTL_MSG_ACTION_TIP_0F:
        case BTL_MSG_ACTION_TIP_10:
        case BTL_MSG_ACTION_TIP_11:
        case BTL_MSG_ACTION_TIP_12:
        case BTL_MSG_ACTION_TIP_13:
        case BTL_MSG_ACTION_TIP_14:
            if (popup->needsInit) {
                s32 messageID;

                popup->needsInit = FALSE;
                messageID = bMessages[popup->messageIndex];
                msgWidth = get_msg_width(messageID, 0) + 31;
                posX = 160 - (msgWidth / 2);
                posY = 192;
                width = msgWidth;
                numLines = get_msg_lines(messageID) - 1;
                height = bMsgHeights[numLines];
                if (popup->messageIndex == BTL_MSG_ACTION_TIP_0D) {
                    posY = 120;
                    D_8029F64C = 1;
                }
                D_8029F64E = posY;
                D_8029F650 = D_802835D8[numLines];

                posY = D_8029F64E + D_8029F650;
                set_window_properties(WINDOW_ID_BATTLE_POPUP, posX, posY, width, height, WINDOW_PRIORITY_0, func_80250818, popup, -1);
                if (popup->messageIndex == BTL_MSG_ACTION_TIP_0D) {
                    set_window_update(WINDOW_ID_BATTLE_POPUP, WINDOW_UPDATE_SHOW);
                } else {
                    set_window_update(WINDOW_ID_BATTLE_POPUP, WINDOW_UPDATE_SHOW_DARKENED);
                }
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_shattering_idle
/* 103EBC 802E263C 27BDFF68 */  addiu     $sp, $sp, -0x98
/* 103EC0 802E2640 F7B80078 */  sdc1      $f24, 0x78($sp)
/* 103EC4 802E2644 4480C000 */  mtc1      $zero, $f24
/* 103EC8 802E2648 F7BC0088 */  sdc1      $f28, 0x88($sp)
/* 103ECC 802E264C 3C01802F */  lui       $at, %hi(D_802EB138)
/* 103ED0 802E2650 D43CB138 */  ldc1      $f28, %lo(D_802EB138)($at)
/* 103ED4 802E2654 AFB40050 */  sw        $s4, 0x50($sp)
/* 103ED8 802E2658 0000A02D */  daddu     $s4, $zero, $zero
/* 103EDC 802E265C F7BE0090 */  sdc1      $f30, 0x90($sp)
/* 103EE0 802E2660 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 103EE4 802E2664 4481F000 */  mtc1      $at, $f30
/* 103EE8 802E2668 27A80020 */  addiu     $t0, $sp, 0x20
/* 103EEC 802E266C AFBE0060 */  sw        $fp, 0x60($sp)
/* 103EF0 802E2670 27BE0024 */  addiu     $fp, $sp, 0x24
/* 103EF4 802E2674 AFB7005C */  sw        $s7, 0x5C($sp)
/* 103EF8 802E2678 27B70028 */  addiu     $s7, $sp, 0x28
/* 103EFC 802E267C AFB60058 */  sw        $s6, 0x58($sp)
/* 103F00 802E2680 27B6002C */  addiu     $s6, $sp, 0x2C
/* 103F04 802E2684 AFB50054 */  sw        $s5, 0x54($sp)
/* 103F08 802E2688 27B50030 */  addiu     $s5, $sp, 0x30
/* 103F0C 802E268C AFBF0064 */  sw        $ra, 0x64($sp)
/* 103F10 802E2690 AFB3004C */  sw        $s3, 0x4C($sp)
/* 103F14 802E2694 AFB20048 */  sw        $s2, 0x48($sp)
/* 103F18 802E2698 AFB10044 */  sw        $s1, 0x44($sp)
/* 103F1C 802E269C AFB00040 */  sw        $s0, 0x40($sp)
/* 103F20 802E26A0 F7BA0080 */  sdc1      $f26, 0x80($sp)
/* 103F24 802E26A4 F7B60070 */  sdc1      $f22, 0x70($sp)
/* 103F28 802E26A8 F7B40068 */  sdc1      $f20, 0x68($sp)
/* 103F2C 802E26AC AFA40098 */  sw        $a0, 0x98($sp)
/* 103F30 802E26B0 AFA80038 */  sw        $t0, 0x38($sp)
/* 103F34 802E26B4 8C920040 */  lw        $s2, 0x40($a0)
/* 103F38 802E26B8 4600C686 */  mov.s     $f26, $f24
/* 103F3C 802E26BC 4600C586 */  mov.s     $f22, $f24
/* 103F40 802E26C0 0240882D */  daddu     $s1, $s2, $zero
/* 103F44 802E26C4 0240802D */  daddu     $s0, $s2, $zero
/* 103F48 802E26C8 0240982D */  daddu     $s3, $s2, $zero
.L802E26CC:
/* 103F4C 802E26CC 24020001 */  addiu     $v0, $zero, 0x1
/* 103F50 802E26D0 82230040 */  lb        $v1, 0x40($s1)
/* 103F54 802E26D4 92240040 */  lbu       $a0, 0x40($s1)
/* 103F58 802E26D8 1062001D */  beq       $v1, $v0, .L802E2750
/* 103F5C 802E26DC 28620002 */   slti     $v0, $v1, 0x2
/* 103F60 802E26E0 50400005 */  beql      $v0, $zero, .L802E26F8
/* 103F64 802E26E4 24020002 */   addiu    $v0, $zero, 0x2
/* 103F68 802E26E8 10600009 */  beqz      $v1, .L802E2710
/* 103F6C 802E26EC 00000000 */   nop
/* 103F70 802E26F0 080B89F7 */  j         .L802E27DC
/* 103F74 802E26F4 00000000 */   nop
.L802E26F8:
/* 103F78 802E26F8 10620021 */  beq       $v1, $v0, .L802E2780
/* 103F7C 802E26FC 24020003 */   addiu    $v0, $zero, 0x3
/* 103F80 802E2700 1062002E */  beq       $v1, $v0, .L802E27BC
/* 103F84 802E2704 00000000 */   nop
/* 103F88 802E2708 080B89F7 */  j         .L802E27DC
/* 103F8C 802E270C 00000000 */   nop
.L802E2710:
/* 103F90 802E2710 96620000 */  lhu       $v0, 0x0($s3)
/* 103F94 802E2714 3C014019 */  lui       $at, (0x4019999A >> 16)
/* 103F98 802E2718 3421999A */  ori       $at, $at, (0x4019999A & 0xFFFF)
/* 103F9C 802E271C 4481B000 */  mtc1      $at, $f22
/* 103FA0 802E2720 30420001 */  andi      $v0, $v0, 0x1
/* 103FA4 802E2724 10400003 */  beqz      $v0, .L802E2734
/* 103FA8 802E2728 00000000 */   nop
/* 103FAC 802E272C 3C013FC0 */  lui       $at, (0x3FC00000 >> 16)
/* 103FB0 802E2730 4481B000 */  mtc1      $at, $f22
.L802E2734:
/* 103FB4 802E2734 82220059 */  lb        $v0, 0x59($s1)
/* 103FB8 802E2738 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
/* 103FBC 802E273C 4481D000 */  mtc1      $at, $f26
/* 103FC0 802E2740 4482C000 */  mtc1      $v0, $f24
/* 103FC4 802E2744 00000000 */  nop
/* 103FC8 802E2748 080B89F7 */  j         .L802E27DC
/* 103FCC 802E274C 4680C620 */   cvt.s.w  $f24, $f24
.L802E2750:
/* 103FD0 802E2750 3C013F99 */  lui       $at, (0x3F99999A >> 16)
/* 103FD4 802E2754 3421999A */  ori       $at, $at, (0x3F99999A & 0xFFFF)
/* 103FD8 802E2758 4481B000 */  mtc1      $at, $f22
/* 103FDC 802E275C 92220059 */  lbu       $v0, 0x59($s1)
/* 103FE0 802E2760 3C014040 */  lui       $at, (0x40400000 >> 16)
/* 103FE4 802E2764 4481D000 */  mtc1      $at, $f26
/* 103FE8 802E2768 00021600 */  sll       $v0, $v0, 24
/* 103FEC 802E276C 00021683 */  sra       $v0, $v0, 26
/* 103FF0 802E2770 4482C000 */  mtc1      $v0, $f24
/* 103FF4 802E2774 00000000 */  nop
/* 103FF8 802E2778 080B89F7 */  j         .L802E27DC
/* 103FFC 802E277C 4680C620 */   cvt.s.w  $f24, $f24
.L802E2780:
/* 104000 802E2780 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 104004 802E2784 4481B000 */  mtc1      $at, $f22
/* 104008 802E2788 92220059 */  lbu       $v0, 0x59($s1)
/* 10400C 802E278C 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 104010 802E2790 4481D000 */  mtc1      $at, $f26
/* 104014 802E2794 8643003C */  lh        $v1, 0x3C($s2)
/* 104018 802E2798 00021600 */  sll       $v0, $v0, 24
/* 10401C 802E279C 00021683 */  sra       $v0, $v0, 26
/* 104020 802E27A0 4482C000 */  mtc1      $v0, $f24
/* 104024 802E27A4 00000000 */  nop
/* 104028 802E27A8 4680C620 */  cvt.s.w   $f24, $f24
/* 10402C 802E27AC 1460000B */  bnez      $v1, .L802E27DC
/* 104030 802E27B0 24820001 */   addiu    $v0, $a0, 0x1
/* 104034 802E27B4 080B89F7 */  j         .L802E27DC
/* 104038 802E27B8 A2220040 */   sb       $v0, 0x40($s1)
.L802E27BC:
/* 10403C 802E27BC C6000124 */  lwc1      $f0, 0x124($s0)
/* 104040 802E27C0 3C01802F */  lui       $at, %hi(D_802EB140)
/* 104044 802E27C4 D422B140 */  ldc1      $f2, %lo(D_802EB140)($at)
/* 104048 802E27C8 46000021 */  cvt.d.s   $f0, $f0
/* 10404C 802E27CC 46220001 */  sub.d     $f0, $f0, $f2
/* 104050 802E27D0 46200020 */  cvt.s.d   $f0, $f0
/* 104054 802E27D4 080B8ABF */  j         .L802E2AFC
/* 104058 802E27D8 E6000124 */   swc1     $f0, 0x124($s0)
.L802E27DC:
/* 10405C 802E27DC C60001EC */  lwc1      $f0, 0x1EC($s0)
/* 104060 802E27E0 3C01802F */  lui       $at, %hi(D_802EB148)
/* 104064 802E27E4 D422B148 */  ldc1      $f2, %lo(D_802EB148)($at)
/* 104068 802E27E8 46000021 */  cvt.d.s   $f0, $f0
/* 10406C 802E27EC 46220001 */  sub.d     $f0, $f0, $f2
/* 104070 802E27F0 3C01802F */  lui       $at, %hi(D_802EB150)
/* 104074 802E27F4 D424B150 */  ldc1      $f4, %lo(D_802EB150)($at)
/* 104078 802E27F8 46200020 */  cvt.s.d   $f0, $f0
/* 10407C 802E27FC 460000A1 */  cvt.d.s   $f2, $f0
/* 104080 802E2800 4624103C */  c.lt.d    $f2, $f4
/* 104084 802E2804 00000000 */  nop
/* 104088 802E2808 45000006 */  bc1f      .L802E2824
/* 10408C 802E280C E60001EC */   swc1     $f0, 0x1EC($s0)
/* 104090 802E2810 3C01C143 */  lui       $at, (0xC1433333 >> 16)
/* 104094 802E2814 34213333 */  ori       $at, $at, (0xC1433333 & 0xFFFF)
/* 104098 802E2818 44810000 */  mtc1      $at, $f0
/* 10409C 802E281C 00000000 */  nop
/* 1040A0 802E2820 E60001EC */  swc1      $f0, 0x1EC($s0)
.L802E2824:
/* 1040A4 802E2824 C6000124 */  lwc1      $f0, 0x124($s0)
/* 1040A8 802E2828 C60201EC */  lwc1      $f2, 0x1EC($s0)
/* 1040AC 802E282C 46020000 */  add.s     $f0, $f0, $f2
/* 1040B0 802E2830 E6000124 */  swc1      $f0, 0x124($s0)
/* 1040B4 802E2834 92220072 */  lbu       $v0, 0x72($s1)
/* 1040B8 802E2838 4482A000 */  mtc1      $v0, $f20
/* 1040BC 802E283C 00000000 */  nop
/* 1040C0 802E2840 4680A521 */  cvt.d.w   $f20, $f20
/* 1040C4 802E2844 463CA502 */  mul.d     $f20, $f20, $f28
/* 1040C8 802E2848 00000000 */  nop
/* 1040CC 802E284C 3C013F70 */  lui       $at, (0x3F700000 >> 16)
/* 1040D0 802E2850 44814800 */  mtc1      $at, $f9
/* 1040D4 802E2854 44804000 */  mtc1      $zero, $f8
/* 1040D8 802E2858 00000000 */  nop
/* 1040DC 802E285C 4628A502 */  mul.d     $f20, $f20, $f8
/* 1040E0 802E2860 00000000 */  nop
/* 1040E4 802E2864 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1040E8 802E2868 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1040EC 802E286C 44816000 */  mtc1      $at, $f12
/* 1040F0 802E2870 4620A520 */  cvt.s.d   $f20, $f20
/* 1040F4 802E2874 460CA302 */  mul.s     $f12, $f20, $f12
/* 1040F8 802E2878 00000000 */  nop
/* 1040FC 802E287C 03C0302D */  daddu     $a2, $fp, $zero
/* 104100 802E2880 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 104104 802E2884 44810000 */  mtc1      $at, $f0
/* 104108 802E2888 8FA50038 */  lw        $a1, 0x38($sp)
/* 10410C 802E288C 0C00A82D */  jal       sin_cos_rad
/* 104110 802E2890 46006303 */   div.s    $f12, $f12, $f0
/* 104114 802E2894 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 104118 802E2898 4600B002 */  mul.s     $f0, $f22, $f0
/* 10411C 802E289C 00000000 */  nop
/* 104120 802E28A0 C7A20024 */  lwc1      $f2, 0x24($sp)
/* 104124 802E28A4 4602B082 */  mul.s     $f2, $f22, $f2
/* 104128 802E28A8 00000000 */  nop
/* 10412C 802E28AC C60400C0 */  lwc1      $f4, 0xC0($s0)
/* 104130 802E28B0 46002100 */  add.s     $f4, $f4, $f0
/* 104134 802E28B4 C6000188 */  lwc1      $f0, 0x188($s0)
/* 104138 802E28B8 46020000 */  add.s     $f0, $f0, $f2
/* 10413C 802E28BC 3C040004 */  lui       $a0, (0x40000 >> 16)
/* 104140 802E28C0 02E0282D */  daddu     $a1, $s7, $zero
/* 104144 802E28C4 E6000188 */  swc1      $f0, 0x188($s0)
/* 104148 802E28C8 C6000124 */  lwc1      $f0, 0x124($s0)
/* 10414C 802E28CC C6020188 */  lwc1      $f2, 0x188($s0)
/* 104150 802E28D0 02C0302D */  daddu     $a2, $s6, $zero
/* 104154 802E28D4 E60400C0 */  swc1      $f4, 0xC0($s0)
/* 104158 802E28D8 E7A40028 */  swc1      $f4, 0x28($sp)
/* 10415C 802E28DC E7A0002C */  swc1      $f0, 0x2C($sp)
/* 104160 802E28E0 E7A20030 */  swc1      $f2, 0x30($sp)
/* 104164 802E28E4 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 104168 802E28E8 44814000 */  mtc1      $at, $f8
/* 10416C 802E28EC 02A0382D */  daddu     $a3, $s5, $zero
/* 104170 802E28F0 E7B60010 */  swc1      $f22, 0x10($sp)
/* 104174 802E28F4 E7B40014 */  swc1      $f20, 0x14($sp)
/* 104178 802E28F8 E7A80018 */  swc1      $f8, 0x18($sp)
/* 10417C 802E28FC 0C0376B9 */  jal       npc_test_move_taller_with_slipping
/* 104180 802E2900 E7A8001C */   swc1     $f8, 0x1C($sp)
/* 104184 802E2904 1040002D */  beqz      $v0, .L802E29BC
/* 104188 802E2908 03C0302D */   daddu    $a2, $fp, $zero
/* 10418C 802E290C C7A00028 */  lwc1      $f0, 0x28($sp)
/* 104190 802E2910 C7A2002C */  lwc1      $f2, 0x2C($sp)
/* 104194 802E2914 C7A40030 */  lwc1      $f4, 0x30($sp)
/* 104198 802E2918 E60000C0 */  swc1      $f0, 0xC0($s0)
/* 10419C 802E291C E6020124 */  swc1      $f2, 0x124($s0)
/* 1041A0 802E2920 E6040188 */  swc1      $f4, 0x188($s0)
/* 1041A4 802E2924 92220072 */  lbu       $v0, 0x72($s1)
/* 1041A8 802E2928 24420080 */  addiu     $v0, $v0, 0x80
/* 1041AC 802E292C A2220072 */  sb        $v0, 0x72($s1)
/* 1041B0 802E2930 304200FF */  andi      $v0, $v0, 0xFF
/* 1041B4 802E2934 44826000 */  mtc1      $v0, $f12
/* 1041B8 802E2938 00000000 */  nop
/* 1041BC 802E293C 46806321 */  cvt.d.w   $f12, $f12
/* 1041C0 802E2940 463C6302 */  mul.d     $f12, $f12, $f28
/* 1041C4 802E2944 00000000 */  nop
/* 1041C8 802E2948 3C013F70 */  lui       $at, (0x3F700000 >> 16)
/* 1041CC 802E294C 44814800 */  mtc1      $at, $f9
/* 1041D0 802E2950 44804000 */  mtc1      $zero, $f8
/* 1041D4 802E2954 00000000 */  nop
/* 1041D8 802E2958 46286302 */  mul.d     $f12, $f12, $f8
/* 1041DC 802E295C 00000000 */  nop
/* 1041E0 802E2960 3C01802F */  lui       $at, %hi(D_802EB158)
/* 1041E4 802E2964 D420B158 */  ldc1      $f0, %lo(D_802EB158)($at)
/* 1041E8 802E2968 46206302 */  mul.d     $f12, $f12, $f0
/* 1041EC 802E296C 00000000 */  nop
/* 1041F0 802E2970 8FA50038 */  lw        $a1, 0x38($sp)
/* 1041F4 802E2974 463C6303 */  div.d     $f12, $f12, $f28
/* 1041F8 802E2978 0C00A82D */  jal       sin_cos_rad
/* 1041FC 802E297C 46206320 */   cvt.s.d  $f12, $f12
/* 104200 802E2980 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 104204 802E2984 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 104208 802E2988 4481B000 */  mtc1      $at, $f22
/* 10420C 802E298C 00000000 */  nop
/* 104210 802E2990 46160002 */  mul.s     $f0, $f0, $f22
/* 104214 802E2994 00000000 */  nop
/* 104218 802E2998 C7A40024 */  lwc1      $f4, 0x24($sp)
/* 10421C 802E299C 46162102 */  mul.s     $f4, $f4, $f22
/* 104220 802E29A0 00000000 */  nop
/* 104224 802E29A4 C60200C0 */  lwc1      $f2, 0xC0($s0)
/* 104228 802E29A8 46001080 */  add.s     $f2, $f2, $f0
/* 10422C 802E29AC C6000188 */  lwc1      $f0, 0x188($s0)
/* 104230 802E29B0 46040000 */  add.s     $f0, $f0, $f4
/* 104234 802E29B4 E60200C0 */  swc1      $f2, 0xC0($s0)
/* 104238 802E29B8 E6000188 */  swc1      $f0, 0x188($s0)
.L802E29BC:
/* 10423C 802E29BC 3C040004 */  lui       $a0, (0x40000 >> 16)
/* 104240 802E29C0 02E0282D */  daddu     $a1, $s7, $zero
/* 104244 802E29C4 02C0302D */  daddu     $a2, $s6, $zero
/* 104248 802E29C8 02A0382D */  daddu     $a3, $s5, $zero
/* 10424C 802E29CC 27A20034 */  addiu     $v0, $sp, 0x34
/* 104250 802E29D0 C60200C0 */  lwc1      $f2, 0xC0($s0)
/* 104254 802E29D4 C6040124 */  lwc1      $f4, 0x124($s0)
/* 104258 802E29D8 C60001EC */  lwc1      $f0, 0x1EC($s0)
/* 10425C 802E29DC C6060188 */  lwc1      $f6, 0x188($s0)
/* 104260 802E29E0 46000005 */  abs.s     $f0, $f0
/* 104264 802E29E4 E7A20028 */  swc1      $f2, 0x28($sp)
/* 104268 802E29E8 E7A4002C */  swc1      $f4, 0x2C($sp)
/* 10426C 802E29EC E7A60030 */  swc1      $f6, 0x30($sp)
/* 104270 802E29F0 E7A00034 */  swc1      $f0, 0x34($sp)
/* 104274 802E29F4 0C0372DF */  jal       npc_raycast_down_sides
/* 104278 802E29F8 AFA20010 */   sw       $v0, 0x10($sp)
/* 10427C 802E29FC 1440000B */  bnez      $v0, .L802E2A2C
/* 104280 802E2A00 00000000 */   nop
/* 104284 802E2A04 C6400038 */  lwc1      $f0, 0x38($s2)
/* 104288 802E2A08 3C014348 */  lui       $at, (0x43480000 >> 16)
/* 10428C 802E2A0C 44811000 */  mtc1      $at, $f2
/* 104290 802E2A10 00000000 */  nop
/* 104294 802E2A14 46020001 */  sub.s     $f0, $f0, $f2
/* 104298 802E2A18 C7A2002C */  lwc1      $f2, 0x2C($sp)
/* 10429C 802E2A1C 4600103C */  c.lt.s    $f2, $f0
/* 1042A0 802E2A20 00000000 */  nop
/* 1042A4 802E2A24 4500000F */  bc1f      .L802E2A64
/* 1042A8 802E2A28 00000000 */   nop
.L802E2A2C:
/* 1042AC 802E2A2C 92220040 */  lbu       $v0, 0x40($s1)
/* 1042B0 802E2A30 24420001 */  addiu     $v0, $v0, 0x1
/* 1042B4 802E2A34 A2220040 */  sb        $v0, 0x40($s1)
/* 1042B8 802E2A38 C60201EC */  lwc1      $f2, 0x1EC($s0)
/* 1042BC 802E2A3C 3C013F99 */  lui       $at, (0x3F99999A >> 16)
/* 1042C0 802E2A40 3421999A */  ori       $at, $at, (0x3F99999A & 0xFFFF)
/* 1042C4 802E2A44 44810000 */  mtc1      $at, $f0
/* 1042C8 802E2A48 46001085 */  abs.s     $f2, $f2
/* 1042CC 802E2A4C 46001082 */  mul.s     $f2, $f2, $f0
/* 1042D0 802E2A50 00000000 */  nop
/* 1042D4 802E2A54 C7A0002C */  lwc1      $f0, 0x2C($sp)
/* 1042D8 802E2A58 46020000 */  add.s     $f0, $f0, $f2
/* 1042DC 802E2A5C E61A01EC */  swc1      $f26, 0x1EC($s0)
/* 1042E0 802E2A60 E6000124 */  swc1      $f0, 0x124($s0)
.L802E2A64:
/* 1042E4 802E2A64 9222008B */  lbu       $v0, 0x8B($s1)
/* 1042E8 802E2A68 44820000 */  mtc1      $v0, $f0
/* 1042EC 802E2A6C 00000000 */  nop
/* 1042F0 802E2A70 46800020 */  cvt.s.w   $f0, $f0
/* 1042F4 802E2A74 46180000 */  add.s     $f0, $f0, $f24
/* 1042F8 802E2A78 4600F03E */  c.le.s    $f30, $f0
/* 1042FC 802E2A7C 00000000 */  nop
glabel func_802E2A80
/* 104300 802E2A80 45010005 */  bc1t      .L802E2A98
/* 104304 802E2A84 2623008B */   addiu    $v1, $s1, 0x8B
/* 104308 802E2A88 4600020D */  trunc.w.s $f8, $f0
/* 10430C 802E2A8C 44024000 */  mfc1      $v0, $f8
/* 104310 802E2A90 080B8AAC */  j         .L802E2AB0
/* 104314 802E2A94 A0620000 */   sb       $v0, 0x0($v1)
.L802E2A98:
/* 104318 802E2A98 461E0001 */  sub.s     $f0, $f0, $f30
/* 10431C 802E2A9C 4600020D */  trunc.w.s $f8, $f0
/* 104320 802E2AA0 44024000 */  mfc1      $v0, $f8
/* 104324 802E2AA4 3C088000 */  lui       $t0, (0x80000000 >> 16)
/* 104328 802E2AA8 00481025 */  or        $v0, $v0, $t0
/* 10432C 802E2AAC A0620000 */  sb        $v0, 0x0($v1)
.L802E2AB0:
/* 104330 802E2AB0 922200A4 */  lbu       $v0, 0xA4($s1)
/* 104334 802E2AB4 44820000 */  mtc1      $v0, $f0
/* 104338 802E2AB8 00000000 */  nop
/* 10433C 802E2ABC 46800020 */  cvt.s.w   $f0, $f0
/* 104340 802E2AC0 46180001 */  sub.s     $f0, $f0, $f24
/* 104344 802E2AC4 4600F03E */  c.le.s    $f30, $f0
/* 104348 802E2AC8 00000000 */  nop
/* 10434C 802E2ACC 45010005 */  bc1t      .L802E2AE4
/* 104350 802E2AD0 262300A4 */   addiu    $v1, $s1, 0xA4
/* 104354 802E2AD4 4600020D */  trunc.w.s $f8, $f0
/* 104358 802E2AD8 44024000 */  mfc1      $v0, $f8
/* 10435C 802E2ADC 080B8ABF */  j         .L802E2AFC
/* 104360 802E2AE0 A0620000 */   sb       $v0, 0x0($v1)
.L802E2AE4:
/* 104364 802E2AE4 461E0001 */  sub.s     $f0, $f0, $f30
/* 104368 802E2AE8 4600020D */  trunc.w.s $f8, $f0
/* 10436C 802E2AEC 44024000 */  mfc1      $v0, $f8
/* 104370 802E2AF0 3C088000 */  lui       $t0, (0x80000000 >> 16)
/* 104374 802E2AF4 00481025 */  or        $v0, $v0, $t0
/* 104378 802E2AF8 A0620000 */  sb        $v0, 0x0($v1)
.L802E2AFC:
/* 10437C 802E2AFC 26310001 */  addiu     $s1, $s1, 0x1
/* 104380 802E2B00 26100004 */  addiu     $s0, $s0, 0x4
/* 104384 802E2B04 26940001 */  addiu     $s4, $s4, 0x1
/* 104388 802E2B08 2A820018 */  slti      $v0, $s4, 0x18
/* 10438C 802E2B0C 1440FEEF */  bnez      $v0, .L802E26CC
/* 104390 802E2B10 26730002 */   addiu    $s3, $s3, 0x2
/* 104394 802E2B14 9642003E */  lhu       $v0, 0x3E($s2)
/* 104398 802E2B18 24420001 */  addiu     $v0, $v0, 0x1
/* 10439C 802E2B1C A642003E */  sh        $v0, 0x3E($s2)
/* 1043A0 802E2B20 00021400 */  sll       $v0, $v0, 16
/* 1043A4 802E2B24 00021403 */  sra       $v0, $v0, 16
/* 1043A8 802E2B28 2842000A */  slti      $v0, $v0, 0xA
/* 1043AC 802E2B2C 1440000B */  bnez      $v0, .L802E2B5C
/* 1043B0 802E2B30 2403000A */   addiu    $v1, $zero, 0xA
/* 1043B4 802E2B34 9642003C */  lhu       $v0, 0x3C($s2)
/* 1043B8 802E2B38 A643003E */  sh        $v1, 0x3E($s2)
/* 1043BC 802E2B3C 2442FFF8 */  addiu     $v0, $v0, -0x8
/* 1043C0 802E2B40 A642003C */  sh        $v0, 0x3C($s2)
/* 1043C4 802E2B44 00021400 */  sll       $v0, $v0, 16
/* 1043C8 802E2B48 1C400004 */  bgtz      $v0, .L802E2B5C
/* 1043CC 802E2B4C 00000000 */   nop
/* 1043D0 802E2B50 A640003C */  sh        $zero, 0x3C($s2)
/* 1043D4 802E2B54 0C043F5A */  jal       exec_entity_commandlist
/* 1043D8 802E2B58 8FA40098 */   lw       $a0, 0x98($sp)
.L802E2B5C:
/* 1043DC 802E2B5C 8FBF0064 */  lw        $ra, 0x64($sp)
/* 1043E0 802E2B60 8FBE0060 */  lw        $fp, 0x60($sp)
/* 1043E4 802E2B64 8FB7005C */  lw        $s7, 0x5C($sp)
/* 1043E8 802E2B68 8FB60058 */  lw        $s6, 0x58($sp)
/* 1043EC 802E2B6C 8FB50054 */  lw        $s5, 0x54($sp)
/* 1043F0 802E2B70 8FB40050 */  lw        $s4, 0x50($sp)
glabel func_802E2B74
/* 1043F4 802E2B74 8FB3004C */  lw        $s3, 0x4C($sp)
/* 1043F8 802E2B78 8FB20048 */  lw        $s2, 0x48($sp)
/* 1043FC 802E2B7C 8FB10044 */  lw        $s1, 0x44($sp)
/* 104400 802E2B80 8FB00040 */  lw        $s0, 0x40($sp)
/* 104404 802E2B84 D7BE0090 */  ldc1      $f30, 0x90($sp)
/* 104408 802E2B88 D7BC0088 */  ldc1      $f28, 0x88($sp)
/* 10440C 802E2B8C D7BA0080 */  ldc1      $f26, 0x80($sp)
/* 104410 802E2B90 D7B80078 */  ldc1      $f24, 0x78($sp)
/* 104414 802E2B94 D7B60070 */  ldc1      $f22, 0x70($sp)
/* 104418 802E2B98 D7B40068 */  ldc1      $f20, 0x68($sp)
/* 10441C 802E2B9C 03E00008 */  jr        $ra
/* 104420 802E2BA0 27BD0098 */   addiu    $sp, $sp, 0x98

### DECOMPILED C INSTRUCTIONS:

void entity_shattering_idle(Entity* entity) {
    ShatteringBlockData* data = entity->dataBuf.shatteringBlock;
    f32 rotSpeed = 0.0f;
    f32 reboundSpeed = 0.0f;
    f32 lateralSpeed = 0.0f;
    f32 angle;
    s32 i;
    f32 sinTheta;
    f32 cosTheta;
    f32 hitX, hitY, hitZ, hitDepth;

    for (i = 0; i < 24; i++) {
        switch (data->fragmentRebounds[i]) {
            case 0:
                if (data->fragmentFlags[i] & 1) {
                    lateralSpeed = 1.5f;
                } else {
                    lateralSpeed = 2.4f;
                }
                reboundSpeed = 6.0f;
                rotSpeed = data->fragmentRotSpeed[i];
                break;
            case 1:
                lateralSpeed = 1.2f;
                reboundSpeed = 3.0f;
                rotSpeed = data->fragmentRotSpeed[i] >> 2;
                break;
            case 2:
                lateralSpeed = 1.0f;
                reboundSpeed = 2.0f;
                rotSpeed = data->fragmentRotSpeed[i] >> 2;
                if (data->alpha == 0) {
                    data->fragmentRebounds[i]++;
                }
                break;
            case 3:
                data->fragmentPosY[i] -= 0.3;
                continue;
        }

        data->fragmentFallSpeed[i] -= 1.2;
        if (data->fragmentFallSpeed[i] < -12.2) {
            data->fragmentFallSpeed[i] = -12.2f;
        }
        data->fragmentPosY[i] += data->fragmentFallSpeed[i];

        angle = data->fragmentMoveAngle[i] * 360.0 / 256;
        sin_cos_rad(DEG_TO_RAD(angle), &sinTheta, &cosTheta);
        data->fragmentPosX[i] += lateralSpeed * sinTheta;
        data->fragmentPosZ[i] += lateralSpeed * cosTheta;

        hitX = data->fragmentPosX[i];
        hitY = data->fragmentPosY[i];
        hitZ = data->fragmentPosZ[i];
        if (npc_test_move_taller_with_slipping(COLLISION_IGNORE_ENTITIES, &hitX, &hitY, &hitZ, lateralSpeed, angle, 8.0f, 8.0f)) {
            data->fragmentPosX[i] = hitX;
            data->fragmentPosY[i] = hitY;
            data->fragmentPosZ[i] = hitZ;
            data->fragmentMoveAngle[i] += 0x80; // inverse yaw

            sin_cos_rad(DEG_TO_RAD(data->fragmentMoveAngle[i] * 360.0 / 256), &sinTheta, &cosTheta);
            lateralSpeed = 8.0f;
            data->fragmentPosX[i] += lateralSpeed * sinTheta;
            data->fragmentPosZ[i] += lateralSpeed * cosTheta;
        }

        hitX = data->fragmentPosX[i];
        hitY = data->fragmentPosY[i];
        hitZ = data->fragmentPosZ[i];
        hitDepth = fabsf(data->fragmentFallSpeed[i]);
        if (npc_raycast_down_sides(COLLISION_IGNORE_ENTITIES, &hitX, &hitY, &hitZ, &hitDepth) || hitY < data->originalPosY - 200.0f) {
            data->fragmentRebounds[i]++;
            data->fragmentPosY[i] = hitY + fabsf(data->fragmentFallSpeed[i]) * 1.2f;
            data->fragmentFallSpeed[i] = reboundSpeed;
        }

        data->fragmentRotX[i] += rotSpeed;
        data->fragmentRotY[i] -= rotSpeed;
    }

    data->fadeOutCounter++;
    if (data->fadeOutCounter >= 10) {
        data->fadeOutCounter = 10;
        data->alpha -= 8;
        if (data->alpha <= 0) {
            data->alpha = 0;
            exec_entity_commandlist(entity);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel render_hud_elements_frontUI
/* D8E1C 8014271C 27BDFAB0 */  addiu     $sp, $sp, -0x550
/* D8E20 80142720 AFBE0548 */  sw        $fp, 0x548($sp)
/* D8E24 80142724 0000F02D */  daddu     $fp, $zero, $zero
/* D8E28 80142728 AFB70544 */  sw        $s7, 0x544($sp)
/* D8E2C 8014272C 03C0B82D */  daddu     $s7, $fp, $zero
/* D8E30 80142730 3C071021 */  lui       $a3, (0x10210080 >> 16)
/* D8E34 80142734 34E70080 */  ori       $a3, $a3, (0x10210080 & 0xFFFF)
/* D8E38 80142738 27A60028 */  addiu     $a2, $sp, 0x28
/* D8E3C 8014273C 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* D8E40 80142740 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* D8E44 80142744 AFBF054C */  sw        $ra, 0x54C($sp)
/* D8E48 80142748 AFB60540 */  sw        $s6, 0x540($sp)
/* D8E4C 8014274C AFB5053C */  sw        $s5, 0x53C($sp)
/* D8E50 80142750 AFB40538 */  sw        $s4, 0x538($sp)
/* D8E54 80142754 AFB30534 */  sw        $s3, 0x534($sp)
/* D8E58 80142758 AFB20530 */  sw        $s2, 0x530($sp)
/* D8E5C 8014275C AFB1052C */  sw        $s1, 0x52C($sp)
/* D8E60 80142760 AFB00528 */  sw        $s0, 0x528($sp)
/* D8E64 80142764 8C620000 */  lw        $v0, 0x0($v1)
/* D8E68 80142768 3C058015 */  lui       $a1, %hi(gHudElements)
/* D8E6C 8014276C 8CA57960 */  lw        $a1, %lo(gHudElements)($a1)
/* D8E70 80142770 0040202D */  daddu     $a0, $v0, $zero
/* D8E74 80142774 24420008 */  addiu     $v0, $v0, 0x8
/* D8E78 80142778 AC620000 */  sw        $v0, 0x0($v1)
/* D8E7C 8014277C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* D8E80 80142780 AC820000 */  sw        $v0, 0x0($a0)
/* D8E84 80142784 3C020015 */  lui       $v0, %hi(D_14F0A0)
/* D8E88 80142788 2442F0A0 */  addiu     $v0, $v0, %lo(D_14F0A0)
/* D8E8C 8014278C AC820004 */  sw        $v0, 0x4($a0)
.L80142790:
/* D8E90 80142790 8CB00000 */  lw        $s0, 0x0($a1)
/* D8E94 80142794 52000014 */  beql      $s0, $zero, .L801427E8
/* D8E98 80142798 26F70001 */   addiu    $s7, $s7, 0x1
/* D8E9C 8014279C 8E030000 */  lw        $v1, 0x0($s0)
/* D8EA0 801427A0 50600011 */  beql      $v1, $zero, .L801427E8
/* D8EA4 801427A4 26F70001 */   addiu    $s7, $s7, 0x1
/* D8EA8 801427A8 30620002 */  andi      $v0, $v1, 0x2
/* D8EAC 801427AC 5440000E */  bnel      $v0, $zero, .L801427E8
/* D8EB0 801427B0 26F70001 */   addiu    $s7, $s7, 0x1
/* D8EB4 801427B4 00671024 */  and       $v0, $v1, $a3
/* D8EB8 801427B8 5440000B */  bnel      $v0, $zero, .L801427E8
/* D8EBC 801427BC 26F70001 */   addiu    $s7, $s7, 0x1
/* D8EC0 801427C0 30620040 */  andi      $v0, $v1, 0x40
/* D8EC4 801427C4 50400008 */  beql      $v0, $zero, .L801427E8
/* D8EC8 801427C8 26F70001 */   addiu    $s7, $s7, 0x1
/* D8ECC 801427CC 82020045 */  lb        $v0, 0x45($s0)
/* D8ED0 801427D0 04420005 */  bltzl     $v0, .L801427E8
/* D8ED4 801427D4 26F70001 */   addiu    $s7, $s7, 0x1
/* D8ED8 801427D8 ACD70000 */  sw        $s7, 0x0($a2)
/* D8EDC 801427DC 24C60004 */  addiu     $a2, $a2, 0x4
/* D8EE0 801427E0 27DE0001 */  addiu     $fp, $fp, 0x1
/* D8EE4 801427E4 26F70001 */  addiu     $s7, $s7, 0x1
.L801427E8:
/* D8EE8 801427E8 2AE20140 */  slti      $v0, $s7, 0x140
/* D8EEC 801427EC 1440FFE8 */  bnez      $v0, .L80142790
/* D8EF0 801427F0 24A50004 */   addiu    $a1, $a1, 0x4
/* D8EF4 801427F4 27C2FFFF */  addiu     $v0, $fp, -0x1
/* D8EF8 801427F8 18400024 */  blez      $v0, .L8014288C
/* D8EFC 801427FC 0000B82D */   daddu    $s7, $zero, $zero
/* D8F00 80142800 3C0D8015 */  lui       $t5, %hi(gHudElements)
/* D8F04 80142804 25AD7960 */  addiu     $t5, $t5, %lo(gHudElements)
/* D8F08 80142808 27AC0028 */  addiu     $t4, $sp, 0x28
/* D8F0C 8014280C 0180582D */  daddu     $t3, $t4, $zero
.L80142810:
/* D8F10 80142810 26E80001 */  addiu     $t0, $s7, 0x1
/* D8F14 80142814 011E102A */  slt       $v0, $t0, $fp
/* D8F18 80142818 50400018 */  beql      $v0, $zero, .L8014287C
/* D8F1C 8014281C 26F70001 */   addiu    $s7, $s7, 0x1
/* D8F20 80142820 0160502D */  daddu     $t2, $t3, $zero
/* D8F24 80142824 8DA90000 */  lw        $t1, 0x0($t5)
/* D8F28 80142828 00081080 */  sll       $v0, $t0, 2
/* D8F2C 8014282C 004C3021 */  addu      $a2, $v0, $t4
.L80142830:
/* D8F30 80142830 8D470000 */  lw        $a3, 0x0($t2)
/* D8F34 80142834 8CC50000 */  lw        $a1, 0x0($a2)
/* D8F38 80142838 00071880 */  sll       $v1, $a3, 2
/* D8F3C 8014283C 00691821 */  addu      $v1, $v1, $t1
/* D8F40 80142840 00051080 */  sll       $v0, $a1, 2
/* D8F44 80142844 00491021 */  addu      $v0, $v0, $t1
/* D8F48 80142848 8C630000 */  lw        $v1, 0x0($v1)
/* D8F4C 8014284C 8C440000 */  lw        $a0, 0x0($v0)
/* D8F50 80142850 80620044 */  lb        $v0, 0x44($v1)
/* D8F54 80142854 80830044 */  lb        $v1, 0x44($a0)
/* D8F58 80142858 0043102A */  slt       $v0, $v0, $v1
/* D8F5C 8014285C 10400003 */  beqz      $v0, .L8014286C
/* D8F60 80142860 25080001 */   addiu    $t0, $t0, 0x1
/* D8F64 80142864 AD450000 */  sw        $a1, 0x0($t2)
/* D8F68 80142868 ACC70000 */  sw        $a3, 0x0($a2)
.L8014286C:
/* D8F6C 8014286C 011E102A */  slt       $v0, $t0, $fp
/* D8F70 80142870 1440FFEF */  bnez      $v0, .L80142830
/* D8F74 80142874 24C60004 */   addiu    $a2, $a2, 0x4
/* D8F78 80142878 26F70001 */  addiu     $s7, $s7, 0x1
.L8014287C:
/* D8F7C 8014287C 27C2FFFF */  addiu     $v0, $fp, -0x1
/* D8F80 80142880 02E2102A */  slt       $v0, $s7, $v0
/* D8F84 80142884 1440FFE2 */  bnez      $v0, .L80142810
/* D8F88 80142888 256B0004 */   addiu    $t3, $t3, 0x4
.L8014288C:
/* D8F8C 8014288C 1BC000CF */  blez      $fp, .L80142BCC
/* D8F90 80142890 0000B82D */   daddu    $s7, $zero, $zero
/* D8F94 80142894 00171080 */  sll       $v0, $s7, 2
.L80142898:
/* D8F98 80142898 03A21021 */  addu      $v0, $sp, $v0
/* D8F9C 8014289C 8C420028 */  lw        $v0, 0x28($v0)
/* D8FA0 801428A0 3C038015 */  lui       $v1, %hi(gHudElements)
/* D8FA4 801428A4 8C637960 */  lw        $v1, %lo(gHudElements)($v1)
/* D8FA8 801428A8 00021080 */  sll       $v0, $v0, 2
/* D8FAC 801428AC 00431021 */  addu      $v0, $v0, $v1
/* D8FB0 801428B0 8C500000 */  lw        $s0, 0x0($v0)
/* D8FB4 801428B4 8E030000 */  lw        $v1, 0x0($s0)
/* D8FB8 801428B8 30620100 */  andi      $v0, $v1, 0x100
/* D8FBC 801428BC 1440005B */  bnez      $v0, .L80142A2C
/* D8FC0 801428C0 3C0E0010 */   lui      $t6, (0x100000 >> 16)
/* D8FC4 801428C4 006E1024 */  and       $v0, $v1, $t6
/* D8FC8 801428C8 1440000B */  bnez      $v0, .L801428F8
/* D8FCC 801428CC 00000000 */   nop
/* D8FD0 801428D0 82030046 */  lb        $v1, 0x46($s0)
/* D8FD4 801428D4 3C0E8015 */  lui       $t6, %hi(gHudElementSizes)
/* D8FD8 801428D8 25CEEFCC */  addiu     $t6, $t6, %lo(gHudElementSizes)
/* D8FDC 801428DC 00031040 */  sll       $v0, $v1, 1
/* D8FE0 801428E0 00431021 */  addu      $v0, $v0, $v1
/* D8FE4 801428E4 00021040 */  sll       $v0, $v0, 1
/* D8FE8 801428E8 004E1021 */  addu      $v0, $v0, $t6
/* D8FEC 801428EC 84560000 */  lh        $s6, 0x0($v0)
/* D8FF0 801428F0 08050A40 */  j         .L80142900
/* D8FF4 801428F4 84550002 */   lh       $s5, 0x2($v0)
.L801428F8:
/* D8FF8 801428F8 9216004E */  lbu       $s6, 0x4E($s0)
/* D8FFC 801428FC 9215004F */  lbu       $s5, 0x4F($s0)
.L80142900:
/* D9000 80142900 8E030000 */  lw        $v1, 0x0($s0)
/* D9004 80142904 30620010 */  andi      $v0, $v1, 0x10
/* D9008 80142908 14400013 */  bnez      $v0, .L80142958
/* D900C 8014290C 3C0E0010 */   lui      $t6, (0x100000 >> 16)
/* D9010 80142910 006E1024 */  and       $v0, $v1, $t6
/* D9014 80142914 1440000C */  bnez      $v0, .L80142948
/* D9018 80142918 00000000 */   nop
/* D901C 8014291C 82030045 */  lb        $v1, 0x45($s0)
/* D9020 80142920 3C0E8015 */  lui       $t6, %hi(gHudElementSizes)
/* D9024 80142924 25CEEFCC */  addiu     $t6, $t6, %lo(gHudElementSizes)
/* D9028 80142928 00031040 */  sll       $v0, $v1, 1
/* D902C 8014292C 00431021 */  addu      $v0, $v0, $v1
/* D9030 80142930 00021040 */  sll       $v0, $v0, 1
/* D9034 80142934 004E1021 */  addu      $v0, $v0, $t6
/* D9038 80142938 84510000 */  lh        $s1, 0x0($v0)
/* D903C 8014293C 84520002 */  lh        $s2, 0x2($v0)
/* D9040 80142940 08050A59 */  j         .L80142964
/* D9044 80142944 00111023 */   negu     $v0, $s1
.L80142948:
/* D9048 80142948 92110050 */  lbu       $s1, 0x50($s0)
/* D904C 8014294C 92120051 */  lbu       $s2, 0x51($s0)
/* D9050 80142950 08050A59 */  j         .L80142964
/* D9054 80142954 00111023 */   negu     $v0, $s1
.L80142958:
/* D9058 80142958 92110048 */  lbu       $s1, 0x48($s0)
/* D905C 8014295C 92120049 */  lbu       $s2, 0x49($s0)
/* D9060 80142960 00111023 */  negu      $v0, $s1
.L80142964:
/* D9064 80142964 00021FC2 */  srl       $v1, $v0, 31
/* D9068 80142968 00431021 */  addu      $v0, $v0, $v1
/* D906C 8014296C 00029843 */  sra       $s3, $v0, 1
/* D9070 80142970 00121023 */  negu      $v0, $s2
/* D9074 80142974 00021FC2 */  srl       $v1, $v0, 31
/* D9078 80142978 00431021 */  addu      $v0, $v0, $v1
/* D907C 8014297C 0002A043 */  sra       $s4, $v0, 1
/* D9080 80142980 8E030000 */  lw        $v1, 0x0($s0)
/* D9084 80142984 30620800 */  andi      $v0, $v1, 0x800
/* D9088 80142988 14400026 */  bnez      $v0, .L80142A24
/* D908C 8014298C 3C0E2000 */   lui      $t6, (0x20000000 >> 16)
/* D9090 80142990 006E1024 */  and       $v0, $v1, $t6
/* D9094 80142994 10400012 */  beqz      $v0, .L801429E0
/* D9098 80142998 0200202D */   daddu    $a0, $s0, $zero
/* D909C 8014299C 02C0282D */  daddu     $a1, $s6, $zero
/* D90A0 801429A0 02A0302D */  daddu     $a2, $s5, $zero
/* D90A4 801429A4 00113C00 */  sll       $a3, $s1, 16
/* D90A8 801429A8 00073C03 */  sra       $a3, $a3, 16
/* D90AC 801429AC 00121400 */  sll       $v0, $s2, 16
/* D90B0 801429B0 00021403 */  sra       $v0, $v0, 16
/* D90B4 801429B4 AFA20010 */  sw        $v0, 0x10($sp)
/* D90B8 801429B8 00131400 */  sll       $v0, $s3, 16
/* D90BC 801429BC 00021403 */  sra       $v0, $v0, 16
/* D90C0 801429C0 AFA20014 */  sw        $v0, 0x14($sp)
/* D90C4 801429C4 00141400 */  sll       $v0, $s4, 16
/* D90C8 801429C8 00021403 */  sra       $v0, $v0, 16
/* D90CC 801429CC 240E0001 */  addiu     $t6, $zero, 0x1
/* D90D0 801429D0 AFA20018 */  sw        $v0, 0x18($sp)
/* D90D4 801429D4 AFAE001C */  sw        $t6, 0x1C($sp)
/* D90D8 801429D8 0C04FDC1 */  jal       hud_element_draw_rect
/* D90DC 801429DC AFAE0020 */   sw       $t6, 0x20($sp)
.L801429E0:
/* D90E0 801429E0 0200202D */  daddu     $a0, $s0, $zero
/* D90E4 801429E4 02C0282D */  daddu     $a1, $s6, $zero
/* D90E8 801429E8 02A0302D */  daddu     $a2, $s5, $zero
/* D90EC 801429EC 00113C00 */  sll       $a3, $s1, 16
/* D90F0 801429F0 00073C03 */  sra       $a3, $a3, 16
/* D90F4 801429F4 00121400 */  sll       $v0, $s2, 16
/* D90F8 801429F8 00021403 */  sra       $v0, $v0, 16
/* D90FC 801429FC AFA20010 */  sw        $v0, 0x10($sp)
/* D9100 80142A00 00131400 */  sll       $v0, $s3, 16
/* D9104 80142A04 00021403 */  sra       $v0, $v0, 16
/* D9108 80142A08 AFA20014 */  sw        $v0, 0x14($sp)
/* D910C 80142A0C 00141400 */  sll       $v0, $s4, 16
/* D9110 80142A10 00021403 */  sra       $v0, $v0, 16
/* D9114 80142A14 240E0001 */  addiu     $t6, $zero, 0x1
/* D9118 80142A18 AFA20018 */  sw        $v0, 0x18($sp)
/* D911C 80142A1C 08050AED */  j         .L80142BB4
/* D9120 80142A20 AFAE001C */   sw       $t6, 0x1C($sp)
.L80142A24:
/* D9124 80142A24 08050ACB */  j         .L80142B2C
/* D9128 80142A28 006E1024 */   and      $v0, $v1, $t6
.L80142A2C:
/* D912C 80142A2C 006E1024 */  and       $v0, $v1, $t6
/* D9130 80142A30 1440000B */  bnez      $v0, .L80142A60
/* D9134 80142A34 00000000 */   nop
/* D9138 80142A38 82030045 */  lb        $v1, 0x45($s0)
/* D913C 80142A3C 3C0E8015 */  lui       $t6, %hi(gHudElementSizes)
/* D9140 80142A40 25CEEFCC */  addiu     $t6, $t6, %lo(gHudElementSizes)
/* D9144 80142A44 00031040 */  sll       $v0, $v1, 1
/* D9148 80142A48 00431021 */  addu      $v0, $v0, $v1
/* D914C 80142A4C 00021040 */  sll       $v0, $v0, 1
/* D9150 80142A50 004E1021 */  addu      $v0, $v0, $t6
/* D9154 80142A54 84560000 */  lh        $s6, 0x0($v0)
/* D9158 80142A58 08050A9A */  j         .L80142A68
/* D915C 80142A5C 84550002 */   lh       $s5, 0x2($v0)
.L80142A60:
/* D9160 80142A60 9216004E */  lbu       $s6, 0x4E($s0)
/* D9164 80142A64 9215004F */  lbu       $s5, 0x4F($s0)
.L80142A68:
/* D9168 80142A68 C6000028 */  lwc1      $f0, 0x28($s0)
/* D916C 80142A6C C606002C */  lwc1      $f6, 0x2C($s0)
/* D9170 80142A70 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* D9174 80142A74 44811000 */  mtc1      $at, $f2
/* D9178 80142A78 46000307 */  neg.s     $f12, $f0
/* D917C 80142A7C 46026302 */  mul.s     $f12, $f12, $f2
/* D9180 80142A80 00000000 */  nop
/* D9184 80142A84 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* D9188 80142A88 44814000 */  mtc1      $at, $f8
/* D918C 80142A8C 3C014480 */  lui       $at, (0x44800000 >> 16)
/* D9190 80142A90 44815000 */  mtc1      $at, $f10
/* D9194 80142A94 4600038D */  trunc.w.s $f14, $f0
/* D9198 80142A98 44117000 */  mfc1      $s1, $f14
/* D919C 80142A9C 4600338D */  trunc.w.s $f14, $f6
/* D91A0 80142AA0 44127000 */  mfc1      $s2, $f14
/* D91A4 80142AA4 46003187 */  neg.s     $f6, $f6
/* D91A8 80142AA8 46023182 */  mul.s     $f6, $f6, $f2
/* D91AC 80142AAC 00000000 */  nop
/* D91B0 80142AB0 44912000 */  mtc1      $s1, $f4
/* D91B4 80142AB4 00000000 */  nop
/* D91B8 80142AB8 46802120 */  cvt.s.w   $f4, $f4
/* D91BC 80142ABC 44960000 */  mtc1      $s6, $f0
/* D91C0 80142AC0 00000000 */  nop
/* D91C4 80142AC4 46800020 */  cvt.s.w   $f0, $f0
/* D91C8 80142AC8 46002103 */  div.s     $f4, $f4, $f0
/* D91CC 80142ACC 46044103 */  div.s     $f4, $f8, $f4
/* D91D0 80142AD0 460A2102 */  mul.s     $f4, $f4, $f10
/* D91D4 80142AD4 00000000 */  nop
/* D91D8 80142AD8 44921000 */  mtc1      $s2, $f2
/* D91DC 80142ADC 00000000 */  nop
/* D91E0 80142AE0 468010A0 */  cvt.s.w   $f2, $f2
/* D91E4 80142AE4 44950000 */  mtc1      $s5, $f0
/* D91E8 80142AE8 00000000 */  nop
/* D91EC 80142AEC 46800020 */  cvt.s.w   $f0, $f0
/* D91F0 80142AF0 46001083 */  div.s     $f2, $f2, $f0
/* D91F4 80142AF4 46024083 */  div.s     $f2, $f8, $f2
/* D91F8 80142AF8 460A1082 */  mul.s     $f2, $f2, $f10
/* D91FC 80142AFC 00000000 */  nop
/* D9200 80142B00 8E020000 */  lw        $v0, 0x0($s0)
/* D9204 80142B04 4600638D */  trunc.w.s $f14, $f12
/* D9208 80142B08 44137000 */  mfc1      $s3, $f14
/* D920C 80142B0C 4600338D */  trunc.w.s $f14, $f6
/* D9210 80142B10 44147000 */  mfc1      $s4, $f14
/* D9214 80142B14 4600238D */  trunc.w.s $f14, $f4
/* D9218 80142B18 E60E0034 */  swc1      $f14, 0x34($s0)
/* D921C 80142B1C 4600138D */  trunc.w.s $f14, $f2
/* D9220 80142B20 E60E0038 */  swc1      $f14, 0x38($s0)
/* D9224 80142B24 3C0E2000 */  lui       $t6, (0x20000000 >> 16)
/* D9228 80142B28 004E1024 */  and       $v0, $v0, $t6
.L80142B2C:
/* D922C 80142B2C 10400012 */  beqz      $v0, .L80142B78
/* D9230 80142B30 0200202D */   daddu    $a0, $s0, $zero
/* D9234 80142B34 02C0282D */  daddu     $a1, $s6, $zero
/* D9238 80142B38 02A0302D */  daddu     $a2, $s5, $zero
/* D923C 80142B3C 00113C00 */  sll       $a3, $s1, 16
/* D9240 80142B40 00073C03 */  sra       $a3, $a3, 16
/* D9244 80142B44 00121400 */  sll       $v0, $s2, 16
/* D9248 80142B48 00021403 */  sra       $v0, $v0, 16
/* D924C 80142B4C AFA20010 */  sw        $v0, 0x10($sp)
/* D9250 80142B50 00131400 */  sll       $v0, $s3, 16
/* D9254 80142B54 00021403 */  sra       $v0, $v0, 16
/* D9258 80142B58 AFA20014 */  sw        $v0, 0x14($sp)
/* D925C 80142B5C 00141400 */  sll       $v0, $s4, 16
/* D9260 80142B60 00021403 */  sra       $v0, $v0, 16
/* D9264 80142B64 240E0001 */  addiu     $t6, $zero, 0x1
/* D9268 80142B68 AFA20018 */  sw        $v0, 0x18($sp)
/* D926C 80142B6C AFA0001C */  sw        $zero, 0x1C($sp)
/* D9270 80142B70 0C04FDC1 */  jal       hud_element_draw_rect
/* D9274 80142B74 AFAE0020 */   sw       $t6, 0x20($sp)
.L80142B78:
/* D9278 80142B78 0200202D */  daddu     $a0, $s0, $zero
/* D927C 80142B7C 02C0282D */  daddu     $a1, $s6, $zero
/* D9280 80142B80 02A0302D */  daddu     $a2, $s5, $zero
/* D9284 80142B84 00113C00 */  sll       $a3, $s1, 16
/* D9288 80142B88 00073C03 */  sra       $a3, $a3, 16
/* D928C 80142B8C 00121400 */  sll       $v0, $s2, 16
/* D9290 80142B90 00021403 */  sra       $v0, $v0, 16
/* D9294 80142B94 AFA20010 */  sw        $v0, 0x10($sp)
/* D9298 80142B98 00131400 */  sll       $v0, $s3, 16
/* D929C 80142B9C 00021403 */  sra       $v0, $v0, 16
/* D92A0 80142BA0 AFA20014 */  sw        $v0, 0x14($sp)
/* D92A4 80142BA4 00141400 */  sll       $v0, $s4, 16
/* D92A8 80142BA8 00021403 */  sra       $v0, $v0, 16
/* D92AC 80142BAC AFA20018 */  sw        $v0, 0x18($sp)
/* D92B0 80142BB0 AFA0001C */  sw        $zero, 0x1C($sp)
.L80142BB4:
/* D92B4 80142BB4 0C04FDC1 */  jal       hud_element_draw_rect
/* D92B8 80142BB8 AFA00020 */   sw       $zero, 0x20($sp)
/* D92BC 80142BBC 26F70001 */  addiu     $s7, $s7, 0x1
/* D92C0 80142BC0 02FE102A */  slt       $v0, $s7, $fp
/* D92C4 80142BC4 1440FF34 */  bnez      $v0, .L80142898
/* D92C8 80142BC8 00171080 */   sll      $v0, $s7, 2
.L80142BCC:
/* D92CC 80142BCC 8FBF054C */  lw        $ra, 0x54C($sp)
/* D92D0 80142BD0 8FBE0548 */  lw        $fp, 0x548($sp)
/* D92D4 80142BD4 8FB70544 */  lw        $s7, 0x544($sp)
/* D92D8 80142BD8 8FB60540 */  lw        $s6, 0x540($sp)
/* D92DC 80142BDC 8FB5053C */  lw        $s5, 0x53C($sp)
/* D92E0 80142BE0 8FB40538 */  lw        $s4, 0x538($sp)
/* D92E4 80142BE4 8FB30534 */  lw        $s3, 0x534($sp)
/* D92E8 80142BE8 8FB20530 */  lw        $s2, 0x530($sp)
/* D92EC 80142BEC 8FB1052C */  lw        $s1, 0x52C($sp)
/* D92F0 80142BF0 8FB00528 */  lw        $s0, 0x528($sp)
/* D92F4 80142BF4 03E00008 */  jr        $ra
/* D92F8 80142BF8 27BD0550 */   addiu    $sp, $sp, 0x550

### DECOMPILED C INSTRUCTIONS:

void render_hud_elements_frontUI(void) {
    s32 i, count, j;
    s32 sortedElements[ARRAY_COUNT(*gHudElements)];
    s32 el1, el2;
    s32 texSizeX, texSizeY;
    s32 drawSizeX, drawSizeY, offsetX, offsetY;
    HudElement* hudElement;

    gSPDisplayList(gMainGfxPos++, VIRTUAL_TO_PHYSICAL(gHudElementsDLFrontUI));

    count = 0;
    for (i = 0; i < ARRAY_COUNT(*gHudElements); i++) {
        hudElement = (*gHudElements)[i];
        if (hudElement != NULL) {
            s32 flags = hudElement->flags;
            if (flags && !(flags & HUD_ELEMENT_FLAG_DISABLED)) {
                if (!(flags & (HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_TRANSFORM | HUD_ELEMENT_FLAG_200000 | HUD_ELEMENT_FLAG_10000000))) {
                    if ((flags & HUD_ELEMENT_FLAG_FRONTUI) && hudElement->drawSizePreset >= 0) {
                        sortedElements[count++] = i;
                    }
                }
            }
        }
    }

    for (i = 0; i < count - 1; i++) {
        for (j = i + 1; j < count; j++) {
            el1 = sortedElements[i];
            el2 = sortedElements[j];
            if ((*gHudElements)[el1]->worldPosOffset.z < (*gHudElements)[el2]->worldPosOffset.z) {
                sortedElements[i] = el2;
                sortedElements[j] = el1;
            }
        }
    }

    for (i = 0; i < count; i++) {
        hudElement = (*gHudElements)[sortedElements[i]];
        if (!(hudElement->flags & HUD_ELEMENT_FLAG_FIXEDSCALE)) {
            if (!(hudElement->flags & HUD_ELEMENT_FLAG_CUSTOM_SIZE)) {
                texSizeX = gHudElementSizes[hudElement->tileSizePreset].width;
                texSizeY = gHudElementSizes[hudElement->tileSizePreset].height;
            } else {
                texSizeX = hudElement->customImageSize.x;
                texSizeY = hudElement->customImageSize.y;
            }

            if (!(hudElement->flags & HUD_ELEMENT_FLAG_SCALED)) {
                if (!(hudElement->flags & HUD_ELEMENT_FLAG_CUSTOM_SIZE)) {
                    drawSizeX = gHudElementSizes[hudElement->drawSizePreset].width;
                    drawSizeY = gHudElementSizes[hudElement->drawSizePreset].height;
                    offsetX = -drawSizeX / 2;
                    offsetY = -drawSizeY / 2;
                } else {
                    // TODO find better match
                    do {
                    drawSizeX = hudElement->customDrawSize.x;
                    drawSizeY = hudElement->customDrawSize.y;
                    offsetX = -drawSizeX / 2;
                    } while (0);
                    offsetY = -drawSizeY / 2;

                }
            } else {
                drawSizeX = hudElement->sizeX;
                drawSizeY = hudElement->sizeY;
                offsetX = -drawSizeX / 2;
                offsetY = -drawSizeY / 2;
            }

            if (!(hudElement->flags & HUD_ELEMENT_FLAG_REPEATED)) {
                if (hudElement->flags & HUD_ELEMENT_FLAG_DROP_SHADOW) {
                    hud_element_draw_rect(hudElement, texSizeX, texSizeY, drawSizeX, drawSizeY, offsetX, offsetY, TRUE, TRUE);
                }
                hud_element_draw_rect(hudElement, texSizeX, texSizeY, drawSizeX, drawSizeY, offsetX, offsetY, TRUE, FALSE);
            } else {
                if (hudElement->flags & HUD_ELEMENT_FLAG_DROP_SHADOW) {
                    hud_element_draw_rect(hudElement, texSizeX, texSizeY, drawSizeX, drawSizeY, offsetX, offsetY, FALSE, TRUE);
                }
                hud_element_draw_rect(hudElement, texSizeX, texSizeY, drawSizeX, drawSizeY, offsetX, offsetY, FALSE, FALSE);
            }
        } else {
            f32 xScaled, yScaled;

            if (!(hudElement->flags & HUD_ELEMENT_FLAG_CUSTOM_SIZE)) {
                texSizeX = gHudElementSizes[hudElement->drawSizePreset].width;
                texSizeY = gHudElementSizes[hudElement->drawSizePreset].height;
            } else {
                texSizeX = hudElement->customImageSize.x;
                texSizeY = hudElement->customImageSize.y;
            }

            drawSizeX = hudElement->unkImgScale[0];
            drawSizeY = hudElement->unkImgScale[1];

            offsetX = -hudElement->unkImgScale[0] / 2;
            offsetY = -hudElement->unkImgScale[1] / 2;

            xScaled = (f32) drawSizeX / (f32) texSizeX;
            yScaled = (f32) drawSizeY / (f32) texSizeY;

            xScaled = 1.0f / xScaled;
            yScaled = 1.0f / yScaled;

            hudElement->widthScale = X10(xScaled);
            hudElement->heightScale = X10(yScaled);

            if (hudElement->flags & HUD_ELEMENT_FLAG_DROP_SHADOW) {
                hud_element_draw_rect(hudElement, texSizeX, texSizeY, drawSizeX, drawSizeY, offsetX, offsetY, FALSE, TRUE);
            }
            hud_element_draw_rect(hudElement, texSizeX, texSizeY, drawSizeX, drawSizeY, offsetX, offsetY, FALSE, FALSE);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_HeartBlockContent__anim_heal
/* 106684 802E4E04 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 106688 802E4E08 AFB1001C */  sw        $s1, 0x1C($sp)
/* 10668C 802E4E0C 0080882D */  daddu     $s1, $a0, $zero
/* 106690 802E4E10 AFBF0024 */  sw        $ra, 0x24($sp)
/* 106694 802E4E14 AFB20020 */  sw        $s2, 0x20($sp)
/* 106698 802E4E18 AFB00018 */  sw        $s0, 0x18($sp)
/* 10669C 802E4E1C F7B60030 */  sdc1      $f22, 0x30($sp)
/* 1066A0 802E4E20 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 1066A4 802E4E24 8E300040 */  lw        $s0, 0x40($s1)
/* 1066A8 802E4E28 92030001 */  lbu       $v1, 0x1($s0)
/* 1066AC 802E4E2C 3C128011 */  lui       $s2, %hi(gPlayerStatus)
/* 1066B0 802E4E30 2652EFC8 */  addiu     $s2, $s2, %lo(gPlayerStatus)
/* 1066B4 802E4E34 2C620006 */  sltiu     $v0, $v1, 0x6
/* 1066B8 802E4E38 1040012B */  beqz      $v0, .L802E52E8
/* 1066BC 802E4E3C 00031080 */   sll      $v0, $v1, 2
/* 1066C0 802E4E40 3C01802F */  lui       $at, %hi(jtbl_802EB278)
/* 1066C4 802E4E44 00220821 */  addu      $at, $at, $v0
/* 1066C8 802E4E48 8C22B278 */  lw        $v0, %lo(jtbl_802EB278)($at)
/* 1066CC 802E4E4C 00400008 */  jr        $v0
/* 1066D0 802E4E50 00000000 */   nop
glabel .L802E4E54
/* 1066D4 802E4E54 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 1066D8 802E4E58 44810000 */  mtc1      $at, $f0
/* 1066DC 802E4E5C 00000000 */  nop
/* 1066E0 802E4E60 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1066E4 802E4E64 8E250048 */  lw        $a1, 0x48($s1)
/* 1066E8 802E4E68 8E26004C */  lw        $a2, 0x4C($s1)
/* 1066EC 802E4E6C 8E270050 */  lw        $a3, 0x50($s1)
/* 1066F0 802E4E70 0C01BFBC */  jal       fx_sparkles
/* 1066F4 802E4E74 0000202D */   daddu    $a0, $zero, $zero
/* 1066F8 802E4E78 92020001 */  lbu       $v0, 0x1($s0)
/* 1066FC 802E4E7C 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
/* 106700 802E4E80 44810000 */  mtc1      $at, $f0
/* 106704 802E4E84 AE000020 */  sw        $zero, 0x20($s0)
/* 106708 802E4E88 24420001 */  addiu     $v0, $v0, 0x1
/* 10670C 802E4E8C A2020001 */  sb        $v0, 0x1($s0)
/* 106710 802E4E90 080B94BA */  j         .L802E52E8
/* 106714 802E4E94 E6000014 */   swc1     $f0, 0x14($s0)
glabel .L802E4E98
/* 106718 802E4E98 C620004C */  lwc1      $f0, 0x4C($s1)
/* 10671C 802E4E9C C6020014 */  lwc1      $f2, 0x14($s0)
/* 106720 802E4EA0 46020000 */  add.s     $f0, $f0, $f2
/* 106724 802E4EA4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 106728 802E4EA8 44811000 */  mtc1      $at, $f2
/* 10672C 802E4EAC E620004C */  swc1      $f0, 0x4C($s1)
/* 106730 802E4EB0 C6000014 */  lwc1      $f0, 0x14($s0)
/* 106734 802E4EB4 46020001 */  sub.s     $f0, $f0, $f2
/* 106738 802E4EB8 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 10673C 802E4EBC 44811000 */  mtc1      $at, $f2
/* 106740 802E4EC0 00000000 */  nop
/* 106744 802E4EC4 4602003E */  c.le.s    $f0, $f2
/* 106748 802E4EC8 00000000 */  nop
/* 10674C 802E4ECC 45000106 */  bc1f      .L802E52E8
/* 106750 802E4ED0 E6000014 */   swc1     $f0, 0x14($s0)
/* 106754 802E4ED4 0220202D */  daddu     $a0, $s1, $zero
/* 106758 802E4ED8 3C05802F */  lui       $a1, %hi(D_802EA744)
/* 10675C 802E4EDC 24A5A744 */  addiu     $a1, $a1, %lo(D_802EA744)
/* 106760 802E4EE0 92020001 */  lbu       $v0, 0x1($s0)
/* 106764 802E4EE4 2403DFFF */  addiu     $v1, $zero, -0x2001
/* 106768 802E4EE8 24420001 */  addiu     $v0, $v0, 0x1
/* 10676C 802E4EEC A2020001 */  sb        $v0, 0x1($s0)
/* 106770 802E4EF0 8E220000 */  lw        $v0, 0x0($s1)
/* 106774 802E4EF4 3C01C120 */  lui       $at, (0xC1200000 >> 16)
/* 106778 802E4EF8 44810000 */  mtc1      $at, $f0
/* 10677C 802E4EFC 00431024 */  and       $v0, $v0, $v1
/* 106780 802E4F00 AE220000 */  sw        $v0, 0x0($s1)
/* 106784 802E4F04 0C0442F3 */  jal       entity_set_render_script
/* 106788 802E4F08 E6000054 */   swc1     $f0, 0x54($s0)
/* 10678C 802E4F0C 3C02802E */  lui       $v0, %hi(entity_HeartBlockContent_setupGfx)
/* 106790 802E4F10 24424AEC */  addiu     $v0, $v0, %lo(entity_HeartBlockContent_setupGfx)
/* 106794 802E4F14 080B94BA */  j         .L802E52E8
/* 106798 802E4F18 AE22003C */   sw       $v0, 0x3C($s1)
glabel .L802E4F1C
/* 10679C 802E4F1C C60C0020 */  lwc1      $f12, 0x20($s0)
/* 1067A0 802E4F20 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1067A4 802E4F24 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1067A8 802E4F28 44810000 */  mtc1      $at, $f0
/* 1067AC 802E4F2C 00000000 */  nop
/* 1067B0 802E4F30 46006302 */  mul.s     $f12, $f12, $f0
/* 1067B4 802E4F34 00000000 */  nop
/* 1067B8 802E4F38 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1067BC 802E4F3C 4481A000 */  mtc1      $at, $f20
/* 1067C0 802E4F40 0C00A85B */  jal       sin_rad
/* 1067C4 802E4F44 46146303 */   div.s    $f12, $f12, $f20
/* 1067C8 802E4F48 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 1067CC 802E4F4C 44811000 */  mtc1      $at, $f2
/* 1067D0 802E4F50 00000000 */  nop
/* 1067D4 802E4F54 46020002 */  mul.s     $f0, $f0, $f2
/* 1067D8 802E4F58 00000000 */  nop
/* 1067DC 802E4F5C C622004C */  lwc1      $f2, 0x4C($s1)
/* 1067E0 802E4F60 46001080 */  add.s     $f2, $f2, $f0
/* 1067E4 802E4F64 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 1067E8 802E4F68 44810000 */  mtc1      $at, $f0
/* 1067EC 802E4F6C E622004C */  swc1      $f2, 0x4C($s1)
/* 1067F0 802E4F70 C6020020 */  lwc1      $f2, 0x20($s0)
/* 1067F4 802E4F74 46001001 */  sub.s     $f0, $f2, $f0
/* 1067F8 802E4F78 44802000 */  mtc1      $zero, $f4
/* 1067FC 802E4F7C 00000000 */  nop
/* 106800 802E4F80 4604003C */  c.lt.s    $f0, $f4
/* 106804 802E4F84 00000000 */  nop
/* 106808 802E4F88 45000003 */  bc1f      .L802E4F98
/* 10680C 802E4F8C E6000020 */   swc1     $f0, 0x20($s0)
/* 106810 802E4F90 46140000 */  add.s     $f0, $f0, $f20
/* 106814 802E4F94 E6000020 */  swc1      $f0, 0x20($s0)
.L802E4F98:
/* 106818 802E4F98 C6200064 */  lwc1      $f0, 0x64($s1)
/* 10681C 802E4F9C C6020054 */  lwc1      $f2, 0x54($s0)
/* 106820 802E4FA0 46020000 */  add.s     $f0, $f0, $f2
/* 106824 802E4FA4 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 106828 802E4FA8 44811000 */  mtc1      $at, $f2
/* 10682C 802E4FAC E6200064 */  swc1      $f0, 0x64($s1)
/* 106830 802E4FB0 C6000054 */  lwc1      $f0, 0x54($s0)
/* 106834 802E4FB4 46020000 */  add.s     $f0, $f0, $f2
/* 106838 802E4FB8 4600203E */  c.le.s    $f4, $f0
/* 10683C 802E4FBC 00000000 */  nop
/* 106840 802E4FC0 450000AC */  bc1f      .L802E5274
/* 106844 802E4FC4 E6000054 */   swc1     $f0, 0x54($s0)
/* 106848 802E4FC8 92020001 */  lbu       $v0, 0x1($s0)
/* 10684C 802E4FCC E6040018 */  swc1      $f4, 0x18($s0)
/* 106850 802E4FD0 E604001C */  swc1      $f4, 0x1C($s0)
/* 106854 802E4FD4 24420001 */  addiu     $v0, $v0, 0x1
/* 106858 802E4FD8 A2020001 */  sb        $v0, 0x1($s0)
/* 10685C 802E4FDC 864200B0 */  lh        $v0, 0xB0($s2)
/* 106860 802E4FE0 2404FFFF */  addiu     $a0, $zero, -0x1
/* 106864 802E4FE4 A2000003 */  sb        $zero, 0x3($s0)
/* 106868 802E4FE8 24420005 */  addiu     $v0, $v0, 0x5
/* 10686C 802E4FEC 44820000 */  mtc1      $v0, $f0
/* 106870 802E4FF0 00000000 */  nop
/* 106874 802E4FF4 46800020 */  cvt.s.w   $f0, $f0
/* 106878 802E4FF8 0C03A8B3 */  jal       recover_hp
/* 10687C 802E4FFC E6000004 */   swc1     $f0, 0x4($s0)
/* 106880 802E5000 0C03A899 */  jal       recover_fp
/* 106884 802E5004 2404FFFF */   addiu    $a0, $zero, -0x1
/* 106888 802E5008 0C05272D */  jal       sfx_play_sound
/* 10688C 802E500C 24040131 */   addiu    $a0, $zero, 0x131
/* 106890 802E5010 080B949D */  j         .L802E5274
/* 106894 802E5014 00000000 */   nop
glabel .L802E5018
/* 106898 802E5018 C600001C */  lwc1      $f0, 0x1C($s0)
/* 10689C 802E501C 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 1068A0 802E5020 44811800 */  mtc1      $at, $f3
/* 1068A4 802E5024 44801000 */  mtc1      $zero, $f2
/* 1068A8 802E5028 46000021 */  cvt.d.s   $f0, $f0
/* 1068AC 802E502C 46220000 */  add.d     $f0, $f0, $f2
/* 1068B0 802E5030 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 1068B4 802E5034 44811000 */  mtc1      $at, $f2
/* 1068B8 802E5038 46200020 */  cvt.s.d   $f0, $f0
/* 1068BC 802E503C 4600103E */  c.le.s    $f2, $f0
/* 1068C0 802E5040 00000000 */  nop
/* 1068C4 802E5044 45000002 */  bc1f      .L802E5050
/* 1068C8 802E5048 E600001C */   swc1     $f0, 0x1C($s0)
/* 1068CC 802E504C E602001C */  swc1      $f2, 0x1C($s0)
.L802E5050:
/* 1068D0 802E5050 C6020018 */  lwc1      $f2, 0x18($s0)
/* 1068D4 802E5054 3C014190 */  lui       $at, (0x41900000 >> 16)
/* 1068D8 802E5058 44810000 */  mtc1      $at, $f0
/* 1068DC 802E505C 00000000 */  nop
/* 1068E0 802E5060 46001000 */  add.s     $f0, $f2, $f0
/* 1068E4 802E5064 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1068E8 802E5068 4481B000 */  mtc1      $at, $f22
/* 1068EC 802E506C 00000000 */  nop
/* 1068F0 802E5070 4600B03E */  c.le.s    $f22, $f0
/* 1068F4 802E5074 00000000 */  nop
/* 1068F8 802E5078 45000003 */  bc1f      .L802E5088
/* 1068FC 802E507C E6000018 */   swc1     $f0, 0x18($s0)
/* 106900 802E5080 46160001 */  sub.s     $f0, $f0, $f22
/* 106904 802E5084 E6000018 */  swc1      $f0, 0x18($s0)
.L802E5088:
/* 106908 802E5088 C60C0018 */  lwc1      $f12, 0x18($s0)
/* 10690C 802E508C 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 106910 802E5090 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 106914 802E5094 4481A000 */  mtc1      $at, $f20
/* 106918 802E5098 00000000 */  nop
/* 10691C 802E509C 46146302 */  mul.s     $f12, $f12, $f20
/* 106920 802E50A0 00000000 */  nop
/* 106924 802E50A4 0C00A85B */  jal       sin_rad
/* 106928 802E50A8 46166303 */   div.s    $f12, $f12, $f22
/* 10692C 802E50AC C60C0018 */  lwc1      $f12, 0x18($s0)
/* 106930 802E50B0 46146302 */  mul.s     $f12, $f12, $f20
/* 106934 802E50B4 00000000 */  nop
/* 106938 802E50B8 C602001C */  lwc1      $f2, 0x1C($s0)
/* 10693C 802E50BC 46001502 */  mul.s     $f20, $f2, $f0
/* 106940 802E50C0 00000000 */  nop
/* 106944 802E50C4 0C00A874 */  jal       cos_rad
/* 106948 802E50C8 46166303 */   div.s    $f12, $f12, $f22
/* 10694C 802E50CC C6060004 */  lwc1      $f6, 0x4($s0)
/* 106950 802E50D0 3C01802F */  lui       $at, %hi(D_802EB290)
/* 106954 802E50D4 D424B290 */  ldc1      $f4, %lo(D_802EB290)($at)
/* 106958 802E50D8 92030003 */  lbu       $v1, 0x3($s0)
/* 10695C 802E50DC 460030A1 */  cvt.d.s   $f2, $f6
/* 106960 802E50E0 46241081 */  sub.d     $f2, $f2, $f4
/* 106964 802E50E4 24620001 */  addiu     $v0, $v1, 0x1
/* 106968 802E50E8 462010A0 */  cvt.s.d   $f2, $f2
/* 10696C 802E50EC E6020004 */  swc1      $f2, 0x4($s0)
/* 106970 802E50F0 C602001C */  lwc1      $f2, 0x1C($s0)
/* 106974 802E50F4 30630001 */  andi      $v1, $v1, 0x1
/* 106978 802E50F8 46001082 */  mul.s     $f2, $f2, $f0
/* 10697C 802E50FC 00000000 */  nop
/* 106980 802E5100 1060000F */  beqz      $v1, .L802E5140
/* 106984 802E5104 A2020003 */   sb       $v0, 0x3($s0)
/* 106988 802E5108 C6400028 */  lwc1      $f0, 0x28($s2)
/* 10698C 802E510C 46140000 */  add.s     $f0, $f0, $f20
/* 106990 802E5110 44050000 */  mfc1      $a1, $f0
/* 106994 802E5114 C640002C */  lwc1      $f0, 0x2C($s2)
/* 106998 802E5118 46060000 */  add.s     $f0, $f0, $f6
/* 10699C 802E511C 44060000 */  mfc1      $a2, $f0
/* 1069A0 802E5120 C6400030 */  lwc1      $f0, 0x30($s2)
/* 1069A4 802E5124 46020001 */  sub.s     $f0, $f0, $f2
/* 1069A8 802E5128 44070000 */  mfc1      $a3, $f0
/* 1069AC 802E512C 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 1069B0 802E5130 44810000 */  mtc1      $at, $f0
/* 1069B4 802E5134 24040003 */  addiu     $a0, $zero, 0x3
/* 1069B8 802E5138 0C01BFBC */  jal       fx_sparkles
/* 1069BC 802E513C E7A00010 */   swc1     $f0, 0x10($sp)
.L802E5140:
/* 1069C0 802E5140 C6000004 */  lwc1      $f0, 0x4($s0)
/* 1069C4 802E5144 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
/* 1069C8 802E5148 44811000 */  mtc1      $at, $f2
/* 1069CC 802E514C 00000000 */  nop
/* 1069D0 802E5150 4602003C */  c.lt.s    $f0, $f2
/* 1069D4 802E5154 00000000 */  nop
/* 1069D8 802E5158 45000005 */  bc1f      .L802E5170
/* 1069DC 802E515C 00000000 */   nop
/* 1069E0 802E5160 92020001 */  lbu       $v0, 0x1($s0)
/* 1069E4 802E5164 E6020004 */  swc1      $f2, 0x4($s0)
/* 1069E8 802E5168 24420001 */  addiu     $v0, $v0, 0x1
/* 1069EC 802E516C A2020001 */  sb        $v0, 0x1($s0)
glabel .L802E5170
/* 1069F0 802E5170 C60C0020 */  lwc1      $f12, 0x20($s0)
/* 1069F4 802E5174 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1069F8 802E5178 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1069FC 802E517C 44810000 */  mtc1      $at, $f0
/* 106A00 802E5180 00000000 */  nop
/* 106A04 802E5184 46006302 */  mul.s     $f12, $f12, $f0
/* 106A08 802E5188 00000000 */  nop
/* 106A0C 802E518C 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 106A10 802E5190 4481A000 */  mtc1      $at, $f20
/* 106A14 802E5194 0C00A85B */  jal       sin_rad
/* 106A18 802E5198 46146303 */   div.s    $f12, $f12, $f20
/* 106A1C 802E519C 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 106A20 802E51A0 44811000 */  mtc1      $at, $f2
/* 106A24 802E51A4 00000000 */  nop
/* 106A28 802E51A8 46020002 */  mul.s     $f0, $f0, $f2
/* 106A2C 802E51AC 00000000 */  nop
/* 106A30 802E51B0 C622004C */  lwc1      $f2, 0x4C($s1)
/* 106A34 802E51B4 46001080 */  add.s     $f2, $f2, $f0
/* 106A38 802E51B8 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 106A3C 802E51BC 44812000 */  mtc1      $at, $f4
/* 106A40 802E51C0 E622004C */  swc1      $f2, 0x4C($s1)
/* 106A44 802E51C4 C6000020 */  lwc1      $f0, 0x20($s0)
/* 106A48 802E51C8 46040081 */  sub.s     $f2, $f0, $f4
/* 106A4C 802E51CC 44800000 */  mtc1      $zero, $f0
/* 106A50 802E51D0 00000000 */  nop
/* 106A54 802E51D4 4600103C */  c.lt.s    $f2, $f0
/* 106A58 802E51D8 00000000 */  nop
/* 106A5C 802E51DC 45000003 */  bc1f      .L802E51EC
/* 106A60 802E51E0 E6020020 */   swc1     $f2, 0x20($s0)
/* 106A64 802E51E4 46141000 */  add.s     $f0, $f2, $f20
/* 106A68 802E51E8 E6000020 */  swc1      $f0, 0x20($s0)
.L802E51EC:
/* 106A6C 802E51EC C6000054 */  lwc1      $f0, 0x54($s0)
/* 106A70 802E51F0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 106A74 802E51F4 44811800 */  mtc1      $at, $f3
/* 106A78 802E51F8 44801000 */  mtc1      $zero, $f2
/* 106A7C 802E51FC 46000021 */  cvt.d.s   $f0, $f0
/* 106A80 802E5200 46220000 */  add.d     $f0, $f0, $f2
/* 106A84 802E5204 46200020 */  cvt.s.d   $f0, $f0
/* 106A88 802E5208 4600203C */  c.lt.s    $f4, $f0
/* 106A8C 802E520C 00000000 */  nop
/* 106A90 802E5210 45000002 */  bc1f      .L802E521C
/* 106A94 802E5214 E6000054 */   swc1     $f0, 0x54($s0)
/* 106A98 802E5218 E6040054 */  swc1      $f4, 0x54($s0)
.L802E521C:
/* 106A9C 802E521C C6220064 */  lwc1      $f2, 0x64($s1)
/* 106AA0 802E5220 C6000054 */  lwc1      $f0, 0x54($s0)
/* 106AA4 802E5224 46001000 */  add.s     $f0, $f2, $f0
/* 106AA8 802E5228 4600A03E */  c.le.s    $f20, $f0
/* 106AAC 802E522C 00000000 */  nop
/* 106AB0 802E5230 45000003 */  bc1f      .L802E5240
/* 106AB4 802E5234 E6200064 */   swc1     $f0, 0x64($s1)
/* 106AB8 802E5238 46140001 */  sub.s     $f0, $f0, $f20
/* 106ABC 802E523C E6200064 */  swc1      $f0, 0x64($s1)
.L802E5240:
/* 106AC0 802E5240 9222000B */  lbu       $v0, 0xB($s1)
/* 106AC4 802E5244 2442FFFB */  addiu     $v0, $v0, -0x5
/* 106AC8 802E5248 A222000B */  sb        $v0, 0xB($s1)
/* 106ACC 802E524C 304200FF */  andi      $v0, $v0, 0xFF
/* 106AD0 802E5250 2C420007 */  sltiu     $v0, $v0, 0x7
/* 106AD4 802E5254 10400007 */  beqz      $v0, .L802E5274
/* 106AD8 802E5258 24020005 */   addiu    $v0, $zero, 0x5
/* 106ADC 802E525C A222000B */  sb        $v0, 0xB($s1)
/* 106AE0 802E5260 92030001 */  lbu       $v1, 0x1($s0)
/* 106AE4 802E5264 24020004 */  addiu     $v0, $zero, 0x4
/* 106AE8 802E5268 14620002 */  bne       $v1, $v0, .L802E5274
/* 106AEC 802E526C 24620001 */   addiu    $v0, $v1, 0x1
/* 106AF0 802E5270 A2020001 */  sb        $v0, 0x1($s0)
.L802E5274:
/* 106AF4 802E5274 96020024 */  lhu       $v0, 0x24($s0)
/* 106AF8 802E5278 C6200064 */  lwc1      $f0, 0x64($s1)
/* 106AFC 802E527C 00021080 */  sll       $v0, $v0, 2
/* 106B00 802E5280 02021021 */  addu      $v0, $s0, $v0
/* 106B04 802E5284 E4400028 */  swc1      $f0, 0x28($v0)
/* 106B08 802E5288 96020024 */  lhu       $v0, 0x24($s0)
/* 106B0C 802E528C 24420001 */  addiu     $v0, $v0, 0x1
/* 106B10 802E5290 A6020024 */  sh        $v0, 0x24($s0)
/* 106B14 802E5294 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 106B18 802E5298 2C42000B */  sltiu     $v0, $v0, 0xB
/* 106B1C 802E529C 50400012 */  beql      $v0, $zero, .L802E52E8
/* 106B20 802E52A0 A6000024 */   sh       $zero, 0x24($s0)
/* 106B24 802E52A4 080B94BA */  j         .L802E52E8
/* 106B28 802E52A8 00000000 */   nop
glabel .L802E52AC
/* 106B2C 802E52AC 8E420004 */  lw        $v0, 0x4($s2)
/* 106B30 802E52B0 2403FDFF */  addiu     $v1, $zero, -0x201
/* 106B34 802E52B4 00431024 */  and       $v0, $v0, $v1
/* 106B38 802E52B8 0C038069 */  jal       enable_player_input
/* 106B3C 802E52BC AE420004 */   sw       $v0, 0x4($s2)
/* 106B40 802E52C0 0C009C22 */  jal       set_time_freeze_mode
/* 106B44 802E52C4 0000202D */   daddu    $a0, $zero, $zero
/* 106B48 802E52C8 0220202D */  daddu     $a0, $s1, $zero
/* 106B4C 802E52CC 3C05800A */  lui       $a1, %hi(gOverrideFlags)
/* 106B50 802E52D0 24A5A650 */  addiu     $a1, $a1, %lo(gOverrideFlags)
/* 106B54 802E52D4 8CA20000 */  lw        $v0, 0x0($a1)
/* 106B58 802E52D8 2403FFBF */  addiu     $v1, $zero, -0x41
/* 106B5C 802E52DC 00431024 */  and       $v0, $v0, $v1
/* 106B60 802E52E0 0C043F5A */  jal       exec_entity_commandlist
/* 106B64 802E52E4 ACA20000 */   sw       $v0, 0x0($a1)
.L802E52E8:
/* 106B68 802E52E8 8FBF0024 */  lw        $ra, 0x24($sp)
/* 106B6C 802E52EC 8FB20020 */  lw        $s2, 0x20($sp)
/* 106B70 802E52F0 8FB1001C */  lw        $s1, 0x1C($sp)
/* 106B74 802E52F4 8FB00018 */  lw        $s0, 0x18($sp)
/* 106B78 802E52F8 D7B60030 */  ldc1      $f22, 0x30($sp)
/* 106B7C 802E52FC D7B40028 */  ldc1      $f20, 0x28($sp)
/* 106B80 802E5300 03E00008 */  jr        $ra
/* 106B84 802E5304 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    HeartBlockContentData* data = entity->dataBuf.heartBlockContent;
    f32 offsetX, offsetY, offsetZ;

    switch (data->state) {
        case 0:
            fx_sparkles(FX_SPARKLES_0, entity->position.x, entity->position.y, entity->position.z, 2.0f);
            data->bouncePhase = 0.0f;
            data->state++;
            data->riseVelocity = 6.0f;
            break;
        case 1:
            entity->position.y = entity->position.y + data->riseVelocity;
            data->riseVelocity -= 1.0f;
            if (data->riseVelocity <= 2.0f) {
                data->state++;
                entity->flags &= ~ENTITY_FLAG_ALWAYS_FACE_CAMERA;
                data->rotationRate = -10.0f;
                entity_set_render_script(entity, &Entity_HeartBlockContent_RenderScriptHit);
                entity->renderSetupFunc = entity_HeartBlockContent_setupGfx;
            }
            break;
        case 2:
            entity->position.y += sin_rad(DEG_TO_RAD(data->bouncePhase)) * 0.5f;
            data->bouncePhase -= 30.0f;
            if (data->bouncePhase < 0.0f) {
                data->bouncePhase += 360.0f;
            }
            entity->rotation.y += data->rotationRate;
            data->rotationRate += 2.0f;
            if (data->rotationRate >= 0.0f) {
                data->sparkleTrailAngle = 0.0f;
                data->sparkleTrailRadius = 0.0f;
                data->state++;
                data->sparkleTrailPosY = playerStatus->colliderHeight + 5;
                data->sparkleTrailTimer = 0;
                recover_hp(-1);
                recover_fp(-1);
                sfx_play_sound(SOUND_131);
            }
            data->yawBuffer[data->yawBufferPos] = entity->rotation.y;
            data->yawBufferPos++;
            if (data->yawBufferPos > ARRAY_COUNT(data->yawBuffer)) {
                data->yawBufferPos = 0;
            }
            break;
        case 3:
            data->sparkleTrailRadius += 2.0;
            if (data->sparkleTrailRadius >= 10.0f) {
                data->sparkleTrailRadius = 10.0f;
            }
            data->sparkleTrailAngle += 18.0f;
            if (data->sparkleTrailAngle >= 360.0f) {
                data->sparkleTrailAngle -= 360.0f;
            }
            offsetX = data->sparkleTrailRadius * sin_rad(DEG_TO_RAD(data->sparkleTrailAngle));
            offsetZ = data->sparkleTrailRadius * cos_rad(DEG_TO_RAD(data->sparkleTrailAngle));
            offsetY = data->sparkleTrailPosY;

            data->sparkleTrailPosY -= 0.7;

            if ((data->sparkleTrailTimer++ & 1) != 0) {
                fx_sparkles(FX_SPARKLES_3, playerStatus->position.x + offsetX,
                        playerStatus->position.y + offsetY,
                        playerStatus->position.z - offsetZ,
                        8.0f
                );
            }
            if (data->sparkleTrailPosY < 20.0f) {
                data->sparkleTrailPosY = 20.0f;
                data->state++;
            }
            // fallthrough
        case 4:
            entity->position.y += sin_rad(DEG_TO_RAD(data->bouncePhase)) * 0.5f;
            data->bouncePhase -= 30.0f;
            if (data->bouncePhase < 0.0f) {
                data->bouncePhase += 360.0f;
            }
            data->rotationRate += 1.0;
            if (data->rotationRate > 30.0f) {
                data->rotationRate = 30.0f;
            }
            entity->rotation.y += data->rotationRate;
            if (entity->rotation.y >= 360.0f) {
                entity->rotation.y -= 360.0f;
            }
            entity->alpha -= 5;
            if (entity->alpha < 7) {
                entity->alpha = 5;
                if (data->state == 4) {
                    data->state++;
                }
            }
            data->yawBuffer[data->yawBufferPos] = entity->rotation.y;
            data->yawBufferPos++;
            if (data->yawBufferPos > ARRAY_COUNT(data->yawBuffer)) {
                data->yawBufferPos = 0;
            }
            break;
        case 5:
            playerStatus->animFlags &= ~PA_FLAG_RAISED_ARMS;
            enable_player_input();
            set_time_freeze_mode(TIME_FREEZE_NORMAL);
            gOverrideFlags &= ~GLOBAL_OVERRIDES_40;
            exec_entity_commandlist(entity);
            break;
    }
}