### RAW ASSEMBLY INSTRUCTIONS:

glabel func_802403BC
/* 16EC9C 802403BC 27BDFF70 */  addiu     $sp, $sp, -0x90
glabel func_802403C0
/* 16ECA0 802403C0 3C0B800E */  lui       $t3, %hi(gBattleStatus)
glabel func_802403C4
/* 16ECA4 802403C4 256BC070 */  addiu     $t3, $t3, %lo(gBattleStatus)
glabel func_802403C8
/* 16ECA8 802403C8 AFBF007C */  sw        $ra, 0x7C($sp)
glabel func_802403CC
/* 16ECAC 802403CC AFBE0078 */  sw        $fp, 0x78($sp)
glabel func_802403D0
/* 16ECB0 802403D0 AFB70074 */  sw        $s7, 0x74($sp)
glabel func_802403D4_EE6984
/* 16ECB4 802403D4 AFB60070 */  sw        $s6, 0x70($sp)
glabel func_802403D8
/* 16ECB8 802403D8 AFB5006C */  sw        $s5, 0x6C($sp)
glabel func_802403DC
/* 16ECBC 802403DC AFB40068 */  sw        $s4, 0x68($sp)
glabel func_802403E0
/* 16ECC0 802403E0 AFB30064 */  sw        $s3, 0x64($sp)
glabel func_802403E4
/* 16ECC4 802403E4 AFB20060 */  sw        $s2, 0x60($sp)
.L802403E8:
/* 16ECC8 802403E8 AFB1005C */  sw        $s1, 0x5C($sp)
glabel func_802403EC
/* 16ECCC 802403EC AFB00058 */  sw        $s0, 0x58($sp)
glabel dead_flo_12_AddPlayerHandsOffset
/* 16ECD0 802403F0 F7B60088 */  sdc1      $f22, 0x88($sp)
glabel func_802403F4
/* 16ECD4 802403F4 F7B40080 */  sdc1      $f20, 0x80($sp)
glabel func_802403F8
/* 16ECD8 802403F8 8D620000 */  lw        $v0, 0x0($t3)
glabel mgm_01_DisableMenus
/* 16ECDC 802403FC 30420001 */  andi      $v0, $v0, 0x1
glabel func_80240400
/* 16ECE0 80240400 1040016E */  beqz      $v0, D_802409BC
glabel func_80240404
/* 16ECE4 80240404 00000000 */   nop
glabel func_80240408
/* 16ECE8 80240408 8D620004 */  lw        $v0, 0x4($t3)
glabel func_8024040C
/* 16ECEC 8024040C 30420001 */  andi      $v0, $v0, 0x1
glabel dead_flo_03_foliage_setup_shear_mtx
/* 16ECF0 80240410 1440001D */  bnez      $v0, D_80240488
glabel func_80240414
/* 16ECF4 80240414 240500CA */   addiu    $a1, $zero, 0xCA
arn_12_pad_418:
/* 16ECF8 80240418 3C036666 */  lui       $v1, (0x66666667 >> 16)
glabel dead_flo_08_SuperBlock_SwitchToPartner
/* 16ECFC 8024041C 34636667 */  ori       $v1, $v1, (0x66666667 & 0xFFFF)
glabel func_80240420
/* 16ED00 80240420 91650078 */  lbu       $a1, 0x78($t3)
arn_10_pad_424:
/* 16ED04 80240424 24020124 */  addiu     $v0, $zero, 0x124
glabel dead_03_GetNpcCollisionHeight
/* 16ED08 80240428 3C01802A */  lui       $at, %hi(D_8029DA40)
glabel func_8024042C_EE69DC
/* 16ED0C 8024042C AC22DA40 */  sw        $v0, %lo(D_8029DA40)($at)
glabel mgm_02_worker_draw_score
/* 16ED10 80240430 240200C4 */  addiu     $v0, $zero, 0xC4
glabel func_80240434
/* 16ED14 80240434 00052E00 */  sll       $a1, $a1, 24
glabel mgm_01_EnableMenus
/* 16ED18 80240438 00052603 */  sra       $a0, $a1, 24
glabel func_8024043C
/* 16ED1C 8024043C 00830018 */  mult      $a0, $v1
glabel dead_flo_00_PatrolAI_LoiterInit
/* 16ED20 80240440 3C01802A */  lui       $at, %hi(D_8029DA44)
glabel func_80240444
/* 16ED24 80240444 AC22DA44 */  sw        $v0, %lo(D_8029DA44)($at)
glabel dead_flo_08_SuperBlock_LoadCurrentPartnerName
/* 16ED28 80240448 24020006 */  addiu     $v0, $zero, 0x6
glabel func_8024044C
/* 16ED2C 8024044C 3C01802A */  lui       $at, %hi(D_8029DA48)
glabel func_80240450
/* 16ED30 80240450 AC22DA48 */  sw        $v0, %lo(D_8029DA48)($at)
glabel func_80240454
/* 16ED34 80240454 00052FC3 */  sra       $a1, $a1, 31
glabel omo_13_ShyGuyWanderAI_17
/* 16ED38 80240458 00006010 */  mfhi      $t4
glabel func_8024045C
/* 16ED3C 8024045C 000C1883 */  sra       $v1, $t4, 2
glabel func_80240460
/* 16ED40 80240460 00651823 */  subu      $v1, $v1, $a1
D_80240464:
/* 16ED44 80240464 00031080 */  sll       $v0, $v1, 2
glabel func_80240468
/* 16ED48 80240468 00431021 */  addu      $v0, $v0, $v1
glabel func_8024046C_EE6A1C
/* 16ED4C 8024046C 00021040 */  sll       $v0, $v0, 1
D_80240470:
/* 16ED50 80240470 00822023 */  subu      $a0, $a0, $v0
D_80240474:
/* 16ED54 80240474 00042600 */  sll       $a0, $a0, 24
glabel func_80240478_EB76A8
/* 16ED58 80240478 00042603 */  sra       $a0, $a0, 24
glabel dgb_14_pad_47C
/* 16ED5C 8024047C 3C01802A */  lui       $at, %hi(D_8029DA4C)
glabel dead_flo_08_SuperBlock_StartGlowEffect
/* 16ED60 80240480 0809014B */  j         func_8024052C
glabel dead_03_AddPlayerHandsOffset
/* 16ED64 80240484 AC24DA4C */   sw       $a0, %lo(D_8029DA4C)($at)
D_80240488:
/* 16ED68 80240488 3C08802A */  lui       $t0, %hi(D_8029DA40)
.L8024048C:
/* 16ED6C 8024048C 2508DA40 */  addiu     $t0, $t0, %lo(D_8029DA40)
glabel func_80240490
/* 16ED70 80240490 3C0A802A */  lui       $t2, %hi(D_8029DA48)
glabel func_80240494
/* 16ED74 80240494 254ADA48 */  addiu     $t2, $t2, %lo(D_8029DA48)
D_80240498:
/* 16ED78 80240498 8D060000 */  lw        $a2, 0x0($t0)
glabel func_8024049C
/* 16ED7C 8024049C 8D430000 */  lw        $v1, 0x0($t2)
glabel func_802404A0
/* 16ED80 802404A0 00A62823 */  subu      $a1, $a1, $a2
glabel func_802404A4
/* 16ED84 802404A4 14600002 */  bnez      $v1, func_802404B0_ED46D0
glabel func_802404A8
/* 16ED88 802404A8 00A3001A */   div      $zero, $a1, $v1
glabel func_802404AC
/* 16ED8C 802404AC 0007000D */  break     7
glabel func_802404B0_ED46D0
/* 16ED90 802404B0 2401FFFF */  addiu     $at, $zero, -0x1
glabel func_802404B4
/* 16ED94 802404B4 14610004 */  bne       $v1, $at, D_802404C8
glabel func_802404B8
/* 16ED98 802404B8 3C018000 */   lui      $at, (0x80000000 >> 16)
D_802404BC:
/* 16ED9C 802404BC 14A10002 */  bne       $a1, $at, D_802404C8
glabel func_802404C0
/* 16EDA0 802404C0 00000000 */   nop
glabel dead_kzn_17_MeleeHitbox_33
/* 16EDA4 802404C4 0006000D */  break     6
D_802404C8:
/* 16EDA8 802404C8 00002812 */  mflo      $a1
arn_09_pad_4CC:
/* 16EDAC 802404CC 3C07802A */  lui       $a3, %hi(D_8029DA44)
glabel func_802404D0_EFEFD0
/* 16EDB0 802404D0 24E7DA44 */  addiu     $a3, $a3, %lo(D_8029DA44)
glabel func_802404D4
/* 16EDB4 802404D4 8CE40000 */  lw        $a0, 0x0($a3)
D_802404D8:
/* 16EDB8 802404D8 24020078 */  addiu     $v0, $zero, 0x78
glabel func_802404DC
/* 16EDBC 802404DC 00441023 */  subu      $v0, $v0, $a0
glabel func_802404E0
/* 16EDC0 802404E0 14600002 */  bnez      $v1, func_802404EC
glabel func_802404E4
/* 16EDC4 802404E4 0043001A */   div      $zero, $v0, $v1
D_802404E8:
/* 16EDC8 802404E8 0007000D */  break     7
glabel func_802404EC
/* 16EDCC 802404EC 2401FFFF */  addiu     $at, $zero, -0x1
obk_08_KnockdownDestroy:
/* 16EDD0 802404F0 14610004 */  bne       $v1, $at, func_80240504_EE6AB4
glabel func_802404F4
/* 16EDD4 802404F4 3C018000 */   lui      $at, (0x80000000 >> 16)
D_802404F8:
/* 16EDD8 802404F8 14410002 */  bne       $v0, $at, func_80240504_EE6AB4
glabel dead_flo_16_SuperBlock_SwitchToPartner
/* 16EDDC 802404FC 00000000 */   nop
glabel dead_flo_00_PatrolAI_Loiter
/* 16EDE0 80240500 0006000D */  break     6
glabel func_80240504_EE6AB4
/* 16EDE4 80240504 00001012 */  mflo      $v0
glabel func_80240508
/* 16EDE8 80240508 2463FFFF */  addiu     $v1, $v1, -0x1
glabel func_8024050C
/* 16EDEC 8024050C AD430000 */  sw        $v1, 0x0($t2)
glabel dead_flo_08_SuperBlock_EndGlowEffect
/* 16EDF0 80240510 00C53021 */  addu      $a2, $a2, $a1
glabel func_80240514
/* 16EDF4 80240514 00822021 */  addu      $a0, $a0, $v0
flo_22_pad_518:
/* 16EDF8 80240518 AD060000 */  sw        $a2, 0x0($t0)
glabel func_8024051C
/* 16EDFC 8024051C 1C600003 */  bgtz      $v1, func_8024052C
glabel func_80240520_EB7750
/* 16EE00 80240520 ACE40000 */   sw       $a0, 0x0($a3)
glabel .L80240524
/* 16EE04 80240524 24020001 */  addiu     $v0, $zero, 0x1
glabel dead_flo_16_SuperBlock_LoadCurrentPartnerName
/* 16EE08 80240528 AD420000 */  sw        $v0, 0x0($t2)
glabel func_8024052C
/* 16EE0C 8024052C 3C028028 */  lui       $v0, %hi(D_802809F4)
glabel dead_flo_18_UnkFunc42
/* 16EE10 80240530 804209F4 */  lb        $v0, %lo(D_802809F4)($v0)
glabel func_80240534
/* 16EE14 80240534 1040000F */  beqz      $v0, func_80240574
glabel func_80240538
/* 16EE18 80240538 24050001 */   addiu    $a1, $zero, 0x1
glabel func_8024053C
/* 16EE1C 8024053C 3C048028 */  lui       $a0, %hi(D_802809F5)
glabel func_80240540_EFF040
/* 16EE20 80240540 248409F5 */  addiu     $a0, $a0, %lo(D_802809F5)
glabel dead_flo_08_SuperBlock_GatherEnergyFX
/* 16EE24 80240544 80830000 */  lb        $v1, 0x0($a0)
glabel func_80240548
/* 16EE28 80240548 28620009 */  slti      $v0, $v1, 0x9
D_8024054C:
/* 16EE2C 8024054C 14400004 */  bnez      $v0, dead_flo_16_SuperBlock_StartGlowEffect
glabel end_01_CharAnim_FadeIn_2
/* 16EE30 80240550 2862000D */   slti     $v0, $v1, 0xD
glabel func_80240554
/* 16EE34 80240554 50400002 */  beql      $v0, $zero, dead_flo_16_SuperBlock_StartGlowEffect
glabel func_80240558
/* 16EE38 80240558 A0800000 */   sb       $zero, 0x0($a0)
glabel func_8024055C
/* 16EE3C 8024055C 0000282D */  daddu     $a1, $zero, $zero
glabel dead_flo_16_SuperBlock_StartGlowEffect
/* 16EE40 80240560 3C038028 */  lui       $v1, %hi(D_802809F5)
glabel func_80240564
/* 16EE44 80240564 246309F5 */  addiu     $v1, $v1, %lo(D_802809F5)
glabel func_80240568
/* 16EE48 80240568 90620000 */  lbu       $v0, 0x0($v1)
dgb_11_pad_56C:
/* 16EE4C 8024056C 24420001 */  addiu     $v0, $v0, 0x1
D_80240570:
/* 16EE50 80240570 A0620000 */  sb        $v0, 0x0($v1)
glabel func_80240574
/* 16EE54 80240574 10A00111 */  beqz      $a1, D_802409BC
glabel func_80240578
/* 16EE58 80240578 00000000 */   nop
glabel omo_03_UpdateTexturePanSmooth
/* 16EE5C 8024057C 3C038028 */  lui       $v1, %hi(D_802809F0)
glabel func_80240580
/* 16EE60 80240580 246309F0 */  addiu     $v1, $v1, %lo(D_802809F0)
glabel func_80240584
/* 16EE64 80240584 9162007A */  lbu       $v0, 0x7A($t3)
glabel func_80240588
/* 16EE68 80240588 C4600000 */  lwc1      $f0, 0x0($v1)
glabel mgm_01_InitPanelEmergeFromBlock
/* 16EE6C 8024058C 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
glabel dead_flo_18_foliage_setup_shear_mtx
/* 16EE70 80240590 44811800 */  mtc1      $at, $f3
glabel func_80240594
/* 16EE74 80240594 44801000 */  mtc1      $zero, $f2
.L80240598:
/* 16EE78 80240598 3C013F80 */  lui       $at, (0x3F800000 >> 16)
glabel func_8024059C
/* 16EE7C 8024059C 4481B000 */  mtc1      $at, $f22
glabel func_802405A0
/* 16EE80 802405A0 46000021 */  cvt.d.s   $f0, $f0
glabel func_802405A4
/* 16EE84 802405A4 46220001 */  sub.d     $f0, $f0, $f2
arn_09_pad_5A8:
/* 16EE88 802405A8 44801000 */  mtc1      $zero, $f2
.L802405AC:
/* 16EE8C 802405AC 2442FFFF */  addiu     $v0, $v0, -0x1
glabel func_802405B0
/* 16EE90 802405B0 A162007A */  sb        $v0, 0x7A($t3)
glabel func_802405B4
/* 16EE94 802405B4 46200020 */  cvt.s.d   $f0, $f0
glabel func_802405B8
/* 16EE98 802405B8 4602003E */  c.le.s    $f0, $f2
glabel omo_15_StarSpiritEffectFunc4
/* 16EE9C 802405BC 00000000 */  nop
glabel func_802405C0_EDC5A0
/* 16EEA0 802405C0 45000036 */  bc1f      func_8024069C
glabel func_802405C4
/* 16EEA4 802405C4 E4600000 */   swc1     $f0, 0x0($v1)
glabel func_802405C8
/* 16EEA8 802405C8 81620079 */  lb        $v0, 0x79($t3)
glabel func_802405CC
/* 16EEAC 802405CC 1840000D */  blez      $v0, func_80240604
glabel func_802405D0
/* 16EEB0 802405D0 00000000 */   nop
glabel func_802405D4
/* 16EEB4 802405D4 91620078 */  lbu       $v0, 0x78($t3)
glabel func_802405D8
/* 16EEB8 802405D8 24420001 */  addiu     $v0, $v0, 0x1
glabel pra_32_StarSpiritEffectFunc4
/* 16EEBC 802405DC A1620078 */  sb        $v0, 0x78($t3)
D_802405E0:
/* 16EEC0 802405E0 00021600 */  sll       $v0, $v0, 24
D_802405E4:
/* 16EEC4 802405E4 00021603 */  sra       $v0, $v0, 24
glabel func_802405E8
/* 16EEC8 802405E8 28420065 */  slti      $v0, $v0, 0x65
glabel gv_01_FadeToTitleScreen
/* 16EECC 802405EC 14400002 */  bnez      $v0, func_802405F8
glabel dead_flo_16_SuperBlock_EndGlowEffect
/* 16EED0 802405F0 24020064 */   addiu    $v0, $zero, 0x64
glabel func_802405F4
/* 16EED4 802405F4 A1620078 */  sb        $v0, 0x78($t3)
glabel func_802405F8
/* 16EED8 802405F8 91620079 */  lbu       $v0, 0x79($t3)
glabel omo_15_StarSpiritEffectFunc5
/* 16EEDC 802405FC 2442FFFF */  addiu     $v0, $v0, -0x1
glabel dead_flo_18_TransformFoliage
/* 16EEE0 80240600 A1620079 */  sb        $v0, 0x79($t3)
glabel func_80240604
/* 16EEE4 80240604 81630079 */  lb        $v1, 0x79($t3)
glabel func_80240608
/* 16EEE8 80240608 58600001 */  blezl     $v1, func_80240610
glabel func_8024060C
/* 16EEEC 8024060C 24030001 */   addiu    $v1, $zero, 0x1
glabel func_80240610
/* 16EEF0 80240610 44830000 */  mtc1      $v1, $f0
glabel func_80240614_EDC5F4
/* 16EEF4 80240614 00000000 */  nop
.L80240618:
/* 16EEF8 80240618 46800020 */  cvt.s.w   $f0, $f0
glabel func_8024061C
/* 16EEFC 8024061C 8162007A */  lb        $v0, 0x7A($t3)
dgb_06_Chest_VarStash:
/* 16EF00 80240620 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
glabel dead_flo_16_SuperBlock_GatherEnergyFX
/* 16EF04 80240624 44811800 */  mtc1      $at, $f3
glabel func_80240628
/* 16EF08 80240628 44801000 */  mtc1      $zero, $f2
D_8024062C:
/* 16EF0C 8024062C 44822000 */  mtc1      $v0, $f4
D_80240630:
/* 16EF10 80240630 00000000 */  nop
glabel func_80240634
/* 16EF14 80240634 46802120 */  cvt.s.w   $f4, $f4
glabel func_80240638
/* 16EF18 80240638 46002103 */  div.s     $f4, $f4, $f0
glabel func_8024063C
/* 16EF1C 8024063C 46002021 */  cvt.d.s   $f0, $f4
D_80240640:
/* 16EF20 80240640 3C028028 */  lui       $v0, %hi(D_802809F0)
glabel mgm_02_OnHitBox
/* 16EF24 80240644 244209F0 */  addiu     $v0, $v0, %lo(D_802809F0)
.L80240648:
/* 16EF28 80240648 4622003C */  c.lt.d    $f0, $f2
glabel func_8024064C_EDC62C
/* 16EF2C 8024064C 00000000 */  nop
glabel sam_07_MeleeHitbox_30
/* 16EF30 80240650 45000005 */  bc1f      .L80240668
glabel func_80240654
/* 16EF34 80240654 E4440000 */   swc1     $f4, 0x0($v0)
glabel func_80240658
/* 16EF38 80240658 3C013F80 */  lui       $at, (0x3F800000 >> 16)
glabel func_8024065C
/* 16EF3C 8024065C 44810000 */  mtc1      $at, $f0
glabel func_80240660_EFF160
/* 16EF40 80240660 00000000 */  nop
glabel func_80240664
/* 16EF44 80240664 E4400000 */  swc1      $f0, 0x0($v0)
.L80240668:
/* 16EF48 80240668 C4400000 */  lwc1      $f0, 0x0($v0)
dgb_10_pad_66C:
/* 16EF4C 8024066C 3C014018 */  lui       $at, (0x40180000 >> 16)
D_80240670:
/* 16EF50 80240670 44811800 */  mtc1      $at, $f3
arn_11_pad_674:
/* 16EF54 80240674 44801000 */  mtc1      $zero, $f2
glabel func_80240678
/* 16EF58 80240678 46000021 */  cvt.d.s   $f0, $f0
glabel func_8024067C
/* 16EF5C 8024067C 4620103C */  c.lt.d    $f2, $f0
glabel func_80240680
/* 16EF60 80240680 00000000 */  nop
.L80240684:
/* 16EF64 80240684 45000006 */  bc1f      omo_17_ShyGuyWanderAI_16
glabel dead_flo_16_SuperBlock_RadiateFaintEnergyFX
/* 16EF68 80240688 3C036666 */   lui      $v1, (0x66666667 >> 16)
glabel pra_40_appendGfx_reflect_player_floor_basic
/* 16EF6C 8024068C 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
D_80240690:
/* 16EF70 80240690 44810000 */  mtc1      $at, $f0
glabel func_80240694
/* 16EF74 80240694 00000000 */  nop
D_80240698:
/* 16EF78 80240698 E4400000 */  swc1      $f0, 0x0($v0)
glabel func_8024069C
/* 16EF7C 8024069C 3C036666 */  lui       $v1, (0x66666667 >> 16)
glabel omo_17_ShyGuyWanderAI_16
/* 16EF80 802406A0 34636667 */  ori       $v1, $v1, (0x66666667 & 0xFFFF)
glabel func_802406A4
/* 16EF84 802406A4 91620078 */  lbu       $v0, 0x78($t3)
glabel dead_03_ItemChoice_SaveSelected
/* 16EF88 802406A8 00021600 */  sll       $v0, $v0, 24
glabel func_802406AC
/* 16EF8C 802406AC 00022603 */  sra       $a0, $v0, 24
glabel func_802406B0
/* 16EF90 802406B0 00830018 */  mult      $a0, $v1
glabel func_802406B4
/* 16EF94 802406B4 0000882D */  daddu     $s1, $zero, $zero
.L802406B8:
/* 16EF98 802406B8 3C12802A */  lui       $s2, %hi(D_8029DA40)
glabel func_802406BC
/* 16EF9C 802406BC 8E52DA40 */  lw        $s2, %lo(D_8029DA40)($s2)
sam_09_varStash:
/* 16EFA0 802406C0 3C15802A */  lui       $s5, %hi(D_8029DA44)
glabel func_802406C4
/* 16EFA4 802406C4 8EB5DA44 */  lw        $s5, %lo(D_8029DA44)($s5)
glabel func_802406C8
/* 16EFA8 802406C8 000217C3 */  sra       $v0, $v0, 31
glabel dead_kzn_17_MeleeHitbox_Main
/* 16EFAC 802406CC 00006010 */  mfhi      $t4
glabel func_802406D0
/* 16EFB0 802406D0 000C1883 */  sra       $v1, $t4, 2
glabel func_802406D4
/* 16EFB4 802406D4 00621823 */  subu      $v1, $v1, $v0
glabel func_802406D8
/* 16EFB8 802406D8 00031600 */  sll       $v0, $v1, 24
glabel func_802406DC
/* 16EFBC 802406DC 0002B603 */  sra       $s6, $v0, 24
glabel dead_flo_16_SuperBlock_AnimateEnergyOrbs
/* 16EFC0 802406E0 00031080 */  sll       $v0, $v1, 2
D_802406E4:
/* 16EFC4 802406E4 00431021 */  addu      $v0, $v0, $v1
glabel func_802406E8
/* 16EFC8 802406E8 00021040 */  sll       $v0, $v0, 1
glabel func_802406EC
/* 16EFCC 802406EC 00822023 */  subu      $a0, $a0, $v0
D_802406F0:
/* 16EFD0 802406F0 00042600 */  sll       $a0, $a0, 24
D_802406F4:
/* 16EFD4 802406F4 00042603 */  sra       $a0, $a0, 24
glabel func_802406F8
/* 16EFD8 802406F8 1AC00039 */  blez      $s6, func_802407E0
D_802406FC:
/* 16EFDC 802406FC AFA40050 */   sw       $a0, 0x50($sp)
glabel func_80240700
/* 16EFE0 80240700 3C1E8008 */  lui       $fp, %hi(HES_Item_StarPoint)
glabel func_80240704
/* 16EFE4 80240704 27DE0FF0 */  addiu     $fp, $fp, %lo(HES_Item_StarPoint)
glabel func_80240708
/* 16EFE8 80240708 3C178010 */  lui       $s7, %hi(HES_StatusSPShine)
glabel func_8024070C
/* 16EFEC 8024070C 26F74BEC */  addiu     $s7, $s7, %lo(HES_StatusSPShine)
D_80240710:
/* 16EFF0 80240710 3C14802A */  lui       $s4, %hi(D_8029EFE8)
glabel func_80240714
/* 16EFF4 80240714 2694EFE8 */  addiu     $s4, $s4, %lo(D_8029EFE8)
glabel func_80240718
/* 16EFF8 80240718 3C13802A */  lui       $s3, %hi(D_8029EFC0)
glabel func_8024071C
/* 16EFFC 8024071C 2673EFC0 */  addiu     $s3, $s3, %lo(D_8029EFC0)
glabel func_80240720
/* 16F000 80240720 8E700000 */  lw        $s0, 0x0($s3)
glabel func_80240724
/* 16F004 80240724 0C05122C */  jal       hud_element_get_script
glabel func_80240728
/* 16F008 80240728 0200202D */   daddu    $a0, $s0, $zero
glabel func_8024072C
/* 16F00C 8024072C 105E0004 */  beq       $v0, $fp, D_80240740
glabel func_80240730
/* 16F010 80240730 0200202D */   daddu    $a0, $s0, $zero
glabel func_80240734
/* 16F014 80240734 0C0511FF */  jal       hud_element_set_script
glabel omo_17_ShyGuyWanderAI_17
/* 16F018 80240738 03C0282D */   daddu    $a1, $fp, $zero
glabel func_8024073C
/* 16F01C 8024073C 0200202D */  daddu     $a0, $s0, $zero
D_80240740:
/* 16F020 80240740 0C05128B */  jal       hud_element_clear_flags
glabel func_80240744
/* 16F024 80240744 24050002 */   addiu    $a1, $zero, 0x2
glabel func_80240748
/* 16F028 80240748 0200202D */  daddu     $a0, $s0, $zero
glabel func_8024074C
/* 16F02C 8024074C 0240282D */  daddu     $a1, $s2, $zero
D_80240750:
/* 16F030 80240750 0C051261 */  jal       hud_element_set_render_pos
glabel func_80240754
/* 16F034 80240754 02A0302D */   daddu    $a2, $s5, $zero
glabel func_80240758
/* 16F038 80240758 0C0511EA */  jal       hud_element_draw_clipped
D_8024075C:
/* 16F03C 8024075C 0200202D */   daddu    $a0, $s0, $zero
D_80240760:
/* 16F040 80240760 8E900000 */  lw        $s0, 0x0($s4)
glabel func_80240764
/* 16F044 80240764 0C05122C */  jal       hud_element_get_script
glabel func_80240768
/* 16F048 80240768 0200202D */   daddu    $a0, $s0, $zero
D_8024076C:
/* 16F04C 8024076C 10570004 */  beq       $v0, $s7, func_80240780
glabel dead_flo_00_PatrolAI_JumpInit
/* 16F050 80240770 0200202D */   daddu    $a0, $s0, $zero
glabel func_80240774
/* 16F054 80240774 0C0511FF */  jal       hud_element_set_script
D_80240778:
/* 16F058 80240778 02E0282D */   daddu    $a1, $s7, $zero
glabel dead_03_LetterDelivery_Init
/* 16F05C 8024077C 0200202D */  daddu     $a0, $s0, $zero
glabel func_80240780
/* 16F060 80240780 0C05128B */  jal       hud_element_clear_flags
glabel func_80240784_EFF284
/* 16F064 80240784 24050002 */   addiu    $a1, $zero, 0x2
glabel func_80240788
/* 16F068 80240788 0200202D */  daddu     $a0, $s0, $zero
sbk_00_pad_78C:
/* 16F06C 8024078C 0240282D */  daddu     $a1, $s2, $zero
glabel func_80240790
/* 16F070 80240790 0C051261 */  jal       hud_element_set_render_pos
D_80240794:
/* 16F074 80240794 26A6FFFB */   addiu    $a2, $s5, -0x5
glabel omo_17_ShyGuyWanderAI_Main
/* 16F078 80240798 0C0511EA */  jal       hud_element_draw_clipped
D_8024079C:
/* 16F07C 8024079C 0200202D */   daddu    $a0, $s0, $zero
glabel mgm_00_PatrolAI_Loiter
/* 16F080 802407A0 3C0141A0 */  lui       $at, (0x41A00000 >> 16)
glabel func_802407A4
/* 16F084 802407A4 44810000 */  mtc1      $at, $f0
D_802407A8:
/* 16F088 802407A8 00000000 */  nop
glabel func_802407AC
/* 16F08C 802407AC 4600B002 */  mul.s     $f0, $f22, $f0
glabel EFEB00_CosInterpMinMax
/* 16F090 802407B0 00000000 */  nop
glabel func_802407B4
/* 16F094 802407B4 26940004 */  addiu     $s4, $s4, 0x4
D_802407B8:
/* 16F098 802407B8 44921000 */  mtc1      $s2, $f2
glabel func_802407BC
/* 16F09C 802407BC 00000000 */  nop
D_802407C0:
/* 16F0A0 802407C0 468010A0 */  cvt.s.w   $f2, $f2
glabel func_802407C4
/* 16F0A4 802407C4 46001081 */  sub.s     $f2, $f2, $f0
glabel .L802407C8
/* 16F0A8 802407C8 26310001 */  addiu     $s1, $s1, 0x1
glabel func_802407CC
/* 16F0AC 802407CC 0236102A */  slt       $v0, $s1, $s6
glabel func_802407D0
/* 16F0B0 802407D0 4600118D */  trunc.w.s $f6, $f2
glabel func_802407D4_EE6D84
/* 16F0B4 802407D4 44123000 */  mfc1      $s2, $f6
glabel func_802407D8
/* 16F0B8 802407D8 1440FFD1 */  bnez      $v0, func_80240720
D_802407DC:
/* 16F0BC 802407DC 26730004 */   addiu    $s3, $s3, 0x4
glabel func_802407E0
/* 16F0C0 802407E0 2A22000A */  slti      $v0, $s1, 0xA
glabel dead_flo_00_PatrolAI_Jump
/* 16F0C4 802407E4 10400013 */  beqz      $v0, dgb_06_pad_834
glabel func_802407E8
/* 16F0C8 802407E8 00111880 */   sll      $v1, $s1, 2
glabel func_802407EC
/* 16F0CC 802407EC 3C02802A */  lui       $v0, %hi(D_8029EFE8)
D_802407F0:
/* 16F0D0 802407F0 2442EFE8 */  addiu     $v0, $v0, %lo(D_8029EFE8)
glabel func_802407F4
/* 16F0D4 802407F4 00629021 */  addu      $s2, $v1, $v0
glabel omo_11_SuperBlock_GetPartnerRank
/* 16F0D8 802407F8 3C02802A */  lui       $v0, %hi(D_8029EFC0)
glabel func_802407FC
/* 16F0DC 802407FC 2442EFC0 */  addiu     $v0, $v0, %lo(D_8029EFC0)
glabel func_80240800
/* 16F0E0 80240800 00628021 */  addu      $s0, $v1, $v0
glabel func_80240804
/* 16F0E4 80240804 24050002 */  addiu     $a1, $zero, 0x2
glabel func_80240808
/* 16F0E8 80240808 8E040000 */  lw        $a0, 0x0($s0)
D_8024080C:
/* 16F0EC 8024080C 26100004 */  addiu     $s0, $s0, 0x4
D_80240810:
/* 16F0F0 80240810 0C051280 */  jal       hud_element_set_flags
glabel func_80240814
/* 16F0F4 80240814 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80240818
/* 16F0F8 80240818 24050002 */  addiu     $a1, $zero, 0x2
glabel end_00_CharAnim_FadeIn_3
/* 16F0FC 8024081C 8E440000 */  lw        $a0, 0x0($s2)
glabel kzn_07_FlyingAI_WanderInit
/* 16F100 80240820 0C051280 */  jal       hud_element_set_flags
glabel func_80240824
/* 16F104 80240824 26520004 */   addiu    $s2, $s2, 0x4
glabel func_80240828
/* 16F108 80240828 2A22000A */  slti      $v0, $s1, 0xA
glabel end_01_CharAnim_FadeIn_3
/* 16F10C 8024082C 1440FFF6 */  bnez      $v0, func_80240808
glabel func_80240830
/* 16F110 80240830 24050002 */   addiu    $a1, $zero, 0x2
dgb_06_pad_834:
/* 16F114 80240834 3C014160 */  lui       $at, (0x41600000 >> 16)
glabel func_80240838
/* 16F118 80240838 44810000 */  mtc1      $at, $f0
glabel func_8024083C
/* 16F11C 8024083C 00000000 */  nop
D_80240840:
/* 16F120 80240840 4600B002 */  mul.s     $f0, $f22, $f0
glabel func_80240844_D9B734
/* 16F124 80240844 00000000 */  nop
glabel dead_11_FlyingAI_LoiterInit
/* 16F128 80240848 3C01802A */  lui       $at, %hi(D_8029DA44)
glabel func_8024084C
/* 16F12C 8024084C C422DA44 */  lwc1      $f2, %lo(D_8029DA44)($at)
glabel sam_02_ToadHouse_ShowWorldStatusBar
/* 16F130 80240850 468010A0 */  cvt.s.w   $f2, $f2
glabel func_80240854
/* 16F134 80240854 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x4)
glabel func_80240858
/* 16F138 80240858 8C42C074 */  lw        $v0, %lo(gBattleStatus + 0x4)($v0)
glabel dead_flo_00_PatrolAI_ChaseInit
/* 16F13C 8024085C 46001080 */  add.s     $f2, $f2, $f0
D_80240860:
/* 16F140 80240860 3C12802A */  lui       $s2, %hi(D_8029DA40)
glabel omo_11_SuperBlock_get_partner_rank
/* 16F144 80240864 8E52DA40 */  lw        $s2, %lo(D_8029DA40)($s2)
dgb_12_pad_868:
/* 16F148 80240868 30420001 */  andi      $v0, $v0, 0x1
dead_03_LetterDelivery_CalcLetterPos:
/* 16F14C 8024086C 4600118D */  trunc.w.s $f6, $f2
glabel dgb_12_varStash
/* 16F150 80240870 44153000 */  mfc1      $s5, $f6
D_80240874:
/* 16F154 80240874 1040001D */  beqz      $v0, func_802408EC
glabel func_80240878
/* 16F158 80240878 00000000 */   nop
glabel func_8024087C
/* 16F15C 8024087C 8FAC0050 */  lw        $t4, 0x50($sp)
D_80240880:
/* 16F160 80240880 1180001B */  beqz      $t4, func_802408F0
glabel sam_11_GetItemName
/* 16F164 80240884 0000202D */   daddu    $a0, $zero, $zero
glabel func_80240888
/* 16F168 80240888 24050004 */  addiu     $a1, $zero, 0x4
glabel func_8024088C
/* 16F16C 8024088C 2646FF9C */  addiu     $a2, $s2, -0x64
D_80240890:
/* 16F170 80240890 2402006E */  addiu     $v0, $zero, 0x6E
glabel func_80240894_D7F5F4
/* 16F174 80240894 AFA20014 */  sw        $v0, 0x14($sp)
glabel func_80240898
/* 16F178 80240898 2402000C */  addiu     $v0, $zero, 0xC
glabel func_8024089C
/* 16F17C 8024089C AFA20018 */  sw        $v0, 0x18($sp)
glabel func_802408A0
/* 16F180 802408A0 24020078 */  addiu     $v0, $zero, 0x78
glabel func_802408A4
/* 16F184 802408A4 AFA2001C */  sw        $v0, 0x1C($sp)
glabel func_802408A8
/* 16F188 802408A8 24020140 */  addiu     $v0, $zero, 0x140
glabel func_802408AC
/* 16F18C 802408AC AFA20044 */  sw        $v0, 0x44($sp)
glabel func_802408B0
/* 16F190 802408B0 240200F0 */  addiu     $v0, $zero, 0xF0
glabel func_802408B4
/* 16F194 802408B4 26A7FFFB */  addiu     $a3, $s5, -0x5
glabel flo_18_pad_8B8
/* 16F198 802408B8 AFA00010 */  sw        $zero, 0x10($sp)
glabel mim_01_MeleeHitbox_Main
/* 16F19C 802408BC AFA00020 */  sw        $zero, 0x20($sp)
D_802408C0:
/* 16F1A0 802408C0 AFA00024 */  sw        $zero, 0x24($sp)
glabel func_802408C4
/* 16F1A4 802408C4 AFA00028 */  sw        $zero, 0x28($sp)
glabel dead_kzn_19_StarSpiritEffectFunc4
/* 16F1A8 802408C8 AFA0002C */  sw        $zero, 0x2C($sp)
flo_07_pad_8CC:
/* 16F1AC 802408CC AFA00030 */  sw        $zero, 0x30($sp)
glabel func_802408D0
/* 16F1B0 802408D0 AFA00034 */  sw        $zero, 0x34($sp)
.L802408D4:
/* 16F1B4 802408D4 AFA00038 */  sw        $zero, 0x38($sp)
glabel flo_25_FlyingAI_Loiter
/* 16F1B8 802408D8 AFA0003C */  sw        $zero, 0x3C($sp)
D_802408DC:
/* 16F1BC 802408DC AFA00040 */  sw        $zero, 0x40($sp)
glabel omo_08_ShyGuyWanderAI_15
/* 16F1C0 802408E0 AFA20048 */  sw        $v0, 0x48($sp)
.L802408E4:
/* 16F1C4 802408E4 0C03D4B8 */  jal       draw_box
glabel func_802408E8
/* 16F1C8 802408E8 AFA0004C */   sw       $zero, 0x4C($sp)
glabel func_802408EC
/* 16F1CC 802408EC 8FAC0050 */  lw        $t4, 0x50($sp)
glabel func_802408F0
/* 16F1D0 802408F0 19800024 */  blez      $t4, func_80240984
glabel func_802408F4
/* 16F1D4 802408F4 0000882D */   daddu    $s1, $zero, $zero
glabel func_802408F8
/* 16F1D8 802408F8 3C148008 */  lui       $s4, %hi(HES_Item_SmallStarPoint)
glabel func_802408FC
/* 16F1DC 802408FC 269410C8 */  addiu     $s4, $s4, %lo(HES_Item_SmallStarPoint)
glabel .L80240900
/* 16F1E0 80240900 3C014120 */  lui       $at, (0x41200000 >> 16)
glabel func_80240904
/* 16F1E4 80240904 4481A000 */  mtc1      $at, $f20
glabel dead_11_FlyingAI_Loiter
/* 16F1E8 80240908 3C13802A */  lui       $s3, %hi(D_8029F010)
glabel func_8024090C
/* 16F1EC 8024090C 2673F010 */  addiu     $s3, $s3, %lo(D_8029F010)
glabel func_80240910
/* 16F1F0 80240910 8E700000 */  lw        $s0, 0x0($s3)
.L80240914:
/* 16F1F4 80240914 0C05122C */  jal       hud_element_get_script
glabel func_80240918
/* 16F1F8 80240918 0200202D */   daddu    $a0, $s0, $zero
glabel func_8024091C
/* 16F1FC 8024091C 10540004 */  beq       $v0, $s4, func_80240930
glabel func_80240920
/* 16F200 80240920 0200202D */   daddu    $a0, $s0, $zero
glabel omo_06_GetItemName
/* 16F204 80240924 0C0511FF */  jal       hud_element_set_script
glabel func_80240928
/* 16F208 80240928 0280282D */   daddu    $a1, $s4, $zero
glabel func_8024092C
/* 16F20C 8024092C 0200202D */  daddu     $a0, $s0, $zero
glabel func_80240930
/* 16F210 80240930 0C05128B */  jal       hud_element_clear_flags
glabel func_80240934
/* 16F214 80240934 24050002 */   addiu    $a1, $zero, 0x2
glabel func_80240938
/* 16F218 80240938 0200202D */  daddu     $a0, $s0, $zero
glabel func_8024093C
/* 16F21C 8024093C 0240282D */  daddu     $a1, $s2, $zero
D_80240940:
/* 16F220 80240940 0C051261 */  jal       hud_element_set_render_pos
glabel func_80240944
/* 16F224 80240944 02A0302D */   daddu    $a2, $s5, $zero
kmr_03_pad_948:
/* 16F228 80240948 0C0511EA */  jal       hud_element_draw_clipped
D_8024094C:
/* 16F22C 8024094C 0200202D */   daddu    $a0, $s0, $zero
D_80240950:
/* 16F230 80240950 4614B082 */  mul.s     $f2, $f22, $f20
D_80240954:
/* 16F234 80240954 00000000 */  nop
glabel func_80240958
/* 16F238 80240958 44920000 */  mtc1      $s2, $f0
glabel mgm_00_PatrolAI_PostLoiter
/* 16F23C 8024095C 00000000 */  nop
glabel func_80240960
/* 16F240 80240960 46800020 */  cvt.s.w   $f0, $f0
.L80240964:
/* 16F244 80240964 46020001 */  sub.s     $f0, $f0, $f2
glabel func_80240968
/* 16F248 80240968 4600018D */  trunc.w.s $f6, $f0
glabel func_8024096C
/* 16F24C 8024096C 44123000 */  mfc1      $s2, $f6
glabel omo_02_ShyGuyWanderAI_14
/* 16F250 80240970 8FAC0050 */  lw        $t4, 0x50($sp)
glabel sam_02_ToadHouse_AwaitScriptComplete
/* 16F254 80240974 26310001 */  addiu     $s1, $s1, 0x1
glabel func_80240978
/* 16F258 80240978 022C102A */  slt       $v0, $s1, $t4
glabel dead_kzn_17_WanderMeleeAI_Main
/* 16F25C 8024097C 1440FFE4 */  bnez      $v0, func_80240910
D_80240980:
/* 16F260 80240980 26730004 */   addiu    $s3, $s3, 0x4
glabel func_80240984
/* 16F264 80240984 2A22000A */  slti      $v0, $s1, 0xA
glabel omo_09_IsItemBadge
/* 16F268 80240988 1040000C */  beqz      $v0, D_802409BC
glabel func_8024098C
/* 16F26C 8024098C 00111080 */   sll      $v0, $s1, 2
glabel func_80240990
/* 16F270 80240990 3C03802A */  lui       $v1, %hi(D_8029F010)
glabel func_80240994
/* 16F274 80240994 2463F010 */  addiu     $v1, $v1, %lo(D_8029F010)
D_80240998:
/* 16F278 80240998 00438021 */  addu      $s0, $v0, $v1
glabel func_8024099C
/* 16F27C 8024099C 8E040000 */  lw        $a0, 0x0($s0)
.L802409A0:
/* 16F280 802409A0 24050002 */  addiu     $a1, $zero, 0x2
glabel func_802409A4
/* 16F284 802409A4 26100004 */  addiu     $s0, $s0, 0x4
glabel func_802409A8
/* 16F288 802409A8 0C051280 */  jal       hud_element_set_flags
glabel func_802409AC
/* 16F28C 802409AC 26310001 */   addiu    $s1, $s1, 0x1
glabel omo_08_ShyGuyWanderAI_16
/* 16F290 802409B0 2A22000A */  slti      $v0, $s1, 0xA
glabel .L802409B4
/* 16F294 802409B4 1440FFF9 */  bnez      $v0, func_8024099C
D_802409B8:
/* 16F298 802409B8 00000000 */   nop
D_802409BC:
/* 16F29C 802409BC 8FBF007C */  lw        $ra, 0x7C($sp)
D_802409C0:
/* 16F2A0 802409C0 8FBE0078 */  lw        $fp, 0x78($sp)
glabel func_802409C4
/* 16F2A4 802409C4 8FB70074 */  lw        $s7, 0x74($sp)
D_802409C8:
/* 16F2A8 802409C8 8FB60070 */  lw        $s6, 0x70($sp)
D_802409CC:
/* 16F2AC 802409CC 8FB5006C */  lw        $s5, 0x6C($sp)
glabel func_802409D0
/* 16F2B0 802409D0 8FB40068 */  lw        $s4, 0x68($sp)
glabel func_802409D4
/* 16F2B4 802409D4 8FB30064 */  lw        $s3, 0x64($sp)
glabel func_802409D8
/* 16F2B8 802409D8 8FB20060 */  lw        $s2, 0x60($sp)
D_802409DC:
/* 16F2BC 802409DC 8FB1005C */  lw        $s1, 0x5C($sp)
glabel func_802409E0
/* 16F2C0 802409E0 8FB00058 */  lw        $s0, 0x58($sp)
D_802409E4:
/* 16F2C4 802409E4 D7B60088 */  ldc1      $f22, 0x88($sp)
glabel func_802409E8
/* 16F2C8 802409E8 D7B40080 */  ldc1      $f20, 0x80($sp)
glabel func_802409EC
/* 16F2CC 802409EC 03E00008 */  jr        $ra
glabel func_802409F0
/* 16F2D0 802409F0 27BD0090 */   addiu    $sp, $sp, 0x90

### DECOMPILED C INSTRUCTIONS:

void btl_update_starpoints_display(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    s32 cond;
    s32 i;

    if (gBattleStatus.flags1 & BS_FLAGS1_ACTORS_VISIBLE) {
        if (!(gBattleStatus.flags2 & BS_FLAGS2_1)) {
            D_8029DA40 = 292;
            D_8029DA44 = 196;
            D_8029DA48 = 6;
            D_8029DA4C = battleStatus->totalStarPoints % 10;
        } else {
            D_8029DA40 += (202 - D_8029DA40) / D_8029DA48;
            D_8029DA44 += (120 - D_8029DA44) / D_8029DA48;
            D_8029DA48--;
            if (D_8029DA48 < 1) {
                D_8029DA48 = 1;
            }
        }

        cond = TRUE;
        if (D_802809F4 != 0) {
            if (D_802809F5 > 8) {
                if (D_802809F5 <= 12) {
                    cond = FALSE;
                } else {
                    D_802809F5 = 0;
                }
            }
            D_802809F5++;
        }

        if (cond) {
            s32 posX, posY;
            s32 tens, ones;
            s32 id;
            f32 one = 1.0f;

            battleStatus->incrementStarPointDelay--;
            D_802809F0 -= 1.0;
            if (D_802809F0 <= 0.0f) {
                s32 pendingStarPoints;

                if (battleStatus->pendingStarPoints > 0) {
                    battleStatus->totalStarPoints++;
                    if (battleStatus->totalStarPoints > 100) {
                        battleStatus->totalStarPoints = 100;
                    }
                    battleStatus->pendingStarPoints--;
                }

                pendingStarPoints = battleStatus->pendingStarPoints;
                if (pendingStarPoints < 1) {
                    pendingStarPoints = 1;
                }

                D_802809F0 = (f32) battleStatus->incrementStarPointDelay / pendingStarPoints;
                if (D_802809F0 < 1.0) {
                    D_802809F0 = 1.0f;
                }
                if (D_802809F0 > 6.0) {
                    D_802809F0 = 6.0f;
                }
            }

            posX = D_8029DA40;
            posY = D_8029DA44;
            tens = battleStatus->totalStarPoints / 10;
            ones = battleStatus->totalStarPoints % 10;

            for (i = 0; i < tens; i++) {
                id = D_8029EFC0[i];
                if (hud_element_get_script(id) != &HES_Item_StarPoint) {
                    hud_element_set_script(id, &HES_Item_StarPoint);
                }
                hud_element_clear_flags(id, 2);
                hud_element_set_render_pos(id, posX, posY);
                hud_element_draw_clipped(id);

                id = D_8029EFE8[i];
                if (hud_element_get_script(id) != &HES_StatusSPShine) {
                    hud_element_set_script(id, &HES_StatusSPShine);
                }
                hud_element_clear_flags(id, 2);
                hud_element_set_render_pos(id, posX, posY - 5);
                hud_element_draw_clipped(id);
                posX -= (one * 20.0f);
            }

           for (; i < ARRAY_COUNT(D_8029EFC0); i++) {
                hud_element_set_flags(D_8029EFC0[i], HUD_ELEMENT_FLAG_DISABLED);
                hud_element_set_flags(D_8029EFE8[i], HUD_ELEMENT_FLAG_DISABLED);
            }

            posX = D_8029DA40;
            posY = D_8029DA44 + (one * 14.0f);
            if (gBattleStatus.flags2 & BS_FLAGS2_1) {
                if (ones != 0) {
                    draw_box(0, WINDOW_STYLE_4, posX - 100, posY - 5, 0, 110, 12, 120, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL,
                             NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
                }
            }

            for (i = 0; i < ones; i++) {
                id = D_8029F010[i];
                if (hud_element_get_script(id) != &HES_Item_SmallStarPoint) {
                    hud_element_set_script(id, &HES_Item_SmallStarPoint);
                }
                hud_element_clear_flags(id, 2);
                hud_element_set_render_pos(id, posX, posY);
                hud_element_draw_clipped(id);
                posX -= one * 10.0f;
            }

            for (; i < ARRAY_COUNT(D_8029F010); i++) {
                hud_element_set_flags(D_8029F010[i], HUD_ELEMENT_FLAG_DISABLED);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80246450
/* 174D30 80246450 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 174D34 80246454 AFB3001C */  sw        $s3, 0x1C($sp)
/* 174D38 80246458 3C13800E */  lui       $s3, %hi(gBattleStatus)
/* 174D3C 8024645C 2673C070 */  addiu     $s3, $s3, %lo(gBattleStatus)
dead_flo_08_FlowerGuard_ItemChoiceList:
/* 174D40 80246460 3C04800E */  lui       $a0, %hi(gBattleSubState)
/* 174D44 80246464 2484C4DC */  addiu     $a0, $a0, %lo(gBattleSubState)
/* 174D48 80246468 AFBF0030 */  sw        $ra, 0x30($sp)
.L8024646C:
/* 174D4C 8024646C AFB7002C */  sw        $s7, 0x2C($sp)
D_80246470:
/* 174D50 80246470 AFB60028 */  sw        $s6, 0x28($sp)
/* 174D54 80246474 AFB50024 */  sw        $s5, 0x24($sp)
D_80246478:
/* 174D58 80246478 AFB40020 */  sw        $s4, 0x20($sp)
.L8024647C:
/* 174D5C 8024647C AFB20018 */  sw        $s2, 0x18($sp)
D_80246480_EA6D80:
/* 174D60 80246480 AFB10014 */  sw        $s1, 0x14($sp)
/* 174D64 80246484 AFB00010 */  sw        $s0, 0x10($sp)
glabel func_80246488
/* 174D68 80246488 F7B80048 */  sdc1      $f24, 0x48($sp)
/* 174D6C 8024648C F7B60040 */  sdc1      $f22, 0x40($sp)
glabel func_80246490
/* 174D70 80246490 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 174D74 80246494 8E7000D8 */  lw        $s0, 0xD8($s3)
/* 174D78 80246498 8C820000 */  lw        $v0, 0x0($a0)
/* 174D7C 8024649C 8E7100DC */  lw        $s1, 0xDC($s3)
/* 174D80 802464A0 1440007F */  bnez      $v0, .L802466A0
D_802464A4:
/* 174D84 802464A4 24020002 */   addiu    $v0, $zero, 0x2
/* 174D88 802464A8 82630178 */  lb        $v1, 0x178($s3)
/* 174D8C 802464AC 14620007 */  bne       $v1, $v0, .L802464CC
/* 174D90 802464B0 00000000 */   nop
/* 174D94 802464B4 82620088 */  lb        $v0, 0x88($s3)
/* 174D98 802464B8 28420002 */  slti      $v0, $v0, 0x2
/* 174D9C 802464BC 14400003 */  bnez      $v0, .L802464CC
/* 174DA0 802464C0 24020005 */   addiu    $v0, $zero, 0x5
D_802464C4:
/* 174DA4 802464C4 080919A8 */  j         .L802466A0
/* 174DA8 802464C8 AC820000 */   sw       $v0, 0x0($a0)
.L802464CC:
/* 174DAC 802464CC 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x4)
D_802464D0:
/* 174DB0 802464D0 8C42C074 */  lw        $v0, %lo(gBattleStatus + 0x4)($v0)
/* 174DB4 802464D4 3C030400 */  lui       $v1, (0x4000000 >> 16)
jtbl_802464D8:
/* 174DB8 802464D8 00431024 */  and       $v0, $v0, $v1
/* 174DBC 802464DC 1440000D */  bnez      $v0, .L80246514
/* 174DC0 802464E0 00000000 */   nop
/* 174DC4 802464E4 0C03A752 */  jal       is_ability_active
D_802464E8:
/* 174DC8 802464E8 24040012 */   addiu    $a0, $zero, 0x12
/* 174DCC 802464EC 14400009 */  bnez      $v0, .L80246514
/* 174DD0 802464F0 00000000 */   nop
/* 174DD4 802464F4 0C03A752 */  jal       is_ability_active
/* 174DD8 802464F8 2404001F */   addiu    $a0, $zero, 0x1F
.L802464FC:
/* 174DDC 802464FC 14400005 */  bnez      $v0, .L80246514
D_80246500:
/* 174DE0 80246500 00000000 */   nop
.L80246504:
/* 174DE4 80246504 0C03A752 */  jal       is_ability_active
D_80246508:
/* 174DE8 80246508 24040034 */   addiu    $a0, $zero, 0x34
/* 174DEC 8024650C 10400031 */  beqz      $v0, .L802465D4
D_80246510:
/* 174DF0 80246510 24020005 */   addiu    $v0, $zero, 0x5
.L80246514:
/* 174DF4 80246514 82030214 */  lb        $v1, 0x214($s0)
jtbl_80246518:
/* 174DF8 80246518 2402000C */  addiu     $v0, $zero, 0xC
.L8024651C:
/* 174DFC 8024651C 1062002D */  beq       $v1, $v0, .L802465D4
D_80246520:
/* 174E00 80246520 24020005 */   addiu    $v0, $zero, 0x5
/* 174E04 80246524 8262009A */  lb        $v0, 0x9A($s3)
D_80246528:
/* 174E08 80246528 1440002A */  bnez      $v0, .L802465D4
D_8024652C:
/* 174E0C 8024652C 24020005 */   addiu    $v0, $zero, 0x5
D_80246530:
/* 174E10 80246530 0000A82D */  daddu     $s5, $zero, $zero
D_80246534:
/* 174E14 80246534 02A0902D */  daddu     $s2, $s5, $zero
D_80246538:
/* 174E18 80246538 3C16800E */  lui       $s6, %hi(gBattleStatus)
/* 174E1C 8024653C 26D6C070 */  addiu     $s6, $s6, %lo(gBattleStatus)
D_80246540:
/* 174E20 80246540 8EC20004 */  lw        $v0, 0x4($s6)
/* 174E24 80246544 3C170400 */  lui       $s7, (0x4000000 >> 16)
D_80246548:
/* 174E28 80246548 00571024 */  and       $v0, $v0, $s7
/* 174E2C 8024654C 10400003 */  beqz      $v0, D_8024655C
D_80246550:
/* 174E30 80246550 02A0A02D */   daddu    $s4, $s5, $zero
D_80246554:
/* 174E34 80246554 82750089 */  lb        $s5, 0x89($s3)
D_80246558:
/* 174E38 80246558 A2600089 */  sb        $zero, 0x89($s3)
D_8024655C:
/* 174E3C 8024655C 0C00A67F */  jal       rand_int
D_80246560:
/* 174E40 80246560 24040064 */   addiu    $a0, $zero, 0x64
/* 174E44 80246564 28420032 */  slti      $v0, $v0, 0x32
D_80246568:
/* 174E48 80246568 10400005 */  beqz      $v0, .L80246580
/* 174E4C 8024656C 00000000 */   nop
jtbl_80246570:
/* 174E50 80246570 0C03A752 */  jal       is_ability_active
/* 174E54 80246574 2404001F */   addiu    $a0, $zero, 0x1F
D_80246578:
/* 174E58 80246578 00021840 */  sll       $v1, $v0, 1
/* 174E5C 8024657C 00629021 */  addu      $s2, $v1, $v0
.L80246580:
/* 174E60 80246580 0C00A67F */  jal       rand_int
/* 174E64 80246584 24040064 */   addiu    $a0, $zero, 0x64
/* 174E68 80246588 28420032 */  slti      $v0, $v0, 0x32
/* 174E6C 8024658C 10400004 */  beqz      $v0, D_802465A0
D_80246590:
/* 174E70 80246590 00000000 */   nop
/* 174E74 80246594 0C03A752 */  jal       is_ability_active
D_80246598:
/* 174E78 80246598 24040012 */   addiu    $a0, $zero, 0x12
D_8024659C:
/* 174E7C 8024659C 02429021 */  addu      $s2, $s2, $v0
D_802465A0:
/* 174E80 802465A0 0C00A67F */  jal       rand_int
/* 174E84 802465A4 24040064 */   addiu    $a0, $zero, 0x64
/* 174E88 802465A8 28420032 */  slti      $v0, $v0, 0x32
/* 174E8C 802465AC 10400005 */  beqz      $v0, .L802465C4
/* 174E90 802465B0 02B21021 */   addu     $v0, $s5, $s2
/* 174E94 802465B4 0C03A752 */  jal       is_ability_active
D_802465B8:
/* 174E98 802465B8 24040034 */   addiu    $a0, $zero, 0x34
/* 174E9C 802465BC 0040A02D */  daddu     $s4, $v0, $zero
D_802465C0:
/* 174EA0 802465C0 02B21021 */  addu      $v0, $s5, $s2
.L802465C4:
/* 174EA4 802465C4 00541021 */  addu      $v0, $v0, $s4
D_802465C8_915C78:
/* 174EA8 802465C8 14400006 */  bnez      $v0, .L802465E4
D_802465CC:
/* 174EAC 802465CC 2402001E */   addiu    $v0, $zero, 0x1E
D_802465D0:
/* 174EB0 802465D0 24020005 */  addiu     $v0, $zero, 0x5
.L802465D4:
/* 174EB4 802465D4 3C01800E */  lui       $at, %hi(gBattleSubState)
D_802465D8:
/* 174EB8 802465D8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 174EBC 802465DC 080919A8 */  j         .L802466A0
D_802465E0:
/* 174EC0 802465E0 00000000 */   nop
.L802465E4:
/* 174EC4 802465E4 3C048028 */  lui       $a0, %hi(EVS_Mario_HandlePhase)
D_802465E8:
/* 174EC8 802465E8 24844EBC */  addiu     $a0, $a0, %lo(EVS_Mario_HandlePhase)
.L802465EC:
/* 174ECC 802465EC 2405000A */  addiu     $a1, $zero, 0xA
D_802465F0:
/* 174ED0 802465F0 0000302D */  daddu     $a2, $zero, $zero
/* 174ED4 802465F4 0C0B0CF8 */  jal       start_script
/* 174ED8 802465F8 A26201A7 */   sb       $v0, 0x1A7($s3)
/* 174EDC 802465FC 0040202D */  daddu     $a0, $v0, $zero
/* 174EE0 80246600 AE0401D4 */  sw        $a0, 0x1D4($s0)
/* 174EE4 80246604 8C820144 */  lw        $v0, 0x144($a0)
/* 174EE8 80246608 AE0201E4 */  sw        $v0, 0x1E4($s0)
/* 174EEC 8024660C AC800148 */  sw        $zero, 0x148($a0)
D_80246610:
/* 174EF0 80246610 8EC20004 */  lw        $v0, 0x4($s6)
D_80246614:
/* 174EF4 80246614 00571024 */  and       $v0, $v0, $s7
D_80246618_EA6F18:
/* 174EF8 80246618 50400007 */  beql      $v0, $zero, D_80246638_EA6F38
/* 174EFC 8024661C AC9500AC */   sw       $s5, 0xAC($a0)
D_80246620_EA6F20:
/* 174F00 80246620 82630089 */  lb        $v1, 0x89($s3)
D_80246624:
/* 174F04 80246624 8C8200AC */  lw        $v0, 0xAC($a0)
D_80246628_EA6F28:
/* 174F08 80246628 00431021 */  addu      $v0, $v0, $v1
/* 174F0C 8024662C AC8200AC */  sw        $v0, 0xAC($a0)
D_80246630_EA6F30:
/* 174F10 80246630 A2600089 */  sb        $zero, 0x89($s3)
/* 174F14 80246634 AC9500AC */  sw        $s5, 0xAC($a0)
D_80246638_EA6F38:
/* 174F18 80246638 02A0102D */  daddu     $v0, $s5, $zero
/* 174F1C 8024663C 28420064 */  slti      $v0, $v0, 0x64
D_80246640_EA6F40:
/* 174F20 80246640 AC9200B0 */  sw        $s2, 0xB0($a0)
D_80246644:
/* 174F24 80246644 14400003 */  bnez      $v0, .L80246654
D_80246648_EA6F48:
/* 174F28 80246648 AC9400B4 */   sw       $s4, 0xB4($a0)
/* 174F2C 8024664C 24020063 */  addiu     $v0, $zero, 0x63
jtbl_80246650:
/* 174F30 80246650 AC8200AC */  sw        $v0, 0xAC($a0)
.L80246654:
/* 174F34 80246654 8C8200B0 */  lw        $v0, 0xB0($a0)
.L80246658:
/* 174F38 80246658 28420064 */  slti      $v0, $v0, 0x64
/* 174F3C 8024665C 14400002 */  bnez      $v0, .L80246668
D_80246660:
/* 174F40 80246660 24020063 */   addiu    $v0, $zero, 0x63
/* 174F44 80246664 AC8200B0 */  sw        $v0, 0xB0($a0)
.L80246668:
/* 174F48 80246668 8C8200B4 */  lw        $v0, 0xB4($a0)
/* 174F4C 8024666C 28420064 */  slti      $v0, $v0, 0x64
/* 174F50 80246670 14400004 */  bnez      $v0, .L80246684
/* 174F54 80246674 3C02FBFF */   lui      $v0, (0xFBFFFFFF >> 16)
/* 174F58 80246678 24020063 */  addiu     $v0, $zero, 0x63
D_8024667C:
/* 174F5C 8024667C AC8200B4 */  sw        $v0, 0xB4($a0)
/* 174F60 80246680 3C02FBFF */  lui       $v0, (0xFBFFFFFF >> 16)
.L80246684:
/* 174F64 80246684 3442FFFF */  ori       $v0, $v0, (0xFBFFFFFF & 0xFFFF)
/* 174F68 80246688 8EC30004 */  lw        $v1, 0x4($s6)
/* 174F6C 8024668C 24040005 */  addiu     $a0, $zero, 0x5
/* 174F70 80246690 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 174F74 80246694 AC24C4DC */  sw        $a0, %lo(gBattleSubState)($at)
/* 174F78 80246698 00621824 */  and       $v1, $v1, $v0
D_8024669C:
/* 174F7C 8024669C AEC30004 */  sw        $v1, 0x4($s6)
.L802466A0:
/* 174F80 802466A0 3C12800E */  lui       $s2, %hi(gBattleSubState)
/* 174F84 802466A4 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
D_802466A8:
/* 174F88 802466A8 8E430000 */  lw        $v1, 0x0($s2)
.L802466AC:
/* 174F8C 802466AC 24020005 */  addiu     $v0, $zero, 0x5
D_802466B0_EA6FB0:
/* 174F90 802466B0 14620027 */  bne       $v1, $v0, jtbl_80246750
flo_18_pad_66B4:
/* 174F94 802466B4 24020006 */   addiu    $v0, $zero, 0x6
D_802466B8_EA6FB8:
/* 174F98 802466B8 8E0201D4 */  lw        $v0, 0x1D4($s0)
D_802466BC:
/* 174F9C 802466BC 10400005 */  beqz      $v0, .L802466D4
D_802466C0_EA6FC0:
/* 174FA0 802466C0 00000000 */   nop
/* 174FA4 802466C4 0C0B1059 */  jal       does_script_exist
D_802466C8_EA6FC8:
/* 174FA8 802466C8 8E0401E4 */   lw       $a0, 0x1E4($s0)
/* 174FAC 802466CC 1440001E */  bnez      $v0, .L80246748
dead_kzn_17_D_802466D0:
/* 174FB0 802466D0 00000000 */   nop
.L802466D4:
/* 174FB4 802466D4 3C03800E */  lui       $v1, %hi(gBattleStatus)
.L802466D8:
/* 174FB8 802466D8 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 174FBC 802466DC AE0001D4 */  sw        $zero, 0x1D4($s0)
/* 174FC0 802466E0 8C620004 */  lw        $v0, 0x4($v1)
/* 174FC4 802466E4 30420040 */  andi      $v0, $v0, 0x40
D_802466E8:
/* 174FC8 802466E8 10400006 */  beqz      $v0, .L80246704
/* 174FCC 802466EC 2402000A */   addiu    $v0, $zero, 0xA
/* 174FD0 802466F0 8C620000 */  lw        $v0, 0x0($v1)
/* 174FD4 802466F4 3C030010 */  lui       $v1, (0x100000 >> 16)
/* 174FD8 802466F8 00431024 */  and       $v0, $v0, $v1
.L802466FC:
/* 174FDC 802466FC 10400003 */  beqz      $v0, .L8024670C
.L80246700:
/* 174FE0 80246700 2402000A */   addiu    $v0, $zero, 0xA
.L80246704:
/* 174FE4 80246704 080919D0 */  j         .L80246740
/* 174FE8 80246708 AE420000 */   sw       $v0, 0x0($s2)
.L8024670C:
/* 174FEC 8024670C C6000138 */  lwc1      $f0, 0x138($s0)
/* 174FF0 80246710 C6020140 */  lwc1      $f2, 0x140($s0)
/* 174FF4 80246714 E600000C */  swc1      $f0, 0xC($s0)
D_80246718:
/* 174FF8 80246718 E6020014 */  swc1      $f2, 0x14($s0)
/* 174FFC 8024671C C6200138 */  lwc1      $f0, 0x138($s1)
/* 175000 80246720 24020006 */  addiu     $v0, $zero, 0x6
/* 175004 80246724 AE420000 */  sw        $v0, 0x0($s2)
D_80246728:
/* 175008 80246728 E6000018 */  swc1      $f0, 0x18($s0)
/* 17500C 8024672C C6200140 */  lwc1      $f0, 0x140($s1)
D_80246730:
/* 175010 80246730 24020004 */  addiu     $v0, $zero, 0x4
/* 175014 80246734 A6020070 */  sh        $v0, 0x70($s0)
/* 175018 80246738 AE000054 */  sw        $zero, 0x54($s0)
/* 17501C 8024673C E6000020 */  swc1      $f0, 0x20($s0)
.L80246740:
/* 175020 80246740 3C12800E */  lui       $s2, %hi(gBattleSubState)
D_80246744:
/* 175024 80246744 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
.L80246748:
/* 175028 80246748 8E430000 */  lw        $v1, 0x0($s2)
D_8024674C:
/* 17502C 8024674C 24020006 */  addiu     $v0, $zero, 0x6
jtbl_80246750:
/* 175030 80246750 1462006C */  bne       $v1, $v0, .L80246904
.L80246754:
/* 175034 80246754 00000000 */   nop
/* 175038 80246758 86020070 */  lh        $v0, 0x70($s0)
.L8024675C:
/* 17503C 8024675C 10400022 */  beqz      $v0, .L802467E8
/* 175040 80246760 00000000 */   nop
.L80246764:
/* 175044 80246764 C6000018 */  lwc1      $f0, 0x18($s0)
D_80246768:
/* 175048 80246768 C6080144 */  lwc1      $f8, 0x144($s0)
/* 17504C 8024676C C6020020 */  lwc1      $f2, 0x20($s0)
D_80246770:
/* 175050 80246770 46080001 */  sub.s     $f0, $f0, $f8
.L80246774:
/* 175054 80246774 C604014C */  lwc1      $f4, 0x14C($s0)
/* 175058 80246778 46041081 */  sub.s     $f2, $f2, $f4
/* 17505C 8024677C 44823000 */  mtc1      $v0, $f6
/* 175060 80246780 00000000 */  nop
D_80246784:
/* 175064 80246784 468031A0 */  cvt.s.w   $f6, $f6
/* 175068 80246788 46060003 */  div.s     $f0, $f0, $f6
/* 17506C 8024678C 46004200 */  add.s     $f8, $f8, $f0
/* 175070 80246790 46003006 */  mov.s     $f0, $f6
D_80246794:
/* 175074 80246794 46061083 */  div.s     $f2, $f2, $f6
D_80246798:
/* 175078 80246798 C600000C */  lwc1      $f0, 0xC($s0)
/* 17507C 8024679C 46022100 */  add.s     $f4, $f4, $f2
/* 175080 802467A0 E6080144 */  swc1      $f8, 0x144($s0)
/* 175084 802467A4 E604014C */  swc1      $f4, 0x14C($s0)
/* 175088 802467A8 C6240144 */  lwc1      $f4, 0x144($s1)
/* 17508C 802467AC 46040001 */  sub.s     $f0, $f0, $f4
/* 175090 802467B0 46003086 */  mov.s     $f2, $f6
kzn_17_LetterDelivery_SavedNpcAnim:
/* 175094 802467B4 46060003 */  div.s     $f0, $f0, $f6
/* 175098 802467B8 46002100 */  add.s     $f4, $f4, $f0
/* 17509C 802467BC E6240144 */  swc1      $f4, 0x144($s1)
/* 1750A0 802467C0 C6000014 */  lwc1      $f0, 0x14($s0)
.L802467C4:
/* 1750A4 802467C4 C624014C */  lwc1      $f4, 0x14C($s1)
/* 1750A8 802467C8 86020070 */  lh        $v0, 0x70($s0)
.L802467CC:
/* 1750AC 802467CC 46040001 */  sub.s     $f0, $f0, $f4
/* 1750B0 802467D0 44821000 */  mtc1      $v0, $f2
/* 1750B4 802467D4 00000000 */  nop
/* 1750B8 802467D8 468010A0 */  cvt.s.w   $f2, $f2
.L802467DC:
/* 1750BC 802467DC 46020003 */  div.s     $f0, $f0, $f2
/* 1750C0 802467E0 46002100 */  add.s     $f4, $f4, $f0
.L802467E4:
/* 1750C4 802467E4 E624014C */  swc1      $f4, 0x14C($s1)
.L802467E8:
/* 1750C8 802467E8 C60C0054 */  lwc1      $f12, 0x54($s0)
/* 1750CC 802467EC 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
D_802467F0:
/* 1750D0 802467F0 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1750D4 802467F4 4481B000 */  mtc1      $at, $f22
/* 1750D8 802467F8 00000000 */  nop
/* 1750DC 802467FC 46166302 */  mul.s     $f12, $f12, $f22
/* 1750E0 80246800 00000000 */  nop
/* 1750E4 80246804 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1750E8 80246808 4481C000 */  mtc1      $at, $f24
/* 1750EC 8024680C 3C014180 */  lui       $at, (0x41800000 >> 16)
/* 1750F0 80246810 4481A000 */  mtc1      $at, $f20
D_80246814:
/* 1750F4 80246814 0C00A85B */  jal       sin_rad
/* 1750F8 80246818 46186303 */   div.s    $f12, $f12, $f24
/* 1750FC 8024681C 46140002 */  mul.s     $f0, $f0, $f20
/* 175100 80246820 00000000 */  nop
D_80246824:
/* 175104 80246824 C602014C */  lwc1      $f2, 0x14C($s0)
/* 175108 80246828 46001080 */  add.s     $f2, $f2, $f0
.L8024682C:
/* 17510C 8024682C C60C0054 */  lwc1      $f12, 0x54($s0)
/* 175110 80246830 46006307 */  neg.s     $f12, $f12
D_80246834:
/* 175114 80246834 0C00A6C9 */  jal       clamp_angle
/* 175118 80246838 E602014C */   swc1     $f2, 0x14C($s0)
/* 17511C 8024683C C60C0054 */  lwc1      $f12, 0x54($s0)
/* 175120 80246840 46166302 */  mul.s     $f12, $f12, $f22
.L80246844:
/* 175124 80246844 00000000 */  nop
D_80246848:
/* 175128 80246848 E600018C */  swc1      $f0, 0x18C($s0)
flo_00_pad_684C:
/* 17512C 8024684C 0C00A85B */  jal       sin_rad
D_80246850:
/* 175130 80246850 46186303 */   div.s    $f12, $f12, $f24
.L80246854:
/* 175134 80246854 46140002 */  mul.s     $f0, $f0, $f20
/* 175138 80246858 00000000 */  nop
/* 17513C 8024685C C622014C */  lwc1      $f2, 0x14C($s1)
.L80246860:
/* 175140 80246860 46001081 */  sub.s     $f2, $f2, $f0
/* 175144 80246864 E622014C */  swc1      $f2, 0x14C($s1)
/* 175148 80246868 C60C0054 */  lwc1      $f12, 0x54($s0)
/* 17514C 8024686C 0C00A6C9 */  jal       clamp_angle
/* 175150 80246870 46006307 */   neg.s    $f12, $f12
/* 175154 80246874 E620018C */  swc1      $f0, 0x18C($s1)
/* 175158 80246878 C6000054 */  lwc1      $f0, 0x54($s0)
/* 17515C 8024687C 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
D_80246880:
/* 175160 80246880 44811000 */  mtc1      $at, $f2
/* 175164 80246884 86020070 */  lh        $v0, 0x70($s0)
/* 175168 80246888 46020000 */  add.s     $f0, $f0, $f2
/* 17516C 8024688C 96030070 */  lhu       $v1, 0x70($s0)
/* 175170 80246890 10400004 */  beqz      $v0, .L802468A4
dead_kzn_17_LetterDelivery_SavedNpcAnim:
/* 175174 80246894 E6000054 */   swc1     $f0, 0x54($s0)
/* 175178 80246898 2462FFFF */  addiu     $v0, $v1, -0x1
.L8024689C:
/* 17517C 8024689C 08091A41 */  j         .L80246904
/* 175180 802468A0 A6020070 */   sh       $v0, 0x70($s0)
.L802468A4:
/* 175184 802468A4 C6000018 */  lwc1      $f0, 0x18($s0)
/* 175188 802468A8 C6020020 */  lwc1      $f2, 0x20($s0)
.L802468AC:
/* 17518C 802468AC C604000C */  lwc1      $f4, 0xC($s0)
/* 175190 802468B0 E6000144 */  swc1      $f0, 0x144($s0)
.L802468B4:
/* 175194 802468B4 E602014C */  swc1      $f2, 0x14C($s0)
.L802468B8:
/* 175198 802468B8 E6240144 */  swc1      $f4, 0x144($s1)
/* 17519C 802468BC C6000014 */  lwc1      $f0, 0x14($s0)
/* 1751A0 802468C0 E620014C */  swc1      $f0, 0x14C($s1)
D_802468C4:
/* 1751A4 802468C4 C6000144 */  lwc1      $f0, 0x144($s0)
D_802468C8:
/* 1751A8 802468C8 C602014C */  lwc1      $f2, 0x14C($s0)
/* 1751AC 802468CC 2402000A */  addiu     $v0, $zero, 0xA
/* 1751B0 802468D0 E6000138 */  swc1      $f0, 0x138($s0)
/* 1751B4 802468D4 E6020140 */  swc1      $f2, 0x140($s0)
/* 1751B8 802468D8 C6200144 */  lwc1      $f0, 0x144($s1)
.L802468DC:
/* 1751BC 802468DC C622014C */  lwc1      $f2, 0x14C($s1)
.L802468E0:
/* 1751C0 802468E0 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 1751C4 802468E4 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
.L802468E8:
/* 1751C8 802468E8 AE420000 */  sw        $v0, 0x0($s2)
/* 1751CC 802468EC E6200138 */  swc1      $f0, 0x138($s1)
/* 1751D0 802468F0 E6220140 */  swc1      $f2, 0x140($s1)
/* 1751D4 802468F4 8C820000 */  lw        $v0, 0x0($a0)
D_802468F8:
/* 1751D8 802468F8 3C030010 */  lui       $v1, (0x100000 >> 16)
.L802468FC:
/* 1751DC 802468FC 00431025 */  or        $v0, $v0, $v1
/* 1751E0 80246900 AC820000 */  sw        $v0, 0x0($a0)
.L80246904:
/* 1751E4 80246904 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 1751E8 80246908 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 1751EC 8024690C 2402000A */  addiu     $v0, $zero, 0xA
/* 1751F0 80246910 14620078 */  bne       $v1, $v0, .L80246AF4
.L80246914:
/* 1751F4 80246914 00000000 */   nop
/* 1751F8 80246918 0C098D0D */  jal       btl_check_enemies_defeated
/* 1751FC 8024691C 00000000 */   nop
glabel .L80246920
/* 175200 80246920 14400074 */  bnez      $v0, .L80246AF4
D_80246924:
/* 175204 80246924 24020002 */   addiu    $v0, $zero, 0x2
/* 175208 80246928 82630178 */  lb        $v1, 0x178($s3)
glabel .L8024692C
/* 17520C 8024692C 14620010 */  bne       $v1, $v0, .L80246970
/* 175210 80246930 00000000 */   nop
.L80246934:
/* 175214 80246934 82620088 */  lb        $v0, 0x88($s3)
/* 175218 80246938 28420002 */  slti      $v0, $v0, 0x2
/* 17521C 8024693C 1440000C */  bnez      $v0, .L80246970
.L80246940:
/* 175220 80246940 00000000 */   nop
/* 175224 80246944 0C093903 */  jal       func_8024E40C
/* 175228 80246948 24040002 */   addiu    $a0, $zero, 0x2
/* 17522C 8024694C 0C093936 */  jal       D_8024E4D8_C0BD58
D_80246950:
/* 175230 80246950 2404000A */   addiu    $a0, $zero, 0xA
/* 175234 80246954 3C02800E */  lui       $v0, %hi(gBattleStatus)
D_80246958:
/* 175238 80246958 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 17523C 8024695C 8C430004 */  lw        $v1, 0x4($v0)
glabel .L80246960
/* 175240 80246960 2404FFFD */  addiu     $a0, $zero, -0x3
.L80246964:
/* 175244 80246964 00641824 */  and       $v1, $v1, $a0
/* 175248 80246968 08091A61 */  j         .L80246984
.L8024696C:
/* 17524C 8024696C AC430004 */   sw       $v1, 0x4($v0)
.L80246970:
/* 175250 80246970 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 175254 80246974 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 175258 80246978 8C620004 */  lw        $v0, 0x4($v1)
.L8024697C:
/* 17525C 8024697C 34420002 */  ori       $v0, $v0, 0x2
/* 175260 80246980 AC620004 */  sw        $v0, 0x4($v1)
.L80246984:
/* 175264 80246984 82620094 */  lb        $v0, 0x94($s3)
/* 175268 80246988 04410004 */  bgez      $v0, .L8024699C
/* 17526C 8024698C 24040006 */   addiu    $a0, $zero, 0x6
D_80246990:
/* 175270 80246990 A2600094 */  sb        $zero, 0x94($s3)
/* 175274 80246994 08091ABB */  j         .L80246AEC
/* 175278 80246998 A2600088 */   sb       $zero, 0x88($s3)
.L8024699C:
/* 17527C 8024699C 82620088 */  lb        $v0, 0x88($s3)
/* 175280 802469A0 92630088 */  lbu       $v1, 0x88($s3)
/* 175284 802469A4 1040002C */  beqz      $v0, .L80246A58
/* 175288 802469A8 2462FFFF */   addiu    $v0, $v1, -0x1
D_802469AC:
/* 17528C 802469AC A2620088 */  sb        $v0, 0x88($s3)
/* 175290 802469B0 00021600 */  sll       $v0, $v0, 24
/* 175294 802469B4 10400008 */  beqz      $v0, .L802469D8
/* 175298 802469B8 3C040400 */   lui      $a0, (0x4000000 >> 16)
/* 17529C 802469BC 0C090464 */  jal       func_80241190
/* 1752A0 802469C0 2404000C */   addiu    $a0, $zero, 0xC
D_802469C4:
/* 1752A4 802469C4 24020046 */  addiu     $v0, $zero, 0x46
/* 1752A8 802469C8 3C01800E */  lui       $at, %hi(gBattleSubState)
.L802469CC:
/* 1752AC 802469CC AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 1752B0 802469D0 08091ABD */  j         .L80246AF4
.L802469D4:
/* 1752B4 802469D4 00000000 */   nop
.L802469D8:
/* 1752B8 802469D8 3C05800E */  lui       $a1, %hi(gBattleStatus)
dgb_08_pad_69DC:
/* 1752BC 802469DC 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
D_802469E0:
/* 1752C0 802469E0 8CA20000 */  lw        $v0, 0x0($a1)
.L802469E4:
/* 1752C4 802469E4 00441024 */  and       $v0, $v0, $a0
/* 1752C8 802469E8 10400006 */  beqz      $v0, D_80246A04
/* 1752CC 802469EC 00000000 */   nop
D_802469F0:
/* 1752D0 802469F0 8262008B */  lb        $v0, 0x8B($s3)
/* 1752D4 802469F4 9263008B */  lbu       $v1, 0x8B($s3)
D_802469F8:
/* 1752D8 802469F8 1040000E */  beqz      $v0, .L80246A34
/* 1752DC 802469FC 2462FFFF */   addiu    $v0, $v1, -0x1
D_80246A00:
/* 1752E0 80246A00 A262008B */  sb        $v0, 0x8B($s3)
D_80246A04:
/* 1752E4 80246A04 8262008B */  lb        $v0, 0x8B($s3)
D_80246A08:
/* 1752E8 80246A08 5040000B */  beql      $v0, $zero, .L80246A38
/* 1752EC 80246A0C 3C05FBFF */   lui      $a1, (0xFBFFFFFF >> 16)
jtbl_80246A10:
/* 1752F0 80246A10 8CA20000 */  lw        $v0, 0x0($a1)
/* 1752F4 80246A14 00441024 */  and       $v0, $v0, $a0
/* 1752F8 80246A18 10400006 */  beqz      $v0, .L80246A34
/* 1752FC 80246A1C 2404000C */   addiu    $a0, $zero, 0xC
D_80246A20:
/* 175300 80246A20 8CA20004 */  lw        $v0, 0x4($a1)
/* 175304 80246A24 2403FFFD */  addiu     $v1, $zero, -0x3
/* 175308 80246A28 00431024 */  and       $v0, $v0, $v1
.L80246A2C:
/* 17530C 80246A2C 08091ABB */  j         .L80246AEC
/* 175310 80246A30 ACA20004 */   sw       $v0, 0x4($a1)
.L80246A34:
/* 175314 80246A34 3C05FBFF */  lui       $a1, (0xFBFFFFFF >> 16)
.L80246A38:
/* 175318 80246A38 34A5FFFF */  ori       $a1, $a1, (0xFBFFFFFF & 0xFFFF)
/* 17531C 80246A3C 3C03800E */  lui       $v1, %hi(gBattleStatus)
.L80246A40:
/* 175320 80246A40 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 175324 80246A44 8C620000 */  lw        $v0, 0x0($v1)
/* 175328 80246A48 24040008 */  addiu     $a0, $zero, 0x8
.L80246A4C:
/* 17532C 80246A4C 00451024 */  and       $v0, $v0, $a1
/* 175330 80246A50 08091ABB */  j         .L80246AEC
/* 175334 80246A54 AC620000 */   sw       $v0, 0x0($v1)
.L80246A58:
/* 175338 80246A58 3C05800E */  lui       $a1, %hi(gBattleStatus)
/* 17533C 80246A5C 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
glabel .L80246A60
/* 175340 80246A60 8CA20000 */  lw        $v0, 0x0($a1)
/* 175344 80246A64 3C040400 */  lui       $a0, (0x4000000 >> 16)
/* 175348 80246A68 00441024 */  and       $v0, $v0, $a0
/* 17534C 80246A6C 10400006 */  beqz      $v0, .L80246A88
D_80246A70:
/* 175350 80246A70 00000000 */   nop
/* 175354 80246A74 8262008B */  lb        $v0, 0x8B($s3)
/* 175358 80246A78 9263008B */  lbu       $v1, 0x8B($s3)
D_80246A7C:
/* 17535C 80246A7C 1040000E */  beqz      $v0, .L80246AB8
/* 175360 80246A80 2462FFFF */   addiu    $v0, $v1, -0x1
/* 175364 80246A84 A262008B */  sb        $v0, 0x8B($s3)
.L80246A88:
/* 175368 80246A88 8262008B */  lb        $v0, 0x8B($s3)
/* 17536C 80246A8C 5040000B */  beql      $v0, $zero, .L80246ABC
/* 175370 80246A90 3C05FBFF */   lui      $a1, (0xFBFFFFFF >> 16)
D_80246A94:
/* 175374 80246A94 8CA20000 */  lw        $v0, 0x0($a1)
.L80246A98:
/* 175378 80246A98 00441024 */  and       $v0, $v0, $a0
/* 17537C 80246A9C 10400006 */  beqz      $v0, .L80246AB8
/* 175380 80246AA0 2404000C */   addiu    $a0, $zero, 0xC
/* 175384 80246AA4 8CA20004 */  lw        $v0, 0x4($a1)
/* 175388 80246AA8 2403FFFD */  addiu     $v1, $zero, -0x3
/* 17538C 80246AAC 00431024 */  and       $v0, $v0, $v1
/* 175390 80246AB0 08091ABB */  j         .L80246AEC
/* 175394 80246AB4 ACA20004 */   sw       $v0, 0x4($a1)
.L80246AB8:
/* 175398 80246AB8 3C05FBFF */  lui       $a1, (0xFBFFFFFF >> 16)
glabel .L80246ABC
/* 17539C 80246ABC 34A5FFFF */  ori       $a1, $a1, (0xFBFFFFFF & 0xFFFF)
/* 1753A0 80246AC0 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1753A4 80246AC4 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
glabel func_80246AC8
/* 1753A8 80246AC8 8C620000 */  lw        $v0, 0x0($v1)
/* 1753AC 80246ACC 8C640004 */  lw        $a0, 0x4($v1)
/* 1753B0 80246AD0 00451024 */  and       $v0, $v0, $a1
/* 1753B4 80246AD4 30840040 */  andi      $a0, $a0, 0x40
/* 1753B8 80246AD8 14800003 */  bnez      $a0, .L80246AE8
/* 1753BC 80246ADC AC620000 */   sw       $v0, 0x0($v1)
/* 1753C0 80246AE0 08091ABB */  j         .L80246AEC
/* 1753C4 80246AE4 24040008 */   addiu    $a0, $zero, 0x8
.L80246AE8:
/* 1753C8 80246AE8 24040009 */  addiu     $a0, $zero, 0x9
.L80246AEC:
/* 1753CC 80246AEC 0C090464 */  jal       func_80241190
/* 1753D0 80246AF0 00000000 */   nop
.L80246AF4:
/* 1753D4 80246AF4 8FBF0030 */  lw        $ra, 0x30($sp)
.L80246AF8:
/* 1753D8 80246AF8 8FB7002C */  lw        $s7, 0x2C($sp)
glabel .L80246AFC
/* 1753DC 80246AFC 8FB60028 */  lw        $s6, 0x28($sp)
/* 1753E0 80246B00 8FB50024 */  lw        $s5, 0x24($sp)
/* 1753E4 80246B04 8FB40020 */  lw        $s4, 0x20($sp)
.L80246B08:
/* 1753E8 80246B08 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1753EC 80246B0C 8FB20018 */  lw        $s2, 0x18($sp)
.L80246B10:
/* 1753F0 80246B10 8FB10014 */  lw        $s1, 0x14($sp)
/* 1753F4 80246B14 8FB00010 */  lw        $s0, 0x10($sp)
/* 1753F8 80246B18 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 1753FC 80246B1C D7B60040 */  ldc1      $f22, 0x40($sp)
/* 175400 80246B20 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 175404 80246B24 03E00008 */  jr        $ra
/* 175408 80246B28 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_end_player_turn(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* player = battleStatus->playerActor;
    Actor* partner = battleStatus->partnerActor;
    Evt* script;

    if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_CHECK_HAPPY) {
        if (battleStatus->moveCategory == BTL_MENU_TYPE_ITEMS && battleStatus->itemUsesLeft >= 2) {
            gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY;
        } else if (
            !(gBattleStatus.flags2 & BS_FLAGS2_HAS_DRAINED_HP)
            && !is_ability_active(ABILITY_HAPPY_HEART)
            && !is_ability_active(ABILITY_CRAZY_HEART)
            && !is_ability_active(ABILITY_HAPPY_FLOWER)
        ) {
            gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY;
        } else if (player->stoneStatus == STATUS_KEY_STONE || battleStatus->outtaSightActive) {
            gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY;
        } else {
            s32 prevHPDrainCount = 0;
            s32 hpRecovery = 0;
            s32 fpRecovery = 0;

            if (gBattleStatus.flags2 & BS_FLAGS2_HAS_DRAINED_HP) {
                prevHPDrainCount = battleStatus->hpDrainCount;
                battleStatus->hpDrainCount = 0;
            }

            if (rand_int(100) < 50) {
                hpRecovery = is_ability_active(ABILITY_CRAZY_HEART) * 3;
            }
            if (rand_int(100) < 50) {
                hpRecovery += is_ability_active(ABILITY_HAPPY_HEART);
            }
            if (rand_int(100) < 50) {
                fpRecovery = is_ability_active(ABILITY_HAPPY_FLOWER);
            }

            if (prevHPDrainCount + hpRecovery + fpRecovery == 0) {
                gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY;
            } else {
                battleStatus->battlePhase = PHASE_PLAYER_HAPPY;
                script = start_script(&EVS_Mario_HandlePhase, EVT_PRIORITY_A, 0);
                player->takeTurnScript = script;
                player->takeTurnScriptID = script->id;
                script->owner1.actorID = ACTOR_PLAYER;
                if (gBattleStatus.flags2 & BS_FLAGS2_HAS_DRAINED_HP) {
                    script->varTable[10] += battleStatus->hpDrainCount;
                    battleStatus->hpDrainCount = 0;
                }
                script->varTable[10] = prevHPDrainCount;
                script->varTable[11] = hpRecovery;
                script->varTable[12] = fpRecovery;

                if (script->varTable[10] > 99) {
                    script->varTable[10] = 99;
                }
                if (script->varTable[11] > 99) {
                    script->varTable[11] = 99;
                }
                if (script->varTable[12] > 99) {
                    script->varTable[12] = 99;
                }

                gBattleStatus.flags2 &= ~BS_FLAGS2_HAS_DRAINED_HP;
                gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY;
            }
        }
    }

    switch (gBattleSubState) {
        case BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY:
            if (player->takeTurnScript != NULL && does_script_exist(player->takeTurnScriptID)) {
                break;
            }
            player->takeTurnScript = NULL;

            if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) || (gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) {
                gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_DONE;
            } else {
                player->state.currentPos.x = player->homePos.x;
                player->state.currentPos.z = player->homePos.z;
                player->state.goalPos.x = partner->homePos.x;
                player->state.goalPos.z = partner->homePos.z;
                player->state.moveTime = 4;
                player->state.angle = 0.0f;
                gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_SWAP;
            }
            break;
    }

    if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_SWAP) {
        if (player->state.moveTime != 0) {
            player->currentPos.x += (player->state.goalPos.x - player->currentPos.x) / player->state.moveTime;
            player->currentPos.z += (player->state.goalPos.z - player->currentPos.z) / player->state.moveTime;
            partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime;
            partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime;
        }
        player->currentPos.z += sin_rad((player->state.angle * TAU) / 360.0f) * 16.0f;
        player->yaw = clamp_angle(-player->state.angle);
        partner->currentPos.z -= sin_rad((player->state.angle * TAU) / 360.0f) * 16.0f;
        partner->yaw = clamp_angle(-player->state.angle);
        player->state.angle += 90.0f;

        if (player->state.moveTime != 0) {
            player->state.moveTime--;
        } else {
            player->currentPos.x = player->state.goalPos.x;
            player->currentPos.z = player->state.goalPos.z;
            partner->currentPos.x = player->state.currentPos.x;
            partner->currentPos.z = player->state.currentPos.z;
            player->homePos.x = player->currentPos.x;
            player->homePos.z = player->currentPos.z;
            partner->homePos.x = partner->currentPos.x;
            partner->homePos.z = partner->currentPos.z;
            gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK;
            gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_DONE;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_DONE) {
        if(!btl_check_enemies_defeated()) {
            if (battleStatus->moveCategory == BTL_MENU_TYPE_ITEMS && battleStatus->itemUsesLeft >= 2) {
                btl_cam_use_preset(BTL_CAM_DEFAULT);
                btl_cam_move(10);
                gBattleStatus.flags2 &= ~BS_FLAGS2_2;
            } else {
                gBattleStatus.flags2 |= BS_FLAGS2_2;
            }

            if (battleStatus->unk_94 < 0) {
                battleStatus->unk_94 = 0;
                battleStatus->itemUsesLeft = 0;
                btl_set_state(BATTLE_STATE_END_TURN);
                return;
            }

            if (battleStatus->itemUsesLeft != 0) {
                battleStatus->itemUsesLeft--;
                if (battleStatus->itemUsesLeft != 0) {
                    // double or triple dip has not run out yet, let the player choose another item
                    btl_set_state(BATTLE_STATE_PREPARE_MENU);
                    gBattleSubState = BATTLE_SUBSTATE_PREPARE_MENU_DIPPING;
                    return;
                }

                if (gBattleStatus.flags1 & BS_FLAGS1_HUSTLED) {
                    if (battleStatus->hustleTurns != 0) {
                        battleStatus->hustleTurns--;
                    }
                }

                if (battleStatus->hustleTurns != 0 && (gBattleStatus.flags1 & BS_FLAGS1_HUSTLED)) {
                    gBattleStatus.flags2 &= ~BS_FLAGS2_2;
                    btl_set_state(BATTLE_STATE_PREPARE_MENU);
                    return;
                } else {
                    gBattleStatus.flags1 &= ~BS_FLAGS1_HUSTLED;
                    btl_set_state(BATTLE_STATE_BEGIN_PARTNER_TURN);
                    return;
                }
            }

            if (gBattleStatus.flags1 & BS_FLAGS1_HUSTLED) {
                if (battleStatus->hustleTurns != 0) {
                    battleStatus->hustleTurns--;
                }
            }

            if (battleStatus->hustleTurns != 0 && (gBattleStatus.flags1 & BS_FLAGS1_HUSTLED)) {
                gBattleStatus.flags2 &= ~BS_FLAGS2_2;
                btl_set_state(BATTLE_STATE_PREPARE_MENU);
            } else {
                gBattleStatus.flags1 &= ~BS_FLAGS2_HAS_DRAINED_HP;
                if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)) {
                    btl_set_state(BATTLE_STATE_BEGIN_PARTNER_TURN);
                } else {
                    btl_set_state(BATTLE_STATE_9);
                }
            }
        }
    }
}