### RAW ASSEMBLY INSTRUCTIONS:

glabel func_802439D8
/* 1722B8 802439D8 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 1722BC 802439DC AFB60028 */  sw        $s6, 0x28($sp)
D_802439E0:
/* 1722C0 802439E0 3C16800E */  lui       $s6, %hi(gBattleStatus)
/* 1722C4 802439E4 26D6C070 */  addiu     $s6, $s6, %lo(gBattleStatus)
D_802439E8:
/* 1722C8 802439E8 AFB7002C */  sw        $s7, 0x2C($sp)
.L802439EC:
/* 1722CC 802439EC 3C178011 */  lui       $s7, %hi(gPlayerData)
D_802439F0:
/* 1722D0 802439F0 26F7F290 */  addiu     $s7, $s7, %lo(gPlayerData)
.L802439F4:
/* 1722D4 802439F4 AFBF0030 */  sw        $ra, 0x30($sp)
D_802439F8:
/* 1722D8 802439F8 AFB50024 */  sw        $s5, 0x24($sp)
glabel func_802439FC
/* 1722DC 802439FC AFB40020 */  sw        $s4, 0x20($sp)
D_80243A00:
/* 1722E0 80243A00 AFB3001C */  sw        $s3, 0x1C($sp)
glabel func_80243A04
/* 1722E4 80243A04 AFB20018 */  sw        $s2, 0x18($sp)
D_80243A08:
/* 1722E8 80243A08 AFB10014 */  sw        $s1, 0x14($sp)
D_80243A0C:
/* 1722EC 80243A0C AFB00010 */  sw        $s0, 0x10($sp)
D_80243A10:
/* 1722F0 80243A10 F7B80048 */  sdc1      $f24, 0x48($sp)
D_80243A14:
/* 1722F4 80243A14 F7B60040 */  sdc1      $f22, 0x40($sp)
D_80243A18:
/* 1722F8 80243A18 F7B40038 */  sdc1      $f20, 0x38($sp)
glabel func_80243A1C
/* 1722FC 80243A1C 8ED500D8 */  lw        $s5, 0xD8($s6)
jtbl_80243A20:
/* 172300 80243A20 3C02800E */  lui       $v0, %hi(gBattleSubState)
/* 172304 80243A24 8C42C4DC */  lw        $v0, %lo(gBattleSubState)($v0)
glabel .L80243A28
/* 172308 80243A28 8ED300DC */  lw        $s3, 0xDC($s6)
D_80243A2C:
/* 17230C 80243A2C 1440002E */  bnez      $v0, func_80243AE8
D_80243A30:
/* 172310 80243A30 0000A02D */   daddu    $s4, $zero, $zero
/* 172314 80243A34 0280882D */  daddu     $s1, $s4, $zero
.L80243A38:
/* 172318 80243A38 02C0902D */  daddu     $s2, $s6, $zero
flo_13_pad_3A3C:
/* 17231C 80243A3C 8E5000E0 */  lw        $s0, 0xE0($s2)
D_80243A40:
/* 172320 80243A40 5200000B */  beql      $s0, $zero, D_80243A70
glabel func_80243A44
/* 172324 80243A44 26310001 */   addiu    $s1, $s1, 0x1
D_80243A48:
/* 172328 80243A48 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 17232C 80243A4C 50400008 */  beql      $v0, $zero, D_80243A70
glabel .L80243A50
/* 172330 80243A50 26310001 */   addiu    $s1, $s1, 0x1
D_80243A54:
/* 172334 80243A54 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 172338 80243A58 0C0B1059 */  jal       does_script_exist
D_80243A5C:
/* 17233C 80243A5C 00000000 */   nop
/* 172340 80243A60 50400002 */  beql      $v0, $zero, D_80243A6C
/* 172344 80243A64 AE0001D8 */   sw       $zero, 0x1D8($s0)
.L80243A68:
/* 172348 80243A68 24140001 */  addiu     $s4, $zero, 0x1
D_80243A6C:
/* 17234C 80243A6C 26310001 */  addiu     $s1, $s1, 0x1
D_80243A70:
/* 172350 80243A70 2A220018 */  slti      $v0, $s1, 0x18
/* 172354 80243A74 1440FFF1 */  bnez      $v0, flo_13_pad_3A3C
/* 172358 80243A78 26520004 */   addiu    $s2, $s2, 0x4
D_80243A7C:
/* 17235C 80243A7C 1680001A */  bnez      $s4, func_80243AE8
D_80243A80:
/* 172360 80243A80 00000000 */   nop
/* 172364 80243A84 0000882D */  daddu     $s1, $zero, $zero
D_80243A88:
/* 172368 80243A88 02C0902D */  daddu     $s2, $s6, $zero
D_80243A8C:
/* 17236C 80243A8C 8E5000E0 */  lw        $s0, 0xE0($s2)
D_80243A90:
/* 172370 80243A90 5200000B */  beql      $s0, $zero, D_80243AC0
.L80243A94:
/* 172374 80243A94 26310001 */   addiu    $s1, $s1, 0x1
D_80243A98:
/* 172378 80243A98 8E0201D4 */  lw        $v0, 0x1D4($s0)
/* 17237C 80243A9C 50400008 */  beql      $v0, $zero, D_80243AC0
glabel func_80243AA0
/* 172380 80243AA0 26310001 */   addiu    $s1, $s1, 0x1
/* 172384 80243AA4 8E0401E4 */  lw        $a0, 0x1E4($s0)
glabel func_80243AA8
/* 172388 80243AA8 0C0B1059 */  jal       does_script_exist
.L80243AAC:
/* 17238C 80243AAC 00000000 */   nop
D_80243AB0:
/* 172390 80243AB0 50400002 */  beql      $v0, $zero, func_80243ABC
/* 172394 80243AB4 AE0001D4 */   sw       $zero, 0x1D4($s0)
glabel func_80243AB8
/* 172398 80243AB8 24140001 */  addiu     $s4, $zero, 0x1
glabel func_80243ABC
/* 17239C 80243ABC 26310001 */  addiu     $s1, $s1, 0x1
D_80243AC0:
/* 1723A0 80243AC0 2A220018 */  slti      $v0, $s1, 0x18
.L80243AC4:
/* 1723A4 80243AC4 1440FFF1 */  bnez      $v0, D_80243A8C
/* 1723A8 80243AC8 26520004 */   addiu    $s2, $s2, 0x4
/* 1723AC 80243ACC 16800006 */  bnez      $s4, func_80243AE8
glabel .L80243AD0
/* 1723B0 80243AD0 00000000 */   nop
/* 1723B4 80243AD4 0C093903 */  jal       func_8024E40C
D_80243AD8_EAC5B8:
/* 1723B8 80243AD8 24040002 */   addiu    $a0, $zero, 0x2
/* 1723BC 80243ADC 24020001 */  addiu     $v0, $zero, 0x1
/* 1723C0 80243AE0 3C01800E */  lui       $at, %hi(gBattleSubState)
.L80243AE4:
/* 1723C4 80243AE4 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_80243AE8
/* 1723C8 80243AE8 3C04800E */  lui       $a0, %hi(gBattleSubState)
.L80243AEC:
/* 1723CC 80243AEC 2484C4DC */  addiu     $a0, $a0, %lo(gBattleSubState)
D_80243AF0:
/* 1723D0 80243AF0 8C830000 */  lw        $v1, 0x0($a0)
/* 1723D4 80243AF4 24020001 */  addiu     $v0, $zero, 0x1
/* 1723D8 80243AF8 1462002A */  bne       $v1, $v0, func_80243BA4
D_80243AFC:
/* 1723DC 80243AFC 00000000 */   nop
glabel .L80243B00
/* 1723E0 80243B00 3C03800E */  lui       $v1, %hi(gBattleStatus)
glabel func_80243B04
/* 1723E4 80243B04 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
.L80243B08:
/* 1723E8 80243B08 8C620004 */  lw        $v0, 0x4($v1)
/* 1723EC 80243B0C 30420040 */  andi      $v0, $v0, 0x40
glabel func_80243B10
/* 1723F0 80243B10 14400007 */  bnez      $v0, .L80243B30
D_80243B14:
/* 1723F4 80243B14 2402000C */   addiu    $v0, $zero, 0xC
D_80243B18:
/* 1723F8 80243B18 8C620000 */  lw        $v0, 0x0($v1)
D_80243B1C:
/* 1723FC 80243B1C 3C030010 */  lui       $v1, (0x100000 >> 16)
D_80243B20:
/* 172400 80243B20 00431024 */  and       $v0, $v0, $v1
/* 172404 80243B24 14400004 */  bnez      $v0, D_80243B38
D_80243B28:
/* 172408 80243B28 3C03F7FF */   lui      $v1, (0xF7FFFFFF >> 16)
glabel func_80243B2C
/* 17240C 80243B2C 2402000C */  addiu     $v0, $zero, 0xC
.L80243B30:
/* 172410 80243B30 08090EE9 */  j         func_80243BA4
/* 172414 80243B34 AC820000 */   sw       $v0, 0x0($a0)
D_80243B38:
/* 172418 80243B38 8EA20000 */  lw        $v0, 0x0($s5)
D_80243B3C:
/* 17241C 80243B3C 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
/* 172420 80243B40 00431024 */  and       $v0, $v0, $v1
D_80243B44_EEA0F4:
/* 172424 80243B44 AEA20000 */  sw        $v0, 0x0($s5)
D_80243B48_EEA0F8:
/* 172428 80243B48 8E620000 */  lw        $v0, 0x0($s3)
/* 17242C 80243B4C 00431024 */  and       $v0, $v0, $v1
.L80243B50:
/* 172430 80243B50 AE620000 */  sw        $v0, 0x0($s3)
D_80243B54:
/* 172434 80243B54 8EA20000 */  lw        $v0, 0x0($s5)
D_80243B58:
/* 172438 80243B58 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* 17243C 80243B5C 00431025 */  or        $v0, $v0, $v1
/* 172440 80243B60 AEA20000 */  sw        $v0, 0x0($s5)
D_80243B64:
/* 172444 80243B64 8E620000 */  lw        $v0, 0x0($s3)
/* 172448 80243B68 C6600138 */  lwc1      $f0, 0x138($s3)
glabel func_80243B6C
/* 17244C 80243B6C C6620140 */  lwc1      $f2, 0x140($s3)
D_80243B70:
/* 172450 80243B70 00431025 */  or        $v0, $v0, $v1
D_80243B74:
/* 172454 80243B74 AE620000 */  sw        $v0, 0x0($s3)
D_80243B78:
/* 172458 80243B78 E660000C */  swc1      $f0, 0xC($s3)
D_80243B7C:
/* 17245C 80243B7C E6620014 */  swc1      $f2, 0x14($s3)
.L80243B80:
/* 172460 80243B80 C6A00138 */  lwc1      $f0, 0x138($s5)
/* 172464 80243B84 2402000B */  addiu     $v0, $zero, 0xB
/* 172468 80243B88 AC820000 */  sw        $v0, 0x0($a0)
/* 17246C 80243B8C E6600018 */  swc1      $f0, 0x18($s3)
.L80243B90:
/* 172470 80243B90 C6A00140 */  lwc1      $f0, 0x140($s5)
/* 172474 80243B94 24020004 */  addiu     $v0, $zero, 0x4
D_80243B98:
/* 172478 80243B98 A6620070 */  sh        $v0, 0x70($s3)
D_80243B9C:
/* 17247C 80243B9C AE600054 */  sw        $zero, 0x54($s3)
.L80243BA0:
/* 172480 80243BA0 E6600020 */  swc1      $f0, 0x20($s3)
glabel func_80243BA4
/* 172484 80243BA4 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 172488 80243BA8 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 17248C 80243BAC 2402000B */  addiu     $v0, $zero, 0xB
D_80243BB0:
/* 172490 80243BB0 1462007D */  bne       $v1, $v0, func_80243DA8
/* 172494 80243BB4 2402000C */   addiu    $v0, $zero, 0xC
D_80243BB8_EAC698:
/* 172498 80243BB8 86620070 */  lh        $v0, 0x70($s3)
/* 17249C 80243BBC 10400022 */  beqz      $v0, D_80243C48
D_80243BC0:
/* 1724A0 80243BC0 00000000 */   nop
D_80243BC4:
/* 1724A4 80243BC4 C6600018 */  lwc1      $f0, 0x18($s3)
dro_02_pad_3BC8:
/* 1724A8 80243BC8 C6680144 */  lwc1      $f8, 0x144($s3)
D_80243BCC:
/* 1724AC 80243BCC C6620020 */  lwc1      $f2, 0x20($s3)
D_80243BD0:
/* 1724B0 80243BD0 46080001 */  sub.s     $f0, $f0, $f8
D_80243BD4:
/* 1724B4 80243BD4 C664014C */  lwc1      $f4, 0x14C($s3)
D_80243BD8:
/* 1724B8 80243BD8 46041081 */  sub.s     $f2, $f2, $f4
/* 1724BC 80243BDC 44823000 */  mtc1      $v0, $f6
D_80243BE0:
/* 1724C0 80243BE0 00000000 */  nop
D_80243BE4:
/* 1724C4 80243BE4 468031A0 */  cvt.s.w   $f6, $f6
/* 1724C8 80243BE8 46060003 */  div.s     $f0, $f0, $f6
glabel func_80243BEC
/* 1724CC 80243BEC 46004200 */  add.s     $f8, $f8, $f0
D_80243BF0:
/* 1724D0 80243BF0 46003006 */  mov.s     $f0, $f6
D_80243BF4:
/* 1724D4 80243BF4 46061083 */  div.s     $f2, $f2, $f6
jtbl_80243BF8:
/* 1724D8 80243BF8 C660000C */  lwc1      $f0, 0xC($s3)
/* 1724DC 80243BFC 46022100 */  add.s     $f4, $f4, $f2
.L80243C00:
/* 1724E0 80243C00 E6680144 */  swc1      $f8, 0x144($s3)
.L80243C04:
/* 1724E4 80243C04 E664014C */  swc1      $f4, 0x14C($s3)
D_80243C08:
/* 1724E8 80243C08 C6A40144 */  lwc1      $f4, 0x144($s5)
D_80243C0C:
/* 1724EC 80243C0C 46040001 */  sub.s     $f0, $f0, $f4
glabel func_80243C10
/* 1724F0 80243C10 46003086 */  mov.s     $f2, $f6
.L80243C14:
/* 1724F4 80243C14 46060003 */  div.s     $f0, $f0, $f6
D_80243C18:
/* 1724F8 80243C18 46002100 */  add.s     $f4, $f4, $f0
/* 1724FC 80243C1C E6A40144 */  swc1      $f4, 0x144($s5)
D_80243C20:
/* 172500 80243C20 C6600014 */  lwc1      $f0, 0x14($s3)
D_80243C24:
/* 172504 80243C24 C6A4014C */  lwc1      $f4, 0x14C($s5)
/* 172508 80243C28 86620070 */  lh        $v0, 0x70($s3)
/* 17250C 80243C2C 46040001 */  sub.s     $f0, $f0, $f4
D_80243C30:
/* 172510 80243C30 44821000 */  mtc1      $v0, $f2
.L80243C34:
/* 172514 80243C34 00000000 */  nop
/* 172518 80243C38 468010A0 */  cvt.s.w   $f2, $f2
dro_02_pad_3C3C:
/* 17251C 80243C3C 46020003 */  div.s     $f0, $f0, $f2
D_80243C40:
/* 172520 80243C40 46002100 */  add.s     $f4, $f4, $f0
.L80243C44:
/* 172524 80243C44 E6A4014C */  swc1      $f4, 0x14C($s5)
D_80243C48:
/* 172528 80243C48 C66C0054 */  lwc1      $f12, 0x54($s3)
D_80243C4C:
/* 17252C 80243C4C 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
D_80243C50:
/* 172530 80243C50 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 172534 80243C54 4481B000 */  mtc1      $at, $f22
/* 172538 80243C58 00000000 */  nop
D_80243C5C:
/* 17253C 80243C5C 46166302 */  mul.s     $f12, $f12, $f22
/* 172540 80243C60 00000000 */  nop
/* 172544 80243C64 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 172548 80243C68 4481C000 */  mtc1      $at, $f24
D_80243C6C:
/* 17254C 80243C6C 3C014180 */  lui       $at, (0x41800000 >> 16)
.L80243C70:
/* 172550 80243C70 4481A000 */  mtc1      $at, $f20
/* 172554 80243C74 0C00A85B */  jal       sin_rad
D_80243C78:
/* 172558 80243C78 46186303 */   div.s    $f12, $f12, $f24
.L80243C7C:
/* 17255C 80243C7C 46140002 */  mul.s     $f0, $f0, $f20
/* 172560 80243C80 00000000 */  nop
/* 172564 80243C84 C662014C */  lwc1      $f2, 0x14C($s3)
/* 172568 80243C88 46001081 */  sub.s     $f2, $f2, $f0
flo_25_pad_3C8C:
/* 17256C 80243C8C C66C0054 */  lwc1      $f12, 0x54($s3)
D_80243C90:
/* 172570 80243C90 0C00A6C9 */  jal       clamp_angle
D_80243C94:
/* 172574 80243C94 E662014C */   swc1     $f2, 0x14C($s3)
D_80243C98:
/* 172578 80243C98 C66C0054 */  lwc1      $f12, 0x54($s3)
D_80243C9C:
/* 17257C 80243C9C 46166302 */  mul.s     $f12, $f12, $f22
D_80243CA0:
/* 172580 80243CA0 00000000 */  nop
D_80243CA4:
/* 172584 80243CA4 E660018C */  swc1      $f0, 0x18C($s3)
/* 172588 80243CA8 0C00A85B */  jal       sin_rad
D_80243CAC:
/* 17258C 80243CAC 46186303 */   div.s    $f12, $f12, $f24
D_80243CB0:
/* 172590 80243CB0 46140002 */  mul.s     $f0, $f0, $f20
D_80243CB4:
/* 172594 80243CB4 00000000 */  nop
/* 172598 80243CB8 C6A2014C */  lwc1      $f2, 0x14C($s5)
/* 17259C 80243CBC 46001080 */  add.s     $f2, $f2, $f0
D_80243CC0:
/* 1725A0 80243CC0 E6A2014C */  swc1      $f2, 0x14C($s5)
D_80243CC4:
/* 1725A4 80243CC4 0C00A6C9 */  jal       clamp_angle
D_80243CC8:
/* 1725A8 80243CC8 C66C0054 */   lwc1     $f12, 0x54($s3)
glabel func_80243CCC
/* 1725AC 80243CCC E6A0018C */  swc1      $f0, 0x18C($s5)
D_80243CD0:
/* 1725B0 80243CD0 C6600054 */  lwc1      $f0, 0x54($s3)
glabel func_80243CD4
/* 1725B4 80243CD4 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
flo_25_pad_3CD8:
/* 1725B8 80243CD8 44811000 */  mtc1      $at, $f2
.L80243CDC:
/* 1725BC 80243CDC 86620070 */  lh        $v0, 0x70($s3)
D_80243CE0:
/* 1725C0 80243CE0 46020000 */  add.s     $f0, $f0, $f2
/* 1725C4 80243CE4 96630070 */  lhu       $v1, 0x70($s3)
.L80243CE8:
/* 1725C8 80243CE8 10400004 */  beqz      $v0, .L80243CFC
D_80243CEC:
/* 1725CC 80243CEC E6600054 */   swc1     $f0, 0x54($s3)
D_80243CF0:
/* 1725D0 80243CF0 2462FFFF */  addiu     $v0, $v1, -0x1
/* 1725D4 80243CF4 08090F67 */  j         .L80243D9C
/* 1725D8 80243CF8 A6620070 */   sh       $v0, 0x70($s3)
.L80243CFC:
/* 1725DC 80243CFC C6600018 */  lwc1      $f0, 0x18($s3)
D_80243D00:
/* 1725E0 80243D00 C6620020 */  lwc1      $f2, 0x20($s3)
D_80243D04:
/* 1725E4 80243D04 C664000C */  lwc1      $f4, 0xC($s3)
D_80243D08:
/* 1725E8 80243D08 E6600144 */  swc1      $f0, 0x144($s3)
/* 1725EC 80243D0C E662014C */  swc1      $f2, 0x14C($s3)
D_80243D10:
/* 1725F0 80243D10 E6A40144 */  swc1      $f4, 0x144($s5)
glabel func_80243D14
/* 1725F4 80243D14 C6600014 */  lwc1      $f0, 0x14($s3)
D_80243D18:
/* 1725F8 80243D18 E6A0014C */  swc1      $f0, 0x14C($s5)
D_80243D1C:
/* 1725FC 80243D1C C6600144 */  lwc1      $f0, 0x144($s3)
/* 172600 80243D20 C662014C */  lwc1      $f2, 0x14C($s3)
/* 172604 80243D24 3C030800 */  lui       $v1, (0x8000000 >> 16)
D_80243D28:
/* 172608 80243D28 E6600138 */  swc1      $f0, 0x138($s3)
/* 17260C 80243D2C E6620140 */  swc1      $f2, 0x140($s3)
D_80243D30:
/* 172610 80243D30 C6A00144 */  lwc1      $f0, 0x144($s5)
/* 172614 80243D34 8EA20000 */  lw        $v0, 0x0($s5)
D_80243D38:
/* 172618 80243D38 C6A2014C */  lwc1      $f2, 0x14C($s5)
/* 17261C 80243D3C 00431025 */  or        $v0, $v0, $v1
D_80243D40:
/* 172620 80243D40 E6A00138 */  swc1      $f0, 0x138($s5)
.L80243D44:
/* 172624 80243D44 E6A20140 */  swc1      $f2, 0x140($s5)
D_80243D48:
/* 172628 80243D48 AEA20000 */  sw        $v0, 0x0($s5)
/* 17262C 80243D4C 8E620000 */  lw        $v0, 0x0($s3)
jtbl_80243D50:
/* 172630 80243D50 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 172634 80243D54 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_80243D58:
/* 172638 80243D58 00431025 */  or        $v0, $v0, $v1
D_80243D5C:
/* 17263C 80243D5C AE620000 */  sw        $v0, 0x0($s3)
glabel func_80243D60
/* 172640 80243D60 8C820004 */  lw        $v0, 0x4($a0)
.L80243D64:
/* 172644 80243D64 30420040 */  andi      $v0, $v0, 0x40
D_80243D68:
/* 172648 80243D68 10400004 */  beqz      $v0, .L80243D7C
D_80243D6C:
/* 17264C 80243D6C 3C030010 */   lui      $v1, (0x100000 >> 16)
D_80243D70:
/* 172650 80243D70 8C820000 */  lw        $v0, 0x0($a0)
dead_kzn_19_varStash:
/* 172654 80243D74 08090F63 */  j         .L80243D8C
D_80243D78:
/* 172658 80243D78 00431025 */   or       $v0, $v0, $v1
.L80243D7C:
/* 17265C 80243D7C 3C03FFEF */  lui       $v1, (0xFFEFFFFF >> 16)
D_80243D80:
/* 172660 80243D80 8C820000 */  lw        $v0, 0x0($a0)
.L80243D84:
/* 172664 80243D84 3463FFFF */  ori       $v1, $v1, (0xFFEFFFFF & 0xFFFF)
dgb_08_pad_3D88:
/* 172668 80243D88 00431024 */  and       $v0, $v0, $v1
.L80243D8C:
/* 17266C 80243D8C AC820000 */  sw        $v0, 0x0($a0)
D_80243D90:
/* 172670 80243D90 2402000C */  addiu     $v0, $zero, 0xC
D_80243D94:
/* 172674 80243D94 3C01800E */  lui       $at, %hi(gBattleSubState)
jtbl_80243D98:
/* 172678 80243D98 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80243D9C:
/* 17267C 80243D9C 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80243DA0:
/* 172680 80243DA0 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_80243DA4:
/* 172684 80243DA4 2402000C */  addiu     $v0, $zero, 0xC
glabel func_80243DA8
/* 172688 80243DA8 1462004C */  bne       $v1, $v0, .L80243EDC
/* 17268C 80243DAC 3C02FFFE */   lui      $v0, (0xFFFEFFFF >> 16)
D_80243DB0:
/* 172690 80243DB0 3C10800E */  lui       $s0, %hi(gBattleStatus)
/* 172694 80243DB4 2610C070 */  addiu     $s0, $s0, %lo(gBattleStatus)
/* 172698 80243DB8 8E030004 */  lw        $v1, 0x4($s0)
.L80243DBC:
/* 17269C 80243DBC 3442FFFF */  ori       $v0, $v0, (0xFFFEFFFF & 0xFFFF)
D_80243DC0:
/* 1726A0 80243DC0 00621824 */  and       $v1, $v1, $v0
.L80243DC4:
/* 1726A4 80243DC4 AE030004 */  sw        $v1, 0x4($s0)
/* 1726A8 80243DC8 8EA20000 */  lw        $v0, 0x0($s5)
D_80243DCC:
/* 1726AC 80243DCC 3C030C00 */  lui       $v1, (0xC000000 >> 16)
.L80243DD0:
/* 1726B0 80243DD0 A2A0021D */  sb        $zero, 0x21D($s5)
D_80243DD4:
/* 1726B4 80243DD4 00431025 */  or        $v0, $v0, $v1
dead_kzn_19_ItemChoice_HasSelectedItem:
/* 1726B8 80243DD8 12600004 */  beqz      $s3, D_80243DEC
dead_kzn_19_ItemChoice_SelectedItemID:
/* 1726BC 80243DDC AEA20000 */   sw       $v0, 0x0($s5)
D_80243DE0:
/* 1726C0 80243DE0 00431025 */  or        $v0, $v0, $v1
/* 1726C4 80243DE4 AEA20000 */  sw        $v0, 0x0($s5)
D_80243DE8:
/* 1726C8 80243DE8 A260021D */  sb        $zero, 0x21D($s3)
D_80243DEC:
/* 1726CC 80243DEC 0C098298 */  jal       func_80260A60
D_80243DF0:
/* 1726D0 80243DF0 00000000 */   nop
/* 1726D4 80243DF4 3C04FFBF */  lui       $a0, (0xFFBFFFFF >> 16)
D_80243DF8:
/* 1726D8 80243DF8 3484FFFF */  ori       $a0, $a0, (0xFFBFFFFF & 0xFFFF)
glabel func_80243DFC
/* 1726DC 80243DFC 8E030000 */  lw        $v1, 0x0($s0)
D_80243E00:
/* 1726E0 80243E00 96E20290 */  lhu       $v0, 0x290($s7)
/* 1726E4 80243E04 00641824 */  and       $v1, $v1, $a0
D_80243E08:
/* 1726E8 80243E08 24420020 */  addiu     $v0, $v0, 0x20
/* 1726EC 80243E0C AE030000 */  sw        $v1, 0x0($s0)
D_80243E10:
/* 1726F0 80243E10 A6E20290 */  sh        $v0, 0x290($s7)
/* 1726F4 80243E14 00021400 */  sll       $v0, $v0, 16
D_80243E18:
/* 1726F8 80243E18 82E3028E */  lb        $v1, 0x28E($s7)
.L80243E1C:
/* 1726FC 80243E1C 00021403 */  sra       $v0, $v0, 16
.L80243E20:
/* 172700 80243E20 00031A00 */  sll       $v1, $v1, 8
D_80243E24:
/* 172704 80243E24 0062102A */  slt       $v0, $v1, $v0
/* 172708 80243E28 54400001 */  bnel      $v0, $zero, .L80243E30
/* 17270C 80243E2C A6E30290 */   sh       $v1, 0x290($s7)
.L80243E30:
/* 172710 80243E30 0000882D */  daddu     $s1, $zero, $zero
/* 172714 80243E34 2414000B */  addiu     $s4, $zero, 0xB
D_80243E38:
/* 172718 80243E38 02C0902D */  daddu     $s2, $s6, $zero
.L80243E3C:
/* 17271C 80243E3C 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 172720 80243E40 52000010 */  beql      $s0, $zero, .L80243E84
D_80243E44:
/* 172724 80243E44 26310001 */   addiu    $s1, $s1, 0x1
/* 172728 80243E48 8E0201CC */  lw        $v0, 0x1CC($s0)
dgb_09_pad_3E4C:
/* 17272C 80243E4C 5040000D */  beql      $v0, $zero, .L80243E84
D_80243E50:
/* 172730 80243E50 26310001 */   addiu    $s1, $s1, 0x1
.L80243E54:
/* 172734 80243E54 2405000A */  addiu     $a1, $zero, 0xA
D_80243E58:
/* 172738 80243E58 A2D401A7 */  sb        $s4, 0x1A7($s6)
D_80243E5C:
/* 17273C 80243E5C 8E0401CC */  lw        $a0, 0x1CC($s0)
D_80243E60:
/* 172740 80243E60 0C0B0CF8 */  jal       start_script
D_80243E64:
/* 172744 80243E64 0000302D */   daddu    $a2, $zero, $zero
/* 172748 80243E68 0040182D */  daddu     $v1, $v0, $zero
/* 17274C 80243E6C AE0301DC */  sw        $v1, 0x1DC($s0)
/* 172750 80243E70 8C620144 */  lw        $v0, 0x144($v1)
/* 172754 80243E74 AE0201EC */  sw        $v0, 0x1EC($s0)
D_80243E78:
/* 172758 80243E78 36220200 */  ori       $v0, $s1, 0x200
/* 17275C 80243E7C AC620148 */  sw        $v0, 0x148($v1)
D_80243E80:
/* 172760 80243E80 26310001 */  addiu     $s1, $s1, 0x1
.L80243E84:
/* 172764 80243E84 2A220018 */  slti      $v0, $s1, 0x18
jtbl_80243E88:
/* 172768 80243E88 1440FFEC */  bnez      $v0, .L80243E3C
/* 17276C 80243E8C 26520004 */   addiu    $s2, $s2, 0x4
D_80243E90:
/* 172770 80243E90 12600010 */  beqz      $s3, .L80243ED4
/* 172774 80243E94 24020002 */   addiu    $v0, $zero, 0x2
/* 172778 80243E98 8E6201CC */  lw        $v0, 0x1CC($s3)
.L80243E9C:
/* 17277C 80243E9C 1040000C */  beqz      $v0, func_80243ED0
/* 172780 80243EA0 2405000A */   addiu    $a1, $zero, 0xA
/* 172784 80243EA4 2402000B */  addiu     $v0, $zero, 0xB
glabel .L80243EA8
/* 172788 80243EA8 A2C201A7 */  sb        $v0, 0x1A7($s6)
.L80243EAC:
/* 17278C 80243EAC 8E6401CC */  lw        $a0, 0x1CC($s3)
.L80243EB0:
/* 172790 80243EB0 0C0B0CF8 */  jal       start_script
.L80243EB4:
/* 172794 80243EB4 0000302D */   daddu    $a2, $zero, $zero
glabel .L80243EB8
/* 172798 80243EB8 0040182D */  daddu     $v1, $v0, $zero
/* 17279C 80243EBC AE6301DC */  sw        $v1, 0x1DC($s3)
/* 1727A0 80243EC0 8C620144 */  lw        $v0, 0x144($v1)
/* 1727A4 80243EC4 AE6201EC */  sw        $v0, 0x1EC($s3)
glabel func_80243EC8
/* 1727A8 80243EC8 24020100 */  addiu     $v0, $zero, 0x100
D_80243ECC:
/* 1727AC 80243ECC AC620148 */  sw        $v0, 0x148($v1)
glabel func_80243ED0
/* 1727B0 80243ED0 24020002 */  addiu     $v0, $zero, 0x2
.L80243ED4:
/* 1727B4 80243ED4 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel .L80243ED8
/* 1727B8 80243ED8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80243EDC:
/* 1727BC 80243EDC 3C03800E */  lui       $v1, %hi(gBattleSubState)
glabel func_80243EE0
/* 1727C0 80243EE0 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
dgb_01_pad_3EE4:
/* 1727C4 80243EE4 24020002 */  addiu     $v0, $zero, 0x2
glabel .L80243EE8
/* 1727C8 80243EE8 14620026 */  bne       $v1, $v0, D_80243F84
glabel func_80243EEC
/* 1727CC 80243EEC 28620005 */   slti     $v0, $v1, 0x5
D_80243EF0:
/* 1727D0 80243EF0 0000A02D */  daddu     $s4, $zero, $zero
.L80243EF4:
/* 1727D4 80243EF4 0280882D */  daddu     $s1, $s4, $zero
D_80243EF8:
/* 1727D8 80243EF8 02C0902D */  daddu     $s2, $s6, $zero
.L80243EFC:
/* 1727DC 80243EFC 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 1727E0 80243F00 5200000A */  beql      $s0, $zero, .L80243F2C
.L80243F04:
/* 1727E4 80243F04 26310001 */   addiu    $s1, $s1, 0x1
D_80243F08:
/* 1727E8 80243F08 8E0201CC */  lw        $v0, 0x1CC($s0)
glabel func_80243F0C
/* 1727EC 80243F0C 50400007 */  beql      $v0, $zero, .L80243F2C
D_80243F10:
/* 1727F0 80243F10 26310001 */   addiu    $s1, $s1, 0x1
/* 1727F4 80243F14 8E0401EC */  lw        $a0, 0x1EC($s0)
D_80243F18:
/* 1727F8 80243F18 0C0B1059 */  jal       does_script_exist
/* 1727FC 80243F1C 00000000 */   nop
D_80243F20:
/* 172800 80243F20 54400001 */  bnel      $v0, $zero, D_80243F28
.L80243F24:
/* 172804 80243F24 24140001 */   addiu    $s4, $zero, 0x1
D_80243F28:
/* 172808 80243F28 26310001 */  addiu     $s1, $s1, 0x1
.L80243F2C:
/* 17280C 80243F2C 2A220018 */  slti      $v0, $s1, 0x18
D_80243F30:
/* 172810 80243F30 1440FFF2 */  bnez      $v0, .L80243EFC
/* 172814 80243F34 26520004 */   addiu    $s2, $s2, 0x4
D_80243F38:
/* 172818 80243F38 12600008 */  beqz      $s3, D_80243F5C
D_80243F3C:
/* 17281C 80243F3C 00000000 */   nop
D_80243F40:
/* 172820 80243F40 8E6201CC */  lw        $v0, 0x1CC($s3)
D_80243F44:
/* 172824 80243F44 10400005 */  beqz      $v0, D_80243F5C
/* 172828 80243F48 00000000 */   nop
/* 17282C 80243F4C 0C0B1059 */  jal       does_script_exist
.L80243F50:
/* 172830 80243F50 8E6401EC */   lw       $a0, 0x1EC($s3)
.L80243F54:
/* 172834 80243F54 54400001 */  bnel      $v0, $zero, D_80243F5C
/* 172838 80243F58 24140001 */   addiu    $s4, $zero, 0x1
D_80243F5C:
/* 17283C 80243F5C 16800006 */  bnez      $s4, .L80243F78
/* 172840 80243F60 00000000 */   nop
/* 172844 80243F64 0C093903 */  jal       func_8024E40C
D_80243F68:
/* 172848 80243F68 24040002 */   addiu    $a0, $zero, 0x2
D_80243F6C:
/* 17284C 80243F6C 24020003 */  addiu     $v0, $zero, 0x3
/* 172850 80243F70 3C01800E */  lui       $at, %hi(gBattleSubState)
D_80243F74:
/* 172854 80243F74 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80243F78:
/* 172858 80243F78 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 17285C 80243F7C 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_80243F80:
/* 172860 80243F80 28620005 */  slti      $v0, $v1, 0x5
D_80243F84:
/* 172864 80243F84 10400005 */  beqz      $v0, .L80243F9C
.L80243F88:
/* 172868 80243F88 28620003 */   slti     $v0, $v1, 0x3
/* 17286C 80243F8C 14400003 */  bnez      $v0, .L80243F9C
D_80243F90:
/* 172870 80243F90 00000000 */   nop
/* 172874 80243F94 0C090464 */  jal       func_80241190
D_80243F98:
/* 172878 80243F98 24040005 */   addiu    $a0, $zero, 0x5
.L80243F9C:
/* 17287C 80243F9C 8FBF0030 */  lw        $ra, 0x30($sp)
jtbl_80243FA0:
/* 172880 80243FA0 8FB7002C */  lw        $s7, 0x2C($sp)
D_80243FA4:
/* 172884 80243FA4 8FB60028 */  lw        $s6, 0x28($sp)
/* 172888 80243FA8 8FB50024 */  lw        $s5, 0x24($sp)
D_80243FAC:
/* 17288C 80243FAC 8FB40020 */  lw        $s4, 0x20($sp)
D_80243FB0:
/* 172890 80243FB0 8FB3001C */  lw        $s3, 0x1C($sp)
/* 172894 80243FB4 8FB20018 */  lw        $s2, 0x18($sp)
.L80243FB8:
/* 172898 80243FB8 8FB10014 */  lw        $s1, 0x14($sp)
.L80243FBC:
/* 17289C 80243FBC 8FB00010 */  lw        $s0, 0x10($sp)
/* 1728A0 80243FC0 D7B80048 */  ldc1      $f24, 0x48($sp)
glabel func_80243FC4
/* 1728A4 80243FC4 D7B60040 */  ldc1      $f22, 0x40($sp)
.L80243FC8:
/* 1728A8 80243FC8 D7B40038 */  ldc1      $f20, 0x38($sp)
flo_17_pad_3FCC:
/* 1728AC 80243FCC 03E00008 */  jr        $ra
D_80243FD0:
/* 1728B0 80243FD0 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_end_turn(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    Actor* player = battleStatus->playerActor;
    Actor* partner = battleStatus->partnerActor;
    Actor* actor;
    Evt* script;
    s32 i;

    if (gBattleSubState == BTL_SUBSTATE_END_TURN_INIT) {
        s32 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)) {
                    do {
                        cond = TRUE;
                    } while (0); // TODO required to match
                } else {
                    actor->handleEventScript = NULL;
                }
            }
        }

        if (!cond) {
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                actor = battleStatus->enemyActors[i];
                if (actor != NULL && actor->takeTurnScript != NULL) {
                    if (does_script_exist(actor->takeTurnScriptID)) {
                        cond = TRUE;
                    } else {
                        actor->takeTurnScript = NULL;
                    }
                }
            }

            if (!cond) {
                btl_cam_use_preset(BTL_CAM_DEFAULT);
                gBattleSubState = BTL_SUBSTATE_END_TURN_CHECK_FOR_SWAP;
            }
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_END_TURN_CHECK_FOR_SWAP) {
        if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
            gBattleSubState = BTL_SUBSTATE_END_TURN_START_SCRIPTS;
        } else if (!(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) {
            gBattleSubState = BTL_SUBSTATE_END_TURN_START_SCRIPTS;
        } else {
            player->flags &= ~ACTOR_FLAG_8000000;
            partner->flags &= ~ACTOR_FLAG_8000000;
            player->flags |= ACTOR_FLAG_4000000;
            partner->flags |= ACTOR_FLAG_4000000;
            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;
            partner->state.moveTime = 4;
            partner->state.angle = 0.0f;
            gBattleSubState = BTL_SUBSTATE_END_TURN_PERFORM_SWAP;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_END_TURN_PERFORM_SWAP) {
        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;
            partner->homePos.x = partner->currentPos.x;
            partner->homePos.z = partner->currentPos.z;
            player->homePos.x = player->currentPos.x;
            player->homePos.z = player->currentPos.z;
            player->flags |= ACTOR_FLAG_8000000;
            partner->flags |= ACTOR_FLAG_8000000;
            if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
                gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK;
            } else {
                gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK;
            }
            gBattleSubState = BTL_SUBSTATE_END_TURN_START_SCRIPTS;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_END_TURN_START_SCRIPTS) {
        gBattleStatus.flags2 &= ~BS_FLAGS2_10000;
        player->disableDismissTimer = 0;
        player->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000;
        if (partner != NULL) {
            player->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000;
            partner->disableDismissTimer = 0;
        }

        btl_set_player_idle_anims();
        gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_DEFENDING;
        playerData->specialBarsFilled += 32;
        if (playerData->specialBarsFilled > playerData->maxStarPower * 256) {
            playerData->specialBarsFilled = playerData->maxStarPower * 256;
        }

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

        if (partner != NULL && partner->handlePhaseSource != NULL) {
            battleStatus->battlePhase = PHASE_ENEMY_END;
            script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0);
            partner->handlePhaseScript = script;
            partner->handleBatttlePhaseScriptID = script->id;
            script->owner1.actorID = ACTOR_PARTNER;
        }
        gBattleSubState = BTL_SUBSTATE_END_TURN_AWAIT_SCRIPTS;
    }

    // wait for all end turn scripts to finish executing
    if (gBattleSubState == BTL_SUBSTATE_END_TURN_AWAIT_SCRIPTS) {
        s32 cond = FALSE;

        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 (partner != NULL && partner->handlePhaseSource != NULL && does_script_exist(partner->handleBatttlePhaseScriptID)) {
            cond = TRUE;
        }

        if (!cond) {
            btl_cam_use_preset(BTL_CAM_DEFAULT);
            gBattleSubState = BTL_SUBSTATE_END_TURN_BEGIN_NEXT;
        }
    }

    // proceed to next turn
    switch (gBattleSubState) {
        case BTL_SUBSTATE_END_TURN_BEGIN_NEXT:
        case BTL_SUBSTATE_END_TURN_UNUSED_4:
            btl_set_state(BATTLE_STATE_BEGIN_TURN);
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel parasol_get_npc
/* E26710 802B6000 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* E26714 802B6004 AFB00018 */  sw        $s0, 0x18($sp)
/* E26718 802B6008 3C108011 */  lui       $s0, %hi(gPlayerStatus)
/* E2671C 802B600C 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* E26720 802B6010 AFBF0020 */  sw        $ra, 0x20($sp)
/* E26724 802B6014 AFB1001C */  sw        $s1, 0x1C($sp)
.L802B6018:
/* E26728 802B6018 F7B40028 */  sdc1      $f20, 0x28($sp)
/* E2672C 802B601C 8E040000 */  lw        $a0, 0x0($s0)
/* E26730 802B6020 3C118016 */  lui       $s1, %hi(gCollisionStatus)
/* E26734 802B6024 2631A550 */  addiu     $s1, $s1, %lo(gCollisionStatus)
/* E26738 802B6028 0481003E */  bgez      $a0, .L802B6124
/* E2673C 802B602C 3C027FFF */   lui      $v0, (0x7FFFFFFF >> 16)
/* E26740 802B6030 3442FFFF */  ori       $v0, $v0, (0x7FFFFFFF & 0xFFFF)
/* E26744 802B6034 3C030002 */  lui       $v1, (0x2000A >> 16)
/* E26748 802B6038 3463000A */  ori       $v1, $v1, (0x2000A & 0xFFFF)
/* E2674C 802B603C 00821024 */  and       $v0, $a0, $v0
.L802B6040:
/* E26750 802B6040 00431025 */  or        $v0, $v0, $v1
.L802B6044:
/* E26754 802B6044 0C03963C */  jal       phys_clear_spin_history
glabel action_hammer_play_hit_fx
/* E26758 802B6048 AE020000 */   sw       $v0, 0x0($s0)
.L802B604C:
/* E2675C 802B604C 3C014180 */  lui       $at, (0x41800000 >> 16)
.L802B6050:
/* E26760 802B6050 44810000 */  mtc1      $at, $f0
/* E26764 802B6054 3C01C0EC */  lui       $at, (0xC0EC5C14 >> 16)
.L802B6058:
/* E26768 802B6058 34215C14 */  ori       $at, $at, (0xC0EC5C14 & 0xFFFF)
/* E2676C 802B605C 44811000 */  mtc1      $at, $f2
glabel action_update_sliding
/* E26770 802B6060 3C01405C */  lui       $at, (0x405C9AAA >> 16)
/* E26774 802B6064 34219AAA */  ori       $at, $at, (0x405C9AAA & 0xFFFF)
.L802B6068:
/* E26778 802B6068 44812000 */  mtc1      $at, $f4
/* E2677C 802B606C 3C01BF40 */  lui       $at, (0xBF400000 >> 16)
/* E26780 802B6070 44813000 */  mtc1      $at, $f6
.L802B6074:
/* E26784 802B6074 3C040008 */  lui       $a0, (0x80000 >> 16)
/* E26788 802B6078 A20000B6 */  sb        $zero, 0xB6($s0)
glabel .L802B607C
/* E2678C 802B607C AE000054 */  sw        $zero, 0x54($s0)
.L802B6080:
/* E26790 802B6080 E6000070 */  swc1      $f0, 0x70($s0)
/* E26794 802B6084 E6020074 */  swc1      $f2, 0x74($s0)
/* E26798 802B6088 E6040078 */  swc1      $f4, 0x78($s0)
.L802B608C:
/* E2679C 802B608C 0C037FDE */  jal       suggest_player_anim_always_forward
.L802B6090:
/* E267A0 802B6090 E606007C */   swc1     $f6, 0x7C($s0)
.L802B6094:
/* E267A4 802B6094 0C03805E */  jal       disable_player_input
/* E267A8 802B6098 00000000 */   nop
glabel action_update_state_23
/* E267AC 802B609C 8E020000 */  lw        $v0, 0x0($s0)
/* E267B0 802B60A0 3C04800B */  lui       $a0, %hi(gCameras)
glabel action_update_use_spinning_flower
/* E267B4 802B60A4 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
.L802B60A8:
/* E267B8 802B60A8 34420200 */  ori       $v0, $v0, 0x200
.L802B60AC:
/* E267BC 802B60AC AE020000 */  sw        $v0, 0x0($s0)
/* E267C0 802B60B0 94820002 */  lhu       $v0, 0x2($a0)
glabel action_update_jump
/* E267C4 802B60B4 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* E267C8 802B60B8 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* E267CC 802B60BC 34420001 */  ori       $v0, $v0, 0x1
/* E267D0 802B60C0 A4820002 */  sh        $v0, 0x2($a0)
/* E267D4 802B60C4 00031080 */  sll       $v0, $v1, 2
.L802B60C8:
/* E267D8 802B60C8 00431021 */  addu      $v0, $v0, $v1
/* E267DC 802B60CC 00021080 */  sll       $v0, $v0, 2
glabel .L802B60D0
/* E267E0 802B60D0 00431023 */  subu      $v0, $v0, $v1
.L802B60D4:
/* E267E4 802B60D4 000218C0 */  sll       $v1, $v0, 3
/* E267E8 802B60D8 00431021 */  addu      $v0, $v0, $v1
/* E267EC 802B60DC 000210C0 */  sll       $v0, $v0, 3
/* E267F0 802B60E0 00441021 */  addu      $v0, $v0, $a0
/* E267F4 802B60E4 C6000080 */  lwc1      $f0, 0x80($s0)
.L802B60E8:
/* E267F8 802B60E8 C44C006C */  lwc1      $f12, 0x6C($v0)
.L802B60EC:
/* E267FC 802B60EC 0C00A6C9 */  jal       clamp_angle
.L802B60F0:
/* E26800 802B60F0 460C0301 */   sub.s    $f12, $f0, $f12
glabel .L802B60F4
/* E26804 802B60F4 3C014334 */  lui       $at, (0x43340000 >> 16)
/* E26808 802B60F8 44811000 */  mtc1      $at, $f2
/* E2680C 802B60FC 3C01C270 */  lui       $at, (0xC2700000 >> 16)
.L802B6100:
/* E26810 802B6100 44812000 */  mtc1      $at, $f4
.L802B6104:
/* E26814 802B6104 4602003E */  c.le.s    $f0, $f2
.L802B6108:
/* E26818 802B6108 00000000 */  nop
glabel .L802B610C
/* E2681C 802B610C 45020005 */  bc1fl     .L802B6124
.L802B6110:
/* E26820 802B6110 E60400D4 */   swc1     $f4, 0xD4($s0)
/* E26824 802B6114 3C014270 */  lui       $at, (0x42700000 >> 16)
.L802B6118:
/* E26828 802B6118 44812000 */  mtc1      $at, $f4
/* E2682C 802B611C 00000000 */  nop
glabel action_update_parasol
/* E26830 802B6120 E60400D4 */  swc1      $f4, 0xD4($s0)
.L802B6124:
/* E26834 802B6124 820200B6 */  lb        $v0, 0xB6($s0)
.L802B6128:
/* E26838 802B6128 28420004 */  slti      $v0, $v0, 0x4
/* E2683C 802B612C 1040001E */  beqz      $v0, .L802B61A8
/* E26840 802B6130 00000000 */   nop
glabel .L802B6134
/* E26844 802B6134 C60200D4 */  lwc1      $f2, 0xD4($s0)
/* E26848 802B6138 44802000 */  mtc1      $zero, $f4
.L802B613C:
/* E2684C 802B613C 00000000 */  nop
.L802B6140:
/* E26850 802B6140 4602203E */  c.le.s    $f4, $f2
.L802B6144:
/* E26854 802B6144 00000000 */  nop
/* E26858 802B6148 4500000C */  bc1f      .L802B617C
.L802B614C:
/* E2685C 802B614C 00000000 */   nop
.L802B6150:
/* E26860 802B6150 C60000A8 */  lwc1      $f0, 0xA8($s0)
.L802B6154:
/* E26864 802B6154 46020000 */  add.s     $f0, $f0, $f2
.L802B6158:
/* E26868 802B6158 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
.L802B615C:
/* E2686C 802B615C 44811000 */  mtc1      $at, $f2
/* E26870 802B6160 00000000 */  nop
.L802B6164:
/* E26874 802B6164 4600103E */  c.le.s    $f2, $f0
.L802B6168:
/* E26878 802B6168 00000000 */  nop
/* E2687C 802B616C 4500000E */  bc1f      .L802B61A8
glabel .L802B6170
/* E26880 802B6170 E60000A8 */   swc1     $f0, 0xA8($s0)
glabel .L802B6174
/* E26884 802B6174 080AD869 */  j         .L802B61A4
/* E26888 802B6178 46020001 */   sub.s    $f0, $f0, $f2
.L802B617C:
/* E2688C 802B617C C60000A8 */  lwc1      $f0, 0xA8($s0)
.L802B6180:
/* E26890 802B6180 46020080 */  add.s     $f2, $f0, $f2
glabel .L802B6184
/* E26894 802B6184 4604103C */  c.lt.s    $f2, $f4
.L802B6188:
/* E26898 802B6188 00000000 */  nop
.L802B618C:
/* E2689C 802B618C 45000006 */  bc1f      .L802B61A8
.L802B6190:
/* E268A0 802B6190 E60200A8 */   swc1     $f2, 0xA8($s0)
.L802B6194:
/* E268A4 802B6194 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
glabel func_802B6198
/* E268A8 802B6198 44810000 */  mtc1      $at, $f0
/* E268AC 802B619C 00000000 */  nop
.L802B61A0:
/* E268B0 802B61A0 46001000 */  add.s     $f0, $f2, $f0
.L802B61A4:
/* E268B4 802B61A4 E60000A8 */  swc1      $f0, 0xA8($s0)
.L802B61A8:
/* E268B8 802B61A8 C6020070 */  lwc1      $f2, 0x70($s0)
.L802B61AC:
/* E268BC 802B61AC 44800000 */  mtc1      $zero, $f0
.L802B61B0:
/* E268C0 802B61B0 00000000 */  nop
.L802B61B4:
/* E268C4 802B61B4 4600103E */  c.le.s    $f2, $f0
/* E268C8 802B61B8 00000000 */  nop
/* E268CC 802B61BC 45000009 */  bc1f      func_802B61E4
glabel func_802B61C0
/* E268D0 802B61C0 00000000 */   nop
/* E268D4 802B61C4 3C028011 */  lui       $v0, %hi(gSpinHistoryBufferPos)
.L802B61C8:
/* E268D8 802B61C8 8C42C944 */  lw        $v0, %lo(gSpinHistoryBufferPos)($v0)
.L802B61CC:
/* E268DC 802B61CC C600002C */  lwc1      $f0, 0x2C($s0)
/* E268E0 802B61D0 00021080 */  sll       $v0, $v0, 2
.L802B61D4:
/* E268E4 802B61D4 4600020D */  trunc.w.s $f8, $f0
.L802B61D8:
/* E268E8 802B61D8 3C018011 */  lui       $at, %hi(gSpinHistoryPosY)
.L802B61DC:
/* E268EC 802B61DC 00220821 */  addu      $at, $at, $v0
/* E268F0 802B61E0 E428EF10 */  swc1      $f8, %lo(gSpinHistoryPosY)($at)
glabel func_802B61E4
/* E268F4 802B61E4 3C058011 */  lui       $a1, %hi(gSpinHistoryBufferPos)
.L802B61E8:
/* E268F8 802B61E8 24A5C944 */  addiu     $a1, $a1, %lo(gSpinHistoryBufferPos)
.L802B61EC:
/* E268FC 802B61EC 8CA20000 */  lw        $v0, 0x0($a1)
.L802B61F0:
/* E26900 802B61F0 C60000A8 */  lwc1      $f0, 0xA8($s0)
.L802B61F4:
/* E26904 802B61F4 00022040 */  sll       $a0, $v0, 1
.L802B61F8:
/* E26908 802B61F8 24420001 */  addiu     $v0, $v0, 0x1
.L802B61FC:
/* E2690C 802B61FC 4600020D */  trunc.w.s $f8, $f0
.L802B6200:
/* E26910 802B6200 44034000 */  mfc1      $v1, $f8
.L802B6204:
/* E26914 802B6204 3C018011 */  lui       $at, %hi(gSpinHistoryPosAngle)
glabel .L802B6208
/* E26918 802B6208 00240821 */  addu      $at, $at, $a0
/* E2691C 802B620C A423F6B8 */  sh        $v1, %lo(gSpinHistoryPosAngle)($at)
.L802B6210:
/* E26920 802B6210 ACA20000 */  sw        $v0, 0x0($a1)
.L802B6214:
/* E26924 802B6214 28420006 */  slti      $v0, $v0, 0x6
glabel .L802B6218
/* E26928 802B6218 50400001 */  beql      $v0, $zero, .L802B6220
/* E2692C 802B621C ACA00000 */   sw       $zero, 0x0($a1)
.L802B6220:
/* E26930 802B6220 820300B6 */  lb        $v1, 0xB6($s0)
.L802B6224:
/* E26934 802B6224 2C62000D */  sltiu     $v0, $v1, 0xD
glabel .L802B6228
/* E26938 802B6228 104000DE */  beqz      $v0, .L802B65A4
.L802B622C:
/* E2693C 802B622C 00031080 */   sll      $v0, $v1, 2
glabel action_update_step_up_peach
/* E26940 802B6230 3C01802B */  lui       $at, %hi(jtbl_802B6690)
/* E26944 802B6234 00220821 */  addu      $at, $at, $v0
glabel .L802B6238
/* E26948 802B6238 8C226690 */  lw        $v0, %lo(jtbl_802B6690)($at)
glabel .L802B623C
/* E2694C 802B623C 00400008 */  jr        $v0
glabel .L802B6240
/* E26950 802B6240 00000000 */   nop
glabel .L802B6244
/* E26954 802B6244 0C038D12 */  jal       integrate_gravity
glabel .L802B6248
/* E26958 802B6248 00000000 */   nop
/* E2695C 802B624C 46000506 */  mov.s     $f20, $f0
glabel .L802B6250
/* E26960 802B6250 4600A306 */  mov.s     $f12, $f20
.L802B6254:
/* E26964 802B6254 0C038D45 */  jal       player_check_collision_below
glabel .L802B6258
/* E26968 802B6258 27A50010 */   addiu    $a1, $sp, 0x10
.L802B625C:
/* E2696C 802B625C 8FA20010 */  lw        $v0, 0x10($sp)
/* E26970 802B6260 04400014 */  bltz      $v0, .L802B62B4
/* E26974 802B6264 E600002C */   swc1     $f0, 0x2C($s0)
.L802B6268:
/* E26978 802B6268 96240002 */  lhu       $a0, 0x2($s1)
.L802B626C:
/* E2697C 802B626C 30824000 */  andi      $v0, $a0, 0x4000
/* E26980 802B6270 10400010 */  beqz      $v0, .L802B62B4
.L802B6274:
/* E26984 802B6274 00042400 */   sll      $a0, $a0, 16
glabel .L802B6278
/* E26988 802B6278 0C0441A9 */  jal       get_entity_type
/* E2698C 802B627C 00042403 */   sra      $a0, $a0, 16
.L802B6280:
/* E26990 802B6280 2442FFF9 */  addiu     $v0, $v0, -0x7
.L802B6284:
/* E26994 802B6284 2C420002 */  sltiu     $v0, $v0, 0x2
glabel action_update_run
/* E26998 802B6288 1040000A */  beqz      $v0, .L802B62B4
/* E2699C 802B628C 00000000 */   nop
.L802B6290:
/* E269A0 802B6290 0C04417A */  jal       get_entity_by_index
glabel func_802B6294
/* E269A4 802B6294 86240002 */   lh       $a0, 0x2($s1)
glabel .L802B6298
/* E269A8 802B6298 90430006 */  lbu       $v1, 0x6($v0)
/* E269AC 802B629C 34630001 */  ori       $v1, $v1, 0x1
/* E269B0 802B62A0 0C03805E */  jal       disable_player_input
glabel func_802B62A4
/* E269B4 802B62A4 A0430006 */   sb       $v1, 0x6($v0)
.L802B62A8:
/* E269B8 802B62A8 2402000B */  addiu     $v0, $zero, 0xB
/* E269BC 802B62AC 080AD969 */  j         .L802B65A4
jtbl_802B62B0:
/* E269C0 802B62B0 A20200B6 */   sb       $v0, 0xB6($s0)
.L802B62B4:
/* E269C4 802B62B4 44800000 */  mtc1      $zero, $f0
glabel .L802B62B8
/* E269C8 802B62B8 00000000 */  nop
/* E269CC 802B62BC 4600A03E */  c.le.s    $f20, $f0
/* E269D0 802B62C0 00000000 */  nop
/* E269D4 802B62C4 4500000E */  bc1f      D_802B6300
.L802B62C8:
/* E269D8 802B62C8 00000000 */   nop
glabel action_update_peach_land
/* E269DC 802B62CC 0C0389AC */  jal       record_jump_apex
Munchlesia_LaunchVelocity:
/* E269E0 802B62D0 00000000 */   nop
Munchlesia_LateralVelocity:
/* E269E4 802B62D4 24040147 */  addiu     $a0, $zero, 0x147
Munchlesia_LaunchAccel:
/* E269E8 802B62D8 0000282D */  daddu     $a1, $zero, $zero
Munchlesia_LaunchYaw:
/* E269EC 802B62DC 24020003 */  addiu     $v0, $zero, 0x3
D_802B62E0:
/* E269F0 802B62E0 A6020008 */  sh        $v0, 0x8($s0)
.L802B62E4:
/* E269F4 802B62E4 8E020000 */  lw        $v0, 0x0($s0)
/* E269F8 802B62E8 920300B6 */  lbu       $v1, 0xB6($s0)
/* E269FC 802B62EC 34420004 */  ori       $v0, $v0, 0x4
/* E26A00 802B62F0 24630001 */  addiu     $v1, $v1, 0x1
/* E26A04 802B62F4 AE020000 */  sw        $v0, 0x0($s0)
glabel func_802B62F8
/* E26A08 802B62F8 0C052736 */  jal       sfx_play_sound_at_player
.L802B62FC:
/* E26A0C 802B62FC A20300B6 */   sb       $v1, 0xB6($s0)
D_802B6300:
/* E26A10 802B6300 8FA20010 */  lw        $v0, 0x10($sp)
/* E26A14 802B6304 044000A7 */  bltz      $v0, .L802B65A4
.L802B6308:
/* E26A18 802B6308 3C03FFFD */   lui      $v1, (0xFFFDFFF7 >> 16)
.L802B630C:
/* E26A1C 802B630C 3463FFF7 */  ori       $v1, $v1, (0xFFFDFFF7 & 0xFFFF)
.L802B6310:
/* E26A20 802B6310 8E020000 */  lw        $v0, 0x0($s0)
/* E26A24 802B6314 2404000A */  addiu     $a0, $zero, 0xA
/* E26A28 802B6318 00431024 */  and       $v0, $v0, $v1
glabel .L802B631C
/* E26A2C 802B631C 0C039769 */  jal       set_action_state
.L802B6320:
/* E26A30 802B6320 AE020000 */   sw       $v0, 0x0($s0)
glabel .L802B6324
/* E26A34 802B6324 080AD969 */  j         .L802B65A4
.L802B6328:
/* E26A38 802B6328 00000000 */   nop
glabel .L802B632C
/* E26A3C 802B632C 96020008 */  lhu       $v0, 0x8($s0)
.L802B6330:
/* E26A40 802B6330 2442FFFF */  addiu     $v0, $v0, -0x1
/* E26A44 802B6334 A6020008 */  sh        $v0, 0x8($s0)
.L802B6338:
/* E26A48 802B6338 00021400 */  sll       $v0, $v0, 16
/* E26A4C 802B633C 1C400099 */  bgtz      $v0, .L802B65A4
.L802B6340:
/* E26A50 802B6340 00000000 */   nop
/* E26A54 802B6344 920200B6 */  lbu       $v0, 0xB6($s0)
glabel func_802B6348
/* E26A58 802B6348 24420001 */  addiu     $v0, $v0, 0x1
/* E26A5C 802B634C 080AD969 */  j         .L802B65A4
PlayerTweesterPhysicsPtr:
/* E26A60 802B6350 A20200B6 */   sb       $v0, 0xB6($s0)
glabel .L802B6354
/* E26A64 802B6354 0C038D12 */  jal       integrate_gravity
/* E26A68 802B6358 00000000 */   nop
.L802B635C:
/* E26A6C 802B635C 46000506 */  mov.s     $f20, $f0
D_802B6360:
/* E26A70 802B6360 4600A306 */  mov.s     $f12, $f20
.L802B6364:
/* E26A74 802B6364 0C038D45 */  jal       player_check_collision_below
/* E26A78 802B6368 27A50010 */   addiu    $a1, $sp, 0x10
.L802B636C:
/* E26A7C 802B636C 3C01C2C8 */  lui       $at, (0xC2C80000 >> 16)
glabel .L802B6370
/* E26A80 802B6370 44811000 */  mtc1      $at, $f2
.L802B6374:
/* E26A84 802B6374 00000000 */  nop
/* E26A88 802B6378 4602A03C */  c.lt.s    $f20, $f2
glabel .L802B637C
/* E26A8C 802B637C 00000000 */  nop
/* E26A90 802B6380 45000005 */  bc1f      .L802B6398
/* E26A94 802B6384 E600002C */   swc1     $f0, 0x2C($s0)
/* E26A98 802B6388 AE00007C */  sw        $zero, 0x7C($s0)
/* E26A9C 802B638C AE000078 */  sw        $zero, 0x78($s0)
/* E26AA0 802B6390 AE000074 */  sw        $zero, 0x74($s0)
glabel .L802B6394
/* E26AA4 802B6394 E6020070 */  swc1      $f2, 0x70($s0)
.L802B6398:
/* E26AA8 802B6398 8FA20010 */  lw        $v0, 0x10($sp)
.L802B639C:
/* E26AAC 802B639C 04400081 */  bltz      $v0, .L802B65A4
/* E26AB0 802B63A0 00000000 */   nop
/* E26AB4 802B63A4 96240002 */  lhu       $a0, 0x2($s1)
.L802B63A8:
/* E26AB8 802B63A8 30824000 */  andi      $v0, $a0, 0x4000
.L802B63AC:
/* E26ABC 802B63AC 1040002D */  beqz      $v0, .L802B6464
glabel .L802B63B0
/* E26AC0 802B63B0 00042400 */   sll      $a0, $a0, 16
/* E26AC4 802B63B4 0C0441A9 */  jal       get_entity_type
/* E26AC8 802B63B8 00042403 */   sra      $a0, $a0, 16
/* E26ACC 802B63BC 0040182D */  daddu     $v1, $v0, $zero
.L802B63C0:
/* E26AD0 802B63C0 2462FFD2 */  addiu     $v0, $v1, -0x2E
.L802B63C4:
/* E26AD4 802B63C4 2C420002 */  sltiu     $v0, $v0, 0x2
.L802B63C8:
/* E26AD8 802B63C8 10400009 */  beqz      $v0, .L802B63F0
.L802B63CC:
/* E26ADC 802B63CC 2404000A */   addiu    $a0, $zero, 0xA
.L802B63D0:
/* E26AE0 802B63D0 3C03FFFD */  lui       $v1, (0xFFFDFFF7 >> 16)
glabel action_update_first_strike
/* E26AE4 802B63D4 3463FFF7 */  ori       $v1, $v1, (0xFFFDFFF7 & 0xFFFF)
.L802B63D8:
/* E26AE8 802B63D8 8E020000 */  lw        $v0, 0x0($s0)
glabel .L802B63DC
/* E26AEC 802B63DC 00431024 */  and       $v0, $v0, $v1
.L802B63E0:
/* E26AF0 802B63E0 0C039769 */  jal       set_action_state
.L802B63E4:
/* E26AF4 802B63E4 AE020000 */   sw       $v0, 0x0($s0)
/* E26AF8 802B63E8 080AD978 */  j         .L802B65E0
/* E26AFC 802B63EC 00000000 */   nop
.L802B63F0:
/* E26B00 802B63F0 2462FFF9 */  addiu     $v0, $v1, -0x7
.L802B63F4:
/* E26B04 802B63F4 2C420002 */  sltiu     $v0, $v0, 0x2
/* E26B08 802B63F8 1040001A */  beqz      $v0, .L802B6464
/* E26B0C 802B63FC 3C03FFFD */   lui      $v1, (0xFFFDFFF7 >> 16)
.L802B6400:
/* E26B10 802B6400 8E020000 */  lw        $v0, 0x0($s0)
/* E26B14 802B6404 3463FFF7 */  ori       $v1, $v1, (0xFFFDFFF7 & 0xFFFF)
/* E26B18 802B6408 00431024 */  and       $v0, $v0, $v1
.L802B640C:
/* E26B1C 802B640C 0C038C9E */  jal       phys_player_land
/* E26B20 802B6410 AE020000 */   sw       $v0, 0x0($s0)
.L802B6414:
/* E26B24 802B6414 0000202D */  daddu     $a0, $zero, $zero
.L802B6418:
/* E26B28 802B6418 0080282D */  daddu     $a1, $a0, $zero
/* E26B2C 802B641C 0C0B2D5B */  jal       exec_ShakeCam1
.L802B6420:
/* E26B30 802B6420 24060004 */   addiu    $a2, $zero, 0x4
.L802B6424:
/* E26B34 802B6424 2404014A */  addiu     $a0, $zero, 0x14A
.L802B6428:
/* E26B38 802B6428 0C052736 */  jal       sfx_play_sound_at_player
.L802B642C:
/* E26B3C 802B642C 0000282D */   daddu    $a1, $zero, $zero
D_802B6430:
/* E26B40 802B6430 24040100 */  addiu     $a0, $zero, 0x100
/* E26B44 802B6434 0C00A3C2 */  jal       start_rumble
/* E26B48 802B6438 24050032 */   addiu    $a1, $zero, 0x32
/* E26B4C 802B643C 3C048016 */  lui       $a0, %hi(gCurrentHiddenPanels)
/* E26B50 802B6440 2484A578 */  addiu     $a0, $a0, %lo(gCurrentHiddenPanels)
/* E26B54 802B6444 C600002C */  lwc1      $f0, 0x2C($s0)
.L802B6448:
/* E26B58 802B6448 8E030000 */  lw        $v1, 0x0($s0)
glabel action_update_peach_step_down_land
/* E26B5C 802B644C 24020001 */  addiu     $v0, $zero, 0x1
.L802B6450:
/* E26B60 802B6450 A0820000 */  sb        $v0, 0x0($a0)
.L802B6454:
/* E26B64 802B6454 34630400 */  ori       $v1, $v1, 0x400
/* E26B68 802B6458 E4800008 */  swc1      $f0, 0x8($a0)
/* E26B6C 802B645C 080AD978 */  j         .L802B65E0
.L802B6460:
/* E26B70 802B6460 AE030000 */   sw       $v1, 0x0($s0)
.L802B6464:
/* E26B74 802B6464 8FA40010 */  lw        $a0, 0x10($sp)
/* E26B78 802B6468 0C016F6A */  jal       get_collider_flags
glabel .L802B646C
/* E26B7C 802B646C 00000000 */   nop
/* E26B80 802B6470 304300FF */  andi      $v1, $v0, 0xFF
/* E26B84 802B6474 24020003 */  addiu     $v0, $zero, 0x3
glabel action_update_raise_arms
/* E26B88 802B6478 1462000E */  bne       $v1, $v0, .L802B64B4
glabel action_update_peach_falling
/* E26B8C 802B647C 24020002 */   addiu    $v0, $zero, 0x2
/* E26B90 802B6480 3C05FFFD */  lui       $a1, (0xFFFDFFF7 >> 16)
/* E26B94 802B6484 34A5FFF7 */  ori       $a1, $a1, (0xFFFDFFF7 & 0xFFFF)
/* E26B98 802B6488 24040017 */  addiu     $a0, $zero, 0x17
.L802B648C:
/* E26B9C 802B648C 8E020000 */  lw        $v0, 0x0($s0)
.L802B6490:
/* E26BA0 802B6490 24030001 */  addiu     $v1, $zero, 0x1
.L802B6494:
/* E26BA4 802B6494 A20300BF */  sb        $v1, 0xBF($s0)
/* E26BA8 802B6498 00451024 */  and       $v0, $v0, $a1
/* E26BAC 802B649C 0C039769 */  jal       set_action_state
.L802B64A0:
/* E26BB0 802B64A0 AE020000 */   sw       $v0, 0x0($s0)
/* E26BB4 802B64A4 8E020000 */  lw        $v0, 0x0($s0)
glabel .L802B64A8
/* E26BB8 802B64A8 34420800 */  ori       $v0, $v0, 0x800
.L802B64AC:
/* E26BBC 802B64AC 080AD978 */  j         .L802B65E0
/* E26BC0 802B64B0 AE020000 */   sw       $v0, 0x0($s0)
.L802B64B4:
/* E26BC4 802B64B4 14620009 */  bne       $v1, $v0, .L802B64DC
/* E26BC8 802B64B8 0000202D */   daddu    $a0, $zero, $zero
/* E26BCC 802B64BC 0C039769 */  jal       set_action_state
/* E26BD0 802B64C0 24040017 */   addiu    $a0, $zero, 0x17
.L802B64C4:
/* E26BD4 802B64C4 3C03FFFD */  lui       $v1, (0xFFFDFFF7 >> 16)
/* E26BD8 802B64C8 8E020000 */  lw        $v0, 0x0($s0)
.L802B64CC:
/* E26BDC 802B64CC 3463FFF7 */  ori       $v1, $v1, (0xFFFDFFF7 & 0xFFFF)
.L802B64D0:
/* E26BE0 802B64D0 00431024 */  and       $v0, $v0, $v1
.L802B64D4:
/* E26BE4 802B64D4 080AD978 */  j         .L802B65E0
.L802B64D8:
/* E26BE8 802B64D8 AE020000 */   sw       $v0, 0x0($s0)
glabel .L802B64DC
/* E26BEC 802B64DC 0080282D */  daddu     $a1, $a0, $zero
glabel .L802B64E0
/* E26BF0 802B64E0 24060004 */  addiu     $a2, $zero, 0x4
/* E26BF4 802B64E4 24020008 */  addiu     $v0, $zero, 0x8
/* E26BF8 802B64E8 A6020008 */  sh        $v0, 0x8($s0)
.L802B64EC:
/* E26BFC 802B64EC 920200B6 */  lbu       $v0, 0xB6($s0)
glabel .L802B64F0
/* E26C00 802B64F0 24030010 */  addiu     $v1, $zero, 0x10
/* E26C04 802B64F4 A60000C0 */  sh        $zero, 0xC0($s0)
.L802B64F8:
/* E26C08 802B64F8 A20300B4 */  sb        $v1, 0xB4($s0)
/* E26C0C 802B64FC 24420001 */  addiu     $v0, $v0, 0x1
/* E26C10 802B6500 0C0B2D5B */  jal       exec_ShakeCam1
/* E26C14 802B6504 A20200B6 */   sb       $v0, 0xB6($s0)
glabel action_update_pushing_block
/* E26C18 802B6508 2404014A */  addiu     $a0, $zero, 0x14A
.L802B650C:
/* E26C1C 802B650C 0C052736 */  jal       sfx_play_sound_at_player
glabel .L802B6510
/* E26C20 802B6510 0000282D */   daddu    $a1, $zero, $zero
/* E26C24 802B6514 24040100 */  addiu     $a0, $zero, 0x100
/* E26C28 802B6518 0C00A3C2 */  jal       start_rumble
.L802B651C:
/* E26C2C 802B651C 24050032 */   addiu    $a1, $zero, 0x32
.L802B6520:
/* E26C30 802B6520 3C048016 */  lui       $a0, %hi(gCurrentHiddenPanels)
.L802B6524:
/* E26C34 802B6524 2484A578 */  addiu     $a0, $a0, %lo(gCurrentHiddenPanels)
/* E26C38 802B6528 C600002C */  lwc1      $f0, 0x2C($s0)
/* E26C3C 802B652C 8E030000 */  lw        $v1, 0x0($s0)
.L802B6530:
/* E26C40 802B6530 24020001 */  addiu     $v0, $zero, 0x1
.L802B6534:
/* E26C44 802B6534 A0820000 */  sb        $v0, 0x0($a0)
/* E26C48 802B6538 34630400 */  ori       $v1, $v1, 0x400
/* E26C4C 802B653C E4800008 */  swc1      $f0, 0x8($a0)
/* E26C50 802B6540 080AD969 */  j         .L802B65A4
glabel .L802B6544
/* E26C54 802B6544 AE030000 */   sw       $v1, 0x0($s0)
glabel .L802B6548
/* E26C58 802B6548 96020008 */  lhu       $v0, 0x8($s0)
/* E26C5C 802B654C 2442FFFF */  addiu     $v0, $v0, -0x1
glabel func_802B6550
/* E26C60 802B6550 A6020008 */  sh        $v0, 0x8($s0)
.L802B6554:
/* E26C64 802B6554 00021400 */  sll       $v0, $v0, 16
/* E26C68 802B6558 14400012 */  bnez      $v0, .L802B65A4
/* E26C6C 802B655C 3C02FFFD */   lui      $v0, (0xFFFDFFF7 >> 16)
/* E26C70 802B6560 3442FFF7 */  ori       $v0, $v0, (0xFFFDFFF7 & 0xFFFF)
/* E26C74 802B6564 2404000A */  addiu     $a0, $zero, 0xA
glabel .L802B6568
/* E26C78 802B6568 920300B6 */  lbu       $v1, 0xB6($s0)
.L802B656C:
/* E26C7C 802B656C 8E050000 */  lw        $a1, 0x0($s0)
.L802B6570:
/* E26C80 802B6570 24630001 */  addiu     $v1, $v1, 0x1
.L802B6574:
/* E26C84 802B6574 00A22824 */  and       $a1, $a1, $v0
/* E26C88 802B6578 A20300B6 */  sb        $v1, 0xB6($s0)
/* E26C8C 802B657C 0C039769 */  jal       set_action_state
.L802B6580:
/* E26C90 802B6580 AE050000 */   sw       $a1, 0x0($s0)
/* E26C94 802B6584 080AD969 */  j         .L802B65A4
/* E26C98 802B6588 00000000 */   nop
glabel .L802B658C
/* E26C9C 802B658C 0C039769 */  jal       set_action_state
.L802B6590:
/* E26CA0 802B6590 24040007 */   addiu    $a0, $zero, 0x7
glabel .L802B6594
/* E26CA4 802B6594 920200B6 */  lbu       $v0, 0xB6($s0)
.L802B6598:
/* E26CA8 802B6598 24420001 */  addiu     $v0, $v0, 0x1
.L802B659C:
/* E26CAC 802B659C 0C038069 */  jal       enable_player_input
/* E26CB0 802B65A0 A20200B6 */   sb       $v0, 0xB6($s0)
glabel .L802B65A4
/* E26CB4 802B65A4 C6020070 */  lwc1      $f2, 0x70($s0)
.L802B65A8:
/* E26CB8 802B65A8 44800000 */  mtc1      $zero, $f0
/* E26CBC 802B65AC 00000000 */  nop
/* E26CC0 802B65B0 4600103C */  c.lt.s    $f2, $f0
glabel .L802B65B4
/* E26CC4 802B65B4 00000000 */  nop
.L802B65B8:
/* E26CC8 802B65B8 45000009 */  bc1f      .L802B65E0
/* E26CCC 802B65BC 00000000 */   nop
glabel .L802B65C0
/* E26CD0 802B65C0 0C0AD97E */  jal       func_802B65F8_E26D08
/* E26CD4 802B65C4 00000000 */   nop
/* E26CD8 802B65C8 04400005 */  bltz      $v0, .L802B65E0
glabel .L802B65CC
/* E26CDC 802B65CC AFA20010 */   sw       $v0, 0x10($sp)
.L802B65D0:
/* E26CE0 802B65D0 97A30012 */  lhu       $v1, 0x12($sp)
/* E26CE4 802B65D4 2402FFFF */  addiu     $v0, $zero, -0x1
/* E26CE8 802B65D8 A6220004 */  sh        $v0, 0x4($s1)
.L802B65DC:
/* E26CEC 802B65DC A6230002 */  sh        $v1, 0x2($s1)
.L802B65E0:
/* E26CF0 802B65E0 8FBF0020 */  lw        $ra, 0x20($sp)
.L802B65E4:
/* E26CF4 802B65E4 8FB1001C */  lw        $s1, 0x1C($sp)
glabel action_update_walk_peach
/* E26CF8 802B65E8 8FB00018 */  lw        $s0, 0x18($sp)
.L802B65EC:
/* E26CFC 802B65EC D7B40028 */  ldc1      $f20, 0x28($sp)
.L802B65F0:
/* E26D00 802B65F0 03E00008 */  jr        $ra
/* E26D04 802B65F4 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void action_update_tornado_jump(void) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    CollisionStatus* collisionStatus = &gCollisionStatus;
    f32 cameraRelativeYaw;
    f32 fallVelocity;
    s32 surfaceType;
    f32 spinRate;
    s32 colliderBelow;
    u32 entityType;

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
        playerStatus->flags |= (PS_FLAG_SPINNING | PS_FLAG_FLYING | PS_FLAG_JUMPING);
        phys_clear_spin_history();
        playerStatus->actionSubstate = SUBSTATE_ASCEND;
        playerStatus->currentSpeed = 0.0f;
        playerStatus->gravityIntegrator[0] = 16.0f;
        playerStatus->gravityIntegrator[1] = -7.38624f;
        playerStatus->gravityIntegrator[2] = 3.44694f;
        playerStatus->gravityIntegrator[3] = -0.75f;
        suggest_player_anim_always_forward(ANIM_MarioW2_Carried);
        disable_player_input();
        playerStatus->flags |= PS_FLAG_SPECIAL_JUMP;
        gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y;
        cameraRelativeYaw = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw);
        if (cameraRelativeYaw <= 180.0f) {
            spinRate = 60.0f;
        } else {
            spinRate = -60.0f;
        }
        playerStatus->spinRate = spinRate;
    }
    if (playerStatus->actionSubstate <= SUBSTATE_IMPACT) {
        if (playerStatus->spinRate >= 0.0f) {
            playerStatus->spriteFacingAngle += playerStatus->spinRate;
            if (playerStatus->spriteFacingAngle >= 360.0f) {
                playerStatus->spriteFacingAngle -= 360.0f;
            }
        } else {
            playerStatus->spriteFacingAngle += playerStatus->spinRate;
            if (playerStatus->spriteFacingAngle < 0.0f) {
                playerStatus->spriteFacingAngle += 360.0f;
            }
        }
    }
    if (playerStatus->gravityIntegrator[0] <= 0.0f) {
        gSpinHistoryPosY[gSpinHistoryBufferPos] = playerStatus->position.y;
    }

    gSpinHistoryPosAngle[gSpinHistoryBufferPos++] = playerStatus->spriteFacingAngle;

    if (gSpinHistoryBufferPos >= 6) {
        gSpinHistoryBufferPos = 0;
    }

    switch (playerStatus->actionSubstate) {
        case SUBSTATE_ASCEND:
            fallVelocity = integrate_gravity();
            playerStatus->position.y = player_check_collision_below(fallVelocity, &colliderBelow);
            if (colliderBelow >= 0 && collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT ) {
                entityType = get_entity_type(collisionStatus->currentFloor);
                if (entityType == ENTITY_TYPE_BLUE_SWITCH || entityType == ENTITY_TYPE_RED_SWITCH) {
                    get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR;
                    disable_player_input();
                    playerStatus->actionSubstate = SUBSTATE_HIT_SWITCH;
                    break;
                }
            }
            if (fallVelocity <= 0.0f) {
                record_jump_apex();
                playerStatus->currentStateTime = 3;
                playerStatus->flags |= PS_FLAG_FALLING;
                playerStatus->actionSubstate++;
                sfx_play_sound_at_player(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0);
            }
            if (colliderBelow >= 0) {
                playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
                set_action_state(ACTION_STATE_LAND);
            }
            break;
        case SUBSTATE_HOVER:
            if (--playerStatus->currentStateTime <= 0) {
                playerStatus->actionSubstate++;
            }
            break;
        case SUBSTATE_DESCEND:
            fallVelocity = integrate_gravity();
            playerStatus->position.y = player_check_collision_below(fallVelocity, &colliderBelow);
            if (fallVelocity < -100.0f) {
                playerStatus->gravityIntegrator[3] = 0.0f;
                playerStatus->gravityIntegrator[2] = 0.0f;
                playerStatus->gravityIntegrator[1] = 0.0f;
                playerStatus->gravityIntegrator[0] = -100.0f;
            }
            if (colliderBelow >= 0) {
                if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) {
                    entityType = get_entity_type(collisionStatus->currentFloor);
                    if (entityType == ENTITY_TYPE_SIMPLE_SPRING || entityType == ENTITY_TYPE_SCRIPT_SPRING) {
                        playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
                        set_action_state(ACTION_STATE_LAND);
                        return;
                    } else if (entityType == ENTITY_TYPE_BLUE_SWITCH || entityType == ENTITY_TYPE_RED_SWITCH) {
                        playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
                        phys_player_land();
                        exec_ShakeCam1(0, 0, 4);
                        sfx_play_sound_at_player(SOUND_14A, SOUND_SPACE_MODE_0);
                        start_rumble(256, 50);

                        gCurrentHiddenPanels.tryFlipTrigger = TRUE;
                        gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y;
                        playerStatus->flags |= PS_FLAG_SPECIAL_LAND;
                        return;
                    }
                }

                surfaceType = get_collider_flags(colliderBelow) & COLLIDER_FLAGS_SURFACE_TYPE_MASK;
                if (surfaceType == SURFACE_TYPE_LAVA) {
                    playerStatus->hazardType = HAZARD_TYPE_LAVA;
                    playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
                    set_action_state(ACTION_STATE_HIT_LAVA);
                    playerStatus->flags |= PS_FLAG_HIT_FIRE;
                    return;
                } else if (surfaceType == SURFACE_TYPE_SPIKES) {
                    set_action_state(ACTION_STATE_HIT_LAVA);
                    playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
                    return;
                }
                playerStatus->currentStateTime = 8;
                playerStatus->timeInAir = 0;
                playerStatus->actionState = ACTION_STATE_TORNADO_POUND;
                playerStatus->actionSubstate++;
                exec_ShakeCam1(0, 0, 4);
                sfx_play_sound_at_player(SOUND_14A, SOUND_SPACE_MODE_0);
                start_rumble(256, 50);

                gCurrentHiddenPanels.tryFlipTrigger = TRUE;
                gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y;
                playerStatus->flags |= PS_FLAG_SPECIAL_LAND;
            }
            break;
        case SUBSTATE_IMPACT:
            if (--playerStatus->currentStateTime == 0) {
                playerStatus->actionSubstate++;
                playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
                set_action_state(ACTION_STATE_LAND);
            }
            break;
        case SUBSTATE_HIT_SWITCH:
            set_action_state(ACTION_STATE_LANDING_ON_SWITCH);
            playerStatus->actionSubstate++;
            enable_player_input();
            break;
        case SUBSTATE_DONE_SWITCH:
            break;
    }

    if (playerStatus->gravityIntegrator[0] < 0.0f) {
        colliderBelow = get_collider_below_tornado_jump();
        if (colliderBelow >= 0) {
            collisionStatus->lastTouchedFloor = -1;
            collisionStatus->currentFloor = colliderBelow;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80247B04
/* 1763E4 80247B04 27BDFFD0 */  addiu     $sp, $sp, -0x30
jtbl_80247B08:
/* 1763E8 80247B08 AFB10014 */  sw        $s1, 0x14($sp)
/* 1763EC 80247B0C 3C118011 */  lui       $s1, %hi(gPlayerData)
/* 1763F0 80247B10 2631F290 */  addiu     $s1, $s1, %lo(gPlayerData)
/* 1763F4 80247B14 AFB40020 */  sw        $s4, 0x20($sp)
/* 1763F8 80247B18 3C14800E */  lui       $s4, %hi(gBattleStatus)
/* 1763FC 80247B1C 2694C070 */  addiu     $s4, $s4, %lo(gBattleStatus)
/* 176400 80247B20 AFB3001C */  sw        $s3, 0x1C($sp)
/* 176404 80247B24 3C13800B */  lui       $s3, %hi(gCurrentEncounter)
/* 176408 80247B28 26730F10 */  addiu     $s3, $s3, %lo(gCurrentEncounter)
/* 17640C 80247B2C AFB60028 */  sw        $s6, 0x28($sp)
/* 176410 80247B30 3C16800E */  lui       $s6, %hi(gBattleSubState)
/* 176414 80247B34 26D6C4DC */  addiu     $s6, $s6, %lo(gBattleSubState)
.L80247B38:
/* 176418 80247B38 AFB20018 */  sw        $s2, 0x18($sp)
/* 17641C 80247B3C 24120001 */  addiu     $s2, $zero, 0x1
/* 176420 80247B40 AFBF002C */  sw        $ra, 0x2C($sp)
D_80247B44:
/* 176424 80247B44 AFB50024 */  sw        $s5, 0x24($sp)
/* 176428 80247B48 AFB00010 */  sw        $s0, 0x10($sp)
/* 17642C 80247B4C 8E9500D8 */  lw        $s5, 0xD8($s4)
D_80247B50_EE6510:
/* 176430 80247B50 8EC30000 */  lw        $v1, 0x0($s6)
/* 176434 80247B54 8E9000DC */  lw        $s0, 0xDC($s4)
jtbl_80247B58:
/* 176438 80247B58 10720077 */  beq       $v1, $s2, .L80247D38
/* 17643C 80247B5C 28620002 */   slti     $v0, $v1, 0x2
D_80247B60:
/* 176440 80247B60 50400005 */  beql      $v0, $zero, .L80247B78
/* 176444 80247B64 24020002 */   addiu    $v0, $zero, 0x2
/* 176448 80247B68 10600009 */  beqz      $v1, .L80247B90
/* 17644C 80247B6C 00000000 */   nop
/* 176450 80247B70 08092032 */  j         .L802480C8
/* 176454 80247B74 00000000 */   nop
.L80247B78:
/* 176458 80247B78 106200A4 */  beq       $v1, $v0, .L80247E0C
/* 17645C 80247B7C 24020003 */   addiu    $v0, $zero, 0x3
D_80247B80:
/* 176460 80247B80 10620131 */  beq       $v1, $v0, .L80248048
/* 176464 80247B84 0000982D */   daddu    $s3, $zero, $zero
/* 176468 80247B88 08092032 */  j         .L802480C8
/* 17646C 80247B8C 00000000 */   nop
.L80247B90:
/* 176470 80247B90 3C01802A */  lui       $at, %hi(D_8029F254)
/* 176474 80247B94 AC20F254 */  sw        $zero, %lo(D_8029F254)($at)
/* 176478 80247B98 0C0903F7 */  jal       func_80240FDC
/* 17647C 80247B9C 00000000 */   nop
D_80247BA0:
/* 176480 80247BA0 9623029C */  lhu       $v1, 0x29C($s1)
.L80247BA4:
/* 176484 80247BA4 2C62270F */  sltiu     $v0, $v1, 0x270F
/* 176488 80247BA8 10400002 */  beqz      $v0, .L80247BB4
/* 17648C 80247BAC 24620001 */   addiu    $v0, $v1, 0x1
D_80247BB0_EE6570:
/* 176490 80247BB0 A622029C */  sh        $v0, 0x29C($s1)
.L80247BB4:
/* 176494 80247BB4 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
D_80247BB8:
/* 176498 80247BB8 8E820004 */  lw        $v0, 0x4($s4)
/* 17649C 80247BBC 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
D_80247BC0:
/* 1764A0 80247BC0 A2800099 */  sb        $zero, 0x99($s4)
/* 1764A4 80247BC4 00431824 */  and       $v1, $v0, $v1
D_80247BC8:
/* 1764A8 80247BC8 30420040 */  andi      $v0, $v0, 0x40
D_80247BCC:
/* 1764AC 80247BCC 14400023 */  bnez      $v0, .L80247C5C
D_80247BD0:
/* 1764B0 80247BD0 AE830004 */   sw       $v1, 0x4($s4)
/* 1764B4 80247BD4 82220002 */  lb        $v0, 0x2($s1)
D_80247BD8:
/* 1764B8 80247BD8 28420002 */  slti      $v0, $v0, 0x2
/* 1764BC 80247BDC 1040000B */  beqz      $v0, .L80247C0C
D_80247BE0_EE65A0:
/* 1764C0 80247BE0 00000000 */   nop
/* 1764C4 80247BE4 0C03A752 */  jal       is_ability_active
/* 1764C8 80247BE8 24040014 */   addiu    $a0, $zero, 0x14
/* 1764CC 80247BEC 10400007 */  beqz      $v0, .L80247C0C
D_80247BF0:
/* 1764D0 80247BF0 3C020800 */   lui      $v0, (0x8000000 >> 16)
/* 1764D4 80247BF4 8E830004 */  lw        $v1, 0x4($s4)
D_80247BF8:
/* 1764D8 80247BF8 92840099 */  lbu       $a0, 0x99($s4)
/* 1764DC 80247BFC 00621825 */  or        $v1, $v1, $v0
/* 1764E0 80247C00 34840001 */  ori       $a0, $a0, 0x1
/* 1764E4 80247C04 AE830004 */  sw        $v1, 0x4($s4)
/* 1764E8 80247C08 A2840099 */  sb        $a0, 0x99($s4)
.L80247C0C:
/* 1764EC 80247C0C 82220002 */  lb        $v0, 0x2($s1)
/* 1764F0 80247C10 28420006 */  slti      $v0, $v0, 0x6
/* 1764F4 80247C14 10400011 */  beqz      $v0, .L80247C5C
/* 1764F8 80247C18 00000000 */   nop
D_80247C1C:
/* 1764FC 80247C1C 0C03A752 */  jal       is_ability_active
D_80247C20:
/* 176500 80247C20 2404001E */   addiu    $a0, $zero, 0x1E
.L80247C24:
/* 176504 80247C24 1040000D */  beqz      $v0, .L80247C5C
jtbl_80247C28:
/* 176508 80247C28 00000000 */   nop
.L80247C2C:
/* 17650C 80247C2C 92820099 */  lbu       $v0, 0x99($s4)
/* 176510 80247C30 30420001 */  andi      $v0, $v0, 0x1
/* 176514 80247C34 14400009 */  bnez      $v0, .L80247C5C
/* 176518 80247C38 3C040800 */   lui      $a0, (0x8000000 >> 16)
D_80247C3C:
/* 17651C 80247C3C 3C05800E */  lui       $a1, %hi(gBattleStatus)
D_80247C40:
/* 176520 80247C40 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
/* 176524 80247C44 8CA20004 */  lw        $v0, 0x4($a1)
/* 176528 80247C48 92830099 */  lbu       $v1, 0x99($s4)
/* 17652C 80247C4C 00441025 */  or        $v0, $v0, $a0
/* 176530 80247C50 34630002 */  ori       $v1, $v1, 0x2
/* 176534 80247C54 ACA20004 */  sw        $v0, 0x4($a1)
/* 176538 80247C58 A2830099 */  sb        $v1, 0x99($s4)
.L80247C5C:
/* 17653C 80247C5C 82630005 */  lb        $v1, 0x5($s3)
/* 176540 80247C60 24020004 */  addiu     $v0, $zero, 0x4
/* 176544 80247C64 10620013 */  beq       $v1, $v0, D_80247CB4
/* 176548 80247C68 28620005 */   slti     $v0, $v1, 0x5
/* 17654C 80247C6C 10400005 */  beqz      $v0, .L80247C84
/* 176550 80247C70 24020002 */   addiu    $v0, $zero, 0x2
/* 176554 80247C74 50620008 */  beql      $v1, $v0, .L80247C98
/* 176558 80247C78 A2800178 */   sb       $zero, 0x178($s4)
.L80247C7C:
/* 17655C 80247C7C 08091F38 */  j         .L80247CE0
D_80247C80:
/* 176560 80247C80 00000000 */   nop
.L80247C84:
/* 176564 80247C84 24020006 */  addiu     $v0, $zero, 0x6
D_80247C88:
/* 176568 80247C88 1062010D */  beq       $v1, $v0, D_802480C0
/* 17656C 80247C8C 24040003 */   addiu    $a0, $zero, 0x3
D_80247C90:
/* 176570 80247C90 08091F38 */  j         .L80247CE0
D_80247C94:
/* 176574 80247C94 00000000 */   nop
.L80247C98:
/* 176578 80247C98 92620006 */  lbu       $v0, 0x6($s3)
/* 17657C 80247C9C 2403001D */  addiu     $v1, $zero, 0x1D
D_80247CA0:
/* 176580 80247CA0 A683017C */  sh        $v1, 0x17C($s4)
/* 176584 80247CA4 3C038009 */  lui       $v1, %hi(D_8008F2A8)
/* 176588 80247CA8 8C63F2A8 */  lw        $v1, %lo(D_8008F2A8)($v1)
/* 17658C 80247CAC 08091F35 */  j         .L80247CD4
/* 176590 80247CB0 00021600 */   sll      $v0, $v0, 24
D_80247CB4:
/* 176594 80247CB4 24020001 */  addiu     $v0, $zero, 0x1
/* 176598 80247CB8 A2820178 */  sb        $v0, 0x178($s4)
/* 17659C 80247CBC 92620006 */  lbu       $v0, 0x6($s3)
.L80247CC0:
/* 1765A0 80247CC0 24030006 */  addiu     $v1, $zero, 0x6
D_80247CC4:
/* 1765A4 80247CC4 A683017C */  sh        $v1, 0x17C($s4)
/* 1765A8 80247CC8 3C038009 */  lui       $v1, %hi(D_8008F0DC)
/* 1765AC 80247CCC 8C63F0DC */  lw        $v1, %lo(D_8008F0DC)($v1)
/* 1765B0 80247CD0 00021600 */  sll       $v0, $v0, 24
.L80247CD4:
/* 1765B4 80247CD4 00021603 */  sra       $v0, $v0, 24
/* 1765B8 80247CD8 A682017A */  sh        $v0, 0x17A($s4)
/* 1765BC 80247CDC AE830184 */  sw        $v1, 0x184($s4)
.L80247CE0:
/* 1765C0 80247CE0 0C09A75B */  jal       get_actor
D_80247CE4:
/* 1765C4 80247CE4 24040200 */   addiu    $a0, $zero, 0x200
/* 1765C8 80247CE8 0040802D */  daddu     $s0, $v0, $zero
/* 1765CC 80247CEC 8E0201C8 */  lw        $v0, 0x1C8($s0)
D_80247CF0:
/* 1765D0 80247CF0 1040000C */  beqz      $v0, .L80247D24
.L80247CF4:
/* 1765D4 80247CF4 2405000A */   addiu    $a1, $zero, 0xA
/* 1765D8 80247CF8 24060020 */  addiu     $a2, $zero, 0x20
.L80247CFC:
/* 1765DC 80247CFC 0040202D */  daddu     $a0, $v0, $zero
D_80247D00:
/* 1765E0 80247D00 24020038 */  addiu     $v0, $zero, 0x38
.L80247D04:
/* 1765E4 80247D04 0C0B0CF8 */  jal       start_script
/* 1765E8 80247D08 A20201F0 */   sb       $v0, 0x1F0($s0)
D_80247D0C:
/* 1765EC 80247D0C 0040202D */  daddu     $a0, $v0, $zero
D_80247D10:
/* 1765F0 80247D10 AE0401D8 */  sw        $a0, 0x1D8($s0)
glabel func_80247D14
/* 1765F4 80247D14 8C820144 */  lw        $v0, 0x144($a0)
/* 1765F8 80247D18 86030192 */  lh        $v1, 0x192($s0)
glabel func_80247D1C
/* 1765FC 80247D1C AE0201E8 */  sw        $v0, 0x1E8($s0)
D_80247D20:
/* 176600 80247D20 AC830148 */  sw        $v1, 0x148($a0)
.L80247D24:
/* 176604 80247D24 24020001 */  addiu     $v0, $zero, 0x1
/* 176608 80247D28 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel func_80247D2C
/* 17660C 80247D2C AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_80247D30
/* 176610 80247D30 08092032 */  j         .L802480C8
/* 176614 80247D34 00000000 */   nop
.L80247D38:
/* 176618 80247D38 0C09A75B */  jal       get_actor
D_80247D3C:
/* 17661C 80247D3C 24040200 */   addiu    $a0, $zero, 0x200
/* 176620 80247D40 0040802D */  daddu     $s0, $v0, $zero
.L80247D44:
/* 176624 80247D44 8E0201C8 */  lw        $v0, 0x1C8($s0)
/* 176628 80247D48 10400007 */  beqz      $v0, .L80247D68
/* 17662C 80247D4C 02A0202D */   daddu    $a0, $s5, $zero
/* 176630 80247D50 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 176634 80247D54 0C0B1059 */  jal       does_script_exist
/* 176638 80247D58 00000000 */   nop
/* 17663C 80247D5C 144000DA */  bnez      $v0, .L802480C8
D_80247D60:
/* 176640 80247D60 02A0202D */   daddu    $a0, $s5, $zero
/* 176644 80247D64 AE0001D8 */  sw        $zero, 0x1D8($s0)
.L80247D68:
/* 176648 80247D68 0C098C8C */  jal       func_80263230
/* 17664C 80247D6C 0200282D */   daddu    $a1, $s0, $zero
/* 176650 80247D70 3C05FFF7 */  lui       $a1, (0xFFF7FFFF >> 16)
/* 176654 80247D74 34A5FFFF */  ori       $a1, $a1, (0xFFF7FFFF & 0xFFFF)
/* 176658 80247D78 8E840000 */  lw        $a0, 0x0($s4)
/* 17665C 80247D7C 2402FFFD */  addiu     $v0, $zero, -0x3
.L80247D80:
/* 176660 80247D80 00822024 */  and       $a0, $a0, $v0
/* 176664 80247D84 8E820004 */  lw        $v0, 0x4($s4)
/* 176668 80247D88 3C030100 */  lui       $v1, (0x1000000 >> 16)
/* 17666C 80247D8C A280008C */  sb        $zero, 0x8C($s4)
D_80247D90:
/* 176670 80247D90 A6800180 */  sh        $zero, 0x180($s4)
/* 176674 80247D94 A280019A */  sb        $zero, 0x19A($s4)
.L80247D98:
/* 176678 80247D98 AE840000 */  sw        $a0, 0x0($s4)
.L80247D9C:
/* 17667C 80247D9C 00852024 */  and       $a0, $a0, $a1
/* 176680 80247DA0 AE840000 */  sw        $a0, 0x0($s4)
.L80247DA4:
/* 176684 80247DA4 00431025 */  or        $v0, $v0, $v1
/* 176688 80247DA8 0C03A6D5 */  jal       increment_status_bar_disabled
D_80247DAC:
/* 17668C 80247DAC AE820004 */   sw       $v0, 0x4($s4)
.L80247DB0:
/* 176690 80247DB0 0C093903 */  jal       func_8024E40C
/* 176694 80247DB4 2404000A */   addiu    $a0, $zero, 0xA
D_80247DB8:
/* 176698 80247DB8 0C09390F */  jal       func_8024E43C
/* 17669C 80247DBC 0000202D */   daddu    $a0, $zero, $zero
/* 1766A0 80247DC0 0C098F18 */  jal       reset_actor_turn_info
/* 1766A4 80247DC4 00000000 */   nop
/* 1766A8 80247DC8 3C048028 */  lui       $a0, %hi(EVS_Mario_HandlePhase)
/* 1766AC 80247DCC 24844EBC */  addiu     $a0, $a0, %lo(EVS_Mario_HandlePhase)
/* 1766B0 80247DD0 2405000A */  addiu     $a1, $zero, 0xA
/* 1766B4 80247DD4 0000302D */  daddu     $a2, $zero, $zero
/* 1766B8 80247DD8 0C0B0CF8 */  jal       start_script
D_80247DDC:
/* 1766BC 80247DDC A29201A7 */   sb       $s2, 0x1A7($s4)
/* 1766C0 80247DE0 0040202D */  daddu     $a0, $v0, $zero
/* 1766C4 80247DE4 AEA401D4 */  sw        $a0, 0x1D4($s5)
/* 1766C8 80247DE8 8C830144 */  lw        $v1, 0x144($a0)
/* 1766CC 80247DEC 24020003 */  addiu     $v0, $zero, 0x3
D_80247DF0:
/* 1766D0 80247DF0 3C01802A */  lui       $at, %hi(D_8029F248)
/* 1766D4 80247DF4 AC22F248 */  sw        $v0, %lo(D_8029F248)($at)
/* 1766D8 80247DF8 24020002 */  addiu     $v0, $zero, 0x2
.L80247DFC:
/* 1766DC 80247DFC AEC20000 */  sw        $v0, 0x0($s6)
D_80247E00:
/* 1766E0 80247E00 AEA301E4 */  sw        $v1, 0x1E4($s5)
/* 1766E4 80247E04 08092032 */  j         .L802480C8
/* 1766E8 80247E08 AC800148 */   sw       $zero, 0x148($a0)
.L80247E0C:
/* 1766EC 80247E0C 3C03802A */  lui       $v1, %hi(D_8029F248)
/* 1766F0 80247E10 2463F248 */  addiu     $v1, $v1, %lo(D_8029F248)
/* 1766F4 80247E14 8C620000 */  lw        $v0, 0x0($v1)
/* 1766F8 80247E18 10400003 */  beqz      $v0, .L80247E28
/* 1766FC 80247E1C 2442FFFF */   addiu    $v0, $v0, -0x1
/* 176700 80247E20 08091F8C */  j         D_80247E30
/* 176704 80247E24 AC620000 */   sw       $v0, 0x0($v1)
.L80247E28:
/* 176708 80247E28 3C01802A */  lui       $at, %hi(D_8029F254)
/* 17670C 80247E2C AC32F254 */  sw        $s2, %lo(D_8029F254)($at)
D_80247E30:
/* 176710 80247E30 3C02800E */  lui       $v0, %hi(gBattleStatus)
D_80247E34:
/* 176714 80247E34 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
D_80247E38:
/* 176718 80247E38 3C030020 */  lui       $v1, (0x200000 >> 16)
/* 17671C 80247E3C 00431024 */  and       $v0, $v0, $v1
/* 176720 80247E40 1440000A */  bnez      $v0, .L80247E6C
/* 176724 80247E44 00000000 */   nop
/* 176728 80247E48 8EA201D4 */  lw        $v0, 0x1D4($s5)
/* 17672C 80247E4C 50400007 */  beql      $v0, $zero, .L80247E6C
/* 176730 80247E50 AEA001D4 */   sw       $zero, 0x1D4($s5)
/* 176734 80247E54 8EA401E4 */  lw        $a0, 0x1E4($s5)
/* 176738 80247E58 0C0B1059 */  jal       does_script_exist
D_80247E5C:
/* 17673C 80247E5C 00000000 */   nop
/* 176740 80247E60 14400099 */  bnez      $v0, .L802480C8
/* 176744 80247E64 00000000 */   nop
D_80247E68:
/* 176748 80247E68 AEA001D4 */  sw        $zero, 0x1D4($s5)
.L80247E6C:
/* 17674C 80247E6C 3C04800E */  lui       $a0, %hi(gBattleStatus)
.L80247E70:
/* 176750 80247E70 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_80247E74:
/* 176754 80247E74 8C820000 */  lw        $v0, 0x0($a0)
/* 176758 80247E78 2403FEFF */  addiu     $v1, $zero, -0x101
/* 17675C 80247E7C 00431024 */  and       $v0, $v0, $v1
/* 176760 80247E80 AC820000 */  sw        $v0, 0x0($a0)
/* 176764 80247E84 8EA201D8 */  lw        $v0, 0x1D8($s5)
/* 176768 80247E88 10400005 */  beqz      $v0, .L80247EA0
/* 17676C 80247E8C 00000000 */   nop
/* 176770 80247E90 0C0B1059 */  jal       does_script_exist
/* 176774 80247E94 8EA401E8 */   lw       $a0, 0x1E8($s5)
/* 176778 80247E98 1440008B */  bnez      $v0, .L802480C8
/* 17677C 80247E9C 00000000 */   nop
.L80247EA0:
/* 176780 80247EA0 1200000A */  beqz      $s0, .L80247ECC
/* 176784 80247EA4 AEA001D8 */   sw       $zero, 0x1D8($s5)
/* 176788 80247EA8 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 17678C 80247EAC 50400007 */  beql      $v0, $zero, .L80247ECC
/* 176790 80247EB0 AE0001D8 */   sw       $zero, 0x1D8($s0)
/* 176794 80247EB4 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 176798 80247EB8 0C0B1059 */  jal       does_script_exist
/* 17679C 80247EBC 00000000 */   nop
/* 1767A0 80247EC0 14400081 */  bnez      $v0, .L802480C8
/* 1767A4 80247EC4 00000000 */   nop
/* 1767A8 80247EC8 AE0001D8 */  sw        $zero, 0x1D8($s0)
.L80247ECC:
/* 1767AC 80247ECC 0000982D */  daddu     $s3, $zero, $zero
/* 1767B0 80247ED0 0260882D */  daddu     $s1, $s3, $zero
/* 1767B4 80247ED4 0280902D */  daddu     $s2, $s4, $zero
.L80247ED8:
/* 1767B8 80247ED8 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 1767BC 80247EDC 5200000B */  beql      $s0, $zero, .L80247F0C
/* 1767C0 80247EE0 26310001 */   addiu    $s1, $s1, 0x1
/* 1767C4 80247EE4 8E0201D4 */  lw        $v0, 0x1D4($s0)
/* 1767C8 80247EE8 50400008 */  beql      $v0, $zero, .L80247F0C
/* 1767CC 80247EEC 26310001 */   addiu    $s1, $s1, 0x1
/* 1767D0 80247EF0 8E0401E4 */  lw        $a0, 0x1E4($s0)
/* 1767D4 80247EF4 0C0B1059 */  jal       does_script_exist
/* 1767D8 80247EF8 00000000 */   nop
/* 1767DC 80247EFC 50400002 */  beql      $v0, $zero, .L80247F08
/* 1767E0 80247F00 AE0001D4 */   sw       $zero, 0x1D4($s0)
/* 1767E4 80247F04 24130001 */  addiu     $s3, $zero, 0x1
.L80247F08:
/* 1767E8 80247F08 26310001 */  addiu     $s1, $s1, 0x1
.L80247F0C:
/* 1767EC 80247F0C 2A220018 */  slti      $v0, $s1, 0x18
/* 1767F0 80247F10 1440FFF1 */  bnez      $v0, .L80247ED8
.L80247F14:
/* 1767F4 80247F14 26520004 */   addiu    $s2, $s2, 0x4
/* 1767F8 80247F18 1660006B */  bnez      $s3, .L802480C8
/* 1767FC 80247F1C 0000882D */   daddu    $s1, $zero, $zero
/* 176800 80247F20 0280902D */  daddu     $s2, $s4, $zero
.L80247F24:
/* 176804 80247F24 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 176808 80247F28 5200000B */  beql      $s0, $zero, .L80247F58
/* 17680C 80247F2C 26310001 */   addiu    $s1, $s1, 0x1
.L80247F30:
/* 176810 80247F30 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 176814 80247F34 50400008 */  beql      $v0, $zero, .L80247F58
/* 176818 80247F38 26310001 */   addiu    $s1, $s1, 0x1
/* 17681C 80247F3C 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 176820 80247F40 0C0B1059 */  jal       does_script_exist
/* 176824 80247F44 00000000 */   nop
/* 176828 80247F48 50400002 */  beql      $v0, $zero, .L80247F54
/* 17682C 80247F4C AE0001D8 */   sw       $zero, 0x1D8($s0)
/* 176830 80247F50 24130001 */  addiu     $s3, $zero, 0x1
.L80247F54:
/* 176834 80247F54 26310001 */  addiu     $s1, $s1, 0x1
.L80247F58:
/* 176838 80247F58 2A220018 */  slti      $v0, $s1, 0x18
/* 17683C 80247F5C 1440FFF1 */  bnez      $v0, .L80247F24
/* 176840 80247F60 26520004 */   addiu    $s2, $s2, 0x4
/* 176844 80247F64 16600058 */  bnez      $s3, .L802480C8
/* 176848 80247F68 0000882D */   daddu    $s1, $zero, $zero
/* 17684C 80247F6C 3C04FFF7 */  lui       $a0, (0xFFF7FFFF >> 16)
D_80247F70:
/* 176850 80247F70 3484FFFF */  ori       $a0, $a0, (0xFFF7FFFF & 0xFFFF)
/* 176854 80247F74 0280182D */  daddu     $v1, $s4, $zero
.L80247F78:
/* 176858 80247F78 8C7000E0 */  lw        $s0, 0xE0($v1)
/* 17685C 80247F7C 12000004 */  beqz      $s0, .L80247F90
.L80247F80:
/* 176860 80247F80 26310001 */   addiu    $s1, $s1, 0x1
/* 176864 80247F84 8E020000 */  lw        $v0, 0x0($s0)
D_80247F88:
/* 176868 80247F88 00441024 */  and       $v0, $v0, $a0
/* 17686C 80247F8C AE020000 */  sw        $v0, 0x0($s0)
.L80247F90:
/* 176870 80247F90 2A220018 */  slti      $v0, $s1, 0x18
.L80247F94:
/* 176874 80247F94 1440FFF8 */  bnez      $v0, .L80247F78
.L80247F98:
/* 176878 80247F98 24630004 */   addiu    $v1, $v1, 0x4
/* 17687C 80247F9C 8282008C */  lb        $v0, 0x8C($s4)
/* 176880 80247FA0 14400049 */  bnez      $v0, .L802480C8
.L80247FA4:
/* 176884 80247FA4 00000000 */   nop
/* 176888 80247FA8 0C03A6CC */  jal       decrement_status_bar_disabled
D_80247FAC:
/* 17688C 80247FAC 00000000 */   nop
/* 176890 80247FB0 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
.L80247FB4:
/* 176894 80247FB4 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 176898 80247FB8 904200AA */  lbu       $v0, 0xAA($v0)
/* 17689C 80247FBC 30420001 */  andi      $v0, $v0, 0x1
/* 1768A0 80247FC0 1440003F */  bnez      $v0, D_802480C0
/* 1768A4 80247FC4 24040023 */   addiu    $a0, $zero, 0x23
/* 1768A8 80247FC8 0C098D19 */  jal       btl_check_player_defeated
D_80247FCC:
/* 1768AC 80247FCC 00000000 */   nop
glabel func_80247FD0
/* 1768B0 80247FD0 1440003D */  bnez      $v0, .L802480C8
/* 1768B4 80247FD4 00000000 */   nop
/* 1768B8 80247FD8 0C098D0D */  jal       btl_check_enemies_defeated
/* 1768BC 80247FDC 00000000 */   nop
/* 1768C0 80247FE0 14400039 */  bnez      $v0, .L802480C8
/* 1768C4 80247FE4 00000000 */   nop
/* 1768C8 80247FE8 0C09A75B */  jal       get_actor
.L80247FEC:
/* 1768CC 80247FEC 86A40428 */   lh       $a0, 0x428($s5)
D_80247FF0:
/* 1768D0 80247FF0 0040802D */  daddu     $s0, $v0, $zero
/* 1768D4 80247FF4 12000010 */  beqz      $s0, .L80248038
/* 1768D8 80247FF8 24020003 */   addiu    $v0, $zero, 0x3
/* 1768DC 80247FFC 8E0201C8 */  lw        $v0, 0x1C8($s0)
/* 1768E0 80248000 1040000C */  beqz      $v0, .L80248034
D_80248004:
/* 1768E4 80248004 2405000A */   addiu    $a1, $zero, 0xA
/* 1768E8 80248008 24060020 */  addiu     $a2, $zero, 0x20
/* 1768EC 8024800C 0040202D */  daddu     $a0, $v0, $zero
/* 1768F0 80248010 24020035 */  addiu     $v0, $zero, 0x35
/* 1768F4 80248014 0C0B0CF8 */  jal       start_script
/* 1768F8 80248018 A20201F0 */   sb       $v0, 0x1F0($s0)
D_8024801C:
/* 1768FC 8024801C 0040202D */  daddu     $a0, $v0, $zero
/* 176900 80248020 AE0401D8 */  sw        $a0, 0x1D8($s0)
glabel func_80248024
/* 176904 80248024 8C820144 */  lw        $v0, 0x144($a0)
/* 176908 80248028 86030192 */  lh        $v1, 0x192($s0)
/* 17690C 8024802C AE0201E8 */  sw        $v0, 0x1E8($s0)
/* 176910 80248030 AC830148 */  sw        $v1, 0x148($a0)
.L80248034:
/* 176914 80248034 24020003 */  addiu     $v0, $zero, 0x3
.L80248038:
/* 176918 80248038 3C01800E */  lui       $at, %hi(gBattleSubState)
D_8024803C:
/* 17691C 8024803C AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80248040:
/* 176920 80248040 08092032 */  j         .L802480C8
/* 176924 80248044 00000000 */   nop
.L80248048:
/* 176928 80248048 0260882D */  daddu     $s1, $s3, $zero
/* 17692C 8024804C 0280902D */  daddu     $s2, $s4, $zero
.L80248050:
/* 176930 80248050 8E5000E0 */  lw        $s0, 0xE0($s2)
D_80248054:
/* 176934 80248054 5200000B */  beql      $s0, $zero, .L80248084
/* 176938 80248058 26310001 */   addiu    $s1, $s1, 0x1
/* 17693C 8024805C 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 176940 80248060 50400008 */  beql      $v0, $zero, .L80248084
.L80248064:
/* 176944 80248064 26310001 */   addiu    $s1, $s1, 0x1
D_80248068:
/* 176948 80248068 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 17694C 8024806C 0C0B1059 */  jal       does_script_exist
D_80248070:
/* 176950 80248070 00000000 */   nop
D_80248074:
/* 176954 80248074 50400002 */  beql      $v0, $zero, D_80248080
/* 176958 80248078 AE0001D8 */   sw       $zero, 0x1D8($s0)
.L8024807C:
/* 17695C 8024807C 24130001 */  addiu     $s3, $zero, 0x1
D_80248080:
/* 176960 80248080 26310001 */  addiu     $s1, $s1, 0x1
.L80248084:
/* 176964 80248084 2A220018 */  slti      $v0, $s1, 0x18
D_80248088:
/* 176968 80248088 1440FFF1 */  bnez      $v0, .L80248050
.L8024808C:
/* 17696C 8024808C 26520004 */   addiu    $s2, $s2, 0x4
D_80248090:
/* 176970 80248090 1660000D */  bnez      $s3, .L802480C8
/* 176974 80248094 00000000 */   nop
/* 176978 80248098 8EA201D4 */  lw        $v0, 0x1D4($s5)
/* 17697C 8024809C 50400007 */  beql      $v0, $zero, .L802480BC
/* 176980 802480A0 AEA001D4 */   sw       $zero, 0x1D4($s5)
/* 176984 802480A4 8EA401E4 */  lw        $a0, 0x1E4($s5)
/* 176988 802480A8 0C0B1059 */  jal       does_script_exist
D_802480AC:
/* 17698C 802480AC 00000000 */   nop
/* 176990 802480B0 14400005 */  bnez      $v0, .L802480C8
/* 176994 802480B4 00000000 */   nop
/* 176998 802480B8 AEA001D4 */  sw        $zero, 0x1D4($s5)
.L802480BC:
/* 17699C 802480BC 24040005 */  addiu     $a0, $zero, 0x5
D_802480C0:
/* 1769A0 802480C0 0C090464 */  jal       func_80241190
/* 1769A4 802480C4 00000000 */   nop
.L802480C8:
/* 1769A8 802480C8 8FBF002C */  lw        $ra, 0x2C($sp)
/* 1769AC 802480CC 8FB60028 */  lw        $s6, 0x28($sp)
/* 1769B0 802480D0 8FB50024 */  lw        $s5, 0x24($sp)
/* 1769B4 802480D4 8FB40020 */  lw        $s4, 0x20($sp)
/* 1769B8 802480D8 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1769BC 802480DC 8FB20018 */  lw        $s2, 0x18($sp)
D_802480E0:
/* 1769C0 802480E0 8FB10014 */  lw        $s1, 0x14($sp)
/* 1769C4 802480E4 8FB00010 */  lw        $s0, 0x10($sp)
/* 1769C8 802480E8 03E00008 */  jr        $ra
D_802480EC:
/* 1769CC 802480EC 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_first_strike(void) {
    PlayerData* playerData = &gPlayerData;
    BattleStatus* battleStatus = &gBattleStatus;
    EncounterStatus* encounterStatus = &gCurrentEncounter;
    Actor* player = gBattleStatus.playerActor;
    Actor* partner = gBattleStatus.partnerActor;
    Evt* script;
    Actor* enemy;
    s32 enemyNotDone;
    s32 i;

    switch (gBattleSubState) {
        case BTL_SUBSTATE_FIRST_STRIKE_INIT:
            D_8029F254 = 0;
            btl_merlee_on_first_strike();
            if (playerData->playerFirstStrikes < 9999) {
                playerData->playerFirstStrikes++;
            }

            // clear rush flags to initialize
            battleStatus->rushFlags = RUSH_FLAG_NONE;
            gBattleStatus.flags2 &= ~BS_FLAGS2_HAS_RUSH;

            // set rush flags based on danger/peril status
            if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)) {
                if (playerData->curHP <= PERIL_THRESHOLD && is_ability_active(ABILITY_MEGA_RUSH)) {
                    gBattleStatus.flags2 |= BS_FLAGS2_HAS_RUSH;
                    battleStatus->rushFlags |= RUSH_FLAG_MEGA;
                }
                if (playerData->curHP <= DANGER_THRESHOLD && is_ability_active(ABILITY_POWER_RUSH)) {
                    if (!(battleStatus->rushFlags & RUSH_FLAG_MEGA)) {
                        gBattleStatus.flags2 |= BS_FLAGS2_HAS_RUSH;
                        battleStatus->rushFlags |= RUSH_FLAG_POWER;
                    }
                }
            }

            // setup dummy 'menu selection' for player move
            switch (encounterStatus->hitType) {
                case ENCOUNTER_TRIGGER_JUMP:
                    battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
                    battleStatus->selectedMoveID = MOVE_UNUSED_JUMP4;
                    battleStatus->moveArgument = encounterStatus->hitTier;
                    battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP4].flags;
                    break;
                case ENCOUNTER_TRIGGER_HAMMER:
                    battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
                    battleStatus->selectedMoveID = MOVE_UNUSED_HAMMER4;
                    battleStatus->moveArgument = encounterStatus->hitTier;
                    battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER4].flags;
                    break;
                case ENCOUNTER_TRIGGER_PARTNER:
                    btl_set_state(BATTLE_STATE_PARTNER_FIRST_STRIKE);
                    return;
            }
            // let the enemy know a first strike is coming
            enemy = get_actor(ACTOR_ENEMY0);
            if (enemy->handleEventSource != NULL) {
                enemy->lastEventType = EVENT_BEGIN_FIRST_STRIKE;
                script = start_script(enemy->handleEventSource, EVT_PRIORITY_A, EVT_FLAG_RUN_IMMEDIATELY);
                enemy->handleEventScript = script;
                enemy->handleEventScriptID = script->id;
                script->owner1.actorID = enemy->actorID;
            }
            gBattleSubState = BTL_SUBSTATE_FIRST_STRIKE_AWAIT_ENEMY_READY;
            break;
        case BTL_SUBSTATE_FIRST_STRIKE_AWAIT_ENEMY_READY:
            enemy = get_actor(ACTOR_ENEMY0);
            if (enemy->handleEventSource != NULL) {
                if (does_script_exist(enemy->handleEventScriptID)) {
                    break;
                } else {
                    enemy->handleEventScript = NULL;
                }
            }

            func_80263230(player, enemy);
            battleStatus->stateFreezeCount = 0;
            battleStatus->lastAttackDamage = 0;
            battleStatus->currentDamageSource = DMG_SRC_DEFAULT;
            gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
            gBattleStatus.flags2 |= BS_FLAGS2_1000000;
            gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING;
            increment_status_bar_disabled();
            btl_cam_use_preset(BTL_CAM_PRESET_10);
            btl_cam_target_actor(ACTOR_PLAYER);
            reset_actor_turn_info();
            // begin the partner turn script
            battleStatus->battlePhase = PHASE_FIRST_STRIKE;
            script = start_script(&EVS_Mario_HandlePhase, EVT_PRIORITY_A, 0);
            player->takeTurnScript = script;
            player->takeTurnScriptID = script->id;
            script->owner1.actorID = ACTOR_PLAYER;
            D_8029F248 = 3;
            gBattleSubState = BTL_SUBSTATE_FIRST_STRIKE_AWAIT_SCRIPTS;
            break;
        case BTL_SUBSTATE_FIRST_STRIKE_AWAIT_SCRIPTS:
            if (D_8029F248 != 0) {
                D_8029F248--;
            } else {
                D_8029F254 = 1;
            }

            // wait for player move script
            if (!(gBattleStatus.flags1 & BS_FLAGS1_YIELD_TURN)) {
                if (player->takeTurnScript != NULL && does_script_exist(player->takeTurnScriptID)) {
                    break;
                }
                player->takeTurnScript = NULL;
            }

            gBattleStatus.flags1 &= ~BS_FLAGS1_100;

            // wait for player handle event script
            if (player->handleEventScript != NULL && does_script_exist(player->handleEventScriptID)) {
                break;
            }
            player->handleEventScript = NULL;

            // wait for partner handle event script
            if (partner != NULL) {
                if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) {
                    break;
                }
                partner->handleEventScript = NULL;
            }

            // wait for all enemy turn scripts
            enemyNotDone = FALSE;
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL && enemy->takeTurnScript != NULL) {
                    if (does_script_exist(enemy->takeTurnScriptID)) {
                        enemyNotDone = TRUE;
                    } else {
                        enemy->takeTurnScript = NULL;
                    }
                }
            }
            if (enemyNotDone) {
                break;
            }

            // wait for all enemy handle event scripts
            enemyNotDone = FALSE;
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL && enemy->handleEventScript != NULL) {
                    if (does_script_exist(enemy->handleEventScriptID)) {
                        enemyNotDone = TRUE;
                    } else {
                        enemy->handleEventScript = NULL;
                    }
                }
            }
            if (enemyNotDone) {
                break;
            }

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL) {
                    enemy->flags &= ~ACTOR_FLAG_HEALTH_BAR_HIDDEN;
                }
            }

            if (battleStatus->stateFreezeCount == 0) {
                decrement_status_bar_disabled();
                if (!(gGameStatusPtr->demoFlags & 1)) {
                    Actor* target;

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

                    target = get_actor(player->targetActorID);
                    if (target != NULL) {
                        if (target->handleEventSource != NULL) {
                            target->lastEventType = EVENT_END_FIRST_STRIKE;
                            script = start_script(target->handleEventSource, EVT_PRIORITY_A, EVT_FLAG_RUN_IMMEDIATELY);
                            target->handleEventScript = script;
                            target->handleEventScriptID = script->id;
                            script->owner1.actorID = target->actorID;
                        }
                    }
                    gBattleSubState = BTL_SUBSTATE_FIRST_STRIKE_AWAIT_ENEMY_DONE;
                } else {
                    btl_set_state(BATTLE_STATE_END_DEMO_BATTLE);
                }
            }
            break;
        case BTL_SUBSTATE_FIRST_STRIKE_AWAIT_ENEMY_DONE:
            enemyNotDone = FALSE;
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL && enemy->handleEventScript != NULL) {
                    if (does_script_exist(enemy->handleEventScriptID)) {
                        enemyNotDone = TRUE;
                    } else {
                        enemy->handleEventScript = NULL;
                    }
                }
            }
            if (enemyNotDone) {
                break;
            }
            if (player->takeTurnScript == NULL || !does_script_exist(player->takeTurnScriptID)) {
                player->takeTurnScript = NULL;
                btl_set_state(BATTLE_STATE_BEGIN_TURN);
            }
            break;
    }
}