### RAW ASSEMBLY INSTRUCTIONS:

dlabel D_80241B14
/* 1703F4 80241B14 27BDFFD0 */  addiu     $sp, $sp, -0x30
mgm_01_TallyPosY:
/* 1703F8 80241B18 AFB40020 */  sw        $s4, 0x20($sp)
.L80241B1C:
/* 1703FC 80241B1C 3C14800E */  lui       $s4, %hi(gBattleStatus)
glabel func_80241B20
/* 170400 80241B20 2694C070 */  addiu     $s4, $s4, %lo(gBattleStatus)
glabel func_80241B24
/* 170404 80241B24 AFB20018 */  sw        $s2, 0x18($sp)
glabel func_80241B28
/* 170408 80241B28 3C128011 */  lui       $s2, %hi(gPlayerData)
glabel func_80241B2C
/* 17040C 80241B2C 2652F290 */  addiu     $s2, $s2, %lo(gPlayerData)
D_80241B30:
/* 170410 80241B30 AFBF0028 */  sw        $ra, 0x28($sp)
glabel func_80241B34
/* 170414 80241B34 AFB50024 */  sw        $s5, 0x24($sp)
glabel .L80241B38
/* 170418 80241B38 AFB3001C */  sw        $s3, 0x1C($sp)
.L80241B3C:
/* 17041C 80241B3C AFB10014 */  sw        $s1, 0x14($sp)
glabel func_80241B40
/* 170420 80241B40 AFB00010 */  sw        $s0, 0x10($sp)
mgm_01_PanelModelIDs:
/* 170424 80241B44 8E9500DC */  lw        $s5, 0xDC($s4)
.L80241B48:
/* 170428 80241B48 3C02800E */  lui       $v0, %hi(gBattleSubState)
D_80241B4C:
/* 17042C 80241B4C 8C42C4DC */  lw        $v0, %lo(gBattleSubState)($v0)
glabel dead_kzn_19_LetterDelivery_SaveNpcAnim
/* 170430 80241B50 8E8500D8 */  lw        $a1, 0xD8($s4)
D_80241B54:
/* 170434 80241B54 144000E9 */  bnez      $v0, func_80241EFC
glabel func_80241B58
/* 170438 80241B58 3C04FEFF */   lui      $a0, (0xFEFFFFFF >> 16)
glabel func_80241B5C
/* 17043C 80241B5C 3484FFFF */  ori       $a0, $a0, (0xFEFFFFFF & 0xFFFF)
glabel func_80241B60
/* 170440 80241B60 8E820004 */  lw        $v0, 0x4($s4)
D_80241B64:
/* 170444 80241B64 2403FFFD */  addiu     $v1, $zero, -0x3
glabel func_80241B68
/* 170448 80241B68 A28000AC */  sb        $zero, 0xAC($s4)
D_80241B6C:
/* 17044C 80241B6C A28000AD */  sb        $zero, 0xAD($s4)
mgm_01_PanelTypes:
/* 170450 80241B70 00431024 */  and       $v0, $v0, $v1
glabel func_80241B74
/* 170454 80241B74 2403FFFB */  addiu     $v1, $zero, -0x5
glabel func_80241B78
/* 170458 80241B78 00431024 */  and       $v0, $v0, $v1
D_80241B7C:
/* 17045C 80241B7C 2403FFF7 */  addiu     $v1, $zero, -0x9
D_80241B80:
/* 170460 80241B80 00431024 */  and       $v0, $v0, $v1
D_80241B84:
/* 170464 80241B84 2403FFEF */  addiu     $v1, $zero, -0x11
glabel func_80241B88
/* 170468 80241B88 00431024 */  and       $v0, $v0, $v1
glabel func_80241B8C
/* 17046C 80241B8C AE820004 */  sw        $v0, 0x4($s4)
glabel func_80241B90
/* 170470 80241B90 00441024 */  and       $v0, $v0, $a0
glabel dead_flo_13_LakituAI_Loiter
/* 170474 80241B94 AE820004 */  sw        $v0, 0x4($s4)
D_80241B98:
/* 170478 80241B98 8CA20000 */  lw        $v0, 0x0($a1)
mgm_01_InitialConfigurations:
/* 17047C 80241B9C 3C030C00 */  lui       $v1, (0xC000000 >> 16)
.L80241BA0:
/* 170480 80241BA0 A0A0021D */  sb        $zero, 0x21D($a1)
glabel func_80241BA4
/* 170484 80241BA4 00431025 */  or        $v0, $v0, $v1
glabel func_80241BA8
/* 170488 80241BA8 12A00004 */  beqz      $s5, func_80241BBC
D_80241BAC:
/* 17048C 80241BAC ACA20000 */   sw       $v0, 0x0($a1)
D_80241BB0:
/* 170490 80241BB0 00431025 */  or        $v0, $v0, $v1
D_80241BB4:
/* 170494 80241BB4 ACA20000 */  sw        $v0, 0x0($a1)
arn_03_pad_1BB8:
/* 170498 80241BB8 A2A0021D */  sb        $zero, 0x21D($s5)
glabel func_80241BBC
/* 17049C 80241BBC 8282008B */  lb        $v0, 0x8B($s4)
glabel func_80241BC0_EAA6A0
/* 1704A0 80241BC0 10400004 */  beqz      $v0, func_80241BD4
glabel func_80241BC4
/* 1704A4 80241BC4 3C030400 */   lui      $v1, (0x4000000 >> 16)
glabel func_80241BC8
/* 1704A8 80241BC8 8E820000 */  lw        $v0, 0x0($s4)
glabel func_80241BCC
/* 1704AC 80241BCC 00431025 */  or        $v0, $v0, $v1
.L80241BD0:
/* 1704B0 80241BD0 AE820000 */  sw        $v0, 0x0($s4)
glabel func_80241BD4
/* 1704B4 80241BD4 0000502D */  daddu     $t2, $zero, $zero
glabel func_80241BD8
/* 1704B8 80241BD8 0140882D */  daddu     $s1, $t2, $zero
D_80241BDC:
/* 1704BC 80241BDC 0280202D */  daddu     $a0, $s4, $zero
glabel func_80241BE0
/* 1704C0 80241BE0 0280182D */  daddu     $v1, $s4, $zero
D_80241BE4:
/* 1704C4 80241BE4 8C9000E0 */  lw        $s0, 0xE0($a0)
glabel func_80241BE8
/* 1704C8 80241BE8 52000006 */  beql      $s0, $zero, D_80241C04
glabel func_80241BEC
/* 1704CC 80241BEC 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80241BF0
/* 1704D0 80241BF0 36220200 */  ori       $v0, $s1, 0x200
.L80241BF4:
/* 1704D4 80241BF4 A4620140 */  sh        $v0, 0x140($v1)
glabel dead_flo_08_FlowerGuard_MakeItemList
/* 1704D8 80241BF8 24630002 */  addiu     $v1, $v1, 0x2
glabel func_80241BFC
/* 1704DC 80241BFC 254A0001 */  addiu     $t2, $t2, 0x1
glabel func_80241C00
/* 1704E0 80241C00 26310001 */  addiu     $s1, $s1, 0x1
D_80241C04:
/* 1704E4 80241C04 2A220018 */  slti      $v0, $s1, 0x18
glabel func_80241C08
/* 1704E8 80241C08 1440FFF6 */  bnez      $v0, D_80241BE4
D_80241C0C:
/* 1704EC 80241C0C 24840004 */   addiu    $a0, $a0, 0x4
D_80241C10_EB8E40:
/* 1704F0 80241C10 A28A0171 */  sb        $t2, 0x171($s4)
D_80241C14:
/* 1704F4 80241C14 0000882D */  daddu     $s1, $zero, $zero
glabel func_80241C18
/* 1704F8 80241C18 2542FFFF */  addiu     $v0, $t2, -0x1
.L80241C1C:
/* 1704FC 80241C1C 18400031 */  blez      $v0, D_80241CE4
glabel func_80241C20
/* 170500 80241C20 268C0140 */   addiu    $t4, $s4, 0x140
glabel .L80241C24
/* 170504 80241C24 3C0E800E */  lui       $t6, %hi(gBattleStatus)
.L80241C28:
/* 170508 80241C28 25CEC070 */  addiu     $t6, $t6, %lo(gBattleStatus)
D_80241C2C:
/* 17050C 80241C2C 3C0D0800 */  lui       $t5, (0x8000000 >> 16)
glabel dead_flo_08_foliage_setup_shear_mtx
/* 170510 80241C30 0180582D */  daddu     $t3, $t4, $zero
glabel func_80241C34
/* 170514 80241C34 26280001 */  addiu     $t0, $s1, 0x1
glabel func_80241C38
/* 170518 80241C38 010A102A */  slt       $v0, $t0, $t2
glabel func_80241C3C
/* 17051C 80241C3C 50400025 */  beql      $v0, $zero, D_80241CD4
D_80241C40:
/* 170520 80241C40 26310001 */   addiu    $s1, $s1, 0x1
glabel dead_flo_16_FlyingAI_Chase
/* 170524 80241C44 0160482D */  daddu     $t1, $t3, $zero
D_80241C48:
/* 170528 80241C48 00081040 */  sll       $v0, $t0, 1
glabel .L80241C4C
/* 17052C 80241C4C 004C2821 */  addu      $a1, $v0, $t4
glabel func_80241C50
/* 170530 80241C50 95270000 */  lhu       $a3, 0x0($t1)
D_80241C54:
/* 170534 80241C54 94A60000 */  lhu       $a2, 0x0($a1)
glabel func_80241C58
/* 170538 80241C58 8DC40000 */  lw        $a0, 0x0($t6)
glabel func_80241C5C
/* 17053C 80241C5C 30E200FF */  andi      $v0, $a3, 0xFF
glabel func_80241C60
/* 170540 80241C60 00021080 */  sll       $v0, $v0, 2
glabel func_80241C64
/* 170544 80241C64 02821021 */  addu      $v0, $s4, $v0
arn_03_varStash:
/* 170548 80241C68 30C300FF */  andi      $v1, $a2, 0xFF
.L80241C6C:
/* 17054C 80241C6C 00031880 */  sll       $v1, $v1, 2
glabel func_80241C70
/* 170550 80241C70 02831821 */  addu      $v1, $s4, $v1
glabel func_80241C74
/* 170554 80241C74 008D2024 */  and       $a0, $a0, $t5
glabel func_80241C78
/* 170558 80241C78 8C4200E0 */  lw        $v0, 0xE0($v0)
glabel func_80241C7C
/* 17055C 80241C7C 10800009 */  beqz      $a0, .L80241CA4
.L80241C80:
/* 170560 80241C80 8C6300E0 */   lw       $v1, 0xE0($v1)
D_80241C84:
/* 170564 80241C84 C4420138 */  lwc1      $f2, 0x138($v0)
D_80241C88:
/* 170568 80241C88 C4600138 */  lwc1      $f0, 0x138($v1)
D_80241C8C:
/* 17056C 80241C8C 4602003C */  c.lt.s    $f0, $f2
glabel dead_11_LakituAI_Main
/* 170570 80241C90 00000000 */  nop
glabel .L80241C94
/* 170574 80241C94 4502000B */  bc1fl     D_80241CC4
D_80241C98:
/* 170578 80241C98 25080001 */   addiu    $t0, $t0, 0x1
D_80241C9C:
/* 17057C 80241C9C 0809072F */  j         func_80241CBC
glabel dead_flo_08_TransformFoliage
/* 170580 80241CA0 A5260000 */   sh       $a2, 0x0($t1)
glabel .L80241CA4
/* 170584 80241CA4 804201F1 */  lb        $v0, 0x1F1($v0)
glabel dead_flo_16_FlyingAI_LosePlayer
/* 170588 80241CA8 806301F1 */  lb        $v1, 0x1F1($v1)
.L80241CAC:
/* 17058C 80241CAC 0043102A */  slt       $v0, $v0, $v1
D_80241CB0:
/* 170590 80241CB0 50400004 */  beql      $v0, $zero, D_80241CC4
D_80241CB4:
/* 170594 80241CB4 25080001 */   addiu    $t0, $t0, 0x1
glabel func_80241CB8
/* 170598 80241CB8 A5260000 */  sh        $a2, 0x0($t1)
glabel func_80241CBC
/* 17059C 80241CBC A4A70000 */  sh        $a3, 0x0($a1)
glabel .L80241CC0
/* 1705A0 80241CC0 25080001 */  addiu     $t0, $t0, 0x1
D_80241CC4:
/* 1705A4 80241CC4 010A102A */  slt       $v0, $t0, $t2
glabel func_80241CC8
/* 1705A8 80241CC8 1440FFE1 */  bnez      $v0, func_80241C50
glabel func_80241CCC
/* 1705AC 80241CCC 24A50002 */   addiu    $a1, $a1, 0x2
D_80241CD0:
/* 1705B0 80241CD0 26310001 */  addiu     $s1, $s1, 0x1
D_80241CD4:
/* 1705B4 80241CD4 2542FFFF */  addiu     $v0, $t2, -0x1
D_80241CD8:
/* 1705B8 80241CD8 0222102A */  slt       $v0, $s1, $v0
glabel func_80241CDC
/* 1705BC 80241CDC 1440FFD5 */  bnez      $v0, func_80241C34
.L80241CE0:
/* 1705C0 80241CE0 256B0002 */   addiu    $t3, $t3, 0x2
D_80241CE4:
/* 1705C4 80241CE4 0C090398 */  jal       func_80240E60
glabel func_80241CE8
/* 1705C8 80241CE8 A2800170 */   sb       $zero, 0x170($s4)
glabel func_80241CEC
/* 1705CC 80241CEC 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
D_80241CF0:
/* 1705D0 80241CF0 3C10800E */  lui       $s0, %hi(gBattleStatus)
D_80241CF4:
/* 1705D4 80241CF4 2610C070 */  addiu     $s0, $s0, %lo(gBattleStatus)
glabel dead_flo_14_FlyingAI_Init
/* 1705D8 80241CF8 8E020004 */  lw        $v0, 0x4($s0)
glabel .L80241CFC
/* 1705DC 80241CFC 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
glabel func_80241D00
/* 1705E0 80241D00 A2800099 */  sb        $zero, 0x99($s4)
glabel func_80241D04
/* 1705E4 80241D04 00431824 */  and       $v1, $v0, $v1
glabel func_80241D08
/* 1705E8 80241D08 30420040 */  andi      $v0, $v0, 0x40
.L80241D0C:
/* 1705EC 80241D0C 14400023 */  bnez      $v0, D_80241D9C
glabel .L80241D10
/* 1705F0 80241D10 AE030004 */   sw       $v1, 0x4($s0)
D_80241D14:
/* 1705F4 80241D14 82420002 */  lb        $v0, 0x2($s2)
glabel func_80241D18
/* 1705F8 80241D18 28420002 */  slti      $v0, $v0, 0x2
glabel func_80241D1C
/* 1705FC 80241D1C 1040000B */  beqz      $v0, .L80241D4C
glabel func_80241D20
/* 170600 80241D20 00000000 */   nop
glabel func_80241D24
/* 170604 80241D24 0C03A752 */  jal       is_ability_active
glabel func_80241D28
/* 170608 80241D28 24040014 */   addiu    $a0, $zero, 0x14
glabel .L80241D2C
/* 17060C 80241D2C 10400007 */  beqz      $v0, .L80241D4C
glabel func_80241D30
/* 170610 80241D30 3C020800 */   lui      $v0, (0x8000000 >> 16)
D_80241D34:
/* 170614 80241D34 8E030004 */  lw        $v1, 0x4($s0)
D_80241D38:
/* 170618 80241D38 92840099 */  lbu       $a0, 0x99($s4)
glabel func_80241D3C
/* 17061C 80241D3C 00621825 */  or        $v1, $v1, $v0
.L80241D40:
/* 170620 80241D40 34840001 */  ori       $a0, $a0, 0x1
glabel func_80241D44
/* 170624 80241D44 AE030004 */  sw        $v1, 0x4($s0)
.L80241D48:
/* 170628 80241D48 A2840099 */  sb        $a0, 0x99($s4)
.L80241D4C:
/* 17062C 80241D4C 82420002 */  lb        $v0, 0x2($s2)
glabel func_80241D50
/* 170630 80241D50 28420006 */  slti      $v0, $v0, 0x6
glabel .L80241D54
/* 170634 80241D54 10400011 */  beqz      $v0, D_80241D9C
glabel func_80241D58
/* 170638 80241D58 00000000 */   nop
glabel func_80241D5C
/* 17063C 80241D5C 0C03A752 */  jal       is_ability_active
glabel func_80241D60
/* 170640 80241D60 2404001E */   addiu    $a0, $zero, 0x1E
glabel func_80241D64
/* 170644 80241D64 1040000D */  beqz      $v0, D_80241D9C
glabel dead_kzn_17_set_script_owner_npc_anim
/* 170648 80241D68 00000000 */   nop
D_80241D6C:
/* 17064C 80241D6C 92820099 */  lbu       $v0, 0x99($s4)
glabel func_80241D70
/* 170650 80241D70 30420001 */  andi      $v0, $v0, 0x1
glabel func_80241D74
/* 170654 80241D74 14400009 */  bnez      $v0, D_80241D9C
glabel .L80241D78
/* 170658 80241D78 3C040800 */   lui      $a0, (0x8000000 >> 16)
glabel func_80241D7C
/* 17065C 80241D7C 3C05800E */  lui       $a1, %hi(gBattleStatus)
glabel .L80241D80
/* 170660 80241D80 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
glabel func_80241D84
/* 170664 80241D84 8CA20004 */  lw        $v0, 0x4($a1)
glabel func_80241D88
/* 170668 80241D88 92830099 */  lbu       $v1, 0x99($s4)
glabel func_80241D8C
/* 17066C 80241D8C 00441025 */  or        $v0, $v0, $a0
glabel func_80241D90
/* 170670 80241D90 34630002 */  ori       $v1, $v1, 0x2
glabel func_80241D94
/* 170674 80241D94 ACA20004 */  sw        $v0, 0x4($a1)
D_80241D98:
/* 170678 80241D98 A2830099 */  sb        $v1, 0x99($s4)
D_80241D9C:
/* 17067C 80241D9C 3C04800E */  lui       $a0, %hi(gBattleStatus)
dead_flo_10_varStash:
/* 170680 80241DA0 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
glabel func_80241DA4
/* 170684 80241DA4 8C820000 */  lw        $v0, 0x0($a0)
glabel func_80241DA8
/* 170688 80241DA8 3C032000 */  lui       $v1, (0x20000000 >> 16)
glabel func_80241DAC
/* 17068C 80241DAC 00431024 */  and       $v0, $v0, $v1
glabel func_80241DB0
/* 170690 80241DB0 50400001 */  beql      $v0, $zero, func_80241DB8
glabel .L80241DB4
/* 170694 80241DB4 A2800097 */   sb       $zero, 0x97($s4)
glabel func_80241DB8
/* 170698 80241DB8 8C820000 */  lw        $v0, 0x0($a0)
D_80241DBC:
/* 17069C 80241DBC 3C031000 */  lui       $v1, (0x10000000 >> 16)
glabel func_80241DC0
/* 1706A0 80241DC0 00431024 */  and       $v0, $v0, $v1
glabel func_80241DC4
/* 1706A4 80241DC4 50400001 */  beql      $v0, $zero, mgm_02_UpdateRecords
glabel .L80241DC8
/* 1706A8 80241DC8 A2800096 */   sb       $zero, 0x96($s4)
glabel mgm_02_UpdateRecords
/* 1706AC 80241DCC 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
D_80241DD0:
/* 1706B0 80241DD0 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
glabel .L80241DD4
/* 1706B4 80241DD4 80430074 */  lb        $v1, 0x74($v0)
D_80241DD8:
/* 1706B8 80241DD8 24020004 */  addiu     $v0, $zero, 0x4
glabel func_80241DDC
/* 1706BC 80241DDC 14620003 */  bne       $v1, $v0, .L80241DEC
glabel func_80241DE0
/* 1706C0 80241DE0 24020003 */   addiu    $v0, $zero, 0x3
glabel dead_flo_13_LakituAI_Main
/* 1706C4 80241DE4 080907FC */  j         func_80241FF0
glabel .L80241DE8
/* 1706C8 80241DE8 24040018 */   addiu    $a0, $zero, 0x18
.L80241DEC:
/* 1706CC 80241DEC 14620018 */  bne       $v1, $v0, D_80241E50
glabel func_80241DF0
/* 1706D0 80241DF0 0000882D */   daddu    $s1, $zero, $zero
glabel .L80241DF4
/* 1706D4 80241DF4 24130020 */  addiu     $s3, $zero, 0x20
glabel func_80241DF8
/* 1706D8 80241DF8 0280902D */  daddu     $s2, $s4, $zero
glabel func_80241DFC
/* 1706DC 80241DFC 8E5000E0 */  lw        $s0, 0xE0($s2)
D_80241E00:
/* 1706E0 80241E00 5200000E */  beql      $s0, $zero, func_80241E3C
glabel func_80241E04
/* 1706E4 80241E04 26310001 */   addiu    $s1, $s1, 0x1
D_80241E08:
/* 1706E8 80241E08 8E0401C8 */  lw        $a0, 0x1C8($s0)
glabel func_80241E0C
/* 1706EC 80241E0C 5080000B */  beql      $a0, $zero, func_80241E3C
D_80241E10:
/* 1706F0 80241E10 26310001 */   addiu    $s1, $s1, 0x1
.L80241E14:
/* 1706F4 80241E14 2405000A */  addiu     $a1, $zero, 0xA
glabel func_80241E18
/* 1706F8 80241E18 0C0B0CF8 */  jal       start_script
glabel dead_flo_14_FlyingAI_Main
/* 1706FC 80241E1C 0000302D */   daddu    $a2, $zero, $zero
glabel func_80241E20
/* 170700 80241E20 AE0201D8 */  sw        $v0, 0x1D8($s0)
glabel func_80241E24
/* 170704 80241E24 8C440144 */  lw        $a0, 0x144($v0)
glabel func_80241E28
/* 170708 80241E28 36230200 */  ori       $v1, $s1, 0x200
D_80241E2C:
/* 17070C 80241E2C AC430148 */  sw        $v1, 0x148($v0)
D_80241E30:
/* 170710 80241E30 A21301F0 */  sb        $s3, 0x1F0($s0)
D_80241E34:
/* 170714 80241E34 AE0401E8 */  sw        $a0, 0x1E8($s0)
glabel func_80241E38
/* 170718 80241E38 26310001 */  addiu     $s1, $s1, 0x1
glabel func_80241E3C
/* 17071C 80241E3C 2A220018 */  slti      $v0, $s1, 0x18
D_80241E40:
/* 170720 80241E40 1440FFEE */  bnez      $v0, func_80241DFC
glabel func_80241E44
/* 170724 80241E44 26520004 */   addiu    $s2, $s2, 0x4
D_80241E48:
/* 170728 80241E48 080907BD */  j         D_80241EF4
glabel func_80241E4C
/* 17072C 80241E4C 2402000A */   addiu    $v0, $zero, 0xA
D_80241E50:
/* 170730 80241E50 2413000A */  addiu     $s3, $zero, 0xA
glabel .L80241E54
/* 170734 80241E54 0280902D */  daddu     $s2, $s4, $zero
D_80241E58:
/* 170738 80241E58 8E5000E0 */  lw        $s0, 0xE0($s2)
D_80241E5C:
/* 17073C 80241E5C 52000010 */  beql      $s0, $zero, D_80241EA0
glabel func_80241E60
/* 170740 80241E60 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80241E64
/* 170744 80241E64 8E0201CC */  lw        $v0, 0x1CC($s0)
D_80241E68:
/* 170748 80241E68 5040000D */  beql      $v0, $zero, D_80241EA0
glabel func_80241E6C
/* 17074C 80241E6C 26310001 */   addiu    $s1, $s1, 0x1
glabel dead_flo_08_CheckVineTriggerDist
/* 170750 80241E70 2405000A */  addiu     $a1, $zero, 0xA
glabel .L80241E74
/* 170754 80241E74 A29301A7 */  sb        $s3, 0x1A7($s4)
D_80241E78:
/* 170758 80241E78 8E0401CC */  lw        $a0, 0x1CC($s0)
.L80241E7C:
/* 17075C 80241E7C 0C0B0CF8 */  jal       start_script
glabel func_80241E80
/* 170760 80241E80 0000302D */   daddu    $a2, $zero, $zero
glabel .L80241E84
/* 170764 80241E84 0040182D */  daddu     $v1, $v0, $zero
glabel dgb_07_pad_1E74
/* 170768 80241E88 AE0301DC */  sw        $v1, 0x1DC($s0)
glabel func_80241E8C
/* 17076C 80241E8C 8C620144 */  lw        $v0, 0x144($v1)
D_80241E90:
/* 170770 80241E90 AE0201EC */  sw        $v0, 0x1EC($s0)
glabel dgb_15_pad_1E94
/* 170774 80241E94 36220200 */  ori       $v0, $s1, 0x200
D_80241E98:
/* 170778 80241E98 AC620148 */  sw        $v0, 0x148($v1)
glabel .L80241E9C
/* 17077C 80241E9C 26310001 */  addiu     $s1, $s1, 0x1
D_80241EA0:
/* 170780 80241EA0 2A220018 */  slti      $v0, $s1, 0x18
glabel func_80241EA4
/* 170784 80241EA4 1440FFEC */  bnez      $v0, D_80241E58
D_80241EA8:
/* 170788 80241EA8 26520004 */   addiu    $s2, $s2, 0x4
glabel func_80241EAC
/* 17078C 80241EAC 8E9500DC */  lw        $s5, 0xDC($s4)
D_80241EB0:
/* 170790 80241EB0 12A00010 */  beqz      $s5, D_80241EF4
glabel func_80241EB4
/* 170794 80241EB4 24020005 */   addiu    $v0, $zero, 0x5
glabel func_80241EB8
/* 170798 80241EB8 8EA201CC */  lw        $v0, 0x1CC($s5)
glabel .L80241EBC
/* 17079C 80241EBC 1040000C */  beqz      $v0, func_80241EF0
.L80241EC0:
/* 1707A0 80241EC0 2405000A */   addiu    $a1, $zero, 0xA
glabel .L80241EC4
/* 1707A4 80241EC4 00A0102D */  daddu     $v0, $a1, $zero
glabel .L80241EC8
/* 1707A8 80241EC8 A28201A7 */  sb        $v0, 0x1A7($s4)
D_80241ECC:
/* 1707AC 80241ECC 8EA401CC */  lw        $a0, 0x1CC($s5)
D_80241ED0:
/* 1707B0 80241ED0 0C0B0CF8 */  jal       start_script
D_80241ED4:
/* 1707B4 80241ED4 0000302D */   daddu    $a2, $zero, $zero
glabel .L80241ED8
/* 1707B8 80241ED8 0040182D */  daddu     $v1, $v0, $zero
glabel .L80241EDC
/* 1707BC 80241EDC AEA301DC */  sw        $v1, 0x1DC($s5)
D_80241EE0:
/* 1707C0 80241EE0 8C620144 */  lw        $v0, 0x144($v1)
.L80241EE4:
/* 1707C4 80241EE4 AEA201EC */  sw        $v0, 0x1EC($s5)
glabel func_80241EE8
/* 1707C8 80241EE8 24020100 */  addiu     $v0, $zero, 0x100
D_80241EEC:
/* 1707CC 80241EEC AC620148 */  sw        $v0, 0x148($v1)
glabel func_80241EF0
/* 1707D0 80241EF0 24020005 */  addiu     $v0, $zero, 0x5
D_80241EF4:
/* 1707D4 80241EF4 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel func_80241EF8
/* 1707D8 80241EF8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_80241EFC
/* 1707DC 80241EFC 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80241F00:
/* 1707E0 80241F00 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_80241F04:
/* 1707E4 80241F04 24020005 */  addiu     $v0, $zero, 0x5
glabel func_80241F08
/* 1707E8 80241F08 14620020 */  bne       $v1, $v0, D_80241F8C
glabel .L80241F0C
/* 1707EC 80241F0C 2402000A */   addiu    $v0, $zero, 0xA
D_80241F10:
/* 1707F0 80241F10 0000982D */  daddu     $s3, $zero, $zero
D_80241F14:
/* 1707F4 80241F14 0260882D */  daddu     $s1, $s3, $zero
glabel dead_kzn_17_UnkNpcAIFunc12
/* 1707F8 80241F18 0280902D */  daddu     $s2, $s4, $zero
glabel func_80241F1C
/* 1707FC 80241F1C 8E5000E0 */  lw        $s0, 0xE0($s2)
D_80241F20:
/* 170800 80241F20 5200000A */  beql      $s0, $zero, func_80241F4C
glabel .L80241F24
/* 170804 80241F24 26310001 */   addiu    $s1, $s1, 0x1
D_80241F28:
/* 170808 80241F28 8E0201CC */  lw        $v0, 0x1CC($s0)
D_80241F2C:
/* 17080C 80241F2C 50400007 */  beql      $v0, $zero, func_80241F4C
glabel func_80241F30
/* 170810 80241F30 26310001 */   addiu    $s1, $s1, 0x1
glabel .L80241F34
/* 170814 80241F34 8E0401EC */  lw        $a0, 0x1EC($s0)
glabel mgm_02_GiveCoinReward
/* 170818 80241F38 0C0B1059 */  jal       does_script_exist
.L80241F3C:
/* 17081C 80241F3C 00000000 */   nop
D_80241F40:
/* 170820 80241F40 54400001 */  bnel      $v0, $zero, D_80241F48
glabel func_80241F44
/* 170824 80241F44 24130001 */   addiu    $s3, $zero, 0x1
D_80241F48:
/* 170828 80241F48 26310001 */  addiu     $s1, $s1, 0x1
glabel func_80241F4C
/* 17082C 80241F4C 2A220018 */  slti      $v0, $s1, 0x18
glabel func_80241F50
/* 170830 80241F50 1440FFF2 */  bnez      $v0, func_80241F1C
glabel func_80241F54
/* 170834 80241F54 26520004 */   addiu    $s2, $s2, 0x4
.L80241F58:
/* 170838 80241F58 12A00008 */  beqz      $s5, .L80241F7C
D_80241F5C:
/* 17083C 80241F5C 00000000 */   nop
glabel func_80241F60
/* 170840 80241F60 8EA201CC */  lw        $v0, 0x1CC($s5)
glabel func_80241F64
/* 170844 80241F64 10400005 */  beqz      $v0, .L80241F7C
glabel func_80241F68
/* 170848 80241F68 00000000 */   nop
D_80241F6C:
/* 17084C 80241F6C 0C0B1059 */  jal       does_script_exist
glabel func_80241F70
/* 170850 80241F70 8EA401EC */   lw       $a0, 0x1EC($s5)
glabel .L80241F74
/* 170854 80241F74 54400001 */  bnel      $v0, $zero, .L80241F7C
glabel func_80241F78
/* 170858 80241F78 24130001 */   addiu    $s3, $zero, 0x1
glabel .L80241F7C
/* 17085C 80241F7C 12600018 */  beqz      $s3, dead_flo_08_SuperBlock_CantUpgradeMessages
D_80241F80:
/* 170860 80241F80 2402000A */   addiu    $v0, $zero, 0xA
.L80241F84:
/* 170864 80241F84 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80241F88:
/* 170868 80241F88 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_80241F8C:
/* 17086C 80241F8C 1462001A */  bne       $v1, $v0, D_80241FF8
.L80241F90:
/* 170870 80241F90 0000982D */   daddu    $s3, $zero, $zero
D_80241F94:
/* 170874 80241F94 0260882D */  daddu     $s1, $s3, $zero
D_80241F98:
/* 170878 80241F98 0280902D */  daddu     $s2, $s4, $zero
glabel func_80241F9C
/* 17087C 80241F9C 8E5000E0 */  lw        $s0, 0xE0($s2)
glabel func_80241FA0
/* 170880 80241FA0 5200000A */  beql      $s0, $zero, func_80241FCC
D_80241FA4:
/* 170884 80241FA4 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80241FA8
/* 170888 80241FA8 8E0201C8 */  lw        $v0, 0x1C8($s0)
glabel func_80241FAC
/* 17088C 80241FAC 50400007 */  beql      $v0, $zero, func_80241FCC
glabel func_80241FB0
/* 170890 80241FB0 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80241FB4
/* 170894 80241FB4 8E0401E8 */  lw        $a0, 0x1E8($s0)
glabel func_80241FB8
/* 170898 80241FB8 0C0B1059 */  jal       does_script_exist
D_80241FBC:
/* 17089C 80241FBC 00000000 */   nop
D_80241FC0:
/* 1708A0 80241FC0 54400001 */  bnel      $v0, $zero, D_80241FC8
D_80241FC4:
/* 1708A4 80241FC4 24130001 */   addiu    $s3, $zero, 0x1
D_80241FC8:
/* 1708A8 80241FC8 26310001 */  addiu     $s1, $s1, 0x1
glabel func_80241FCC
/* 1708AC 80241FCC 2A220018 */  slti      $v0, $s1, 0x18
glabel func_80241FD0
/* 1708B0 80241FD0 1440FFF2 */  bnez      $v0, func_80241F9C
D_80241FD4:
/* 1708B4 80241FD4 26520004 */   addiu    $s2, $s2, 0x4
.L80241FD8:
/* 1708B8 80241FD8 16600007 */  bnez      $s3, D_80241FF8
glabel func_80241FDC
/* 1708BC 80241FDC 00000000 */   nop
dead_flo_08_SuperBlock_CantUpgradeMessages:
/* 1708C0 80241FE0 0C098D0D */  jal       btl_check_enemies_defeated
glabel mgm_02_CleanupGame
/* 1708C4 80241FE4 00000000 */   nop
dead_flo_08_SuperBlock_PartnerIDs:
/* 1708C8 80241FE8 14400003 */  bnez      $v0, D_80241FF8
.L80241FEC:
/* 1708CC 80241FEC 24040007 */   addiu    $a0, $zero, 0x7
glabel func_80241FF0
/* 1708D0 80241FF0 0C090464 */  jal       func_80241190
D_80241FF4:
/* 1708D4 80241FF4 00000000 */   nop
D_80241FF8:
/* 1708D8 80241FF8 8FBF0028 */  lw        $ra, 0x28($sp)
glabel func_80241FFC
/* 1708DC 80241FFC 8FB50024 */  lw        $s5, 0x24($sp)
D_80242000:
/* 1708E0 80242000 8FB40020 */  lw        $s4, 0x20($sp)
flo_09_pad_2004:
/* 1708E4 80242004 8FB3001C */  lw        $s3, 0x1C($sp)
glabel func_80242008
/* 1708E8 80242008 8FB20018 */  lw        $s2, 0x18($sp)
glabel .L8024200C
/* 1708EC 8024200C 8FB10014 */  lw        $s1, 0x14($sp)
D_80242010:
/* 1708F0 80242010 8FB00010 */  lw        $s0, 0x10($sp)
glabel func_80242014
/* 1708F4 80242014 03E00008 */  jr        $ra
.L80242018:
/* 1708F8 80242018 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_begin_turn(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    Actor* partner = battleStatus->partnerActor;
    Actor* player = battleStatus->playerActor;
    Actor* enemy;
    Actor* enemy1;
    Actor* enemy2;
    Evt* script;
    Evt* script2;
    s32 cond;
    u16 id1;
    u16 id2;
    s32 numEnemyActors;
    s32 i;
    s32 j;
    s16* enemyIDs;

    if (gBattleSubState == BTL_SUBSTATE_BEGIN_TURN_INIT) {
        battleStatus->flags2 &= ~BS_FLAGS2_2;
        battleStatus->flags2 &= ~BS_FLAGS2_4;
        battleStatus->flags2 &= ~BS_FLAGS2_8;
        battleStatus->flags2 &= ~BS_FLAGS2_10;
        battleStatus->merleeAttackBoost = 0;
        battleStatus->merleeDefenseBoost = 0;
        battleStatus->flags2 &= ~BS_FLAGS2_1000000;

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

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

        numEnemyActors = 0;
        for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
            enemy = battleStatus->enemyActors[i];
            if (enemy != NULL) {
                battleStatus->enemyIDs[numEnemyActors] = i | ACTOR_ENEMY0;
                numEnemyActors++;
            }
        }
        battleStatus->numEnemyActors = numEnemyActors;

        // sort enemies by x-position or turn priority
        enemyIDs = battleStatus->enemyIDs;
        for (i = 0; i < numEnemyActors - 1; i++) {
            for (j = i + 1; j < numEnemyActors; j++) {
                id1 = enemyIDs[i];
                id2 = enemyIDs[j];
                enemy1 = battleStatus->enemyActors[id1 & 0xFF];
                enemy2 = battleStatus->enemyActors[id2 & 0xFF];
                if (gBattleStatus.flags1 & BS_FLAGS1_SORT_ENEMIES_BY_POSX) {
                    if (enemy1->homePos.x > enemy2->homePos.x) {
                        enemyIDs[i] = id2;
                        enemyIDs[j] = id1;
                    }
                } else if (enemy1->turnPriority < enemy2->turnPriority) {
                    enemyIDs[i] = id2;
                    enemyIDs[j] = id1;
                }
            }
        }
        battleStatus->nextEnemyIndex = 0;

        btl_merlee_on_start_turn();

        // 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;
                }
            }
        }

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

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

        if (gGameStatusPtr->debugEnemyContact == DEBUG_CONTACT_AUTO_FLEE) {
            btl_set_state(BATTLE_STATE_RUN_AWAY);
            return;
        }

        if (gGameStatusPtr->debugEnemyContact == DEBUG_CONTACT_DIE_IN_BATTLE) {
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL && enemy->handleEventSource != NULL) {
                    Evt* script = start_script(enemy->handleEventSource, EVT_PRIORITY_A, 0);

                    enemy->handleEventScript = script;
                    script->owner1.actorID = i | ACTOR_ENEMY0;
                    enemy->handleEventScriptID = script->id;
                    enemy->lastEventType = EVENT_DEATH;
                }
            }
            gBattleSubState = BTL_SUBSTATE_BEGIN_TURN_AWAIT_ENEMY_DEATH;
        } else {
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL && enemy->handlePhaseSource != NULL) {
                    battleStatus->battlePhase = PHASE_PLAYER_BEGIN;
                    script = start_script(enemy->handlePhaseSource, EVT_PRIORITY_A, 0);
                    enemy->handlePhaseScript = script;
                    enemy->handleBatttlePhaseScriptID = script->id;
                    script->owner1.actorID = i | ACTOR_ENEMY0;
                }
            }

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

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

        if (!cond) {
            if (!btl_check_enemies_defeated()) {
                btl_set_state(BATTLE_STATE_BEGIN_PLAYER_TURN);
            }
            return;
        }
    }

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

        if (!cond) {
            if (!btl_check_enemies_defeated()) {
                btl_set_state(BATTLE_STATE_BEGIN_PLAYER_TURN);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802AACD8_7B2678
/* 41FA68 802AACD8 27BDFF58 */  addiu     $sp, $sp, -0xA8
/* 41FA6C 802AACDC 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 41FA70 802AACE0 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
/* 41FA74 802AACE4 3C030008 */  lui       $v1, (0x80000 >> 16)
/* 41FA78 802AACE8 AFBF008C */  sw        $ra, 0x8C($sp)
/* 41FA7C 802AACEC AFBE0088 */  sw        $fp, 0x88($sp)
/* 41FA80 802AACF0 AFB70084 */  sw        $s7, 0x84($sp)
/* 41FA84 802AACF4 AFB60080 */  sw        $s6, 0x80($sp)
/* 41FA88 802AACF8 AFB5007C */  sw        $s5, 0x7C($sp)
/* 41FA8C 802AACFC AFB40078 */  sw        $s4, 0x78($sp)
/* 41FA90 802AAD00 AFB30074 */  sw        $s3, 0x74($sp)
/* 41FA94 802AAD04 AFB20070 */  sw        $s2, 0x70($sp)
/* 41FA98 802AAD08 AFB1006C */  sw        $s1, 0x6C($sp)
/* 41FA9C 802AAD0C AFB00068 */  sw        $s0, 0x68($sp)
/* 41FAA0 802AAD10 F7B800A0 */  sdc1      $f24, 0xA0($sp)
/* 41FAA4 802AAD14 F7B60098 */  sdc1      $f22, 0x98($sp)
/* 41FAA8 802AAD18 F7B40090 */  sdc1      $f20, 0x90($sp)
/* 41FAAC 802AAD1C 00431024 */  and       $v0, $v0, $v1
/* 41FAB0 802AAD20 14400005 */  bnez      $v0, .L802AAD38_7B26D8
/* 41FAB4 802AAD24 00000000 */   nop
/* 41FAB8 802AAD28 3C16800E */  lui       $s6, %hi(gBattleStatus + 0xD8)
/* 41FABC 802AAD2C 8ED6C148 */  lw        $s6, %lo(gBattleStatus + 0xD8)($s6)
/* 41FAC0 802AAD30 080AAB50 */  j         .L802AAD40_7B26E0
/* 41FAC4 802AAD34 00000000 */   nop
.L802AAD38_7B26D8:
/* 41FAC8 802AAD38 3C16800E */  lui       $s6, %hi(gBattleStatus + 0xDC)
/* 41FACC 802AAD3C 8ED6C14C */  lw        $s6, %lo(gBattleStatus + 0xDC)($s6)
.L802AAD40_7B26E0:
/* 41FAD0 802AAD40 82C9040C */  lb        $t1, 0x40C($s6)
/* 41FAD4 802AAD44 AFA9005C */  sw        $t1, 0x5C($sp)
/* 41FAD8 802AAD48 82C90425 */  lb        $t1, 0x425($s6)
/* 41FADC 802AAD4C 26D1022C */  addiu     $s1, $s6, 0x22C
/* 41FAE0 802AAD50 AFA90060 */  sw        $t1, 0x60($sp)
/* 41FAE4 802AAD54 8FA9005C */  lw        $t1, 0x5C($sp)
/* 41FAE8 802AAD58 11200166 */  beqz      $t1, .L802AB2F4_7B2C94
/* 41FAEC 802AAD5C 26D7040D */   addiu    $s7, $s6, 0x40D
/* 41FAF0 802AAD60 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x184)
/* 41FAF4 802AAD64 8C42C1F4 */  lw        $v0, %lo(gBattleStatus + 0x184)($v0)
/* 41FAF8 802AAD68 30420001 */  andi      $v0, $v0, 0x1
/* 41FAFC 802AAD6C 10400045 */  beqz      $v0, .L802AAE84_7B2824
/* 41FB00 802AAD70 00000000 */   nop
/* 41FB04 802AAD74 8FA90060 */  lw        $t1, 0x60($sp)
/* 41FB08 802AAD78 02E91021 */  addu      $v0, $s7, $t1
/* 41FB0C 802AAD7C 80430000 */  lb        $v1, 0x0($v0)
/* 41FB10 802AAD80 00031080 */  sll       $v0, $v1, 2
/* 41FB14 802AAD84 00431021 */  addu      $v0, $v0, $v1
/* 41FB18 802AAD88 00021080 */  sll       $v0, $v0, 2
/* 41FB1C 802AAD8C 2442022C */  addiu     $v0, $v0, 0x22C
/* 41FB20 802AAD90 02C28821 */  addu      $s1, $s6, $v0
/* 41FB24 802AAD94 0C09A75B */  jal       get_actor
/* 41FB28 802AAD98 86240000 */   lh       $a0, 0x0($s1)
/* 41FB2C 802AAD9C 3C10802B */  lui       $s0, %hi(D_802ACC70)
/* 41FB30 802AADA0 8E10CC70 */  lw        $s0, %lo(D_802ACC70)($s0)
/* 41FB34 802AADA4 86230004 */  lh        $v1, 0x4($s1)
/* 41FB38 802AADA8 86240006 */  lh        $a0, 0x6($s1)
/* 41FB3C 802AADAC 8C420000 */  lw        $v0, 0x0($v0)
/* 41FB40 802AADB0 4483B000 */  mtc1      $v1, $f22
/* 41FB44 802AADB4 00000000 */  nop
/* 41FB48 802AADB8 4680B5A0 */  cvt.s.w   $f22, $f22
/* 41FB4C 802AADBC 4484C000 */  mtc1      $a0, $f24
/* 41FB50 802AADC0 00000000 */  nop
/* 41FB54 802AADC4 4680C620 */  cvt.s.w   $f24, $f24
/* 41FB58 802AADC8 86230008 */  lh        $v1, 0x8($s1)
/* 41FB5C 802AADCC 30420800 */  andi      $v0, $v0, 0x800
/* 41FB60 802AADD0 4483A000 */  mtc1      $v1, $f20
/* 41FB64 802AADD4 00000000 */  nop
/* 41FB68 802AADD8 4680A520 */  cvt.s.w   $f20, $f20
/* 41FB6C 802AADDC 10400008 */  beqz      $v0, .L802AAE00_7B27A0
/* 41FB70 802AADE0 24140010 */   addiu    $s4, $zero, 0x10
/* 41FB74 802AADE4 24130002 */  addiu     $s3, $zero, 0x2
/* 41FB78 802AADE8 0C05122C */  jal       hud_element_get_script
/* 41FB7C 802AADEC 0200202D */   daddu    $a0, $s0, $zero
/* 41FB80 802AADF0 3C058008 */  lui       $a1, %hi(HES_HandPointLeftLoop)
/* 41FB84 802AADF4 24A50208 */  addiu     $a1, $a1, %lo(HES_HandPointLeftLoop)
/* 41FB88 802AADF8 080AAB86 */  j         .L802AAE18_7B27B8
/* 41FB8C 802AADFC 00000000 */   nop
.L802AAE00_7B27A0:
/* 41FB90 802AAE00 24140005 */  addiu     $s4, $zero, 0x5
/* 41FB94 802AAE04 2413FFF5 */  addiu     $s3, $zero, -0xB
/* 41FB98 802AAE08 0C05122C */  jal       hud_element_get_script
/* 41FB9C 802AAE0C 0200202D */   daddu    $a0, $s0, $zero
/* 41FBA0 802AAE10 3C058008 */  lui       $a1, %hi(HES_HandPointDownLoop)
/* 41FBA4 802AAE14 24A5FF20 */  addiu     $a1, $a1, %lo(HES_HandPointDownLoop)
.L802AAE18_7B27B8:
/* 41FBA8 802AAE18 50450004 */  beql      $v0, $a1, .L802AAE2C_7B27CC
/* 41FBAC 802AAE1C 24040001 */   addiu    $a0, $zero, 0x1
/* 41FBB0 802AAE20 0C0511FF */  jal       hud_element_set_script
/* 41FBB4 802AAE24 0200202D */   daddu    $a0, $s0, $zero
/* 41FBB8 802AAE28 24040001 */  addiu     $a0, $zero, 0x1
.L802AAE2C_7B27CC:
/* 41FBBC 802AAE2C 4405B000 */  mfc1      $a1, $f22
/* 41FBC0 802AAE30 4406C000 */  mfc1      $a2, $f24
/* 41FBC4 802AAE34 4407A000 */  mfc1      $a3, $f20
/* 41FBC8 802AAE38 27A20050 */  addiu     $v0, $sp, 0x50
/* 41FBCC 802AAE3C AFA20010 */  sw        $v0, 0x10($sp)
/* 41FBD0 802AAE40 27A20054 */  addiu     $v0, $sp, 0x54
/* 41FBD4 802AAE44 AFA20014 */  sw        $v0, 0x14($sp)
/* 41FBD8 802AAE48 27A20058 */  addiu     $v0, $sp, 0x58
/* 41FBDC 802AAE4C 0C00B94E */  jal       get_screen_coords
/* 41FBE0 802AAE50 AFA20018 */   sw       $v0, 0x18($sp)
/* 41FBE4 802AAE54 0200202D */  daddu     $a0, $s0, $zero
/* 41FBE8 802AAE58 8FA50050 */  lw        $a1, 0x50($sp)
/* 41FBEC 802AAE5C 8FA60054 */  lw        $a2, 0x54($sp)
/* 41FBF0 802AAE60 00B42821 */  addu      $a1, $a1, $s4
/* 41FBF4 802AAE64 0C051261 */  jal       hud_element_set_render_pos
/* 41FBF8 802AAE68 00D33021 */   addu     $a2, $a2, $s3
/* 41FBFC 802AAE6C 3C05802B */  lui       $a1, %hi(D_802ACC64)
/* 41FC00 802AAE70 8CA5CC64 */  lw        $a1, %lo(D_802ACC64)($a1)
/* 41FC04 802AAE74 0C0513AC */  jal       hud_element_set_alpha
/* 41FC08 802AAE78 0200202D */   daddu    $a0, $s0, $zero
/* 41FC0C 802AAE7C 080AABED */  j         .L802AAFB4_7B2954
/* 41FC10 802AAE80 00000000 */   nop
.L802AAE84_7B2824:
/* 41FC14 802AAE84 1920004B */  blez      $t1, .L802AAFB4_7B2954
/* 41FC18 802AAE88 0000902D */   daddu    $s2, $zero, $zero
/* 41FC1C 802AAE8C 3C1E8008 */  lui       $fp, %hi(HES_HandPointDownLoop)
/* 41FC20 802AAE90 27DEFF20 */  addiu     $fp, $fp, %lo(HES_HandPointDownLoop)
/* 41FC24 802AAE94 3C15802B */  lui       $s5, %hi(D_802ACC70)
/* 41FC28 802AAE98 26B5CC70 */  addiu     $s5, $s5, %lo(D_802ACC70)
.L802AAE9C_7B283C:
/* 41FC2C 802AAE9C 02F21021 */  addu      $v0, $s7, $s2
/* 41FC30 802AAEA0 80430000 */  lb        $v1, 0x0($v0)
/* 41FC34 802AAEA4 00031080 */  sll       $v0, $v1, 2
/* 41FC38 802AAEA8 00431021 */  addu      $v0, $v0, $v1
/* 41FC3C 802AAEAC 00021080 */  sll       $v0, $v0, 2
/* 41FC40 802AAEB0 2442022C */  addiu     $v0, $v0, 0x22C
/* 41FC44 802AAEB4 02C28821 */  addu      $s1, $s6, $v0
/* 41FC48 802AAEB8 0C09A75B */  jal       get_actor
/* 41FC4C 802AAEBC 86240000 */   lh       $a0, 0x0($s1)
/* 41FC50 802AAEC0 8EB00000 */  lw        $s0, 0x0($s5)
/* 41FC54 802AAEC4 86230004 */  lh        $v1, 0x4($s1)
/* 41FC58 802AAEC8 86240006 */  lh        $a0, 0x6($s1)
/* 41FC5C 802AAECC 8C420000 */  lw        $v0, 0x0($v0)
/* 41FC60 802AAED0 4483B000 */  mtc1      $v1, $f22
/* 41FC64 802AAED4 00000000 */  nop
/* 41FC68 802AAED8 4680B5A0 */  cvt.s.w   $f22, $f22
/* 41FC6C 802AAEDC 4484C000 */  mtc1      $a0, $f24
D_802AAEE0_7B2880:
/* 41FC70 802AAEE0 00000000 */  nop
/* 41FC74 802AAEE4 4680C620 */  cvt.s.w   $f24, $f24
/* 41FC78 802AAEE8 86230008 */  lh        $v1, 0x8($s1)
/* 41FC7C 802AAEEC 30420800 */  andi      $v0, $v0, 0x800
/* 41FC80 802AAEF0 4483A000 */  mtc1      $v1, $f20
/* 41FC84 802AAEF4 00000000 */  nop
/* 41FC88 802AAEF8 4680A520 */  cvt.s.w   $f20, $f20
/* 41FC8C 802AAEFC 1040000A */  beqz      $v0, .L802AAF28_7B28C8
D_802AAF00_7B28A0:
/* 41FC90 802AAF00 24140010 */   addiu    $s4, $zero, 0x10
/* 41FC94 802AAF04 24130002 */  addiu     $s3, $zero, 0x2
/* 41FC98 802AAF08 0C05122C */  jal       hud_element_get_script
/* 41FC9C 802AAF0C 0200202D */   daddu    $a0, $s0, $zero
/* 41FCA0 802AAF10 3C098008 */  lui       $t1, %hi(HES_HandPointLeftLoop)
/* 41FCA4 802AAF14 25290208 */  addiu     $t1, $t1, %lo(HES_HandPointLeftLoop)
/* 41FCA8 802AAF18 1049000C */  beq       $v0, $t1, .L802AAF4C_7B28EC
/* 41FCAC 802AAF1C 0120282D */   daddu    $a1, $t1, $zero
/* 41FCB0 802AAF20 080AABD1 */  j         .L802AAF44_7B28E4
/* 41FCB4 802AAF24 0200202D */   daddu    $a0, $s0, $zero
.L802AAF28_7B28C8:
/* 41FCB8 802AAF28 24140005 */  addiu     $s4, $zero, 0x5
/* 41FCBC 802AAF2C 2413FFF5 */  addiu     $s3, $zero, -0xB
/* 41FCC0 802AAF30 0C05122C */  jal       hud_element_get_script
/* 41FCC4 802AAF34 0200202D */   daddu    $a0, $s0, $zero
/* 41FCC8 802AAF38 105E0004 */  beq       $v0, $fp, .L802AAF4C_7B28EC
/* 41FCCC 802AAF3C 03C0282D */   daddu    $a1, $fp, $zero
/* 41FCD0 802AAF40 0200202D */  daddu     $a0, $s0, $zero
.L802AAF44_7B28E4:
/* 41FCD4 802AAF44 0C0511FF */  jal       hud_element_set_script
/* 41FCD8 802AAF48 00000000 */   nop
.L802AAF4C_7B28EC:
/* 41FCDC 802AAF4C 24040001 */  addiu     $a0, $zero, 0x1
/* 41FCE0 802AAF50 02449021 */  addu      $s2, $s2, $a0
/* 41FCE4 802AAF54 4405B000 */  mfc1      $a1, $f22
/* 41FCE8 802AAF58 4406C000 */  mfc1      $a2, $f24
/* 41FCEC 802AAF5C 4407A000 */  mfc1      $a3, $f20
/* 41FCF0 802AAF60 27A20050 */  addiu     $v0, $sp, 0x50
/* 41FCF4 802AAF64 AFA20010 */  sw        $v0, 0x10($sp)
/* 41FCF8 802AAF68 27A20054 */  addiu     $v0, $sp, 0x54
/* 41FCFC 802AAF6C AFA20014 */  sw        $v0, 0x14($sp)
/* 41FD00 802AAF70 27A20058 */  addiu     $v0, $sp, 0x58
/* 41FD04 802AAF74 0C00B94E */  jal       get_screen_coords
/* 41FD08 802AAF78 AFA20018 */   sw       $v0, 0x18($sp)
/* 41FD0C 802AAF7C 0200202D */  daddu     $a0, $s0, $zero
/* 41FD10 802AAF80 8FA50050 */  lw        $a1, 0x50($sp)
/* 41FD14 802AAF84 8FA60054 */  lw        $a2, 0x54($sp)
/* 41FD18 802AAF88 00B42821 */  addu      $a1, $a1, $s4
/* 41FD1C 802AAF8C 0C051261 */  jal       hud_element_set_render_pos
/* 41FD20 802AAF90 00D33021 */   addu     $a2, $a2, $s3
/* 41FD24 802AAF94 3C05802B */  lui       $a1, %hi(D_802ACC64)
/* 41FD28 802AAF98 8CA5CC64 */  lw        $a1, %lo(D_802ACC64)($a1)
/* 41FD2C 802AAF9C 0C0513AC */  jal       hud_element_set_alpha
/* 41FD30 802AAFA0 0200202D */   daddu    $a0, $s0, $zero
/* 41FD34 802AAFA4 8FA9005C */  lw        $t1, 0x5C($sp)
/* 41FD38 802AAFA8 0249102A */  slt       $v0, $s2, $t1
/* 41FD3C 802AAFAC 1440FFBB */  bnez      $v0, .L802AAE9C_7B283C
/* 41FD40 802AAFB0 26B50004 */   addiu    $s5, $s5, 0x4
.L802AAFB4_7B2954:
/* 41FD44 802AAFB4 3C028011 */  lui       $v0, %hi(gPlayerData)
/* 41FD48 802AAFB8 2442F290 */  addiu     $v0, $v0, %lo(gPlayerData)
/* 41FD4C 802AAFBC 80520012 */  lb        $s2, 0x12($v0)
/* 41FD50 802AAFC0 24020034 */  addiu     $v0, $zero, 0x34
/* 41FD54 802AAFC4 AFA20050 */  sw        $v0, 0x50($sp)
/* 41FD58 802AAFC8 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x4)
/* 41FD5C 802AAFCC 8C42C074 */  lw        $v0, %lo(gBattleStatus + 0x4)($v0)
/* 41FD60 802AAFD0 24030040 */  addiu     $v1, $zero, 0x40
/* 41FD64 802AAFD4 00431024 */  and       $v0, $v0, $v1
/* 41FD68 802AAFD8 10400002 */  beqz      $v0, .L802AAFE4_7B2984
/* 41FD6C 802AAFDC AFA30054 */   sw       $v1, 0x54($sp)
/* 41FD70 802AAFE0 2412000B */  addiu     $s2, $zero, 0xB
.L802AAFE4_7B2984:
/* 41FD74 802AAFE4 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x184)
/* 41FD78 802AAFE8 8C42C1F4 */  lw        $v0, %lo(gBattleStatus + 0x184)($v0)
/* 41FD7C 802AAFEC 30420001 */  andi      $v0, $v0, 0x1
/* 41FD80 802AAFF0 14400004 */  bnez      $v0, .L802AB004_7B29A4
/* 41FD84 802AAFF4 24020001 */   addiu    $v0, $zero, 0x1
/* 41FD88 802AAFF8 8FA9005C */  lw        $t1, 0x5C($sp)
/* 41FD8C 802AAFFC 15220026 */  bne       $t1, $v0, .L802AB098_7B2A38
/* 41FD90 802AB000 00000000 */   nop
.L802AB004_7B29A4:
/* 41FD94 802AB004 86230000 */  lh        $v1, 0x0($s1)
/* 41FD98 802AB008 14600004 */  bnez      $v1, .L802AB01C_7B29BC
/* 41FD9C 802AB00C 24020100 */   addiu    $v0, $zero, 0x100
/* 41FDA0 802AB010 3C04001D */  lui       $a0, (0x1D00C4 >> 16)
/* 41FDA4 802AB014 080AAC3C */  j         .L802AB0F0_7B2A90
/* 41FDA8 802AB018 348400C4 */   ori      $a0, $a0, (0x1D00C4 & 0xFFFF)
.L802AB01C_7B29BC:
/* 41FDAC 802AB01C 14620005 */  bne       $v1, $v0, .L802AB034_7B29D4
D_802AB020_7B29C0:
/* 41FDB0 802AB020 00121080 */   sll      $v0, $s2, 2
/* 41FDB4 802AB024 3C04802B */  lui       $a0, %hi(D_802AB738_7B30D8)
/* 41FDB8 802AB028 00822021 */  addu      $a0, $a0, $v0
/* 41FDBC 802AB02C 080AAC3C */  j         .L802AB0F0_7B2A90
/* 41FDC0 802AB030 8C84B738 */   lw       $a0, %lo(D_802AB738_7B30D8)($a0)
.L802AB034_7B29D4:
/* 41FDC4 802AB034 8FA90060 */  lw        $t1, 0x60($sp)
/* 41FDC8 802AB038 02E91021 */  addu      $v0, $s7, $t1
/* 41FDCC 802AB03C 80430000 */  lb        $v1, 0x0($v0)
D_802AB040_7B29E0:
/* 41FDD0 802AB040 00031080 */  sll       $v0, $v1, 2
/* 41FDD4 802AB044 00431021 */  addu      $v0, $v0, $v1
/* 41FDD8 802AB048 00021080 */  sll       $v0, $v0, 2
/* 41FDDC 802AB04C 2442022C */  addiu     $v0, $v0, 0x22C
/* 41FDE0 802AB050 02C28821 */  addu      $s1, $s6, $v0
/* 41FDE4 802AB054 0C09A75B */  jal       get_actor
/* 41FDE8 802AB058 86240000 */   lh       $a0, 0x0($s1)
/* 41FDEC 802AB05C 0040802D */  daddu     $s0, $v0, $zero
/* 41FDF0 802AB060 86250002 */  lh        $a1, 0x2($s1)
/* 41FDF4 802AB064 0C099117 */  jal       get_actor_part
D_802AB068_7B2A08:
/* 41FDF8 802AB068 0200202D */   daddu    $a0, $s0, $zero
/* 41FDFC 802AB06C 8C420008 */  lw        $v0, 0x8($v0)
/* 41FE00 802AB070 8C440020 */  lw        $a0, 0x20($v0)
/* 41FE04 802AB074 1480001E */  bnez      $a0, .L802AB0F0_7B2A90
/* 41FE08 802AB078 00000000 */   nop
/* 41FE0C 802AB07C 92020136 */  lbu       $v0, 0x136($s0)
/* 41FE10 802AB080 00021080 */  sll       $v0, $v0, 2
/* 41FE14 802AB084 3C048028 */  lui       $a0, %hi(bActorNames)
/* 41FE18 802AB088 00822021 */  addu      $a0, $a0, $v0
/* 41FE1C 802AB08C 8C841104 */  lw        $a0, %lo(bActorNames)($a0)
D_802AB090_7B2A30:
/* 41FE20 802AB090 080AAC3C */  j         .L802AB0F0_7B2A90
/* 41FE24 802AB094 00000000 */   nop
.L802AB098_7B2A38:
/* 41FE28 802AB098 8FA90060 */  lw        $t1, 0x60($sp)
/* 41FE2C 802AB09C 02E91021 */  addu      $v0, $s7, $t1
/* 41FE30 802AB0A0 80430000 */  lb        $v1, 0x0($v0)
/* 41FE34 802AB0A4 00031080 */  sll       $v0, $v1, 2
/* 41FE38 802AB0A8 00431021 */  addu      $v0, $v0, $v1
/* 41FE3C 802AB0AC 00021080 */  sll       $v0, $v0, 2
/* 41FE40 802AB0B0 2442022C */  addiu     $v0, $v0, 0x22C
/* 41FE44 802AB0B4 02C28821 */  addu      $s1, $s6, $v0
D_802AB0B8_7B2A58:
/* 41FE48 802AB0B8 86230000 */  lh        $v1, 0x0($s1)
/* 41FE4C 802AB0BC 14600004 */  bnez      $v1, .L802AB0D0_7B2A70
/* 41FE50 802AB0C0 24020100 */   addiu    $v0, $zero, 0x100
/* 41FE54 802AB0C4 3C04001D */  lui       $a0, (0x1D00C4 >> 16)
/* 41FE58 802AB0C8 080AAC3C */  j         .L802AB0F0_7B2A90
/* 41FE5C 802AB0CC 348400C4 */   ori      $a0, $a0, (0x1D00C4 & 0xFFFF)
.L802AB0D0_7B2A70:
/* 41FE60 802AB0D0 14620006 */  bne       $v1, $v0, .L802AB0EC_7B2A8C
/* 41FE64 802AB0D4 3C04001D */   lui      $a0, (0x1D00C5 >> 16)
/* 41FE68 802AB0D8 00121080 */  sll       $v0, $s2, 2
/* 41FE6C 802AB0DC 3C04802B */  lui       $a0, (0x802B00C5 >> 16)
D_802AB0E0_7B2A80:
/* 41FE70 802AB0E0 00822021 */  addu      $a0, $a0, $v0
/* 41FE74 802AB0E4 080AAC3C */  j         .L802AB0F0_7B2A90
/* 41FE78 802AB0E8 8C84B738 */   lw       $a0, %lo(D_802AB738_7B30D8)($a0)
.L802AB0EC_7B2A8C:
/* 41FE7C 802AB0EC 348400C5 */  ori       $a0, $a0, (0x802B00C5 & 0xFFFF)
.L802AB0F0_7B2A90:
/* 41FE80 802AB0F0 0C04991D */  jal       get_msg_width
/* 41FE84 802AB0F4 0000282D */   daddu    $a1, $zero, $zero
/* 41FE88 802AB0F8 2442000A */  addiu     $v0, $v0, 0xA
/* 41FE8C 802AB0FC 0000202D */  daddu     $a0, $zero, $zero
/* 41FE90 802AB100 8FA30050 */  lw        $v1, 0x50($sp)
/* 41FE94 802AB104 8FA70054 */  lw        $a3, 0x54($sp)
D_802AB108_7B2AA8:
/* 41FE98 802AB108 24050004 */  addiu     $a1, $zero, 0x4
/* 41FE9C 802AB10C AFA20014 */  sw        $v0, 0x14($sp)
/* 41FEA0 802AB110 24020014 */  addiu     $v0, $zero, 0x14
/* 41FEA4 802AB114 AFA20018 */  sw        $v0, 0x18($sp)
/* 41FEA8 802AB118 240200FF */  addiu     $v0, $zero, 0xFF
/* 41FEAC 802AB11C AFA2001C */  sw        $v0, 0x1C($sp)
/* 41FEB0 802AB120 24020140 */  addiu     $v0, $zero, 0x140
/* 41FEB4 802AB124 3C10802B */  lui       $s0, %hi(D_802ACC68)
/* 41FEB8 802AB128 2610CC68 */  addiu     $s0, $s0, %lo(D_802ACC68)
/* 41FEBC 802AB12C AFA00010 */  sw        $zero, 0x10($sp)
D_802AB130_7B2AD0:
/* 41FEC0 802AB130 AFA00020 */  sw        $zero, 0x20($sp)
/* 41FEC4 802AB134 AFA00024 */  sw        $zero, 0x24($sp)
/* 41FEC8 802AB138 AFA00028 */  sw        $zero, 0x28($sp)
/* 41FECC 802AB13C AFA0002C */  sw        $zero, 0x2C($sp)
/* 41FED0 802AB140 AFA00030 */  sw        $zero, 0x30($sp)
/* 41FED4 802AB144 AFA00034 */  sw        $zero, 0x34($sp)
/* 41FED8 802AB148 AFA00038 */  sw        $zero, 0x38($sp)
/* 41FEDC 802AB14C AFA0003C */  sw        $zero, 0x3C($sp)
/* 41FEE0 802AB150 AFA00040 */  sw        $zero, 0x40($sp)
/* 41FEE4 802AB154 AFA20044 */  sw        $v0, 0x44($sp)
D_802AB158_7B2AF8:
/* 41FEE8 802AB158 8E060000 */  lw        $a2, 0x0($s0)
/* 41FEEC 802AB15C 240200F0 */  addiu     $v0, $zero, 0xF0
/* 41FEF0 802AB160 AFA20048 */  sw        $v0, 0x48($sp)
/* 41FEF4 802AB164 AFA0004C */  sw        $zero, 0x4C($sp)
/* 41FEF8 802AB168 0C03D4B8 */  jal       draw_box
/* 41FEFC 802AB16C 00663021 */   addu     $a2, $v1, $a2
/* 41FF00 802AB170 8FA20050 */  lw        $v0, 0x50($sp)
/* 41FF04 802AB174 8FA30054 */  lw        $v1, 0x54($sp)
/* 41FF08 802AB178 24480004 */  addiu     $t0, $v0, 0x4
/* 41FF0C 802AB17C 3C02800E */  lui       $v0, %hi(gBattleStatus + 0x184)
D_802AB180_7B2B20:
/* 41FF10 802AB180 8C42C1F4 */  lw        $v0, %lo(gBattleStatus + 0x184)($v0)
D_802AB184_7B2B24:
/* 41FF14 802AB184 24660002 */  addiu     $a2, $v1, 0x2
/* 41FF18 802AB188 AFA80050 */  sw        $t0, 0x50($sp)
/* 41FF1C 802AB18C 30420001 */  andi      $v0, $v0, 0x1
/* 41FF20 802AB190 14400005 */  bnez      $v0, .L802AB1A8_7B2B48
/* 41FF24 802AB194 AFA60054 */   sw       $a2, 0x54($sp)
/* 41FF28 802AB198 8FA9005C */  lw        $t1, 0x5C($sp)
/* 41FF2C 802AB19C 24020001 */  addiu     $v0, $zero, 0x1
/* 41FF30 802AB1A0 15220032 */  bne       $t1, $v0, .L802AB26C_7B2C0C
/* 41FF34 802AB1A4 00000000 */   nop
.L802AB1A8_7B2B48:
/* 41FF38 802AB1A8 86230000 */  lh        $v1, 0x0($s1)
/* 41FF3C 802AB1AC 14600004 */  bnez      $v1, .L802AB1C0_7B2B60
jtbl_802AB1B0_7B2B50:
/* 41FF40 802AB1B0 24020100 */   addiu    $v0, $zero, 0x100
/* 41FF44 802AB1B4 3C04001D */  lui       $a0, (0x1D00C4 >> 16)
/* 41FF48 802AB1B8 080AACB5 */  j         .L802AB2D4_7B2C74
/* 41FF4C 802AB1BC 348400C4 */   ori      $a0, $a0, (0x1D00C4 & 0xFFFF)
.L802AB1C0_7B2B60:
/* 41FF50 802AB1C0 1462000A */  bne       $v1, $v0, .L802AB1EC_7B2B8C
/* 41FF54 802AB1C4 24020036 */   addiu    $v0, $zero, 0x36
/* 41FF58 802AB1C8 AFA20010 */  sw        $v0, 0x10($sp)
/* 41FF5C 802AB1CC 00121080 */  sll       $v0, $s2, 2
/* 41FF60 802AB1D0 AFA00014 */  sw        $zero, 0x14($sp)
/* 41FF64 802AB1D4 8E050000 */  lw        $a1, 0x0($s0)
/* 41FF68 802AB1D8 3C04802B */  lui       $a0, %hi(D_802AB738_7B30D8)
/* 41FF6C 802AB1DC 00822021 */  addu      $a0, $a0, $v0
/* 41FF70 802AB1E0 8C84B738 */  lw        $a0, %lo(D_802AB738_7B30D8)($a0)
/* 41FF74 802AB1E4 080AACBA */  j         .L802AB2E8_7B2C88
/* 41FF78 802AB1E8 240700FF */   addiu    $a3, $zero, 0xFF
.L802AB1EC_7B2B8C:
/* 41FF7C 802AB1EC 8FA90060 */  lw        $t1, 0x60($sp)
/* 41FF80 802AB1F0 02E91021 */  addu      $v0, $s7, $t1
/* 41FF84 802AB1F4 80430000 */  lb        $v1, 0x0($v0)
/* 41FF88 802AB1F8 00031080 */  sll       $v0, $v1, 2
/* 41FF8C 802AB1FC 00431021 */  addu      $v0, $v0, $v1
/* 41FF90 802AB200 00021080 */  sll       $v0, $v0, 2
/* 41FF94 802AB204 2442022C */  addiu     $v0, $v0, 0x22C
/* 41FF98 802AB208 02C28821 */  addu      $s1, $s6, $v0
/* 41FF9C 802AB20C 0C09A75B */  jal       get_actor
/* 41FFA0 802AB210 86240000 */   lh       $a0, 0x0($s1)
/* 41FFA4 802AB214 0040802D */  daddu     $s0, $v0, $zero
/* 41FFA8 802AB218 86250002 */  lh        $a1, 0x2($s1)
/* 41FFAC 802AB21C 0C099117 */  jal       get_actor_part
/* 41FFB0 802AB220 0200202D */   daddu    $a0, $s0, $zero
/* 41FFB4 802AB224 8C420008 */  lw        $v0, 0x8($v0)
/* 41FFB8 802AB228 8C440020 */  lw        $a0, 0x20($v0)
/* 41FFBC 802AB22C 14800006 */  bnez      $a0, .L802AB248_7B2BE8
/* 41FFC0 802AB230 240700FF */   addiu    $a3, $zero, 0xFF
/* 41FFC4 802AB234 92020136 */  lbu       $v0, 0x136($s0)
/* 41FFC8 802AB238 00021080 */  sll       $v0, $v0, 2
/* 41FFCC 802AB23C 3C048028 */  lui       $a0, %hi(bActorNames)
/* 41FFD0 802AB240 00822021 */  addu      $a0, $a0, $v0
/* 41FFD4 802AB244 8C841104 */  lw        $a0, %lo(bActorNames)($a0)
.L802AB248_7B2BE8:
/* 41FFD8 802AB248 8FA30050 */  lw        $v1, 0x50($sp)
/* 41FFDC 802AB24C 3C05802B */  lui       $a1, %hi(D_802ACC68)
/* 41FFE0 802AB250 8CA5CC68 */  lw        $a1, %lo(D_802ACC68)($a1)
/* 41FFE4 802AB254 8FA60054 */  lw        $a2, 0x54($sp)
/* 41FFE8 802AB258 24020036 */  addiu     $v0, $zero, 0x36
/* 41FFEC 802AB25C AFA20010 */  sw        $v0, 0x10($sp)
/* 41FFF0 802AB260 AFA00014 */  sw        $zero, 0x14($sp)
/* 41FFF4 802AB264 080AACBB */  j         .L802AB2EC_7B2C8C
/* 41FFF8 802AB268 00652821 */   addu     $a1, $v1, $a1
.L802AB26C_7B2C0C:
/* 41FFFC 802AB26C 8FA90060 */  lw        $t1, 0x60($sp)
/* 420000 802AB270 02E91021 */  addu      $v0, $s7, $t1
/* 420004 802AB274 80430000 */  lb        $v1, 0x0($v0)
/* 420008 802AB278 00031080 */  sll       $v0, $v1, 2
/* 42000C 802AB27C 00431021 */  addu      $v0, $v0, $v1
/* 420010 802AB280 00021080 */  sll       $v0, $v0, 2
/* 420014 802AB284 00568821 */  addu      $s1, $v0, $s6
/* 420018 802AB288 8623022C */  lh        $v1, 0x22C($s1)
/* 42001C 802AB28C 14600004 */  bnez      $v1, .L802AB2A0_7B2C40
/* 420020 802AB290 24020100 */   addiu    $v0, $zero, 0x100
/* 420024 802AB294 3C04001D */  lui       $a0, (0x1D00C4 >> 16)
/* 420028 802AB298 080AACB5 */  j         .L802AB2D4_7B2C74
/* 42002C 802AB29C 348400C4 */   ori      $a0, $a0, (0x1D00C4 & 0xFFFF)
.L802AB2A0_7B2C40:
/* 420030 802AB2A0 1462000B */  bne       $v1, $v0, .L802AB2D0_7B2C70
/* 420034 802AB2A4 3C04001D */   lui      $a0, (0x1D00C5 >> 16)
/* 420038 802AB2A8 24020036 */  addiu     $v0, $zero, 0x36
/* 42003C 802AB2AC AFA20010 */  sw        $v0, 0x10($sp)
/* 420040 802AB2B0 00121080 */  sll       $v0, $s2, 2
/* 420044 802AB2B4 AFA00014 */  sw        $zero, 0x14($sp)
/* 420048 802AB2B8 8E050000 */  lw        $a1, 0x0($s0)
/* 42004C 802AB2BC 3C04802B */  lui       $a0, %hi(D_802AB738_7B30D8)
/* 420050 802AB2C0 00822021 */  addu      $a0, $a0, $v0
/* 420054 802AB2C4 8C84B738 */  lw        $a0, %lo(D_802AB738_7B30D8)($a0)
/* 420058 802AB2C8 080AACBA */  j         .L802AB2E8_7B2C88
/* 42005C 802AB2CC 240700FF */   addiu    $a3, $zero, 0xFF
.L802AB2D0_7B2C70:
/* 420060 802AB2D0 348400C5 */  ori       $a0, $a0, (0x1D00C5 & 0xFFFF)
.L802AB2D4_7B2C74:
/* 420064 802AB2D4 240700FF */  addiu     $a3, $zero, 0xFF
/* 420068 802AB2D8 8E050000 */  lw        $a1, 0x0($s0)
/* 42006C 802AB2DC 24020036 */  addiu     $v0, $zero, 0x36
/* 420070 802AB2E0 AFA20010 */  sw        $v0, 0x10($sp)
/* 420074 802AB2E4 AFA00014 */  sw        $zero, 0x14($sp)
.L802AB2E8_7B2C88:
/* 420078 802AB2E8 01052821 */  addu      $a1, $t0, $a1
.L802AB2EC_7B2C8C:
/* 42007C 802AB2EC 0C04993B */  jal       draw_msg
/* 420080 802AB2F0 00000000 */   nop
.L802AB2F4_7B2C94:
/* 420084 802AB2F4 8FBF008C */  lw        $ra, 0x8C($sp)
/* 420088 802AB2F8 8FBE0088 */  lw        $fp, 0x88($sp)
/* 42008C 802AB2FC 8FB70084 */  lw        $s7, 0x84($sp)
/* 420090 802AB300 8FB60080 */  lw        $s6, 0x80($sp)
/* 420094 802AB304 8FB5007C */  lw        $s5, 0x7C($sp)
/* 420098 802AB308 8FB40078 */  lw        $s4, 0x78($sp)
/* 42009C 802AB30C 8FB30074 */  lw        $s3, 0x74($sp)
/* 4200A0 802AB310 8FB20070 */  lw        $s2, 0x70($sp)
/* 4200A4 802AB314 8FB1006C */  lw        $s1, 0x6C($sp)
/* 4200A8 802AB318 8FB00068 */  lw        $s0, 0x68($sp)
/* 4200AC 802AB31C D7B800A0 */  ldc1      $f24, 0xA0($sp)
/* 4200B0 802AB320 D7B60098 */  ldc1      $f22, 0x98($sp)
/* 4200B4 802AB324 D7B40090 */  ldc1      $f20, 0x90($sp)
/* 4200B8 802AB328 03E00008 */  jr        $ra
/* 4200BC 802AB32C 27BD00A8 */   addiu    $sp, $sp, 0xA8

### DECOMPILED C INSTRUCTIONS:

void btl_state_draw_select_target(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    s32 msgID;
    s32 msgX;
    s32 msgY;
    s32 targetListLength;
    s32 currentPartner;
    s32 actorID;
    SelectableTarget* target;
    Actor* actor;
    Actor* anotherActor;
    s32 id;
    s32 msgWidth;
    s32 xOffset, yOffset;
    f32 targetX, targetY, targetZ;
    s32 screenX, screenY, screenZ;
    s32 selectedTargetIndex;
    s8* targetIndexList;
    s32* tmpPtr; // TODO required to match and CURSED

    if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) {
        actor = battleStatus->playerActor;
    } else {
        actor = battleStatus->partnerActor;
    }

    targetListLength = actor->targetListLength;
    target = actor->targetData;
    selectedTargetIndex = actor->selectedTargetIndex;
    targetIndexList = actor->targetIndexList;

    tmpPtr = &D_802ACC68;

    if (targetListLength != 0) {
        if (battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) {
            target = &actor->targetData[targetIndexList[selectedTargetIndex]];
            anotherActor = get_actor(target->actorID);
            id = D_802ACC70[0];
            targetX = target->posA.x;
            targetY = target->posA.y;
            targetZ = target->posA.z;

            if (anotherActor->flags & ACTOR_FLAG_UPSIDE_DOWN) {
                xOffset = 16;
                yOffset = 2;
                if (hud_element_get_script(id) != &HES_HandPointLeftLoop) {
                    hud_element_set_script(id, &HES_HandPointLeftLoop);
                }
            } else {
                xOffset = 5;
                yOffset = -11;
                if (hud_element_get_script(id) != &HES_HandPointDownLoop) {
                    hud_element_set_script(id, &HES_HandPointDownLoop);
                }
            }

            get_screen_coords(1, targetX, targetY, targetZ, &screenX, &screenY, &screenZ);
            hud_element_set_render_pos(id, screenX + xOffset, screenY + yOffset);
            hud_element_set_alpha(id, D_802ACC64);
        } else {
            s32 i;

            for (i = 0; i < targetListLength; i++) {
                target = &actor->targetData[targetIndexList[i]];
                anotherActor = get_actor(target->actorID);
                id = D_802ACC70[i];
                targetX = target->posA.x;
                targetY = target->posA.y;
                targetZ = target->posA.z;
                if (anotherActor->flags & ACTOR_FLAG_UPSIDE_DOWN) {
                    xOffset = 16;
                    yOffset = 2;
                    if (hud_element_get_script(id) != &HES_HandPointLeftLoop) {
                        hud_element_set_script(id, &HES_HandPointLeftLoop);
                    }
                } else {
                    xOffset = 5;
                    yOffset = -11;
                    if (hud_element_get_script(id) != &HES_HandPointDownLoop) {
                        hud_element_set_script(id, &HES_HandPointDownLoop);
                    }
                }
                get_screen_coords(1, targetX, targetY, targetZ, &screenX, &screenY, &screenZ);
                hud_element_set_render_pos(id, screenX + xOffset, screenY + yOffset);
                hud_element_set_alpha(id, D_802ACC64);
            }
        }

        currentPartner = playerData->currentPartner;
        screenX = 52;
        screenY = 64;
        if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
            currentPartner = PARTNER_TWINK;
        }

        if ((battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) || targetListLength == 1) {
            actorID = target->actorID;
            if (actorID == ACTOR_PLAYER) {
                msgWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10;
            } else if (actorID == ACTOR_PARTNER) {
                msgWidth = get_msg_width(PartnerNameMessages[currentPartner], 0) + 10;
            } else {
                target = &actor->targetData[targetIndexList[selectedTargetIndex]];
                anotherActor = get_actor(target->actorID);
                msgID = get_actor_part(anotherActor, target->partID)->staticData->overrideNameMsg;
                if (msgID == MSG_NONE) {
                    msgID = bActorNames[anotherActor->actorType];
                }
                msgWidth = get_msg_width(msgID, 0) + 10;
            }
        } else {
            target = &actor->targetData[targetIndexList[selectedTargetIndex]];
            actorID = target->actorID;
            if (actorID == ACTOR_PLAYER) {
                msgWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10;
            } else if (actorID == ACTOR_PARTNER) {
                msgWidth = get_msg_width(PartnerNameMessages[currentPartner], 0) + 10;
            } else {
                msgWidth = get_msg_width(MSG_Menus_Battle_TargetAllEnemies, 0) + 10;
            }
        }

        draw_box(0, WINDOW_STYLE_4, screenX + D_802ACC68, screenY, 0, msgWidth, 20, 255, 0,
                 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);

        screenX += 4;
        screenY += 2;
        if ((battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) || targetListLength == 1) {
            actorID = target->actorID;
            if (actorID == ACTOR_PLAYER) {
                draw_msg(MSG_Menus_Battle_TargetMario, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0);
            } else if (actorID == ACTOR_PARTNER) {
                draw_msg(PartnerNameMessages[currentPartner], screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0);
            } else {
                target = &actor->targetData[targetIndexList[selectedTargetIndex]];
                anotherActor = get_actor(target->actorID);
                msgID = get_actor_part(anotherActor, target->partID)->staticData->overrideNameMsg;
                if (msgID == MSG_NONE) {
                    msgID = bActorNames[anotherActor->actorType];
                }
                draw_msg(msgID, screenX + *tmpPtr, screenY, 255, MSG_PAL_36, 0); // TODO required to match
            }
        } else {
            target = &actor->targetData[targetIndexList[selectedTargetIndex]];
            actorID = target->actorID;
            if (actorID == ACTOR_PLAYER) {
                draw_msg(MSG_Menus_Battle_TargetMario, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0);
            } else if (actorID == ACTOR_PARTNER) {
                draw_msg(PartnerNameMessages[currentPartner], screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0);
            } else {
                draw_msg(MSG_Menus_Battle_TargetAllEnemies, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel tubba_heart_attack_update
/* 3D18E8 E00CC258 27BDFF10 */  addiu     $sp, $sp, -0xF0
/* 3D18EC E00CC25C AFBF00BC */  sw        $ra, 0xBC($sp)
/* 3D18F0 E00CC260 AFBE00B8 */  sw        $fp, 0xB8($sp)
/* 3D18F4 E00CC264 AFB700B4 */  sw        $s7, 0xB4($sp)
/* 3D18F8 E00CC268 AFB600B0 */  sw        $s6, 0xB0($sp)
/* 3D18FC E00CC26C AFB500AC */  sw        $s5, 0xAC($sp)
/* 3D1900 E00CC270 AFB400A8 */  sw        $s4, 0xA8($sp)
/* 3D1904 E00CC274 AFB300A4 */  sw        $s3, 0xA4($sp)
/* 3D1908 E00CC278 AFB200A0 */  sw        $s2, 0xA0($sp)
/* 3D190C E00CC27C AFB1009C */  sw        $s1, 0x9C($sp)
/* 3D1910 E00CC280 AFB00098 */  sw        $s0, 0x98($sp)
/* 3D1914 E00CC284 F7BE00E8 */  sdc1      $f30, 0xE8($sp)
/* 3D1918 E00CC288 F7BC00E0 */  sdc1      $f28, 0xE0($sp)
/* 3D191C E00CC28C F7BA00D8 */  sdc1      $f26, 0xD8($sp)
/* 3D1920 E00CC290 F7B800D0 */  sdc1      $f24, 0xD0($sp)
/* 3D1924 E00CC294 F7B600C8 */  sdc1      $f22, 0xC8($sp)
/* 3D1928 E00CC298 F7B400C0 */  sdc1      $f20, 0xC0($sp)
/* 3D192C E00CC29C 8C830000 */  lw        $v1, 0x0($a0)
/* 3D1930 E00CC2A0 8C92000C */  lw        $s2, 0xC($a0)
/* 3D1934 E00CC2A4 30620010 */  andi      $v0, $v1, 0x10
/* 3D1938 E00CC2A8 8E5E0000 */  lw        $fp, 0x0($s2)
/* 3D193C E00CC2AC 10400005 */  beqz      $v0, .LE00CC2C4
/* 3D1940 E00CC2B0 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3D1944 E00CC2B4 00621024 */  and       $v0, $v1, $v0
/* 3D1948 E00CC2B8 AC820000 */  sw        $v0, 0x0($a0)
/* 3D194C E00CC2BC 24020040 */  addiu     $v0, $zero, 0x40
/* 3D1950 E00CC2C0 AE420010 */  sw        $v0, 0x10($s2)
.LE00CC2C4:
/* 3D1954 E00CC2C4 8E430010 */  lw        $v1, 0x10($s2)
/* 3D1958 E00CC2C8 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3D195C E00CC2CC 10400002 */  beqz      $v0, .LE00CC2D8
/* 3D1960 E00CC2D0 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3D1964 E00CC2D4 AE420010 */  sw        $v0, 0x10($s2)
.LE00CC2D8:
/* 3D1968 E00CC2D8 8E420014 */  lw        $v0, 0x14($s2)
/* 3D196C E00CC2DC 8E430010 */  lw        $v1, 0x10($s2)
/* 3D1970 E00CC2E0 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1974 E00CC2E4 04610005 */  bgez      $v1, .LE00CC2FC
/* 3D1978 E00CC2E8 AE420014 */   sw       $v0, 0x14($s2)
/* 3D197C E00CC2EC 0C080128 */  jal       shim_remove_effect
/* 3D1980 E00CC2F0 00000000 */   nop
/* 3D1984 E00CC2F4 0803324E */  j         .LE00CC938
/* 3D1988 E00CC2F8 00000000 */   nop
.LE00CC2FC:
/* 3D198C E00CC2FC 0040B02D */  daddu     $s6, $v0, $zero
/* 3D1990 E00CC300 0000982D */  daddu     $s3, $zero, $zero
/* 3D1994 E00CC304 3C17E00D */  lui       $s7, %hi(D_E00CCDD8)
/* 3D1998 E00CC308 26F7CDD8 */  addiu     $s7, $s7, %lo(D_E00CCDD8)
/* 3D199C E00CC30C 0240882D */  daddu     $s1, $s2, $zero
/* 3D19A0 E00CC310 0260A82D */  daddu     $s5, $s3, $zero
/* 3D19A4 E00CC314 0260A02D */  daddu     $s4, $s3, $zero
/* 3D19A8 E00CC318 4480F000 */  mtc1      $zero, $f30
/* 3D19AC E00CC31C 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D19B0 E00CC320 D43ACE70 */  ldc1      $f26, -0x3190($at)
/* 3D19B4 E00CC324 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3D19B8 E00CC328 4481E000 */  mtc1      $at, $f28
/* 3D19BC E00CC32C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3D19C0 E00CC330 4481C800 */  mtc1      $at, $f25
/* 3D19C4 E00CC334 4480C000 */  mtc1      $zero, $f24
.LE00CC338:
/* 3D19C8 E00CC338 3C029249 */  lui       $v0, (0x92492493 >> 16)
/* 3D19CC E00CC33C 34422493 */  ori       $v0, $v0, (0x92492493 & 0xFFFF)
/* 3D19D0 E00CC340 02C20018 */  mult      $s6, $v0
/* 3D19D4 E00CC344 001617C3 */  sra       $v0, $s6, 31
/* 3D19D8 E00CC348 3C013C23 */  lui       $at, (0x3C23D70A >> 16)
/* 3D19DC E00CC34C 3421D70A */  ori       $at, $at, (0x3C23D70A & 0xFFFF)
/* 3D19E0 E00CC350 44811000 */  mtc1      $at, $f2
/* 3D19E4 E00CC354 00004010 */  mfhi      $t0
/* 3D19E8 E00CC358 01161821 */  addu      $v1, $t0, $s6
/* 3D19EC E00CC35C 00031883 */  sra       $v1, $v1, 2
/* 3D19F0 E00CC360 00621823 */  subu      $v1, $v1, $v0
/* 3D19F4 E00CC364 000310C0 */  sll       $v0, $v1, 3
/* 3D19F8 E00CC368 00431023 */  subu      $v0, $v0, $v1
/* 3D19FC E00CC36C 02C21023 */  subu      $v0, $s6, $v0
/* 3D1A00 E00CC370 3C08E00D */  lui       $t0, %hi(D_E00CCDD0)
/* 3D1A04 E00CC374 2508CDD0 */  addiu     $t0, $t0, %lo(D_E00CCDD0)
/* 3D1A08 E00CC378 00481021 */  addu      $v0, $v0, $t0
/* 3D1A0C E00CC37C 90420000 */  lbu       $v0, 0x0($v0)
/* 3D1A10 E00CC380 C6260158 */  lwc1      $f6, 0x158($s1)
/* 3D1A14 E00CC384 44820000 */  mtc1      $v0, $f0
/* 3D1A18 E00CC388 00000000 */  nop
/* 3D1A1C E00CC38C 46800020 */  cvt.s.w   $f0, $f0
/* 3D1A20 E00CC390 46020002 */  mul.s     $f0, $f0, $f2
/* 3D1A24 E00CC394 00000000 */  nop
/* 3D1A28 E00CC398 C62801BC */  lwc1      $f8, 0x1BC($s1)
/* 3D1A2C E00CC39C C62A0220 */  lwc1      $f10, 0x220($s1)
/* 3D1A30 E00CC3A0 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3D1A34 E00CC3A4 44811000 */  mtc1      $at, $f2
/* 3D1A38 E00CC3A8 8E2306D0 */  lw        $v1, 0x6D0($s1)
/* 3D1A3C E00CC3AC 46001081 */  sub.s     $f2, $f2, $f0
/* 3D1A40 E00CC3B0 2C620015 */  sltiu     $v0, $v1, 0x15
/* 3D1A44 E00CC3B4 E6200414 */  swc1      $f0, 0x414($s1)
/* 3D1A48 E00CC3B8 10400159 */  beqz      $v0, .LE00CC920
/* 3D1A4C E00CC3BC E62203B0 */   swc1     $f2, 0x3B0($s1)
/* 3D1A50 E00CC3C0 00031080 */  sll       $v0, $v1, 2
/* 3D1A54 E00CC3C4 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1A58 E00CC3C8 00220821 */  addu      $at, $at, $v0
/* 3D1A5C E00CC3CC 8C22CE78 */  lw        $v0, -0x3188($at)
/* 3D1A60 E00CC3D0 00400008 */  jr        $v0
/* 3D1A64 E00CC3D4 00000000 */   nop
/* 3D1A68 E00CC3D8 C62004DC */  lwc1      $f0, 0x4DC($s1)
/* 3D1A6C E00CC3DC 8E22066C */  lw        $v0, 0x66C($s1)
/* 3D1A70 E00CC3E0 E626002C */  swc1      $f6, 0x2C($s1)
/* 3D1A74 E00CC3E4 461E0000 */  add.s     $f0, $f0, $f30
/* 3D1A78 E00CC3E8 E6280090 */  swc1      $f8, 0x90($s1)
/* 3D1A7C E00CC3EC E62A00F4 */  swc1      $f10, 0xF4($s1)
/* 3D1A80 E00CC3F0 10400004 */  beqz      $v0, .LE00CC404
/* 3D1A84 E00CC3F4 E62004DC */   swc1     $f0, 0x4DC($s1)
/* 3D1A88 E00CC3F8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3D1A8C E00CC3FC 08033248 */  j         .LE00CC920
/* 3D1A90 E00CC400 AE22066C */   sw       $v0, 0x66C($s1)
.LE00CC404:
/* 3D1A94 E00CC404 8E230734 */  lw        $v1, 0x734($s1)
/* 3D1A98 E00CC408 24020001 */  addiu     $v0, $zero, 0x1
/* 3D1A9C E00CC40C AE2206D0 */  sw        $v0, 0x6D0($s1)
/* 3D1AA0 E00CC410 00771821 */  addu      $v1, $v1, $s7
/* 3D1AA4 E00CC414 90620000 */  lbu       $v0, 0x0($v1)
/* 3D1AA8 E00CC418 44820000 */  mtc1      $v0, $f0
/* 3D1AAC E00CC41C 00000000 */  nop
/* 3D1AB0 E00CC420 46800021 */  cvt.d.w   $f0, $f0
/* 3D1AB4 E00CC424 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D1AB8 E00CC428 00000000 */  nop
/* 3D1ABC E00CC42C 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1AC0 E00CC430 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1AC4 E00CC434 AE220734 */  sw        $v0, 0x734($s1)
/* 3D1AC8 E00CC438 46200020 */  cvt.s.d   $f0, $f0
/* 3D1ACC E00CC43C E6200414 */  swc1      $f0, 0x414($s1)
/* 3D1AD0 E00CC440 08033248 */  j         .LE00CC920
/* 3D1AD4 E00CC444 E62003B0 */   swc1     $f0, 0x3B0($s1)
/* 3D1AD8 E00CC448 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1ADC E00CC44C 00571021 */  addu      $v0, $v0, $s7
/* 3D1AE0 E00CC450 90420000 */  lbu       $v0, 0x0($v0)
/* 3D1AE4 E00CC454 44820000 */  mtc1      $v0, $f0
/* 3D1AE8 E00CC458 00000000 */  nop
/* 3D1AEC E00CC45C 46800021 */  cvt.d.w   $f0, $f0
/* 3D1AF0 E00CC460 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D1AF4 E00CC464 00000000 */  nop
/* 3D1AF8 E00CC468 C62204DC */  lwc1      $f2, 0x4DC($s1)
/* 3D1AFC E00CC46C 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1B00 E00CC470 461E1080 */  add.s     $f2, $f2, $f30
/* 3D1B04 E00CC474 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1B08 E00CC478 AE220734 */  sw        $v0, 0x734($s1)
/* 3D1B0C E00CC47C 28420008 */  slti      $v0, $v0, 0x8
/* 3D1B10 E00CC480 E62204DC */  swc1      $f2, 0x4DC($s1)
/* 3D1B14 E00CC484 46200020 */  cvt.s.d   $f0, $f0
/* 3D1B18 E00CC488 E6200414 */  swc1      $f0, 0x414($s1)
/* 3D1B1C E00CC48C 14400124 */  bnez      $v0, .LE00CC920
/* 3D1B20 E00CC490 E62003B0 */   swc1     $f0, 0x3B0($s1)
/* 3D1B24 E00CC494 17C00050 */  bnez      $fp, .LE00CC5D8
/* 3D1B28 E00CC498 24020014 */   addiu    $v0, $zero, 0x14
/* 3D1B2C E00CC49C 08033176 */  j         .LE00CC5D8
/* 3D1B30 E00CC4A0 24020002 */   addiu    $v0, $zero, 0x2
/* 3D1B34 E00CC4A4 C62004DC */  lwc1      $f0, 0x4DC($s1)
/* 3D1B38 E00CC4A8 461E0000 */  add.s     $f0, $f0, $f30
/* 3D1B3C E00CC4AC 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1B40 E00CC4B0 E62004DC */  swc1      $f0, 0x4DC($s1)
/* 3D1B44 E00CC4B4 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1B48 E00CC4B8 00220821 */  addu      $at, $at, $v0
/* 3D1B4C E00CC4BC 9022CDF0 */  lbu       $v0, -0x3210($at)
/* 3D1B50 E00CC4C0 44820000 */  mtc1      $v0, $f0
/* 3D1B54 E00CC4C4 00000000 */  nop
/* 3D1B58 E00CC4C8 46800021 */  cvt.d.w   $f0, $f0
/* 3D1B5C E00CC4CC 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D1B60 E00CC4D0 00000000 */  nop
/* 3D1B64 E00CC4D4 C6240284 */  lwc1      $f4, 0x284($s1)
/* 3D1B68 E00CC4D8 46062101 */  sub.s     $f4, $f4, $f6
/* 3D1B6C E00CC4DC 462005A0 */  cvt.s.d   $f22, $f0
/* 3D1B70 E00CC4E0 46162102 */  mul.s     $f4, $f4, $f22
/* 3D1B74 E00CC4E4 00000000 */  nop
/* 3D1B78 E00CC4E8 C62202E8 */  lwc1      $f2, 0x2E8($s1)
/* 3D1B7C E00CC4EC 46081081 */  sub.s     $f2, $f2, $f8
/* 3D1B80 E00CC4F0 46161082 */  mul.s     $f2, $f2, $f22
/* 3D1B84 E00CC4F4 00000000 */  nop
/* 3D1B88 E00CC4F8 C620034C */  lwc1      $f0, 0x34C($s1)
/* 3D1B8C E00CC4FC 460A0001 */  sub.s     $f0, $f0, $f10
/* 3D1B90 E00CC500 46160002 */  mul.s     $f0, $f0, $f22
/* 3D1B94 E00CC504 00000000 */  nop
/* 3D1B98 E00CC508 E63C0414 */  swc1      $f28, 0x414($s1)
/* 3D1B9C E00CC50C 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1BA0 E00CC510 46043100 */  add.s     $f4, $f6, $f4
/* 3D1BA4 E00CC514 E63C03B0 */  swc1      $f28, 0x3B0($s1)
/* 3D1BA8 E00CC518 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1BAC E00CC51C 46024080 */  add.s     $f2, $f8, $f2
/* 3D1BB0 E00CC520 AE220734 */  sw        $v0, 0x734($s1)
/* 3D1BB4 E00CC524 28420014 */  slti      $v0, $v0, 0x14
/* 3D1BB8 E00CC528 46005000 */  add.s     $f0, $f10, $f0
/* 3D1BBC E00CC52C E624002C */  swc1      $f4, 0x2C($s1)
/* 3D1BC0 E00CC530 E6220090 */  swc1      $f2, 0x90($s1)
/* 3D1BC4 E00CC534 080331CC */  j         .LE00CC730
/* 3D1BC8 E00CC538 E62000F4 */   swc1     $f0, 0xF4($s1)
/* 3D1BCC E00CC53C C62004DC */  lwc1      $f0, 0x4DC($s1)
/* 3D1BD0 E00CC540 461E0000 */  add.s     $f0, $f0, $f30
/* 3D1BD4 E00CC544 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1BD8 E00CC548 E62004DC */  swc1      $f0, 0x4DC($s1)
/* 3D1BDC E00CC54C 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1BE0 E00CC550 00220821 */  addu      $at, $at, $v0
/* 3D1BE4 E00CC554 9022CDE0 */  lbu       $v0, -0x3220($at)
/* 3D1BE8 E00CC558 44820000 */  mtc1      $v0, $f0
/* 3D1BEC E00CC55C 00000000 */  nop
/* 3D1BF0 E00CC560 46800021 */  cvt.d.w   $f0, $f0
/* 3D1BF4 E00CC564 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D1BF8 E00CC568 00000000 */  nop
/* 3D1BFC E00CC56C C6240284 */  lwc1      $f4, 0x284($s1)
/* 3D1C00 E00CC570 46062101 */  sub.s     $f4, $f4, $f6
/* 3D1C04 E00CC574 462005A0 */  cvt.s.d   $f22, $f0
/* 3D1C08 E00CC578 46162102 */  mul.s     $f4, $f4, $f22
/* 3D1C0C E00CC57C 00000000 */  nop
/* 3D1C10 E00CC580 C62202E8 */  lwc1      $f2, 0x2E8($s1)
/* 3D1C14 E00CC584 46081081 */  sub.s     $f2, $f2, $f8
/* 3D1C18 E00CC588 46161082 */  mul.s     $f2, $f2, $f22
/* 3D1C1C E00CC58C 00000000 */  nop
/* 3D1C20 E00CC590 C620034C */  lwc1      $f0, 0x34C($s1)
/* 3D1C24 E00CC594 460A0001 */  sub.s     $f0, $f0, $f10
/* 3D1C28 E00CC598 46160002 */  mul.s     $f0, $f0, $f22
/* 3D1C2C E00CC59C 00000000 */  nop
/* 3D1C30 E00CC5A0 E63C0414 */  swc1      $f28, 0x414($s1)
/* 3D1C34 E00CC5A4 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1C38 E00CC5A8 46043100 */  add.s     $f4, $f6, $f4
/* 3D1C3C E00CC5AC E63C03B0 */  swc1      $f28, 0x3B0($s1)
/* 3D1C40 E00CC5B0 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1C44 E00CC5B4 46024080 */  add.s     $f2, $f8, $f2
/* 3D1C48 E00CC5B8 AE220734 */  sw        $v0, 0x734($s1)
/* 3D1C4C E00CC5BC 2842000F */  slti      $v0, $v0, 0xF
/* 3D1C50 E00CC5C0 46005000 */  add.s     $f0, $f10, $f0
/* 3D1C54 E00CC5C4 E624002C */  swc1      $f4, 0x2C($s1)
/* 3D1C58 E00CC5C8 E6220090 */  swc1      $f2, 0x90($s1)
/* 3D1C5C E00CC5CC 144000D4 */  bnez      $v0, .LE00CC920
/* 3D1C60 E00CC5D0 E62000F4 */   swc1     $f0, 0xF4($s1)
/* 3D1C64 E00CC5D4 24020003 */  addiu     $v0, $zero, 0x3
.LE00CC5D8:
/* 3D1C68 E00CC5D8 AE2206D0 */  sw        $v0, 0x6D0($s1)
/* 3D1C6C E00CC5DC 08033248 */  j         .LE00CC920
/* 3D1C70 E00CC5E0 AE200734 */   sw       $zero, 0x734($s1)
/* 3D1C74 E00CC5E4 24020018 */  addiu     $v0, $zero, 0x18
/* 3D1C78 E00CC5E8 566200CE */  bnel      $s3, $v0, .LE00CC924
/* 3D1C7C E00CC5EC 26310004 */   addiu    $s1, $s1, 0x4
/* 3D1C80 E00CC5F0 24040004 */  addiu     $a0, $zero, 0x4
/* 3D1C84 E00CC5F4 0040182D */  daddu     $v1, $v0, $zero
/* 3D1C88 E00CC5F8 26420060 */  addiu     $v0, $s2, 0x60
.LE00CC5FC:
/* 3D1C8C E00CC5FC AC4406D0 */  sw        $a0, 0x6D0($v0)
/* 3D1C90 E00CC600 2463FFFF */  addiu     $v1, $v1, -0x1
/* 3D1C94 E00CC604 0461FFFD */  bgez      $v1, .LE00CC5FC
/* 3D1C98 E00CC608 2442FFFC */   addiu    $v0, $v0, -0x4
/* 3D1C9C E00CC60C 08033249 */  j         .LE00CC924
/* 3D1CA0 E00CC610 26310004 */   addiu    $s1, $s1, 0x4
/* 3D1CA4 E00CC614 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1CA8 E00CC618 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1CAC E00CC61C 00220821 */  addu      $at, $at, $v0
/* 3D1CB0 E00CC620 9022CE04 */  lbu       $v0, -0x31FC($at)
/* 3D1CB4 E00CC624 44820000 */  mtc1      $v0, $f0
/* 3D1CB8 E00CC628 00000000 */  nop
/* 3D1CBC E00CC62C 46800021 */  cvt.d.w   $f0, $f0
/* 3D1CC0 E00CC630 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D1CC4 E00CC634 00000000 */  nop
/* 3D1CC8 E00CC638 3C1051EB */  lui       $s0, (0x51EB851F >> 16)
/* 3D1CCC E00CC63C 3610851F */  ori       $s0, $s0, (0x51EB851F & 0xFFFF)
/* 3D1CD0 E00CC640 02900018 */  mult      $s4, $s0
/* 3D1CD4 E00CC644 00141FC3 */  sra       $v1, $s4, 31
/* 3D1CD8 E00CC648 00004010 */  mfhi      $t0
/* 3D1CDC E00CC64C 000810C3 */  sra       $v0, $t0, 3
/* 3D1CE0 E00CC650 00431023 */  subu      $v0, $v0, $v1
/* 3D1CE4 E00CC654 44826000 */  mtc1      $v0, $f12
/* 3D1CE8 E00CC658 00000000 */  nop
/* 3D1CEC E00CC65C 46806320 */  cvt.s.w   $f12, $f12
/* 3D1CF0 E00CC660 0C080144 */  jal       shim_cos_deg
/* 3D1CF4 E00CC664 462005A0 */   cvt.s.d  $f22, $f0
/* 3D1CF8 E00CC668 4616E081 */  sub.s     $f2, $f28, $f22
/* 3D1CFC E00CC66C 3C014487 */  lui       $at, (0x44870000 >> 16)
/* 3D1D00 E00CC670 44812000 */  mtc1      $at, $f4
/* 3D1D04 E00CC674 00000000 */  nop
/* 3D1D08 E00CC678 46041082 */  mul.s     $f2, $f2, $f4
/* 3D1D0C E00CC67C 00000000 */  nop
/* 3D1D10 E00CC680 460010A1 */  cvt.d.s   $f2, $f2
/* 3D1D14 E00CC684 46381082 */  mul.d     $f2, $f2, $f24
/* 3D1D18 E00CC688 00000000 */  nop
/* 3D1D1C E00CC68C 46000021 */  cvt.d.s   $f0, $f0
/* 3D1D20 E00CC690 46201082 */  mul.d     $f2, $f2, $f0
/* 3D1D24 E00CC694 00000000 */  nop
/* 3D1D28 E00CC698 02B00018 */  mult      $s5, $s0
/* 3D1D2C E00CC69C 00151FC3 */  sra       $v1, $s5, 31
/* 3D1D30 E00CC6A0 00004010 */  mfhi      $t0
/* 3D1D34 E00CC6A4 000810C3 */  sra       $v0, $t0, 3
/* 3D1D38 E00CC6A8 00431023 */  subu      $v0, $v0, $v1
/* 3D1D3C E00CC6AC 4482A000 */  mtc1      $v0, $f20
/* 3D1D40 E00CC6B0 00000000 */  nop
/* 3D1D44 E00CC6B4 4680A521 */  cvt.d.w   $f20, $f20
/* 3D1D48 E00CC6B8 4622A500 */  add.d     $f20, $f20, $f2
/* 3D1D4C E00CC6BC 4620A520 */  cvt.s.d   $f20, $f20
/* 3D1D50 E00CC6C0 0C080140 */  jal       shim_sin_deg
/* 3D1D54 E00CC6C4 4600A306 */   mov.s    $f12, $f20
/* 3D1D58 E00CC6C8 4600A306 */  mov.s     $f12, $f20
/* 3D1D5C E00CC6CC 0C080144 */  jal       shim_cos_deg
/* 3D1D60 E00CC6D0 46000506 */   mov.s    $f20, $f0
/* 3D1D64 E00CC6D4 3C014170 */  lui       $at, (0x41700000 >> 16)
/* 3D1D68 E00CC6D8 44811000 */  mtc1      $at, $f2
/* 3D1D6C E00CC6DC 00000000 */  nop
/* 3D1D70 E00CC6E0 46161083 */  div.s     $f2, $f2, $f22
/* 3D1D74 E00CC6E4 46161083 */  div.s     $f2, $f2, $f22
/* 3D1D78 E00CC6E8 46141502 */  mul.s     $f20, $f2, $f20
/* 3D1D7C E00CC6EC 00000000 */  nop
/* 3D1D80 E00CC6F0 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1D84 E00CC6F4 46001082 */  mul.s     $f2, $f2, $f0
/* 3D1D88 E00CC6F8 00000000 */  nop
/* 3D1D8C E00CC6FC E634002C */  swc1      $f20, 0x2C($s1)
/* 3D1D90 E00CC700 3C03E00D */  lui       $v1, (0xE00D0000 >> 16)
/* 3D1D94 E00CC704 00731821 */  addu      $v1, $v1, $s3
/* 3D1D98 E00CC708 8063CE4C */  lb        $v1, -0x31B4($v1)
/* 3D1D9C E00CC70C 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1DA0 E00CC710 AE220734 */  sw        $v0, 0x734($s1)
/* 3D1DA4 E00CC714 28420046 */  slti      $v0, $v0, 0x46
/* 3D1DA8 E00CC718 E62200F4 */  swc1      $f2, 0xF4($s1)
/* 3D1DAC E00CC71C 2463000A */  addiu     $v1, $v1, 0xA
/* 3D1DB0 E00CC720 44830000 */  mtc1      $v1, $f0
/* 3D1DB4 E00CC724 00000000 */  nop
/* 3D1DB8 E00CC728 46800020 */  cvt.s.w   $f0, $f0
/* 3D1DBC E00CC72C E6200090 */  swc1      $f0, 0x90($s1)
.LE00CC730:
/* 3D1DC0 E00CC730 5440007C */  bnel      $v0, $zero, .LE00CC924
/* 3D1DC4 E00CC734 26310004 */   addiu    $s1, $s1, 0x4
/* 3D1DC8 E00CC738 C6240284 */  lwc1      $f4, 0x284($s1)
/* 3D1DCC E00CC73C 46002121 */  cvt.d.s   $f4, $f4
/* 3D1DD0 E00CC740 46382102 */  mul.d     $f4, $f4, $f24
/* 3D1DD4 E00CC744 00000000 */  nop
/* 3D1DD8 E00CC748 C62202E8 */  lwc1      $f2, 0x2E8($s1)
/* 3D1DDC E00CC74C 460010A1 */  cvt.d.s   $f2, $f2
/* 3D1DE0 E00CC750 46381082 */  mul.d     $f2, $f2, $f24
/* 3D1DE4 E00CC754 00000000 */  nop
/* 3D1DE8 E00CC758 C620034C */  lwc1      $f0, 0x34C($s1)
/* 3D1DEC E00CC75C 46000021 */  cvt.d.s   $f0, $f0
/* 3D1DF0 E00CC760 46380002 */  mul.d     $f0, $f0, $f24
/* 3D1DF4 E00CC764 00000000 */  nop
/* 3D1DF8 E00CC768 24020005 */  addiu     $v0, $zero, 0x5
/* 3D1DFC E00CC76C AE2206D0 */  sw        $v0, 0x6D0($s1)
/* 3D1E00 E00CC770 AE200734 */  sw        $zero, 0x734($s1)
/* 3D1E04 E00CC774 46202120 */  cvt.s.d   $f4, $f4
/* 3D1E08 E00CC778 462010A0 */  cvt.s.d   $f2, $f2
/* 3D1E0C E00CC77C 46200020 */  cvt.s.d   $f0, $f0
/* 3D1E10 E00CC780 E6240540 */  swc1      $f4, 0x540($s1)
/* 3D1E14 E00CC784 E62205A4 */  swc1      $f2, 0x5A4($s1)
/* 3D1E18 E00CC788 08033248 */  j         .LE00CC920
/* 3D1E1C E00CC78C E6200608 */   swc1     $f0, 0x608($s1)
/* 3D1E20 E00CC790 C6260540 */  lwc1      $f6, 0x540($s1)
/* 3D1E24 E00CC794 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1E28 E00CC798 D42CCED0 */  ldc1      $f12, -0x3130($at)
/* 3D1E2C E00CC79C 460031A1 */  cvt.d.s   $f6, $f6
/* 3D1E30 E00CC7A0 462C3182 */  mul.d     $f6, $f6, $f12
/* 3D1E34 E00CC7A4 00000000 */  nop
/* 3D1E38 E00CC7A8 C62405A4 */  lwc1      $f4, 0x5A4($s1)
/* 3D1E3C E00CC7AC 46002121 */  cvt.d.s   $f4, $f4
/* 3D1E40 E00CC7B0 462C2102 */  mul.d     $f4, $f4, $f12
/* 3D1E44 E00CC7B4 00000000 */  nop
/* 3D1E48 E00CC7B8 C6280608 */  lwc1      $f8, 0x608($s1)
/* 3D1E4C E00CC7BC 46004086 */  mov.s     $f2, $f8
/* 3D1E50 E00CC7C0 460010A1 */  cvt.d.s   $f2, $f2
/* 3D1E54 E00CC7C4 462C1082 */  mul.d     $f2, $f2, $f12
/* 3D1E58 E00CC7C8 00000000 */  nop
/* 3D1E5C E00CC7CC C62E002C */  lwc1      $f14, 0x2C($s1)
/* 3D1E60 E00CC7D0 C6200540 */  lwc1      $f0, 0x540($s1)
/* 3D1E64 E00CC7D4 C62A0090 */  lwc1      $f10, 0x90($s1)
/* 3D1E68 E00CC7D8 8E220734 */  lw        $v0, 0x734($s1)
/* 3D1E6C E00CC7DC 46007380 */  add.s     $f14, $f14, $f0
/* 3D1E70 E00CC7E0 C62005A4 */  lwc1      $f0, 0x5A4($s1)
/* 3D1E74 E00CC7E4 24420001 */  addiu     $v0, $v0, 0x1
/* 3D1E78 E00CC7E8 AE220734 */  sw        $v0, 0x734($s1)
/* 3D1E7C E00CC7EC 46005280 */  add.s     $f10, $f10, $f0
/* 3D1E80 E00CC7F0 C62000F4 */  lwc1      $f0, 0xF4($s1)
/* 3D1E84 E00CC7F4 28420011 */  slti      $v0, $v0, 0x11
/* 3D1E88 E00CC7F8 46080000 */  add.s     $f0, $f0, $f8
/* 3D1E8C E00CC7FC E62E002C */  swc1      $f14, 0x2C($s1)
/* 3D1E90 E00CC800 E62A0090 */  swc1      $f10, 0x90($s1)
/* 3D1E94 E00CC804 E62000F4 */  swc1      $f0, 0xF4($s1)
/* 3D1E98 E00CC808 462031A0 */  cvt.s.d   $f6, $f6
/* 3D1E9C E00CC80C 46202120 */  cvt.s.d   $f4, $f4
/* 3D1EA0 E00CC810 E62405A4 */  swc1      $f4, 0x5A4($s1)
/* 3D1EA4 E00CC814 46002006 */  mov.s     $f0, $f4
/* 3D1EA8 E00CC818 46000021 */  cvt.d.s   $f0, $f0
/* 3D1EAC E00CC81C 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1EB0 E00CC820 D424CED8 */  ldc1      $f4, -0x3128($at)
/* 3D1EB4 E00CC824 462010A0 */  cvt.s.d   $f2, $f2
/* 3D1EB8 E00CC828 46240000 */  add.d     $f0, $f0, $f4
/* 3D1EBC E00CC82C E6260540 */  swc1      $f6, 0x540($s1)
/* 3D1EC0 E00CC830 E6220608 */  swc1      $f2, 0x608($s1)
/* 3D1EC4 E00CC834 46200020 */  cvt.s.d   $f0, $f0
/* 3D1EC8 E00CC838 14400004 */  bnez      $v0, .LE00CC84C
/* 3D1ECC E00CC83C E62005A4 */   swc1     $f0, 0x5A4($s1)
/* 3D1ED0 E00CC840 24020006 */  addiu     $v0, $zero, 0x6
/* 3D1ED4 E00CC844 AE200734 */  sw        $zero, 0x734($s1)
/* 3D1ED8 E00CC848 AE2206D0 */  sw        $v0, 0x6D0($s1)
.LE00CC84C:
/* 3D1EDC E00CC84C C6200478 */  lwc1      $f0, 0x478($s1)
/* 3D1EE0 E00CC850 3C01E00D */  lui       $at, (0xE00D0000 >> 16)
/* 3D1EE4 E00CC854 D422CEE0 */  ldc1      $f2, -0x3120($at)
/* 3D1EE8 E00CC858 46000021 */  cvt.d.s   $f0, $f0
/* 3D1EEC E00CC85C 46220002 */  mul.d     $f0, $f0, $f2
/* 3D1EF0 E00CC860 00000000 */  nop
/* 3D1EF4 E00CC864 46200020 */  cvt.s.d   $f0, $f0
/* 3D1EF8 E00CC868 08033248 */  j         .LE00CC920
/* 3D1EFC E00CC86C E6200478 */   swc1     $f0, 0x478($s1)
/* 3D1F00 E00CC870 0C080150 */  jal       shim_load_effect
/* 3D1F04 E00CC874 24040069 */   addiu    $a0, $zero, 0x69
/* 3D1F08 E00CC878 E7BE0010 */  swc1      $f30, 0x10($sp)
/* 3D1F0C E00CC87C 8E2504DC */  lw        $a1, 0x4DC($s1)
/* 3D1F10 E00CC880 4406F000 */  mfc1      $a2, $f30
/* 3D1F14 E00CC884 4407E000 */  mfc1      $a3, $f28
/* 3D1F18 E00CC888 0C080104 */  jal       shim_guRotateF
/* 3D1F1C E00CC88C 27A40018 */   addiu    $a0, $sp, 0x18
/* 3D1F20 E00CC890 27B00058 */  addiu     $s0, $sp, 0x58
/* 3D1F24 E00CC894 8E25002C */  lw        $a1, 0x2C($s1)
/* 3D1F28 E00CC898 8E260090 */  lw        $a2, 0x90($s1)
/* 3D1F2C E00CC89C 8E2700F4 */  lw        $a3, 0xF4($s1)
/* 3D1F30 E00CC8A0 0C080108 */  jal       shim_guTranslateF
/* 3D1F34 E00CC8A4 0200202D */   daddu    $a0, $s0, $zero
/* 3D1F38 E00CC8A8 0200202D */  daddu     $a0, $s0, $zero
/* 3D1F3C E00CC8AC 27A50018 */  addiu     $a1, $sp, 0x18
/* 3D1F40 E00CC8B0 0C080114 */  jal       shim_guMtxCatF
/* 3D1F44 E00CC8B4 00A0302D */   daddu    $a2, $a1, $zero
/* 3D1F48 E00CC8B8 C6420004 */  lwc1      $f2, 0x4($s2)
/* 3D1F4C E00CC8BC C7A00048 */  lwc1      $f0, 0x48($sp)
/* 3D1F50 E00CC8C0 46001080 */  add.s     $f2, $f2, $f0
/* 3D1F54 E00CC8C4 C7A0004C */  lwc1      $f0, 0x4C($sp)
/* 3D1F58 E00CC8C8 44051000 */  mfc1      $a1, $f2
/* 3D1F5C E00CC8CC C6420008 */  lwc1      $f2, 0x8($s2)
/* 3D1F60 E00CC8D0 46001080 */  add.s     $f2, $f2, $f0
/* 3D1F64 E00CC8D4 C7A00050 */  lwc1      $f0, 0x50($sp)
/* 3D1F68 E00CC8D8 44061000 */  mfc1      $a2, $f2
/* 3D1F6C E00CC8DC C642000C */  lwc1      $f2, 0xC($s2)
/* 3D1F70 E00CC8E0 46001080 */  add.s     $f2, $f2, $f0
/* 3D1F74 E00CC8E4 0000202D */  daddu     $a0, $zero, $zero
/* 3D1F78 E00CC8E8 44071000 */  mfc1      $a3, $f2
/* 3D1F7C E00CC8EC 24020010 */  addiu     $v0, $zero, 0x10
/* 3D1F80 E00CC8F0 E7BC0010 */  swc1      $f28, 0x10($sp)
/* 3D1F84 E00CC8F4 0C034800 */  jal       floating_cloud_puff_main
/* 3D1F88 E00CC8F8 AFA20014 */   sw       $v0, 0x14($sp)
/* 3D1F8C E00CC8FC 8C44000C */  lw        $a0, 0xC($v0)
/* 3D1F90 E00CC900 24030064 */  addiu     $v1, $zero, 0x64
/* 3D1F94 E00CC904 AC830028 */  sw        $v1, 0x28($a0)
/* 3D1F98 E00CC908 8C43000C */  lw        $v1, 0xC($v0)
/* 3D1F9C E00CC90C AC60002C */  sw        $zero, 0x2C($v1)
/* 3D1FA0 E00CC910 8C42000C */  lw        $v0, 0xC($v0)
/* 3D1FA4 E00CC914 AC400030 */  sw        $zero, 0x30($v0)
/* 3D1FA8 E00CC918 24020007 */  addiu     $v0, $zero, 0x7
/* 3D1FAC E00CC91C AE2206D0 */  sw        $v0, 0x6D0($s1)
.LE00CC920:
/* 3D1FB0 E00CC920 26310004 */  addiu     $s1, $s1, 0x4
.LE00CC924:
/* 3D1FB4 E00CC924 26B50438 */  addiu     $s5, $s5, 0x438
/* 3D1FB8 E00CC928 26730001 */  addiu     $s3, $s3, 0x1
/* 3D1FBC E00CC92C 2A620019 */  slti      $v0, $s3, 0x19
/* 3D1FC0 E00CC930 1440FE81 */  bnez      $v0, .LE00CC338
/* 3D1FC4 E00CC934 269400B4 */   addiu    $s4, $s4, 0xB4
.LE00CC938:
/* 3D1FC8 E00CC938 8FBF00BC */  lw        $ra, 0xBC($sp)
/* 3D1FCC E00CC93C 8FBE00B8 */  lw        $fp, 0xB8($sp)
/* 3D1FD0 E00CC940 8FB700B4 */  lw        $s7, 0xB4($sp)
/* 3D1FD4 E00CC944 8FB600B0 */  lw        $s6, 0xB0($sp)
/* 3D1FD8 E00CC948 8FB500AC */  lw        $s5, 0xAC($sp)
/* 3D1FDC E00CC94C 8FB400A8 */  lw        $s4, 0xA8($sp)
/* 3D1FE0 E00CC950 8FB300A4 */  lw        $s3, 0xA4($sp)
/* 3D1FE4 E00CC954 8FB200A0 */  lw        $s2, 0xA0($sp)
/* 3D1FE8 E00CC958 8FB1009C */  lw        $s1, 0x9C($sp)
/* 3D1FEC E00CC95C 8FB00098 */  lw        $s0, 0x98($sp)
/* 3D1FF0 E00CC960 D7BE00E8 */  ldc1      $f30, 0xE8($sp)
/* 3D1FF4 E00CC964 D7BC00E0 */  ldc1      $f28, 0xE0($sp)
/* 3D1FF8 E00CC968 D7BA00D8 */  ldc1      $f26, 0xD8($sp)
/* 3D1FFC E00CC96C D7B800D0 */  ldc1      $f24, 0xD0($sp)
/* 3D2000 E00CC970 D7B600C8 */  ldc1      $f22, 0xC8($sp)
/* 3D2004 E00CC974 D7B400C0 */  ldc1      $f20, 0xC0($sp)
/* 3D2008 E00CC978 03E00008 */  jr        $ra
/* 3D200C E00CC97C 27BD00F0 */   addiu    $sp, $sp, 0xF0

### DECOMPILED C INSTRUCTIONS:

void tubba_heart_attack_update(EffectInstance* effect) {
    TubbaHeartAttackFXData* data = effect->data.tubbaHeartAttack;
    EffectInstance* puffEffect;
    s32 unk_00 = data->unk_00;
    s32 unk_14;
    f32 factor;
    f32 angle;
    f32 sin;
    f32 cos;
    Matrix4f sp18;
    Matrix4f sp58;
    s32 i;
    s32 j;

    if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
        effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        data->unk_10 = 64;
    }

    if (data->unk_10 < 1000) {
        data->unk_10--;
    }

    data->unk_14++;

    if (data->unk_10 < 0) {
        shim_remove_effect(effect);
        return;
    }

    unk_14 = data->unk_14;

    for (i = 0; i < 25; i++) {
        f32 unk_158 = data->unk_158[i];
        f32 unk_1BC = data->unk_1BC[i];
        f32 unk_220 = data->unk_220[i];

        data->unk_414[i] = D_E00CCDD0[unk_14 % ARRAY_COUNT(D_E00CCDD0)] * 0.01f;
        data->unk_3B0[i] = 2.0f - data->unk_414[i];

        switch (data->unk_6D0[i]) {
            case 0:
                data->unk_2C[i] = unk_158;
                data->unk_90[i] = unk_1BC;
                data->unk_F4[i] = unk_220;
                data->unk_4DC[i] += 0.0f;

                if (data->unk_66C[i] != 0) {
                    data->unk_66C[i]--;
                } else {
                    data->unk_6D0[i] = 1;
                    data->unk_3B0[i] = data->unk_414[i] = D_E00CCDD8[data->unk_734[i]] * 0.01;
                    data->unk_734[i]++;
                }

                break;
            case 1:
                data->unk_3B0[i] = data->unk_414[i] = D_E00CCDD8[data->unk_734[i]] * 0.01;
                data->unk_4DC[i] += 0.0f;

                data->unk_734[i]++;
                if (data->unk_734[i] >= ARRAY_COUNT(D_E00CCDD8)) {
                    if (unk_00 == 0) {
                        data->unk_6D0[i] = 2;
                    } else {
                        data->unk_6D0[i] = 20;
                    }
                    data->unk_734[i] = 0;
                }

                break;
            case 20:
                data->unk_4DC[i] += 0.0f;

                factor = D_E00CCDF0[data->unk_734[i]] * 0.01;

                data->unk_3B0[i] = data->unk_414[i] = 1.0f;
                data->unk_2C[i] = unk_158 + (data->unk_284[i] - unk_158) * factor;
                data->unk_90[i] = unk_1BC + (data->unk_2E8[i] - unk_1BC) * factor;
                data->unk_F4[i] = unk_220 + (data->unk_34C[i] - unk_220) * factor;

                data->unk_734[i]++;
                if (data->unk_734[i] >= ARRAY_COUNT(D_E00CCDF0)) {
                    data->unk_6D0[i] = 5;
                    data->unk_734[i] = 0;
                    data->unk_540[i] = data->unk_284[i] * 0.5;
                    data->unk_5A4[i] = data->unk_2E8[i] * 0.5;
                    data->unk_608[i] = data->unk_34C[i] * 0.5;
                }

                break;
            case 2:
                data->unk_4DC[i] += 0.0f;

                factor = D_E00CCDE0[data->unk_734[i]] * 0.01;

                data->unk_414[i] = 1.0f;
                data->unk_3B0[i] = 1.0f;
                data->unk_2C[i] = unk_158 + (data->unk_284[i] - unk_158) * factor;
                data->unk_90[i] = unk_1BC + (data->unk_2E8[i] - unk_1BC) * factor;
                data->unk_F4[i] = unk_220 + (data->unk_34C[i] - unk_220) * factor;

                data->unk_734[i]++;
                if (data->unk_734[i] >= ARRAY_COUNT(D_E00CCDE0)) {
                    data->unk_6D0[i] = 3;
                    data->unk_734[i] = 0;
                }

                break;
            case 3:
                if (i == 24) {
                    for (j = 0; j < ARRAY_COUNT(data->unk_6D0); j++) {
                        data->unk_6D0[j] = 4;
                    }
                }

                break;
            case 4:
                factor = D_E00CCE04[data->unk_734[i]] * 0.01;
                angle = i * 1080 / 25 + (1.0f - factor) * 1080.0f * 0.5 * shim_cos_deg(i * 180 / 25);
                sin = shim_sin_deg(angle);
                cos = shim_cos_deg(angle);

                data->unk_2C[i] = ((15.0f / factor) / factor) * sin;
                data->unk_90[i] = D_E00CCE4C[i] + 10;
                data->unk_F4[i] = ((15.0f / factor) / factor) * cos;

                data->unk_734[i]++;
                if (data->unk_734[i] >= ARRAY_COUNT(D_E00CCE04)) {
                    data->unk_6D0[i] = 5;
                    data->unk_734[i] = 0;
                    data->unk_540[i] = data->unk_284[i] * 0.5;
                    data->unk_5A4[i] = data->unk_2E8[i] * 0.5;
                    data->unk_608[i] = data->unk_34C[i] * 0.5;
                }

                break;
            case 5:
                data->unk_2C[i] += data->unk_540[i];
                data->unk_90[i] += data->unk_5A4[i];
                data->unk_F4[i] += data->unk_608[i];
                data->unk_540[i] *= 0.99;
                data->unk_5A4[i] *= 0.99;
                data->unk_608[i] *= 0.99;
                data->unk_5A4[i] += -0.1;

                data->unk_734[i]++;
                if (data->unk_734[i] >= 17) {
                    data->unk_734[i] = 0;
                    data->unk_6D0[i] = 6;
                }

                data->unk_478[i] *= 0.9;

                break;
            case 6:
                shim_load_effect(EFFECT_FLOATING_CLOUD_PUFF);
                shim_guRotateF(sp18, data->unk_4DC[i], 0.0f, 1.0f, 0.0f);
                shim_guTranslateF(sp58, data->unk_2C[i], data->unk_90[i], data->unk_F4[i]);
                shim_guMtxCatF(sp58, sp18, sp18);

                puffEffect = floating_cloud_puff_main(0, data->unk_04 + sp18[3][0], data->unk_08 + sp18[3][1], data->unk_0C + sp18[3][2], 1.0f, 16);
                puffEffect->data.floatingCloudPuff->unk_28 = 100;
                puffEffect->data.floatingCloudPuff->unk_2C = 0;
                puffEffect->data.floatingCloudPuff->unk_30 = 0;

                data->unk_6D0[i] = 7;

                break;
        }
    }
}