### RAW ASSEMBLY INSTRUCTIONS:

glabel D_80242FE0
/* 1718C0 80242FE0 27BDFFB8 */  addiu     $sp, $sp, -0x48
glabel func_80242FE4
/* 1718C4 80242FE4 AFB60028 */  sw        $s6, 0x28($sp)
D_80242FE8:
/* 1718C8 80242FE8 3C16800E */  lui       $s6, %hi(gBattleStatus)
.L80242FEC:
/* 1718CC 80242FEC 26D6C070 */  addiu     $s6, $s6, %lo(gBattleStatus)
D_80242FF0:
/* 1718D0 80242FF0 AFBF002C */  sw        $ra, 0x2C($sp)
glabel func_80242FF4
/* 1718D4 80242FF4 AFB50024 */  sw        $s5, 0x24($sp)
D_80242FF8:
/* 1718D8 80242FF8 AFB40020 */  sw        $s4, 0x20($sp)
.L80242FFC:
/* 1718DC 80242FFC AFB3001C */  sw        $s3, 0x1C($sp)
glabel func_80243000
/* 1718E0 80243000 AFB20018 */  sw        $s2, 0x18($sp)
glabel func_80243004
/* 1718E4 80243004 AFB10014 */  sw        $s1, 0x14($sp)
D_80243008:
/* 1718E8 80243008 AFB00010 */  sw        $s0, 0x10($sp)
D_8024300C:
/* 1718EC 8024300C F7B80040 */  sdc1      $f24, 0x40($sp)
D_80243010:
/* 1718F0 80243010 F7B60038 */  sdc1      $f22, 0x38($sp)
glabel func_80243014
/* 1718F4 80243014 F7B40030 */  sdc1      $f20, 0x30($sp)
glabel func_80243018
/* 1718F8 80243018 8ED500D8 */  lw        $s5, 0xD8($s6)
glabel func_8024301C
/* 1718FC 8024301C 3C02800E */  lui       $v0, %hi(gBattleSubState)
.L80243020:
/* 171900 80243020 8C42C4DC */  lw        $v0, %lo(gBattleSubState)($v0)
/* 171904 80243024 1440002D */  bnez      $v0, .L802430DC
D_80243028:
/* 171908 80243028 8ED200DC */   lw       $s2, 0xDC($s6)
.L8024302C:
/* 17190C 8024302C 8EC30004 */  lw        $v1, 0x4($s6)
.L80243030:
/* 171910 80243030 30620002 */  andi      $v0, $v1, 0x2
glabel func_80243034
/* 171914 80243034 10400227 */  beqz      $v0, D_802438D4
glabel func_80243038
/* 171918 80243038 2404000A */   addiu    $a0, $zero, 0xA
D_8024303C:
/* 17191C 8024303C 1240000A */  beqz      $s2, func_80243068
glabel func_80243040
/* 171920 80243040 30620004 */   andi     $v0, $v1, 0x4
glabel func_80243044
/* 171924 80243044 14400009 */  bnez      $v0, .L8024306C
glabel func_80243048
/* 171928 80243048 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
D_8024304C:
/* 17192C 8024304C 8E420000 */  lw        $v0, 0x0($s2)
glabel func_80243050
/* 171930 80243050 3C030020 */  lui       $v1, (0x200000 >> 16)
glabel func_80243054_EA3954
/* 171934 80243054 00431024 */  and       $v0, $v0, $v1
glabel func_80243058
/* 171938 80243058 14400004 */  bnez      $v0, .L8024306C
D_8024305C:
/* 17193C 8024305C 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
.L80243060:
/* 171940 80243060 08090E35 */  j         D_802438D4
.L80243064:
/* 171944 80243064 2404000B */   addiu    $a0, $zero, 0xB
glabel func_80243068
/* 171948 80243068 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
.L8024306C:
/* 17194C 8024306C 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
glabel func_80243070
/* 171950 80243070 8EA20000 */  lw        $v0, 0x0($s5)
.L80243074:
/* 171954 80243074 3C040400 */  lui       $a0, (0x4000000 >> 16)
D_80243078:
/* 171958 80243078 00431024 */  and       $v0, $v0, $v1
/* 17195C 8024307C 00441025 */  or        $v0, $v0, $a0
D_80243080:
/* 171960 80243080 12400005 */  beqz      $s2, D_80243098
glabel func_80243084
/* 171964 80243084 AEA20000 */   sw       $v0, 0x0($s5)
D_80243088:
/* 171968 80243088 8E420000 */  lw        $v0, 0x0($s2)
D_8024308C:
/* 17196C 8024308C 00431024 */  and       $v0, $v0, $v1
D_80243090:
/* 171970 80243090 00441025 */  or        $v0, $v0, $a0
glabel func_80243094
/* 171974 80243094 AE420000 */  sw        $v0, 0x0($s2)
D_80243098:
/* 171978 80243098 24020001 */  addiu     $v0, $zero, 0x1
D_8024309C:
/* 17197C 8024309C 3C04800E */  lui       $a0, %hi(gBattleStatus)
D_802430A0:
/* 171980 802430A0 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
.L802430A4:
/* 171984 802430A4 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel func_802430A8
/* 171988 802430A8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L802430AC:
/* 17198C 802430AC 8C820004 */  lw        $v0, 0x4($a0)
D_802430B0:
/* 171990 802430B0 2403FFFD */  addiu     $v1, $zero, -0x3
glabel func_802430B4
/* 171994 802430B4 3C01802A */  lui       $at, %hi(D_8029F258)
dead_flo_08_ItemChoice_HasSelectedItem:
/* 171998 802430B8 AC20F258 */  sw        $zero, %lo(D_8029F258)($at)
dead_flo_08_ItemChoice_SelectedItemID:
/* 17199C 802430BC 00431024 */  and       $v0, $v0, $v1
glabel func_802430C0
/* 1719A0 802430C0 2403FFFB */  addiu     $v1, $zero, -0x5
D_802430C4:
/* 1719A4 802430C4 00431024 */  and       $v0, $v0, $v1
glabel func_802430C8
/* 1719A8 802430C8 2403FFF7 */  addiu     $v1, $zero, -0x9
glabel func_802430CC
/* 1719AC 802430CC 00431024 */  and       $v0, $v0, $v1
glabel func_802430D0
/* 1719B0 802430D0 2403FFEF */  addiu     $v1, $zero, -0x11
D_802430D4:
/* 1719B4 802430D4 00431024 */  and       $v0, $v0, $v1
dgb_03_pad_30D8:
/* 1719B8 802430D8 AC820004 */  sw        $v0, 0x4($a0)
.L802430DC:
/* 1719BC 802430DC 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_802430E0:
/* 1719C0 802430E0 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
glabel dead_kzn_17_UnkFunc51
/* 1719C4 802430E4 24020001 */  addiu     $v0, $zero, 0x1
D_802430E8:
/* 1719C8 802430E8 14620091 */  bne       $v1, $v0, .L80243330
flo_11_pad_30EC:
/* 1719CC 802430EC 24020002 */   addiu    $v0, $zero, 0x2
D_802430F0:
/* 1719D0 802430F0 0000A02D */  daddu     $s4, $zero, $zero
/* 1719D4 802430F4 0280882D */  daddu     $s1, $s4, $zero
.L802430F8:
/* 1719D8 802430F8 02C0982D */  daddu     $s3, $s6, $zero
.L802430FC:
/* 1719DC 802430FC 8E7000E0 */  lw        $s0, 0xE0($s3)
D_80243100:
/* 1719E0 80243100 5200000B */  beql      $s0, $zero, D_80243130
glabel func_80243104
/* 1719E4 80243104 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80243108
/* 1719E8 80243108 8E0201D8 */  lw        $v0, 0x1D8($s0)
glabel .L8024310C
/* 1719EC 8024310C 50400008 */  beql      $v0, $zero, D_80243130
end_01_Font4Patterns:
/* 1719F0 80243110 26310001 */   addiu    $s1, $s1, 0x1
.L80243114:
/* 1719F4 80243114 8E0401E8 */  lw        $a0, 0x1E8($s0)
D_80243118:
/* 1719F8 80243118 0C0B1059 */  jal       does_script_exist
D_8024311C:
/* 1719FC 8024311C 00000000 */   nop
D_80243120:
/* 171A00 80243120 50400002 */  beql      $v0, $zero, .L8024312C
glabel func_80243124
/* 171A04 80243124 AE0001D8 */   sw       $zero, 0x1D8($s0)
.L80243128:
/* 171A08 80243128 24140001 */  addiu     $s4, $zero, 0x1
.L8024312C:
/* 171A0C 8024312C 26310001 */  addiu     $s1, $s1, 0x1
D_80243130:
/* 171A10 80243130 2A220018 */  slti      $v0, $s1, 0x18
glabel func_80243134
/* 171A14 80243134 1440FFF1 */  bnez      $v0, .L802430FC
glabel func_80243138
/* 171A18 80243138 26730004 */   addiu    $s3, $s3, 0x4
glabel func_8024313C
/* 171A1C 8024313C 16800079 */  bnez      $s4, func_80243324
/* 171A20 80243140 00000000 */   nop
.L80243144:
/* 171A24 80243144 0C098F18 */  jal       reset_actor_turn_info
.L80243148:
/* 171A28 80243148 0000882D */   daddu    $s1, $zero, $zero
D_8024314C:
/* 171A2C 8024314C 24130014 */  addiu     $s3, $zero, 0x14
.L80243150:
/* 171A30 80243150 3C14800E */  lui       $s4, %hi(gBattleStatus)
.L80243154:
/* 171A34 80243154 2694C070 */  addiu     $s4, $s4, %lo(gBattleStatus)
.L80243158:
/* 171A38 80243158 00111080 */  sll       $v0, $s1, 2
.L8024315C:
/* 171A3C 8024315C 02C21021 */  addu      $v0, $s6, $v0
D_80243160:
/* 171A40 80243160 8C5000E0 */  lw        $s0, 0xE0($v0)
glabel func_80243164
/* 171A44 80243164 52000069 */  beql      $s0, $zero, D_8024330C
D_80243168:
/* 171A48 80243168 26310001 */   addiu    $s1, $s1, 0x1
.L8024316C:
/* 171A4C 8024316C 3C04FFFE */  lui       $a0, (0xFFFEFFFF >> 16)
D_80243170_EDBF90:
/* 171A50 80243170 3484FFFF */  ori       $a0, $a0, (0xFFFEFFFF & 0xFFFF)
.L80243174:
/* 171A54 80243174 8E020000 */  lw        $v0, 0x0($s0)
end_01_Font3Patterns:
/* 171A58 80243178 3C030C00 */  lui       $v1, (0xC000000 >> 16)
glabel func_8024317C
/* 171A5C 8024317C 00431025 */  or        $v0, $v0, $v1
.L80243180:
/* 171A60 80243180 00442024 */  and       $a0, $v0, $a0
.L80243184:
/* 171A64 80243184 82020210 */  lb        $v0, 0x210($s0)
glabel func_80243188
/* 171A68 80243188 92030210 */  lbu       $v1, 0x210($s0)
D_8024318C:
/* 171A6C 8024318C 10400015 */  beqz      $v0, D_802431E4
D_80243190:
/* 171A70 80243190 AE040000 */   sw       $a0, 0x0($s0)
.L80243194:
/* 171A74 80243194 2462FFFD */  addiu     $v0, $v1, -0x3
glabel func_80243198
/* 171A78 80243198 2C420006 */  sltiu     $v0, $v0, 0x6
glabel .L8024319C
/* 171A7C 8024319C 10400003 */  beqz      $v0, .L802431AC
glabel func_802431A0
/* 171A80 802431A0 3C020001 */   lui      $v0, (0x10000 >> 16)
D_802431A4:
/* 171A84 802431A4 00821025 */  or        $v0, $a0, $v0
.L802431A8:
/* 171A88 802431A8 AE020000 */  sw        $v0, 0x0($s0)
.L802431AC:
/* 171A8C 802431AC 92020211 */  lbu       $v0, 0x211($s0)
glabel func_802431B0
/* 171A90 802431B0 2442FFFF */  addiu     $v0, $v0, -0x1
glabel func_802431B4
/* 171A94 802431B4 A2020211 */  sb        $v0, 0x211($s0)
glabel func_802431B8
/* 171A98 802431B8 00021600 */  sll       $v0, $v0, 24
glabel .L802431BC
/* 171A9C 802431BC 1C400009 */  bgtz      $v0, D_802431E4
.L802431C0:
/* 171AA0 802431C0 00000000 */   nop
D_802431C4:
/* 171AA4 802431C4 86040436 */  lh        $a0, 0x436($s0)
D_802431C8:
/* 171AA8 802431C8 0C011E26 */  jal       remove_status_debuff
D_802431CC:
/* 171AAC 802431CC A2000210 */   sb       $zero, 0x210($s0)
D_802431D0:
/* 171AB0 802431D0 0200202D */  daddu     $a0, $s0, $zero
D_802431D4:
/* 171AB4 802431D4 0C09DC58 */  jal       dispatch_event_actor
/* 171AB8 802431D8 24050031 */   addiu    $a1, $zero, 0x31
glabel func_802431DC
/* 171ABC 802431DC 3C01802A */  lui       $at, %hi(D_8029F258)
glabel func_802431E0
/* 171AC0 802431E0 AC33F258 */  sw        $s3, %lo(D_8029F258)($at)
D_802431E4:
/* 171AC4 802431E4 82020212 */  lb        $v0, 0x212($s0)
D_802431E8:
/* 171AC8 802431E8 1040000C */  beqz      $v0, .L8024321C
.L802431EC:
/* 171ACC 802431EC 00000000 */   nop
D_802431F0:
/* 171AD0 802431F0 92020213 */  lbu       $v0, 0x213($s0)
glabel func_802431F4
/* 171AD4 802431F4 2442FFFF */  addiu     $v0, $v0, -0x1
glabel func_802431F8
/* 171AD8 802431F8 A2020213 */  sb        $v0, 0x213($s0)
D_802431FC:
/* 171ADC 802431FC 00021600 */  sll       $v0, $v0, 24
D_80243200:
/* 171AE0 80243200 1C400006 */  bgtz      $v0, .L8024321C
.L80243204:
/* 171AE4 80243204 00000000 */   nop
dgb_04_pad_3208:
/* 171AE8 80243208 86040436 */  lh        $a0, 0x436($s0)
glabel .L8024320C
/* 171AEC 8024320C 0C011E68 */  jal       remove_status_static
D_80243210:
/* 171AF0 80243210 A2000212 */   sb       $zero, 0x212($s0)
D_80243214:
/* 171AF4 80243214 3C01802A */  lui       $at, %hi(D_8029F258)
flo_10_pad_3218:
/* 171AF8 80243218 AC33F258 */  sw        $s3, %lo(D_8029F258)($at)
.L8024321C:
/* 171AFC 8024321C 82020218 */  lb        $v0, 0x218($s0)
glabel func_80243220
/* 171B00 80243220 1040000C */  beqz      $v0, D_80243254
glabel .L80243224
/* 171B04 80243224 00000000 */   nop
D_80243228:
/* 171B08 80243228 92020219 */  lbu       $v0, 0x219($s0)
.L8024322C:
/* 171B0C 8024322C 2442FFFF */  addiu     $v0, $v0, -0x1
glabel func_80243230
/* 171B10 80243230 A2020219 */  sb        $v0, 0x219($s0)
.L80243234:
/* 171B14 80243234 00021600 */  sll       $v0, $v0, 24
glabel func_80243238
/* 171B18 80243238 1C400006 */  bgtz      $v0, D_80243254
/* 171B1C 8024323C 00000000 */   nop
D_80243240:
/* 171B20 80243240 86040436 */  lh        $a0, 0x436($s0)
glabel .L80243244
/* 171B24 80243244 0C011EAA */  jal       remove_status_transparent
D_80243248:
/* 171B28 80243248 A2000218 */   sb       $zero, 0x218($s0)
glabel func_8024324C
/* 171B2C 8024324C 3C01802A */  lui       $at, %hi(D_8029F258)
D_80243250:
/* 171B30 80243250 AC33F258 */  sw        $s3, %lo(D_8029F258)($at)
D_80243254:
/* 171B34 80243254 82020214 */  lb        $v0, 0x214($s0)
D_80243258:
/* 171B38 80243258 1040000A */  beqz      $v0, D_80243284
.L8024325C:
/* 171B3C 8024325C 00000000 */   nop
glabel func_80243260
/* 171B40 80243260 92020215 */  lbu       $v0, 0x215($s0)
D_80243264:
/* 171B44 80243264 2442FFFF */  addiu     $v0, $v0, -0x1
.L80243268:
/* 171B48 80243268 A2020215 */  sb        $v0, 0x215($s0)
D_8024326C:
/* 171B4C 8024326C 00021600 */  sll       $v0, $v0, 24
glabel func_80243270
/* 171B50 80243270 1C400004 */  bgtz      $v0, D_80243284
.L80243274:
/* 171B54 80243274 00000000 */   nop
.L80243278:
/* 171B58 80243278 A2000214 */  sb        $zero, 0x214($s0)
.L8024327C:
/* 171B5C 8024327C 3C01802A */  lui       $at, %hi(D_8029F258)
D_80243280:
/* 171B60 80243280 AC33F258 */  sw        $s3, %lo(D_8029F258)($at)
D_80243284:
/* 171B64 80243284 92020211 */  lbu       $v0, 0x211($s0)
D_80243288:
/* 171B68 80243288 82030217 */  lb        $v1, 0x217($s0)
glabel func_8024328C
/* 171B6C 8024328C A2020217 */  sb        $v0, 0x217($s0)
glabel .L80243290
/* 171B70 80243290 00021600 */  sll       $v0, $v0, 24
glabel func_80243294
/* 171B74 80243294 00021603 */  sra       $v0, $v0, 24
glabel .L80243298
/* 171B78 80243298 18400008 */  blez      $v0, .L802432BC
D_8024329C:
/* 171B7C 8024329C 00000000 */   nop
.L802432A0:
/* 171B80 802432A0 8E030440 */  lw        $v1, 0x440($s0)
glabel .L802432A4
/* 171B84 802432A4 2402000D */  addiu     $v0, $zero, 0xD
glabel .L802432A8
/* 171B88 802432A8 A2020216 */  sb        $v0, 0x216($s0)
glabel func_802432AC
/* 171B8C 802432AC 82020217 */  lb        $v0, 0x217($s0)
glabel func_802432B0
/* 171B90 802432B0 8C63000C */  lw        $v1, 0xC($v1)
glabel .L802432B4
/* 171B94 802432B4 08090CB5 */  j         D_802432D4
/* 171B98 802432B8 AC62003C */   sw       $v0, 0x3C($v1)
.L802432BC:
/* 171B9C 802432BC 10620005 */  beq       $v1, $v0, D_802432D4
glabel func_802432C0
/* 171BA0 802432C0 00000000 */   nop
D_802432C4:
/* 171BA4 802432C4 8E020440 */  lw        $v0, 0x440($s0)
glabel .L802432C8
/* 171BA8 802432C8 A2000216 */  sb        $zero, 0x216($s0)
glabel .L802432CC
/* 171BAC 802432CC 8C42000C */  lw        $v0, 0xC($v0)
D_802432D0:
/* 171BB0 802432D0 AC40003C */  sw        $zero, 0x3C($v0)
D_802432D4:
/* 171BB4 802432D4 82030210 */  lb        $v1, 0x210($s0)
glabel .L802432D8
/* 171BB8 802432D8 24020009 */  addiu     $v0, $zero, 0x9
glabel .L802432DC
/* 171BBC 802432DC 5462000B */  bnel      $v1, $v0, D_8024330C
D_802432E0:
/* 171BC0 802432E0 26310001 */   addiu    $s1, $s1, 0x1
/* 171BC4 802432E4 0200202D */  daddu     $a0, $s0, $zero
D_802432E8:
/* 171BC8 802432E8 24050001 */  addiu     $a1, $zero, 0x1
.L802432EC:
/* 171BCC 802432EC 8E820000 */  lw        $v0, 0x0($s4)
D_802432F0:
/* 171BD0 802432F0 2406000A */  addiu     $a2, $zero, 0xA
glabel .L802432F4
/* 171BD4 802432F4 34420020 */  ori       $v0, $v0, 0x20
glabel .L802432F8
/* 171BD8 802432F8 0C09E23E */  jal       dispatch_damage_event_actor_0
glabel func_802432FC
/* 171BDC 802432FC AE820000 */   sw       $v0, 0x0($s4)
D_80243300:
/* 171BE0 80243300 3C01802A */  lui       $at, %hi(D_8029F258)
/* 171BE4 80243304 AC33F258 */  sw        $s3, %lo(D_8029F258)($at)
.L80243308:
/* 171BE8 80243308 26310001 */  addiu     $s1, $s1, 0x1
D_8024330C:
/* 171BEC 8024330C 2A220018 */  slti      $v0, $s1, 0x18
glabel func_80243310
/* 171BF0 80243310 1440FF92 */  bnez      $v0, .L8024315C
glabel func_80243314
/* 171BF4 80243314 00111080 */   sll      $v0, $s1, 2
.L80243318:
/* 171BF8 80243318 24020002 */  addiu     $v0, $zero, 0x2
glabel .L8024331C
/* 171BFC 8024331C 3C01800E */  lui       $at, %hi(gBattleSubState)
D_80243320:
/* 171C00 80243320 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_80243324
/* 171C04 80243324 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80243328:
/* 171C08 80243328 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 171C0C 8024332C 24020002 */  addiu     $v0, $zero, 0x2
glabel .L80243330
/* 171C10 80243330 14620070 */  bne       $v1, $v0, func_802434F4
glabel func_80243334
/* 171C14 80243334 00000000 */   nop
glabel .L80243338
/* 171C18 80243338 8EA201D8 */  lw        $v0, 0x1D8($s5)
/* 171C1C 8024333C 10400005 */  beqz      $v0, D_80243354
D_80243340:
/* 171C20 80243340 00000000 */   nop
glabel .L80243344
/* 171C24 80243344 0C0B1059 */  jal       does_script_exist
.L80243348:
/* 171C28 80243348 8EA401E8 */   lw       $a0, 0x1E8($s5)
D_8024334C:
/* 171C2C 8024334C 14400069 */  bnez      $v0, func_802434F4
glabel func_80243350
/* 171C30 80243350 00000000 */   nop
D_80243354:
/* 171C34 80243354 1240000A */  beqz      $s2, func_80243380
jtbl_80243358:
/* 171C38 80243358 AEA001D8 */   sw       $zero, 0x1D8($s5)
glabel func_8024335C
/* 171C3C 8024335C 8E4201D8 */  lw        $v0, 0x1D8($s2)
glabel func_80243360
/* 171C40 80243360 50400007 */  beql      $v0, $zero, func_80243380
glabel func_80243364
/* 171C44 80243364 AE4001D8 */   sw       $zero, 0x1D8($s2)
glabel func_80243368
/* 171C48 80243368 8E4401E8 */  lw        $a0, 0x1E8($s2)
/* 171C4C 8024336C 0C0B1059 */  jal       does_script_exist
D_80243370:
/* 171C50 80243370 00000000 */   nop
glabel D_80243374
/* 171C54 80243374 1440005F */  bnez      $v0, func_802434F4
D_80243378:
/* 171C58 80243378 00000000 */   nop
.L8024337C:
/* 171C5C 8024337C AE4001D8 */  sw        $zero, 0x1D8($s2)
glabel func_80243380
/* 171C60 80243380 0000A02D */  daddu     $s4, $zero, $zero
D_80243384:
/* 171C64 80243384 0280882D */  daddu     $s1, $s4, $zero
glabel func_80243388
/* 171C68 80243388 02C0982D */  daddu     $s3, $s6, $zero
D_8024338C:
/* 171C6C 8024338C 8E7000E0 */  lw        $s0, 0xE0($s3)
D_80243390:
/* 171C70 80243390 5200000B */  beql      $s0, $zero, func_802433C0
D_80243394:
/* 171C74 80243394 26310001 */   addiu    $s1, $s1, 0x1
/* 171C78 80243398 8E0201D8 */  lw        $v0, 0x1D8($s0)
D_8024339C:
/* 171C7C 8024339C 50400008 */  beql      $v0, $zero, func_802433C0
glabel func_802433A0
/* 171C80 802433A0 26310001 */   addiu    $s1, $s1, 0x1
.L802433A4:
/* 171C84 802433A4 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 171C88 802433A8 0C0B1059 */  jal       does_script_exist
D_802433AC:
/* 171C8C 802433AC 00000000 */   nop
D_802433B0:
/* 171C90 802433B0 50400002 */  beql      $v0, $zero, func_802433BC
glabel func_802433B4
/* 171C94 802433B4 AE0001D8 */   sw       $zero, 0x1D8($s0)
glabel .L802433B8
/* 171C98 802433B8 24140001 */  addiu     $s4, $zero, 0x1
glabel func_802433BC
/* 171C9C 802433BC 26310001 */  addiu     $s1, $s1, 0x1
glabel func_802433C0
/* 171CA0 802433C0 2A220018 */  slti      $v0, $s1, 0x18
glabel func_802433C4
/* 171CA4 802433C4 1440FFF1 */  bnez      $v0, D_8024338C
D_802433C8:
/* 171CA8 802433C8 26730004 */   addiu    $s3, $s3, 0x4
glabel .L802433CC
/* 171CAC 802433CC 16800049 */  bnez      $s4, func_802434F4
D_802433D0:
/* 171CB0 802433D0 00000000 */   nop
/* 171CB4 802433D4 0C098D19 */  jal       btl_check_player_defeated
D_802433D8:
/* 171CB8 802433D8 00000000 */   nop
glabel .L802433DC
/* 171CBC 802433DC 1440013F */  bnez      $v0, .L802438DC
.L802433E0:
/* 171CC0 802433E0 00000000 */   nop
/* 171CC4 802433E4 0C098D0D */  jal       btl_check_enemies_defeated
glabel func_802433E8
/* 171CC8 802433E8 00000000 */   nop
glabel .L802433EC
/* 171CCC 802433EC 1440013B */  bnez      $v0, .L802438DC
D_802433F0:
/* 171CD0 802433F0 00000000 */   nop
glabel func_802433F4
/* 171CD4 802433F4 0C093903 */  jal       func_8024E40C
jtbl_802433F8:
/* 171CD8 802433F8 24040002 */   addiu    $a0, $zero, 0x2
/* 171CDC 802433FC 12400007 */  beqz      $s2, .L8024341C
D_80243400:
/* 171CE0 80243400 3C030010 */   lui      $v1, (0x100000 >> 16)
glabel .L80243404
/* 171CE4 80243404 3C04800E */  lui       $a0, %hi(gBattleStatus)
.L80243408:
/* 171CE8 80243408 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_8024340C:
/* 171CEC 8024340C 8C820000 */  lw        $v0, 0x0($a0)
/* 171CF0 80243410 00431024 */  and       $v0, $v0, $v1
D_80243414:
/* 171CF4 80243414 14400003 */  bnez      $v0, .L80243424
glabel dead_flo_13_UnkFunc42
/* 171CF8 80243418 00000000 */   nop
.L8024341C:
/* 171CFC 8024341C 08090D3B */  j         D_802434EC
D_80243420:
/* 171D00 80243420 24020004 */   addiu    $v0, $zero, 0x4
.L80243424:
/* 171D04 80243424 8C820004 */  lw        $v0, 0x4($a0)
D_80243428:
/* 171D08 80243428 30420040 */  andi      $v0, $v0, 0x40
glabel .L8024342C
/* 171D0C 8024342C 1440002F */  bnez      $v0, D_802434EC
.L80243430:
/* 171D10 80243430 24020004 */   addiu    $v0, $zero, 0x4
D_80243434:
/* 171D14 80243434 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
D_80243438:
/* 171D18 80243438 8EA20000 */  lw        $v0, 0x0($s5)
D_8024343C:
/* 171D1C 8024343C 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
D_80243440:
/* 171D20 80243440 00431024 */  and       $v0, $v0, $v1
D_80243444:
/* 171D24 80243444 AEA20000 */  sw        $v0, 0x0($s5)
D_80243448:
/* 171D28 80243448 8E420000 */  lw        $v0, 0x0($s2)
D_8024344C:
/* 171D2C 8024344C 00431024 */  and       $v0, $v0, $v1
D_80243450:
/* 171D30 80243450 AE420000 */  sw        $v0, 0x0($s2)
glabel .L80243454
/* 171D34 80243454 8EA20000 */  lw        $v0, 0x0($s5)
.L80243458:
/* 171D38 80243458 3C030400 */  lui       $v1, (0x4000000 >> 16)
.L8024345C:
/* 171D3C 8024345C 00431025 */  or        $v0, $v0, $v1
D_80243460:
/* 171D40 80243460 AEA20000 */  sw        $v0, 0x0($s5)
glabel .L80243464
/* 171D44 80243464 8E420000 */  lw        $v0, 0x0($s2)
glabel func_80243468
/* 171D48 80243468 00431025 */  or        $v0, $v0, $v1
D_8024346C:
/* 171D4C 8024346C AE420000 */  sw        $v0, 0x0($s2)
glabel func_80243470_EE1E30
/* 171D50 80243470 82C2009A */  lb        $v0, 0x9A($s6)
D_80243474:
/* 171D54 80243474 1440000A */  bnez      $v0, D_802434A0
.L80243478:
/* 171D58 80243478 2643000C */   addiu    $v1, $s2, 0xC
D_8024347C:
/* 171D5C 8024347C C6400138 */  lwc1      $f0, 0x138($s2)
D_80243480:
/* 171D60 80243480 C6420140 */  lwc1      $f2, 0x140($s2)
D_80243484:
/* 171D64 80243484 E640000C */  swc1      $f0, 0xC($s2)
/* 171D68 80243488 E6420014 */  swc1      $f2, 0x14($s2)
D_8024348C:
/* 171D6C 8024348C C6A00138 */  lwc1      $f0, 0x138($s5)
/* 171D70 80243490 E6400018 */  swc1      $f0, 0x18($s2)
glabel func_80243494
/* 171D74 80243494 C6A00140 */  lwc1      $f0, 0x140($s5)
D_80243498:
/* 171D78 80243498 08090D37 */  j         D_802434DC
glabel func_8024349C
/* 171D7C 8024349C E6400020 */   swc1     $f0, 0x20($s2)
D_802434A0:
/* 171D80 802434A0 C6400138 */  lwc1      $f0, 0x138($s2)
glabel func_802434A4
/* 171D84 802434A4 C6460140 */  lwc1      $f6, 0x140($s2)
D_802434A8:
/* 171D88 802434A8 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 171D8C 802434AC 44811000 */  mtc1      $at, $f2
glabel func_802434B0
/* 171D90 802434B0 C6440138 */  lwc1      $f4, 0x138($s2)
glabel func_802434B4
/* 171D94 802434B4 E640000C */  swc1      $f0, 0xC($s2)
D_802434B8:
/* 171D98 802434B8 46003006 */  mov.s     $f0, $f6
/* 171D9C 802434BC 46020000 */  add.s     $f0, $f0, $f2
D_802434C0:
/* 171DA0 802434C0 E6460014 */  swc1      $f6, 0x14($s2)
D_802434C4:
/* 171DA4 802434C4 E6440018 */  swc1      $f4, 0x18($s2)
jtbl_802434C8:
/* 171DA8 802434C8 E6400020 */  swc1      $f0, 0x20($s2)
D_802434CC:
/* 171DAC 802434CC C6A00138 */  lwc1      $f0, 0x138($s5)
.L802434D0:
/* 171DB0 802434D0 E6400138 */  swc1      $f0, 0x138($s2)
glabel func_802434D4
/* 171DB4 802434D4 C6A00140 */  lwc1      $f0, 0x140($s5)
D_802434D8:
/* 171DB8 802434D8 E6400140 */  swc1      $f0, 0x140($s2)
D_802434DC:
/* 171DBC 802434DC 24020004 */  addiu     $v0, $zero, 0x4
.L802434E0:
/* 171DC0 802434E0 A4620064 */  sh        $v0, 0x64($v1)
glabel .L802434E4
/* 171DC4 802434E4 24020003 */  addiu     $v0, $zero, 0x3
.L802434E8:
/* 171DC8 802434E8 AC600048 */  sw        $zero, 0x48($v1)
D_802434EC:
/* 171DCC 802434EC 3C01800E */  lui       $at, %hi(gBattleSubState)
.L802434F0:
/* 171DD0 802434F0 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_802434F4
/* 171DD4 802434F4 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_802434F8:
/* 171DD8 802434F8 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_802434FC:
/* 171DDC 802434FC 24020003 */  addiu     $v0, $zero, 0x3
glabel func_80243500
/* 171DE0 80243500 1462006F */  bne       $v1, $v0, func_802436C0
glabel func_80243504
/* 171DE4 80243504 00000000 */   nop
glabel func_80243508
/* 171DE8 80243508 86420070 */  lh        $v0, 0x70($s2)
glabel .L8024350C
/* 171DEC 8024350C 10400022 */  beqz      $v0, func_80243598
D_80243510:
/* 171DF0 80243510 00000000 */   nop
glabel func_80243514
/* 171DF4 80243514 C6400018 */  lwc1      $f0, 0x18($s2)
glabel func_80243518
/* 171DF8 80243518 C6480144 */  lwc1      $f8, 0x144($s2)
glabel func_8024351C
/* 171DFC 8024351C C6420020 */  lwc1      $f2, 0x20($s2)
.L80243520:
/* 171E00 80243520 46080001 */  sub.s     $f0, $f0, $f8
/* 171E04 80243524 C644014C */  lwc1      $f4, 0x14C($s2)
/* 171E08 80243528 46041081 */  sub.s     $f2, $f2, $f4
D_8024352C:
/* 171E0C 8024352C 44823000 */  mtc1      $v0, $f6
glabel func_80243530
/* 171E10 80243530 00000000 */  nop
.L80243534:
/* 171E14 80243534 468031A0 */  cvt.s.w   $f6, $f6
D_80243538:
/* 171E18 80243538 46060003 */  div.s     $f0, $f0, $f6
D_8024353C:
/* 171E1C 8024353C 46004200 */  add.s     $f8, $f8, $f0
D_80243540:
/* 171E20 80243540 46003006 */  mov.s     $f0, $f6
glabel .L80243544
/* 171E24 80243544 46061083 */  div.s     $f2, $f2, $f6
dgb_01_pad_3548:
/* 171E28 80243548 C640000C */  lwc1      $f0, 0xC($s2)
.L8024354C:
/* 171E2C 8024354C 46022100 */  add.s     $f4, $f4, $f2
D_80243550:
/* 171E30 80243550 E6480144 */  swc1      $f8, 0x144($s2)
/* 171E34 80243554 E644014C */  swc1      $f4, 0x14C($s2)
glabel dgb_04_pad_3558
/* 171E38 80243558 C6A40144 */  lwc1      $f4, 0x144($s5)
.L8024355C:
/* 171E3C 8024355C 46040001 */  sub.s     $f0, $f0, $f4
D_80243560:
/* 171E40 80243560 46003086 */  mov.s     $f2, $f6
D_80243564:
/* 171E44 80243564 46060003 */  div.s     $f0, $f0, $f6
D_80243568:
/* 171E48 80243568 46002100 */  add.s     $f4, $f4, $f0
glabel func_8024356C
/* 171E4C 8024356C E6A40144 */  swc1      $f4, 0x144($s5)
glabel func_80243570
/* 171E50 80243570 C6400014 */  lwc1      $f0, 0x14($s2)
glabel func_80243574
/* 171E54 80243574 C6A4014C */  lwc1      $f4, 0x14C($s5)
glabel func_80243578
/* 171E58 80243578 86420070 */  lh        $v0, 0x70($s2)
.L8024357C:
/* 171E5C 8024357C 46040001 */  sub.s     $f0, $f0, $f4
glabel func_80243580
/* 171E60 80243580 44821000 */  mtc1      $v0, $f2
glabel func_80243584_EE1F44
/* 171E64 80243584 00000000 */  nop
glabel func_80243588
/* 171E68 80243588 468010A0 */  cvt.s.w   $f2, $f2
/* 171E6C 8024358C 46020003 */  div.s     $f0, $f0, $f2
glabel .L80243590
/* 171E70 80243590 46002100 */  add.s     $f4, $f4, $f0
.L80243594:
/* 171E74 80243594 E6A4014C */  swc1      $f4, 0x14C($s5)
glabel func_80243598
/* 171E78 80243598 C64C0054 */  lwc1      $f12, 0x54($s2)
D_8024359C:
/* 171E7C 8024359C 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
glabel func_802435A0
/* 171E80 802435A0 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 171E84 802435A4 4481B000 */  mtc1      $at, $f22
D_802435A8:
/* 171E88 802435A8 00000000 */  nop
/* 171E8C 802435AC 46166302 */  mul.s     $f12, $f12, $f22
D_802435B0:
/* 171E90 802435B0 00000000 */  nop
D_802435B4:
/* 171E94 802435B4 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
D_802435B8:
/* 171E98 802435B8 4481C000 */  mtc1      $at, $f24
.L802435BC:
/* 171E9C 802435BC 3C014180 */  lui       $at, (0x41800000 >> 16)
D_802435C0:
/* 171EA0 802435C0 4481A000 */  mtc1      $at, $f20
glabel func_802435C4
/* 171EA4 802435C4 0C00A85B */  jal       sin_rad
D_802435C8:
/* 171EA8 802435C8 46186303 */   div.s    $f12, $f12, $f24
glabel func_802435CC
/* 171EAC 802435CC 46140002 */  mul.s     $f0, $f0, $f20
D_802435D0:
/* 171EB0 802435D0 00000000 */  nop
D_802435D4:
/* 171EB4 802435D4 C642014C */  lwc1      $f2, 0x14C($s2)
D_802435D8:
/* 171EB8 802435D8 46001081 */  sub.s     $f2, $f2, $f0
/* 171EBC 802435DC C64C0054 */  lwc1      $f12, 0x54($s2)
D_802435E0:
/* 171EC0 802435E0 0C00A6C9 */  jal       clamp_angle
D_802435E4:
/* 171EC4 802435E4 E642014C */   swc1     $f2, 0x14C($s2)
D_802435E8:
/* 171EC8 802435E8 C64C0054 */  lwc1      $f12, 0x54($s2)
D_802435EC:
/* 171ECC 802435EC 46166302 */  mul.s     $f12, $f12, $f22
D_802435F0:
/* 171ED0 802435F0 00000000 */  nop
/* 171ED4 802435F4 E640018C */  swc1      $f0, 0x18C($s2)
D_802435F8:
/* 171ED8 802435F8 0C00A85B */  jal       sin_rad
.L802435FC:
/* 171EDC 802435FC 46186303 */   div.s    $f12, $f12, $f24
D_80243600:
/* 171EE0 80243600 46140002 */  mul.s     $f0, $f0, $f20
D_80243604:
/* 171EE4 80243604 00000000 */  nop
D_80243608:
/* 171EE8 80243608 C6A2014C */  lwc1      $f2, 0x14C($s5)
D_8024360C:
/* 171EEC 8024360C 46001080 */  add.s     $f2, $f2, $f0
glabel func_80243610
/* 171EF0 80243610 E6A2014C */  swc1      $f2, 0x14C($s5)
D_80243614:
/* 171EF4 80243614 0C00A6C9 */  jal       clamp_angle
.L80243618:
/* 171EF8 80243618 C64C0054 */   lwc1     $f12, 0x54($s2)
/* 171EFC 8024361C E6A0018C */  swc1      $f0, 0x18C($s5)
glabel .L80243620
/* 171F00 80243620 C6400054 */  lwc1      $f0, 0x54($s2)
glabel func_80243624
/* 171F04 80243624 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
D_80243628:
/* 171F08 80243628 44811000 */  mtc1      $at, $f2
D_8024362C:
/* 171F0C 8024362C 86420070 */  lh        $v0, 0x70($s2)
/* 171F10 80243630 46020000 */  add.s     $f0, $f0, $f2
.L80243634:
/* 171F14 80243634 96430070 */  lhu       $v1, 0x70($s2)
glabel .L80243638
/* 171F18 80243638 10400004 */  beqz      $v0, .L8024364C
/* 171F1C 8024363C E6400054 */   swc1     $f0, 0x54($s2)
glabel func_80243640
/* 171F20 80243640 2462FFFF */  addiu     $v0, $v1, -0x1
D_80243644:
/* 171F24 80243644 08090DB0 */  j         func_802436C0
/* 171F28 80243648 A6420070 */   sh       $v0, 0x70($s2)
.L8024364C:
/* 171F2C 8024364C C6400018 */  lwc1      $f0, 0x18($s2)
glabel func_80243650
/* 171F30 80243650 C6420020 */  lwc1      $f2, 0x20($s2)
arn_04_pad_3654:
/* 171F34 80243654 C644000C */  lwc1      $f4, 0xC($s2)
D_80243658:
/* 171F38 80243658 E6400144 */  swc1      $f0, 0x144($s2)
dead_flo_09_FlyingAI_JumpVels:
/* 171F3C 8024365C E642014C */  swc1      $f2, 0x14C($s2)
D_80243660:
/* 171F40 80243660 E6A40144 */  swc1      $f4, 0x144($s5)
glabel func_80243664
/* 171F44 80243664 C6400014 */  lwc1      $f0, 0x14($s2)
/* 171F48 80243668 E6A0014C */  swc1      $f0, 0x14C($s5)
glabel func_8024366C
/* 171F4C 8024366C 82C2009A */  lb        $v0, 0x9A($s6)
D_80243670:
/* 171F50 80243670 14400005 */  bnez      $v0, .L80243688
D_80243674:
/* 171F54 80243674 00000000 */   nop
.L80243678:
/* 171F58 80243678 C6400144 */  lwc1      $f0, 0x144($s2)
D_8024367C:
/* 171F5C 8024367C C642014C */  lwc1      $f2, 0x14C($s2)
glabel dead_flo_13_LoadPartyImage
/* 171F60 80243680 E6400138 */  swc1      $f0, 0x138($s2)
D_80243684:
/* 171F64 80243684 E6420140 */  swc1      $f2, 0x140($s2)
glabel .L80243688
/* 171F68 80243688 C6A00144 */  lwc1      $f0, 0x144($s5)
D_8024368C:
/* 171F6C 8024368C C6A2014C */  lwc1      $f2, 0x14C($s5)
D_80243690:
/* 171F70 80243690 E6A00138 */  swc1      $f0, 0x138($s5)
.L80243694:
/* 171F74 80243694 E6A20140 */  swc1      $f2, 0x140($s5)
glabel func_80243698
/* 171F78 80243698 3C05FFEF */  lui       $a1, (0xFFEFFFFF >> 16)
D_8024369C:
/* 171F7C 8024369C 34A5FFFF */  ori       $a1, $a1, (0xFFEFFFFF & 0xFFFF)
glabel .L802436A0
/* 171F80 802436A0 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 171F84 802436A4 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
/* 171F88 802436A8 8C820000 */  lw        $v0, 0x0($a0)
D_802436AC:
/* 171F8C 802436AC 24030004 */  addiu     $v1, $zero, 0x4
D_802436B0:
/* 171F90 802436B0 3C01800E */  lui       $at, %hi(gBattleSubState)
D_802436B4:
/* 171F94 802436B4 AC23C4DC */  sw        $v1, %lo(gBattleSubState)($at)
D_802436B8:
/* 171F98 802436B8 00451024 */  and       $v0, $v0, $a1
D_802436BC:
/* 171F9C 802436BC AC820000 */  sw        $v0, 0x0($a0)
glabel func_802436C0
/* 171FA0 802436C0 3C10800E */  lui       $s0, %hi(gBattleSubState)
/* 171FA4 802436C4 2610C4DC */  addiu     $s0, $s0, %lo(gBattleSubState)
.L802436C8:
/* 171FA8 802436C8 8E030000 */  lw        $v1, 0x0($s0)
.L802436CC:
/* 171FAC 802436CC 24020004 */  addiu     $v0, $zero, 0x4
D_802436D0:
/* 171FB0 802436D0 14620038 */  bne       $v1, $v0, D_802437B4
glabel func_802436D4
/* 171FB4 802436D4 00000000 */   nop
glabel dgb_18_pad_36D8
/* 171FB8 802436D8 3C03802A */  lui       $v1, %hi(D_8029F258)
D_802436DC:
/* 171FBC 802436DC 2463F258 */  addiu     $v1, $v1, %lo(D_8029F258)
D_802436E0:
/* 171FC0 802436E0 8C620000 */  lw        $v0, 0x0($v1)
D_802436E4:
/* 171FC4 802436E4 10400003 */  beqz      $v0, D_802436F4
.L802436E8:
/* 171FC8 802436E8 2442FFFF */   addiu    $v0, $v0, -0x1
D_802436EC:
/* 171FCC 802436EC 08090DED */  j         D_802437B4
glabel func_802436F0
/* 171FD0 802436F0 AC620000 */   sw       $v0, 0x0($v1)
D_802436F4:
/* 171FD4 802436F4 82C3008A */  lb        $v1, 0x8A($s6)
glabel .L802436F8
/* 171FD8 802436F8 24020002 */  addiu     $v0, $zero, 0x2
flo_16_pad_36FC:
/* 171FDC 802436FC 14620011 */  bne       $v1, $v0, func_80243744
D_80243700:
/* 171FE0 80243700 3C04F7FF */   lui      $a0, (0xF7FFFFFF >> 16)
.L80243704:
/* 171FE4 80243704 3C048028 */  lui       $a0, %hi(EVS_Mario_HandlePhase)
D_80243708:
/* 171FE8 80243708 24844EBC */  addiu     $a0, $a0, %lo(EVS_Mario_HandlePhase)
glabel func_8024370C
/* 171FEC 8024370C 2405000A */  addiu     $a1, $zero, 0xA
D_80243710:
/* 171FF0 80243710 0000302D */  daddu     $a2, $zero, $zero
glabel func_80243714
/* 171FF4 80243714 24020003 */  addiu     $v0, $zero, 0x3
D_80243718:
/* 171FF8 80243718 A2C200AD */  sb        $v0, 0xAD($s6)
D_8024371C:
/* 171FFC 8024371C 24020015 */  addiu     $v0, $zero, 0x15
D_80243720:
/* 172000 80243720 A2C0008A */  sb        $zero, 0x8A($s6)
D_80243724:
/* 172004 80243724 0C0B0CF8 */  jal       start_script
/* 172008 80243728 A2C201A7 */   sb       $v0, 0x1A7($s6)
.L8024372C:
/* 17200C 8024372C 0040182D */  daddu     $v1, $v0, $zero
jtbl_80243730:
/* 172010 80243730 AEA301D4 */  sw        $v1, 0x1D4($s5)
/* 172014 80243734 8C620144 */  lw        $v0, 0x144($v1)
dgb_03_pad_3738:
/* 172018 80243738 AEA201E4 */  sw        $v0, 0x1E4($s5)
D_8024373C:
/* 17201C 8024373C AC600148 */  sw        $zero, 0x148($v1)
D_80243740:
/* 172020 80243740 3C04F7FF */  lui       $a0, (0xF7FFFFFF >> 16)
glabel func_80243744
/* 172024 80243744 3C05800E */  lui       $a1, %hi(gBattleStatus)
glabel func_80243748
/* 172028 80243748 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
D_8024374C:
/* 17202C 8024374C 2406FFFD */  addiu     $a2, $zero, -0x3
/* 172030 80243750 8CA20000 */  lw        $v0, 0x0($a1)
glabel func_80243754
/* 172034 80243754 3484FFFF */  ori       $a0, $a0, (0xF7FFFFFF & 0xFFFF)
glabel dgb_00_pad_3758
/* 172038 80243758 00461024 */  and       $v0, $v0, $a2
.L8024375C:
/* 17203C 8024375C ACA20000 */  sw        $v0, 0x0($a1)
dead_flo_16_SuperBlock_CantUpgradeMessages:
/* 172040 80243760 8EA20000 */  lw        $v0, 0x0($s5)
D_80243764:
/* 172044 80243764 3C030400 */  lui       $v1, (0x4000000 >> 16)
dead_flo_16_SuperBlock_PartnerIDs:
/* 172048 80243768 00441024 */  and       $v0, $v0, $a0
D_8024376C:
/* 17204C 8024376C 00431025 */  or        $v0, $v0, $v1
glabel D_80243770
/* 172050 80243770 12400005 */  beqz      $s2, .L80243788
/* 172054 80243774 AEA20000 */   sw       $v0, 0x0($s5)
dead_flo_16_SuperBlock_UpgradeDescMessages:
/* 172058 80243778 8E420000 */  lw        $v0, 0x0($s2)
/* 17205C 8024377C 00441024 */  and       $v0, $v0, $a0
glabel func_80243780
/* 172060 80243780 00431025 */  or        $v0, $v0, $v1
/* 172064 80243784 AE420000 */  sw        $v0, 0x0($s2)
glabel .L80243788
/* 172068 80243788 8CA20004 */  lw        $v0, 0x4($a1)
.L8024378C:
/* 17206C 8024378C 24030005 */  addiu     $v1, $zero, 0x5
D_80243790:
/* 172070 80243790 AE030000 */  sw        $v1, 0x0($s0)
D_80243794:
/* 172074 80243794 2403FFFB */  addiu     $v1, $zero, -0x5
glabel func_80243798
/* 172078 80243798 00461024 */  and       $v0, $v0, $a2
/* 17207C 8024379C 00431024 */  and       $v0, $v0, $v1
D_802437A0:
/* 172080 802437A0 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 172084 802437A4 00431024 */  and       $v0, $v0, $v1
D_802437A8:
/* 172088 802437A8 2403FFEF */  addiu     $v1, $zero, -0x11
D_802437AC:
/* 17208C 802437AC 00431024 */  and       $v0, $v0, $v1
D_802437B0:
/* 172090 802437B0 ACA20004 */  sw        $v0, 0x4($a1)
D_802437B4:
/* 172094 802437B4 3C03800E */  lui       $v1, %hi(gBattleSubState)
dead_flo_16_SuperBlock_UpgradeOrbAngles:
/* 172098 802437B8 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_802437BC:
/* 17209C 802437BC 24020005 */  addiu     $v0, $zero, 0x5
glabel D_802437C0
/* 1720A0 802437C0 14620028 */  bne       $v1, $v0, .L80243864
/* 1720A4 802437C4 24020006 */   addiu    $v0, $zero, 0x6
D_802437C8:
/* 1720A8 802437C8 8EA201D4 */  lw        $v0, 0x1D4($s5)
glabel func_802437CC
/* 1720AC 802437CC 50400007 */  beql      $v0, $zero, .L802437EC
glabel func_802437D0
/* 1720B0 802437D0 AEA001D4 */   sw       $zero, 0x1D4($s5)
/* 1720B4 802437D4 8EA401E4 */  lw        $a0, 0x1E4($s5)
/* 1720B8 802437D8 0C0B1059 */  jal       does_script_exist
D_802437DC:
/* 1720BC 802437DC 00000000 */   nop
D_802437E0:
/* 1720C0 802437E0 1440001D */  bnez      $v0, .L80243858
/* 1720C4 802437E4 00000000 */   nop
glabel .L802437E8
/* 1720C8 802437E8 AEA001D4 */  sw        $zero, 0x1D4($s5)
.L802437EC:
/* 1720CC 802437EC 0000882D */  daddu     $s1, $zero, $zero
D_802437F0:
/* 1720D0 802437F0 2413000D */  addiu     $s3, $zero, 0xD
glabel func_802437F4
/* 1720D4 802437F4 02C0902D */  daddu     $s2, $s6, $zero
.L802437F8:
/* 1720D8 802437F8 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 1720DC 802437FC 52000010 */  beql      $s0, $zero, D_80243840
D_80243800:
/* 1720E0 80243800 26310001 */   addiu    $s1, $s1, 0x1
D_80243804:
/* 1720E4 80243804 8E0201CC */  lw        $v0, 0x1CC($s0)
glabel func_80243808
/* 1720E8 80243808 5040000D */  beql      $v0, $zero, D_80243840
/* 1720EC 8024380C 26310001 */   addiu    $s1, $s1, 0x1
/* 1720F0 80243810 2405000A */  addiu     $a1, $zero, 0xA
D_80243814:
/* 1720F4 80243814 A2D301A7 */  sb        $s3, 0x1A7($s6)
/* 1720F8 80243818 8E0401CC */  lw        $a0, 0x1CC($s0)
glabel func_8024381C
/* 1720FC 8024381C 0C0B0CF8 */  jal       start_script
D_80243820:
/* 172100 80243820 0000302D */   daddu    $a2, $zero, $zero
.L80243824:
/* 172104 80243824 0040182D */  daddu     $v1, $v0, $zero
glabel .L80243828
/* 172108 80243828 AE0301DC */  sw        $v1, 0x1DC($s0)
D_8024382C:
/* 17210C 8024382C 8C620144 */  lw        $v0, 0x144($v1)
D_80243830:
/* 172110 80243830 AE0201EC */  sw        $v0, 0x1EC($s0)
.L80243834:
/* 172114 80243834 36220200 */  ori       $v0, $s1, 0x200
jtbl_80243838:
/* 172118 80243838 AC620148 */  sw        $v0, 0x148($v1)
/* 17211C 8024383C 26310001 */  addiu     $s1, $s1, 0x1
D_80243840:
/* 172120 80243840 2A220018 */  slti      $v0, $s1, 0x18
/* 172124 80243844 1440FFEC */  bnez      $v0, .L802437F8
glabel .L80243848
/* 172128 80243848 26520004 */   addiu    $s2, $s2, 0x4
.L8024384C:
/* 17212C 8024384C 24020006 */  addiu     $v0, $zero, 0x6
.L80243850:
/* 172130 80243850 3C01800E */  lui       $at, %hi(gBattleSubState)
D_80243854:
/* 172134 80243854 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80243858:
/* 172138 80243858 3C03800E */  lui       $v1, %hi(gBattleSubState)
.L8024385C:
/* 17213C 8024385C 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
.L80243860:
/* 172140 80243860 24020006 */  addiu     $v0, $zero, 0x6
.L80243864:
/* 172144 80243864 14620016 */  bne       $v1, $v0, .L802438C0
glabel .L80243868
/* 172148 80243868 0000A02D */   daddu    $s4, $zero, $zero
glabel func_8024386C
/* 17214C 8024386C 0280882D */  daddu     $s1, $s4, $zero
D_80243870:
/* 172150 80243870 02C0902D */  daddu     $s2, $s6, $zero
D_80243874:
/* 172154 80243874 8E5000E0 */  lw        $s0, 0xE0($s2)
glabel .L80243878
/* 172158 80243878 5200000A */  beql      $s0, $zero, func_802438A4
D_8024387C:
/* 17215C 8024387C 26310001 */   addiu    $s1, $s1, 0x1
D_80243880:
/* 172160 80243880 8E0201CC */  lw        $v0, 0x1CC($s0)
/* 172164 80243884 50400007 */  beql      $v0, $zero, func_802438A4
D_80243888:
/* 172168 80243888 26310001 */   addiu    $s1, $s1, 0x1
D_8024388C:
/* 17216C 8024388C 8E0401EC */  lw        $a0, 0x1EC($s0)
D_80243890:
/* 172170 80243890 0C0B1059 */  jal       does_script_exist
/* 172174 80243894 00000000 */   nop
D_80243898:
/* 172178 80243898 54400001 */  bnel      $v0, $zero, .L802438A0
/* 17217C 8024389C 24140001 */   addiu    $s4, $zero, 0x1
.L802438A0:
/* 172180 802438A0 26310001 */  addiu     $s1, $s1, 0x1
glabel func_802438A4
/* 172184 802438A4 2A220018 */  slti      $v0, $s1, 0x18
D_802438A8:
/* 172188 802438A8 1440FFF2 */  bnez      $v0, D_80243874
/* 17218C 802438AC 26520004 */   addiu    $s2, $s2, 0x4
D_802438B0:
/* 172190 802438B0 16800003 */  bnez      $s4, .L802438C0
/* 172194 802438B4 24020007 */   addiu    $v0, $zero, 0x7
/* 172198 802438B8 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 17219C 802438BC AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L802438C0:
/* 1721A0 802438C0 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 1721A4 802438C4 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_802438C8:
/* 1721A8 802438C8 24020007 */  addiu     $v0, $zero, 0x7
D_802438CC:
/* 1721AC 802438CC 14620003 */  bne       $v1, $v0, .L802438DC
glabel func_802438D0
/* 1721B0 802438D0 24040014 */   addiu    $a0, $zero, 0x14
D_802438D4:
/* 1721B4 802438D4 0C090464 */  jal       func_80241190
D_802438D8:
/* 1721B8 802438D8 00000000 */   nop
.L802438DC:
/* 1721BC 802438DC 8FBF002C */  lw        $ra, 0x2C($sp)
D_802438E0:
/* 1721C0 802438E0 8FB60028 */  lw        $s6, 0x28($sp)
/* 1721C4 802438E4 8FB50024 */  lw        $s5, 0x24($sp)
pra_13_802438E8:
/* 1721C8 802438E8 8FB40020 */  lw        $s4, 0x20($sp)
D_802438EC:
/* 1721CC 802438EC 8FB3001C */  lw        $s3, 0x1C($sp)
glabel func_802438F0
/* 1721D0 802438F0 8FB20018 */  lw        $s2, 0x18($sp)
.L802438F4:
/* 1721D4 802438F4 8FB10014 */  lw        $s1, 0x14($sp)
D_802438F8:
/* 1721D8 802438F8 8FB00010 */  lw        $s0, 0x10($sp)
/* 1721DC 802438FC D7B80040 */  ldc1      $f24, 0x40($sp)
jtbl_80243900:
/* 1721E0 80243900 D7B60038 */  ldc1      $f22, 0x38($sp)
/* 1721E4 80243904 D7B40030 */  ldc1      $f20, 0x30($sp)
glabel func_80243908
/* 1721E8 80243908 03E00008 */  jr        $ra
/* 1721EC 8024390C 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_9(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* player = battleStatus->playerActor;
    Actor* partner = battleStatus->partnerActor;
    Actor* actor;
    ActorState* state;
    Evt* script;
    s32 cond;
    s32 i;

    s32 oldKoDuration;

    if (gBattleSubState == BTL_SUBSTATE_9_INIT) {
        if (gBattleStatus.flags2 & BS_FLAGS2_2) {
            if (partner != NULL) {
                if (!(gBattleStatus.flags2 & BS_FLAGS2_4) && !(partner->flags & ACTOR_FLAG_NO_ATTACK)) {
                    btl_set_state(BATTLE_STATE_SWITCH_TO_PARTNER);
                    return;
                }
            }

            player->flags &= ~ACTOR_FLAG_8000000;
            player->flags |= ACTOR_FLAG_4000000;
            if (partner != NULL) {
                partner->flags &= ~ACTOR_FLAG_8000000;
                partner->flags |= ACTOR_FLAG_4000000;
            }

            gBattleSubState = BTL_SUBSTATE_9_1;
            D_8029F258 = 0;
            gBattleStatus.flags2 &= ~BS_FLAGS2_2;
            gBattleStatus.flags2 &= ~BS_FLAGS2_4;
            gBattleStatus.flags2 &= ~BS_FLAGS2_8;
            gBattleStatus.flags2 &= ~BS_FLAGS2_10;
        } else {
            btl_set_state(BATTLE_STATE_SWITCH_TO_PLAYER);
            return;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_9_1) {
        cond = FALSE;
        for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
            actor = battleStatus->enemyActors[i];
            if (actor != NULL && actor->handleEventScript != NULL) {
                if (does_script_exist(actor->handleEventScriptID)) {
                    cond = TRUE;
                } else {
                    actor->handleEventScript = NULL;
                }
            }
        }

        if (!cond) {
            reset_actor_turn_info();

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                actor = battleStatus->enemyActors[i];
                if (actor != NULL) {
                    actor->flags |= ACTOR_FLAG_4000000 | ACTOR_FLAG_8000000;
                    actor->flags &= ~ACTOR_FLAG_10000;

                    if (actor->debuff != 0) {
                        if (actor->debuff == STATUS_KEY_FEAR ||
                            actor->debuff == STATUS_KEY_DIZZY ||
                            actor->debuff == STATUS_KEY_PARALYZE ||
                            actor->debuff == STATUS_KEY_SLEEP ||
                            actor->debuff == STATUS_KEY_FROZEN ||
                            actor->debuff == STATUS_KEY_STOP)
                        {
                            actor->flags |= ACTOR_FLAG_10000;
                        }
                        actor->debuffDuration--;
                        if (actor->debuffDuration <= 0) {
                            actor->debuff = 0;
                            remove_status_debuff(actor->hudElementDataIndex);
                            dispatch_event_actor(actor, EVENT_RECOVER_STATUS);
                            D_8029F258 = 20;
                        }
                    }

                    if (actor->staticStatus != 0) {
                        actor->staticDuration--;
                        if (actor->staticDuration <= 0) {
                            actor->staticStatus = 0;
                            remove_status_static(actor->hudElementDataIndex);
                            D_8029F258 = 20;
                        }
                    }

                    if (actor->transparentStatus != 0) {
                        actor->transparentDuration--;
                        if (actor->transparentDuration <= 0) {
                            actor->transparentStatus = 0;
                            remove_status_transparent(actor->hudElementDataIndex);
                            D_8029F258 = 20;
                        }
                    }

                    if (actor->stoneStatus != 0) {
                        actor->stoneDuration--;
                        if (actor->stoneDuration <= 0) {
                            actor->stoneStatus = 0;
                            D_8029F258 = 20;
                        }
                    }

                    oldKoDuration = actor->koDuration;
                    actor->koDuration = actor->debuffDuration;
                    if (actor->koDuration > 0) {
                        actor->koStatus = STATUS_KEY_DAZE;
                        actor->disableEffect->data.disableX->koDuration = actor->koDuration;
                    } else if (oldKoDuration != actor->koDuration) {
                        actor->koStatus = 0;
                        actor->disableEffect->data.disableX->koDuration = 0;
                    }
                    if (actor->debuff == STATUS_KEY_POISON) {
                        gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
                        dispatch_damage_event_actor_0(actor, 1, EVENT_HIT);
                        D_8029F258 = 20;
                    }
                }
            }
            gBattleSubState = BTL_SUBSTATE_9_2;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_9_2) {
        if(player->handleEventScript == NULL || !does_script_exist(player->handleEventScriptID)) {
            player->handleEventScript = NULL;
            if (partner != NULL) {
                if (partner->handleEventScript == NULL || !does_script_exist(partner->handleEventScriptID)) {
                    partner->handleEventScript = NULL;
                    goto block_52; // TODO find a way to remove
                }
            } else {
    block_52:
                cond = FALSE;
                for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                    actor = battleStatus->enemyActors[i];
                    if ((actor != NULL) && (actor->handleEventScript != NULL)) {
                        if (does_script_exist(actor->handleEventScriptID)) {
                            cond = TRUE;
                        } else {
                            actor->handleEventScript = NULL;
                        }
                    }
                }

                if (!cond) {
                    if (btl_check_player_defeated() || btl_check_enemies_defeated()) {
                        return;
                    }

                    btl_cam_use_preset(BTL_CAM_DEFAULT);
                    if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) {
                        gBattleSubState = BTL_SUBSTATE_9_4;
                    } else if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
                        gBattleSubState = BTL_SUBSTATE_9_4;
                    } else {
                        player->flags &= ~ACTOR_FLAG_8000000;
                        partner->flags &= ~ACTOR_FLAG_8000000;
                        player->flags |= ACTOR_FLAG_4000000;
                        partner->flags |= ACTOR_FLAG_4000000;
                        state = &partner->state;
                        if (!battleStatus->outtaSightActive) {
                            partner->state.currentPos.x = partner->homePos.x;
                            partner->state.currentPos.z = partner->homePos.z;
                            partner->state.goalPos.x = player->homePos.x;
                            partner->state.goalPos.z = player->homePos.z;
                        } else {
                            partner->state.currentPos.x = partner->homePos.x;
                            partner->state.currentPos.z = partner->homePos.z;
                            partner->state.goalPos.x = partner->homePos.x;
                            partner->state.goalPos.z = partner->homePos.z + 5.0f;
                            partner->homePos.x = player->homePos.x;
                            partner->homePos.z = player->homePos.z;
                        }
                        state->moveTime = 4;
                        state->angle = 0.0f;
                        gBattleSubState = BTL_SUBSTATE_9_3;
                    }
                }
            }
        }
    }

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

        if (partner->state.moveTime != 0) {
            partner->state.moveTime--;
        } else {
            partner->currentPos.x = partner->state.goalPos.x;
            partner->currentPos.z = partner->state.goalPos.z;
            player->currentPos.x = partner->state.currentPos.x;
            player->currentPos.z = partner->state.currentPos.z;
            if (!battleStatus->outtaSightActive) {
                partner->homePos.x = partner->currentPos.x;
                partner->homePos.z = partner->currentPos.z;
                player->homePos.x = player->currentPos.x;
                player->homePos.z = player->currentPos.z;
            } else {
                player->homePos.x = player->currentPos.x;
                player->homePos.z = player->currentPos.z;
            }
            gBattleSubState = BTL_SUBSTATE_9_4;
            gBattleStatus.flags1 &= ~ACTOR_FLAG_100000;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_9_4) {
        if (D_8029F258 != 0) {
            D_8029F258--;
        } else {
            if (battleStatus->nextMerleeSpellType == MERLEE_SPELL_2) {
                battleStatus->merleeDefenseBoost = 3;
                battleStatus->nextMerleeSpellType = MERLEE_SPELL_0;
                battleStatus->battlePhase = PHASE_MERLEE_DEFENSE_BONUS;
                script = start_script(&EVS_Mario_HandlePhase, EVT_PRIORITY_A, 0);
                player->takeTurnScript = script;
                player->takeTurnScriptID = script->id;
                script->owner1.actorID = ACTOR_PLAYER;
            }
            gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
            player->flags &= ~ACTOR_FLAG_8000000;
            player->flags |= ACTOR_FLAG_4000000;
            if (partner != NULL) {
                partner->flags &= ~ACTOR_FLAG_8000000;
                partner->flags |= ACTOR_FLAG_4000000;
            }
            gBattleSubState = BTL_SUBSTATE_9_5;
            gBattleStatus.flags2 &= ~BS_FLAGS2_2;
            gBattleStatus.flags2 &= ~BS_FLAGS2_4;
            gBattleStatus.flags2 &= ~BS_FLAGS2_8;
            gBattleStatus.flags2 &= ~BS_FLAGS2_10;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_9_5) {
        if (player->takeTurnScript == NULL || (does_script_exist(player->takeTurnScriptID) == 0)) {
            player->takeTurnScript = NULL;

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                actor = battleStatus->enemyActors[i];
                if (actor != NULL && actor->handlePhaseSource != NULL) {
                    battleStatus->battlePhase = PHASE_PLAYER_END;
                    script = start_script(actor->handlePhaseSource, EVT_PRIORITY_A, 0);
                    actor->handlePhaseScript = script;
                    actor->handleBatttlePhaseScriptID = script->id;
                    script->owner1.enemyID = i | ACTOR_CLASS_ENEMY;
                }
            }
            gBattleSubState = BTL_SUBSTATE_9_6;
        }
    }

    cond = FALSE;
    if (gBattleSubState == BTL_SUBSTATE_9_6) {
        for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
            actor = battleStatus->enemyActors[i];
            if (actor != NULL && actor->handlePhaseSource != NULL && does_script_exist(actor->handleBatttlePhaseScriptID)) {
                cond = TRUE;
            }
        }
        if (!cond) {
            gBattleSubState = BTL_SUBSTATE_9_7;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_9_7) {
        btl_set_state(BATTLE_STATE_NEXT_ENEMY);
    }
}