### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80248190
/* 176A70 80248190 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 176A74 80248194 AFB50024 */  sw        $s5, 0x24($sp)
/* 176A78 80248198 3C15800E */  lui       $s5, %hi(gBattleStatus)
/* 176A7C 8024819C 26B5C070 */  addiu     $s5, $s5, %lo(gBattleStatus)
/* 176A80 802481A0 AFB20018 */  sw        $s2, 0x18($sp)
/* 176A84 802481A4 3C12800E */  lui       $s2, %hi(gBattleSubState)
/* 176A88 802481A8 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
.L802481AC:
/* 176A8C 802481AC AFB10014 */  sw        $s1, 0x14($sp)
/* 176A90 802481B0 24110001 */  addiu     $s1, $zero, 0x1
/* 176A94 802481B4 AFBF0028 */  sw        $ra, 0x28($sp)
glabel func_802481B8
/* 176A98 802481B8 AFB40020 */  sw        $s4, 0x20($sp)
/* 176A9C 802481BC AFB3001C */  sw        $s3, 0x1C($sp)
/* 176AA0 802481C0 AFB00010 */  sw        $s0, 0x10($sp)
/* 176AA4 802481C4 8EB000D8 */  lw        $s0, 0xD8($s5)
/* 176AA8 802481C8 8E430000 */  lw        $v1, 0x0($s2)
/* 176AAC 802481CC 8EB400DC */  lw        $s4, 0xDC($s5)
/* 176AB0 802481D0 1071003E */  beq       $v1, $s1, .L802482CC
/* 176AB4 802481D4 28620002 */   slti     $v0, $v1, 0x2
D_802481D8:
/* 176AB8 802481D8 50400005 */  beql      $v0, $zero, .L802481F0
/* 176ABC 802481DC 24020002 */   addiu    $v0, $zero, 0x2
.L802481E0:
/* 176AC0 802481E0 10600009 */  beqz      $v1, .L80248208
/* 176AC4 802481E4 24040002 */   addiu    $a0, $zero, 0x2
.L802481E8:
/* 176AC8 802481E8 08092176 */  j         .L802485D8
/* 176ACC 802481EC 00000000 */   nop
.L802481F0:
/* 176AD0 802481F0 10620068 */  beq       $v1, $v0, .L80248394
/* 176AD4 802481F4 24020003 */   addiu    $v0, $zero, 0x3
D_802481F8:
/* 176AD8 802481F8 106200E1 */  beq       $v1, $v0, .L80248580
/* 176ADC 802481FC 0000982D */   daddu    $s3, $zero, $zero
/* 176AE0 80248200 08092176 */  j         .L802485D8
/* 176AE4 80248204 00000000 */   nop
.L80248208:
/* 176AE8 80248208 8E830008 */  lw        $v1, 0x8($s4)
/* 176AEC 8024820C 3C028011 */  lui       $v0, %hi(gPlayerData)
.L80248210:
/* 176AF0 80248210 2442F290 */  addiu     $v0, $v0, %lo(gPlayerData)
/* 176AF4 80248214 3C01802A */  lui       $at, %hi(D_8029F254)
/* 176AF8 80248218 AC20F254 */  sw        $zero, %lo(D_8029F254)($at)
D_8024821C:
/* 176AFC 8024821C 80450012 */  lb        $a1, 0x12($v0)
/* 176B00 80248220 90630006 */  lbu       $v1, 0x6($v1)
/* 176B04 80248224 10A40005 */  beq       $a1, $a0, .L8024823C
/* 176B08 80248228 24020003 */   addiu    $v0, $zero, 0x3
/* 176B0C 8024822C 10A20006 */  beq       $a1, $v0, .L80248248
/* 176B10 80248230 24020005 */   addiu    $v0, $zero, 0x5
/* 176B14 80248234 0809209D */  j         .L80248274
/* 176B18 80248238 00000000 */   nop
.L8024823C:
/* 176B1C 8024823C 24020005 */  addiu     $v0, $zero, 0x5
/* 176B20 80248240 08092093 */  j         .L8024824C
/* 176B24 80248244 24630089 */   addiu    $v1, $v1, 0x89
.L80248248:
/* 176B28 80248248 2463008F */  addiu     $v1, $v1, 0x8F
.L8024824C:
/* 176B2C 8024824C A2A20178 */  sb        $v0, 0x178($s5)
/* 176B30 80248250 00031080 */  sll       $v0, $v1, 2
/* 176B34 80248254 00431021 */  addu      $v0, $v0, $v1
/* 176B38 80248258 00021080 */  sll       $v0, $v0, 2
/* 176B3C 8024825C A6A0017A */  sh        $zero, 0x17A($s5)
/* 176B40 80248260 A6A3017C */  sh        $v1, 0x17C($s5)
/* 176B44 80248264 3C018009 */  lui       $at, %hi(D_8008F064)
/* 176B48 80248268 00220821 */  addu      $at, $at, $v0
/* 176B4C 8024826C 8C22F064 */  lw        $v0, %lo(D_8008F064)($at)
/* 176B50 80248270 AEA20184 */  sw        $v0, 0x184($s5)
.L80248274:
/* 176B54 80248274 0C09A75B */  jal       get_actor
/* 176B58 80248278 24040200 */   addiu    $a0, $zero, 0x200
/* 176B5C 8024827C 0040802D */  daddu     $s0, $v0, $zero
/* 176B60 80248280 8E0201C8 */  lw        $v0, 0x1C8($s0)
.L80248284:
/* 176B64 80248284 1040000C */  beqz      $v0, .L802482B8
/* 176B68 80248288 2405000A */   addiu    $a1, $zero, 0xA
/* 176B6C 8024828C 24060020 */  addiu     $a2, $zero, 0x20
/* 176B70 80248290 0040202D */  daddu     $a0, $v0, $zero
/* 176B74 80248294 24020038 */  addiu     $v0, $zero, 0x38
/* 176B78 80248298 0C0B0CF8 */  jal       start_script
D_8024829C:
/* 176B7C 8024829C A20201F0 */   sb       $v0, 0x1F0($s0)
mgm_02_panel_peach_img:
/* 176B80 802482A0 0040202D */  daddu     $a0, $v0, $zero
/* 176B84 802482A4 AE0401D8 */  sw        $a0, 0x1D8($s0)
D_802482A8:
/* 176B88 802482A8 8C820144 */  lw        $v0, 0x144($a0)
/* 176B8C 802482AC 86030192 */  lh        $v1, 0x192($s0)
/* 176B90 802482B0 AE0201E8 */  sw        $v0, 0x1E8($s0)
D_802482B4:
/* 176B94 802482B4 AC830148 */  sw        $v1, 0x148($a0)
.L802482B8:
/* 176B98 802482B8 24020001 */  addiu     $v0, $zero, 0x1
/* 176B9C 802482BC 3C01800E */  lui       $at, %hi(gBattleSubState)
D_802482C0:
/* 176BA0 802482C0 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L802482C4:
/* 176BA4 802482C4 08092176 */  j         .L802485D8
/* 176BA8 802482C8 00000000 */   nop
.L802482CC:
/* 176BAC 802482CC 0C098C0B */  jal       func_8026302C
/* 176BB0 802482D0 0280202D */   daddu    $a0, $s4, $zero
/* 176BB4 802482D4 8283040D */  lb        $v1, 0x40D($s4)
/* 176BB8 802482D8 00031080 */  sll       $v0, $v1, 2
/* 176BBC 802482DC 00431021 */  addu      $v0, $v0, $v1
/* 176BC0 802482E0 00021080 */  sll       $v0, $v0, 2
D_802482E4:
/* 176BC4 802482E4 2442022C */  addiu     $v0, $v0, 0x22C
.L802482E8:
/* 176BC8 802482E8 02821021 */  addu      $v0, $s4, $v0
/* 176BCC 802482EC 94430000 */  lhu       $v1, 0x0($v0)
/* 176BD0 802482F0 A6830428 */  sh        $v1, 0x428($s4)
/* 176BD4 802482F4 90420003 */  lbu       $v0, 0x3($v0)
D_802482F8:
/* 176BD8 802482F8 A2820426 */  sb        $v0, 0x426($s4)
D_802482FC:
/* 176BDC 802482FC 8EA40000 */  lw        $a0, 0x0($s5)
/* 176BE0 80248300 2402FFFD */  addiu     $v0, $zero, -0x3
/* 176BE4 80248304 00822024 */  and       $a0, $a0, $v0
/* 176BE8 80248308 8EA20004 */  lw        $v0, 0x4($s5)
glabel func_8024830C
/* 176BEC 8024830C 3C030100 */  lui       $v1, (0x1000000 >> 16)
/* 176BF0 80248310 A2A0008C */  sb        $zero, 0x8C($s5)
/* 176BF4 80248314 A6A00180 */  sh        $zero, 0x180($s5)
/* 176BF8 80248318 A2A0019A */  sb        $zero, 0x19A($s5)
/* 176BFC 8024831C AEA40000 */  sw        $a0, 0x0($s5)
/* 176C00 80248320 00431025 */  or        $v0, $v0, $v1
/* 176C04 80248324 AEA20004 */  sw        $v0, 0x4($s5)
/* 176C08 80248328 3C020008 */  lui       $v0, (0x80000 >> 16)
/* 176C0C 8024832C 00822025 */  or        $a0, $a0, $v0
/* 176C10 80248330 0C03A6D5 */  jal       increment_status_bar_disabled
/* 176C14 80248334 AEA40000 */   sw       $a0, 0x0($s5)
/* 176C18 80248338 0C093903 */  jal       func_8024E40C
/* 176C1C 8024833C 2404000A */   addiu    $a0, $zero, 0xA
jtbl_80248340:
/* 176C20 80248340 0C09390F */  jal       func_8024E43C
.L80248344:
/* 176C24 80248344 24040100 */   addiu    $a0, $zero, 0x100
/* 176C28 80248348 0C098F18 */  jal       reset_actor_turn_info
D_8024834C:
/* 176C2C 8024834C 00000000 */   nop
/* 176C30 80248350 2405000A */  addiu     $a1, $zero, 0xA
D_80248354:
/* 176C34 80248354 A2B101A7 */  sb        $s1, 0x1A7($s5)
/* 176C38 80248358 8E8401C4 */  lw        $a0, 0x1C4($s4)
D_8024835C:
/* 176C3C 8024835C 0C0B0CF8 */  jal       start_script
D_80248360:
/* 176C40 80248360 0000302D */   daddu    $a2, $zero, $zero
D_80248364:
/* 176C44 80248364 0040202D */  daddu     $a0, $v0, $zero
D_80248368:
/* 176C48 80248368 AE8401D4 */  sw        $a0, 0x1D4($s4)
/* 176C4C 8024836C 8C830144 */  lw        $v1, 0x144($a0)
D_80248370_EB0E50:
/* 176C50 80248370 24020003 */  addiu     $v0, $zero, 0x3
/* 176C54 80248374 3C01802A */  lui       $at, %hi(D_8029F248)
D_80248378:
/* 176C58 80248378 AC22F248 */  sw        $v0, %lo(D_8029F248)($at)
/* 176C5C 8024837C 24020002 */  addiu     $v0, $zero, 0x2
kzn_19_VineRenderState:
/* 176C60 80248380 AE420000 */  sw        $v0, 0x0($s2)
/* 176C64 80248384 24020100 */  addiu     $v0, $zero, 0x100
dead_kzn_19_D_80248388:
/* 176C68 80248388 AE8301E4 */  sw        $v1, 0x1E4($s4)
/* 176C6C 8024838C 08092176 */  j         .L802485D8
.L80248390:
/* 176C70 80248390 AC820148 */   sw       $v0, 0x148($a0)
.L80248394:
/* 176C74 80248394 3C03802A */  lui       $v1, %hi(D_8029F248)
D_80248398:
/* 176C78 80248398 2463F248 */  addiu     $v1, $v1, %lo(D_8029F248)
/* 176C7C 8024839C 8C620000 */  lw        $v0, 0x0($v1)
D_802483A0:
/* 176C80 802483A0 10400003 */  beqz      $v0, D_802483B0
/* 176C84 802483A4 2442FFFF */   addiu    $v0, $v0, -0x1
D_802483A8:
/* 176C88 802483A8 080920EE */  j         .L802483B8
/* 176C8C 802483AC AC620000 */   sw       $v0, 0x0($v1)
D_802483B0:
/* 176C90 802483B0 3C01802A */  lui       $at, %hi(D_8029F254)
/* 176C94 802483B4 AC31F254 */  sw        $s1, %lo(D_8029F254)($at)
.L802483B8:
/* 176C98 802483B8 8E8201D4 */  lw        $v0, 0x1D4($s4)
/* 176C9C 802483BC 10400005 */  beqz      $v0, .L802483D4
kmr_22_ChapterEffect:
/* 176CA0 802483C0 00000000 */   nop
kmr_22_ChapterEffectTime:
/* 176CA4 802483C4 0C0B1059 */  jal       does_script_exist
/* 176CA8 802483C8 8E8401E4 */   lw       $a0, 0x1E4($s4)
D_802483CC:
/* 176CAC 802483CC 14400082 */  bnez      $v0, .L802485D8
kmr_22_VineRenderState:
/* 176CB0 802483D0 00000000 */   nop
.L802483D4:
/* 176CB4 802483D4 8E8201D8 */  lw        $v0, 0x1D8($s4)
.L802483D8:
/* 176CB8 802483D8 10400006 */  beqz      $v0, .L802483F4
/* 176CBC 802483DC AE8001D4 */   sw       $zero, 0x1D4($s4)
/* 176CC0 802483E0 8E8401E8 */  lw        $a0, 0x1E8($s4)
/* 176CC4 802483E4 0C0B1059 */  jal       does_script_exist
D_802483E8:
/* 176CC8 802483E8 00000000 */   nop
D_802483EC:
/* 176CCC 802483EC 1440007A */  bnez      $v0, .L802485D8
/* 176CD0 802483F0 00000000 */   nop
.L802483F4:
/* 176CD4 802483F4 AE8001D8 */  sw        $zero, 0x1D8($s4)
/* 176CD8 802483F8 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 176CDC 802483FC 50400007 */  beql      $v0, $zero, .L8024841C
/* 176CE0 80248400 AE0001D8 */   sw       $zero, 0x1D8($s0)
/* 176CE4 80248404 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 176CE8 80248408 0C0B1059 */  jal       does_script_exist
/* 176CEC 8024840C 00000000 */   nop
/* 176CF0 80248410 14400071 */  bnez      $v0, .L802485D8
/* 176CF4 80248414 00000000 */   nop
/* 176CF8 80248418 AE0001D8 */  sw        $zero, 0x1D8($s0)
.L8024841C:
/* 176CFC 8024841C 0000982D */  daddu     $s3, $zero, $zero
D_80248420:
/* 176D00 80248420 0260882D */  daddu     $s1, $s3, $zero
/* 176D04 80248424 02A0902D */  daddu     $s2, $s5, $zero
.L80248428:
/* 176D08 80248428 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 176D0C 8024842C 5200000B */  beql      $s0, $zero, .L8024845C
/* 176D10 80248430 26310001 */   addiu    $s1, $s1, 0x1
/* 176D14 80248434 8E0201D4 */  lw        $v0, 0x1D4($s0)
/* 176D18 80248438 50400008 */  beql      $v0, $zero, .L8024845C
/* 176D1C 8024843C 26310001 */   addiu    $s1, $s1, 0x1
/* 176D20 80248440 8E0401E4 */  lw        $a0, 0x1E4($s0)
/* 176D24 80248444 0C0B1059 */  jal       does_script_exist
/* 176D28 80248448 00000000 */   nop
/* 176D2C 8024844C 50400002 */  beql      $v0, $zero, .L80248458
/* 176D30 80248450 AE0001D4 */   sw       $zero, 0x1D4($s0)
/* 176D34 80248454 24130001 */  addiu     $s3, $zero, 0x1
.L80248458:
/* 176D38 80248458 26310001 */  addiu     $s1, $s1, 0x1
.L8024845C:
/* 176D3C 8024845C 2A220018 */  slti      $v0, $s1, 0x18
/* 176D40 80248460 1440FFF1 */  bnez      $v0, .L80248428
.L80248464:
/* 176D44 80248464 26520004 */   addiu    $s2, $s2, 0x4
/* 176D48 80248468 1660005B */  bnez      $s3, .L802485D8
/* 176D4C 8024846C 0000882D */   daddu    $s1, $zero, $zero
D_80248470:
/* 176D50 80248470 02A0902D */  daddu     $s2, $s5, $zero
.L80248474:
/* 176D54 80248474 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 176D58 80248478 5200000B */  beql      $s0, $zero, .L802484A8
/* 176D5C 8024847C 26310001 */   addiu    $s1, $s1, 0x1
iwa_10_D_80248480:
/* 176D60 80248480 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 176D64 80248484 50400008 */  beql      $v0, $zero, .L802484A8
/* 176D68 80248488 26310001 */   addiu    $s1, $s1, 0x1
.L8024848C:
/* 176D6C 8024848C 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 176D70 80248490 0C0B1059 */  jal       does_script_exist
/* 176D74 80248494 00000000 */   nop
/* 176D78 80248498 50400002 */  beql      $v0, $zero, .L802484A4
/* 176D7C 8024849C AE0001D8 */   sw       $zero, 0x1D8($s0)
mgm_02_panel_peach_pal:
/* 176D80 802484A0 24130001 */  addiu     $s3, $zero, 0x1
.L802484A4:
/* 176D84 802484A4 26310001 */  addiu     $s1, $s1, 0x1
.L802484A8:
/* 176D88 802484A8 2A220018 */  slti      $v0, $s1, 0x18
/* 176D8C 802484AC 1440FFF1 */  bnez      $v0, .L80248474
/* 176D90 802484B0 26520004 */   addiu    $s2, $s2, 0x4
/* 176D94 802484B4 16600048 */  bnez      $s3, .L802485D8
/* 176D98 802484B8 0000882D */   daddu    $s1, $zero, $zero
/* 176D9C 802484BC 3C04FFF7 */  lui       $a0, (0xFFF7FFFF >> 16)
mgm_02_MsgImg_PeachPanel:
/* 176DA0 802484C0 3484FFFF */  ori       $a0, $a0, (0xFFF7FFFF & 0xFFFF)
/* 176DA4 802484C4 02A0182D */  daddu     $v1, $s5, $zero
.L802484C8:
/* 176DA8 802484C8 8C7000E0 */  lw        $s0, 0xE0($v1)
/* 176DAC 802484CC 12000004 */  beqz      $s0, D_802484E0_E1E260
/* 176DB0 802484D0 26310001 */   addiu    $s1, $s1, 0x1
/* 176DB4 802484D4 8E020000 */  lw        $v0, 0x0($s0)
/* 176DB8 802484D8 00441024 */  and       $v0, $v0, $a0
/* 176DBC 802484DC AE020000 */  sw        $v0, 0x0($s0)
D_802484E0_E1E260:
/* 176DC0 802484E0 2A220018 */  slti      $v0, $s1, 0x18
/* 176DC4 802484E4 1440FFF8 */  bnez      $v0, .L802484C8
jtbl_802484E8:
/* 176DC8 802484E8 24630004 */   addiu    $v1, $v1, 0x4
/* 176DCC 802484EC 82A2008C */  lb        $v0, 0x8C($s5)
D_802484F0:
/* 176DD0 802484F0 14400039 */  bnez      $v0, .L802485D8
/* 176DD4 802484F4 00000000 */   nop
D_802484F8:
/* 176DD8 802484F8 0C03A6CC */  jal       decrement_status_bar_disabled
/* 176DDC 802484FC 00000000 */   nop
/* 176DE0 80248500 0C098D19 */  jal       btl_check_player_defeated
D_80248504:
/* 176DE4 80248504 00000000 */   nop
/* 176DE8 80248508 14400033 */  bnez      $v0, .L802485D8
/* 176DEC 8024850C 00000000 */   nop
/* 176DF0 80248510 0C098D0D */  jal       btl_check_enemies_defeated
/* 176DF4 80248514 00000000 */   nop
/* 176DF8 80248518 1440002F */  bnez      $v0, .L802485D8
/* 176DFC 8024851C 00000000 */   nop
.L80248520:
/* 176E00 80248520 0C09A75B */  jal       get_actor
/* 176E04 80248524 86840428 */   lh       $a0, 0x428($s4)
/* 176E08 80248528 0040802D */  daddu     $s0, $v0, $zero
.L8024852C:
/* 176E0C 8024852C 12000010 */  beqz      $s0, D_80248570
/* 176E10 80248530 24020003 */   addiu    $v0, $zero, 0x3
/* 176E14 80248534 8E0201C8 */  lw        $v0, 0x1C8($s0)
/* 176E18 80248538 1040000C */  beqz      $v0, D_8024856C
/* 176E1C 8024853C 2405000A */   addiu    $a1, $zero, 0xA
/* 176E20 80248540 24060020 */  addiu     $a2, $zero, 0x20
/* 176E24 80248544 0040202D */  daddu     $a0, $v0, $zero
/* 176E28 80248548 24020035 */  addiu     $v0, $zero, 0x35
dead_kzn_19_LetterDelivery_SavedNpcAnim:
/* 176E2C 8024854C 0C0B0CF8 */  jal       start_script
/* 176E30 80248550 A20201F0 */   sb       $v0, 0x1F0($s0)
/* 176E34 80248554 0040202D */  daddu     $a0, $v0, $zero
/* 176E38 80248558 AE0401D8 */  sw        $a0, 0x1D8($s0)
/* 176E3C 8024855C 8C820144 */  lw        $v0, 0x144($a0)
/* 176E40 80248560 86030192 */  lh        $v1, 0x192($s0)
/* 176E44 80248564 AE0201E8 */  sw        $v0, 0x1E8($s0)
/* 176E48 80248568 AC830148 */  sw        $v1, 0x148($a0)
D_8024856C:
/* 176E4C 8024856C 24020003 */  addiu     $v0, $zero, 0x3
D_80248570:
/* 176E50 80248570 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 176E54 80248574 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80248578:
/* 176E58 80248578 08092176 */  j         .L802485D8
/* 176E5C 8024857C 00000000 */   nop
.L80248580:
/* 176E60 80248580 0260882D */  daddu     $s1, $s3, $zero
/* 176E64 80248584 02A0902D */  daddu     $s2, $s5, $zero
.L80248588:
/* 176E68 80248588 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 176E6C 8024858C 5200000B */  beql      $s0, $zero, .L802485BC
/* 176E70 80248590 26310001 */   addiu    $s1, $s1, 0x1
/* 176E74 80248594 8E0201D8 */  lw        $v0, 0x1D8($s0)
D_80248598:
/* 176E78 80248598 50400008 */  beql      $v0, $zero, .L802485BC
/* 176E7C 8024859C 26310001 */   addiu    $s1, $s1, 0x1
/* 176E80 802485A0 8E0401E8 */  lw        $a0, 0x1E8($s0)
.L802485A4:
/* 176E84 802485A4 0C0B1059 */  jal       does_script_exist
D_802485A8:
/* 176E88 802485A8 00000000 */   nop
/* 176E8C 802485AC 50400002 */  beql      $v0, $zero, .L802485B8
/* 176E90 802485B0 AE0001D8 */   sw       $zero, 0x1D8($s0)
/* 176E94 802485B4 24130001 */  addiu     $s3, $zero, 0x1
.L802485B8:
/* 176E98 802485B8 26310001 */  addiu     $s1, $s1, 0x1
.L802485BC:
/* 176E9C 802485BC 2A220018 */  slti      $v0, $s1, 0x18
D_802485C0:
/* 176EA0 802485C0 1440FFF1 */  bnez      $v0, .L80248588
/* 176EA4 802485C4 26520004 */   addiu    $s2, $s2, 0x4
D_802485C8:
/* 176EA8 802485C8 16600003 */  bnez      $s3, .L802485D8
/* 176EAC 802485CC 00000000 */   nop
jtbl_802485D0:
/* 176EB0 802485D0 0C090464 */  jal       func_80241190
/* 176EB4 802485D4 24040005 */   addiu    $a0, $zero, 0x5
.L802485D8:
/* 176EB8 802485D8 8FBF0028 */  lw        $ra, 0x28($sp)
/* 176EBC 802485DC 8FB50024 */  lw        $s5, 0x24($sp)
/* 176EC0 802485E0 8FB40020 */  lw        $s4, 0x20($sp)
/* 176EC4 802485E4 8FB3001C */  lw        $s3, 0x1C($sp)
D_802485E8:
/* 176EC8 802485E8 8FB20018 */  lw        $s2, 0x18($sp)
/* 176ECC 802485EC 8FB10014 */  lw        $s1, 0x14($sp)
.L802485F0:
/* 176ED0 802485F0 8FB00010 */  lw        $s0, 0x10($sp)
.L802485F4:
/* 176ED4 802485F4 03E00008 */  jr        $ra
/* 176ED8 802485F8 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

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

    switch (gBattleSubState) {
        case BTL_SUBSTATE_PARTNER_FIRST_STRIKE_INIT:
            D_8029F254 = 0;
            // setup dummy 'menu selection' for partner move
            level = partner->actorBlueprint->level;
            switch (playerData->currentPartner) {
                case PARTNER_KOOPER:
                    battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER;
                    battleStatus->moveArgument = 0;
                    battleStatus->selectedMoveID = level + MOVE_SHELL_TOSS1;
                    battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
                    break;
                case PARTNER_BOMBETTE:
                    battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER;
                    battleStatus->moveArgument = 0;
                    battleStatus->selectedMoveID = level + MOVE_BODY_SLAM1;
                    battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
                    break;
            }
            // let the enemy know a first strike is coming
            actor = get_actor(ACTOR_ENEMY0);
            if (actor->handleEventSource != NULL) {
                actor->lastEventType = EVENT_BEGIN_FIRST_STRIKE;
                script = start_script(actor->handleEventSource, EVT_PRIORITY_A, EVT_FLAG_RUN_IMMEDIATELY);
                actor->handleEventScript = script;
                actor->handleEventScriptID = script->id;
                script->owner1.actorID = actor->actorID;
            }
            gBattleSubState = BTL_SUBSTATE_PARTNER_FIRST_STRIKE_AWAIT_ENEMY_READY;
            break;
        case BTL_SUBSTATE_PARTNER_FIRST_STRIKE_AWAIT_ENEMY_READY:
            player_create_target_list(partner);
            target = &partner->targetData[partner->targetIndexList[0]];
            partner->targetActorID = target->actorID;
            partner->targetPartIndex = target->partID;
            battleStatus->stateFreezeCount = 0;
            battleStatus->lastAttackDamage = 0;
            battleStatus->currentDamageSource = DMG_SRC_DEFAULT;
            gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
            gBattleStatus.flags2 |= BS_FLAGS2_1000000;
            gBattleStatus.flags1 |= BS_FLAGS1_PARTNER_ACTING;
            increment_status_bar_disabled();
            btl_cam_use_preset(BTL_CAM_PRESET_10);
            btl_cam_target_actor(ACTOR_PARTNER);
            reset_actor_turn_info();
            // begin the partner turn script
            battleStatus->battlePhase = PHASE_FIRST_STRIKE;
            script = start_script(partner->takeTurnSource, EVT_PRIORITY_A, 0);
            partner->takeTurnScript = script;
            partner->takeTurnScriptID = script->id;
            script->owner1.actorID = ACTOR_PARTNER;
            D_8029F248 = 3;
            gBattleSubState = BTL_SUBSTATE_PARTNER_FIRST_STRIKE_AWAIT_SCRIPTS;
            break;
        case BTL_SUBSTATE_PARTNER_FIRST_STRIKE_AWAIT_SCRIPTS:
            if (D_8029F248 != 0) {
                D_8029F248--;
            } else {
                D_8029F254 = 1;
            }
            // wait for partner move script
            if (partner->takeTurnScript != NULL && does_script_exist(partner->takeTurnScriptID)) {
                break;
            }
            partner->takeTurnScript = NULL;
            // wait for partner handle event script
            if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) {
                break;
            }
            partner->handleEventScript = NULL;
            // wait for player handle event script
            if (player->handleEventScript != NULL && does_script_exist(player->handleEventScriptID)) {
                break;
            }
            player->handleEventScript = NULL;

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

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

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

            if (battleStatus->stateFreezeCount == 0) {
                decrement_status_bar_disabled();
                if (btl_check_player_defeated() || btl_check_enemies_defeated()) {
                    return;
                }

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


### RAW ASSEMBLY INSTRUCTIONS:

glabel star_spirits_energy_update
/* 40C71C E012217C 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 40C720 E0122180 AFBF001C */  sw        $ra, 0x1C($sp)
/* 40C724 E0122184 AFB20018 */  sw        $s2, 0x18($sp)
/* 40C728 E0122188 AFB10014 */  sw        $s1, 0x14($sp)
/* 40C72C E012218C AFB00010 */  sw        $s0, 0x10($sp)
/* 40C730 E0122190 8C830000 */  lw        $v1, 0x0($a0)
/* 40C734 E0122194 8C90000C */  lw        $s0, 0xC($a0)
/* 40C738 E0122198 30620010 */  andi      $v0, $v1, 0x10
/* 40C73C E012219C 8E120004 */  lw        $s2, 0x4($s0)
/* 40C740 E01221A0 10400005 */  beqz      $v0, .LE01221B8
/* 40C744 E01221A4 2402FFEF */   addiu    $v0, $zero, -0x11
/* 40C748 E01221A8 00621024 */  and       $v0, $v1, $v0
/* 40C74C E01221AC AC820000 */  sw        $v0, 0x0($a0)
/* 40C750 E01221B0 24020010 */  addiu     $v0, $zero, 0x10
/* 40C754 E01221B4 AE020014 */  sw        $v0, 0x14($s0)
.LE01221B8:
/* 40C758 E01221B8 8E030014 */  lw        $v1, 0x14($s0)
/* 40C75C E01221BC 286203E8 */  slti      $v0, $v1, 0x3E8
/* 40C760 E01221C0 10400002 */  beqz      $v0, .LE01221CC
/* 40C764 E01221C4 2462FFFF */   addiu    $v0, $v1, -0x1
/* 40C768 E01221C8 AE020014 */  sw        $v0, 0x14($s0)
.LE01221CC:
/* 40C76C E01221CC 8E020018 */  lw        $v0, 0x18($s0)
/* 40C770 E01221D0 8E030014 */  lw        $v1, 0x14($s0)
/* 40C774 E01221D4 24510001 */  addiu     $s1, $v0, 0x1
/* 40C778 E01221D8 04610005 */  bgez      $v1, .LE01221F0
/* 40C77C E01221DC AE110018 */   sw       $s1, 0x18($s0)
/* 40C780 E01221E0 0C080128 */  jal       shim_remove_effect
/* 40C784 E01221E4 00000000 */   nop
/* 40C788 E01221E8 080489AB */  j         .LE01226AC
/* 40C78C E01221EC 00000000 */   nop
.LE01221F0:
/* 40C790 E01221F0 28620010 */  slti      $v0, $v1, 0x10
/* 40C794 E01221F4 10400002 */  beqz      $v0, .LE0122200
/* 40C798 E01221F8 00031100 */   sll      $v0, $v1, 4
/* 40C79C E01221FC AE020028 */  sw        $v0, 0x28($s0)
.LE0122200:
/* 40C7A0 E0122200 8E030070 */  lw        $v1, 0x70($s0)
/* 40C7A4 E0122204 24020004 */  addiu     $v0, $zero, 0x4
/* 40C7A8 E0122208 106200D5 */  beq       $v1, $v0, .LE0122560
/* 40C7AC E012220C 28620005 */   slti     $v0, $v1, 0x5
/* 40C7B0 E0122210 10400007 */  beqz      $v0, .LE0122230
/* 40C7B4 E0122214 24020005 */   addiu    $v0, $zero, 0x5
/* 40C7B8 E0122218 1060000B */  beqz      $v1, .LE0122248
/* 40C7BC E012221C 24020001 */   addiu    $v0, $zero, 0x1
/* 40C7C0 E0122220 10620096 */  beq       $v1, $v0, .LE012247C
/* 40C7C4 E0122224 00000000 */   nop
/* 40C7C8 E0122228 0804898B */  j         .LE012262C
/* 40C7CC E012222C 00000000 */   nop
.LE0122230:
/* 40C7D0 E0122230 106200FE */  beq       $v1, $v0, .LE012262C
/* 40C7D4 E0122234 24020064 */   addiu    $v0, $zero, 0x64
/* 40C7D8 E0122238 10620040 */  beq       $v1, $v0, .LE012233C
/* 40C7DC E012223C 00000000 */   nop
/* 40C7E0 E0122240 0804898B */  j         .LE012262C
/* 40C7E4 E0122244 00000000 */   nop
.LE0122248:
/* 40C7E8 E0122248 00111080 */  sll       $v0, $s1, 2
/* 40C7EC E012224C 00511021 */  addu      $v0, $v0, $s1
/* 40C7F0 E0122250 00021080 */  sll       $v0, $v0, 2
/* 40C7F4 E0122254 44826000 */  mtc1      $v0, $f12
/* 40C7F8 E0122258 00000000 */  nop
/* 40C7FC E012225C 46806320 */  cvt.s.w   $f12, $f12
/* 40C800 E0122260 32230003 */  andi      $v1, $s1, 0x3
/* 40C804 E0122264 00031100 */  sll       $v0, $v1, 4
/* 40C808 E0122268 00431023 */  subu      $v0, $v0, $v1
/* 40C80C E012226C 00021040 */  sll       $v0, $v0, 1
/* 40C810 E0122270 8E030074 */  lw        $v1, 0x74($s0)
/* 40C814 E0122274 244200C8 */  addiu     $v0, $v0, 0xC8
/* 40C818 E0122278 AE020050 */  sw        $v0, 0x50($s0)
/* 40C81C E012227C 24630001 */  addiu     $v1, $v1, 0x1
/* 40C820 E0122280 0C080140 */  jal       shim_sin_deg
/* 40C824 E0122284 AE030074 */   sw       $v1, 0x74($s0)
/* 40C828 E0122288 3C01E012 */  lui       $at, (0xE0122CA0 >> 16)
/* 40C82C E012228C D4222CA0 */  ldc1      $f2, (0xE0122CA0 & 0xFFFF)($at)
/* 40C830 E0122290 46000021 */  cvt.d.s   $f0, $f0
/* 40C834 E0122294 46220002 */  mul.d     $f0, $f0, $f2
/* 40C838 E0122298 00000000 */  nop
/* 40C83C E012229C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 40C840 E01222A0 44811800 */  mtc1      $at, $f3
/* 40C844 E01222A4 44801000 */  mtc1      $zero, $f2
/* 40C848 E01222A8 00000000 */  nop
/* 40C84C E01222AC 46220000 */  add.d     $f0, $f0, $f2
/* 40C850 E01222B0 8E020000 */  lw        $v0, 0x0($s0)
/* 40C854 E01222B4 46200020 */  cvt.s.d   $f0, $f0
/* 40C858 E01222B8 104000E8 */  beqz      $v0, .LE012265C
/* 40C85C E01222BC E6000040 */   swc1     $f0, 0x40($s0)
/* 40C860 E01222C0 44916000 */  mtc1      $s1, $f12
/* 40C864 E01222C4 00000000 */  nop
/* 40C868 E01222C8 0C080140 */  jal       shim_sin_deg
/* 40C86C E01222CC 46806320 */   cvt.s.w  $f12, $f12
/* 40C870 E01222D0 3C01E012 */  lui       $at, (0xE0122CA8 >> 16)
/* 40C874 E01222D4 D4222CA8 */  ldc1      $f2, (0xE0122CA8 & 0xFFFF)($at)
/* 40C878 E01222D8 44916000 */  mtc1      $s1, $f12
/* 40C87C E01222DC 00000000 */  nop
/* 40C880 E01222E0 46806321 */  cvt.d.w   $f12, $f12
/* 40C884 E01222E4 46226302 */  mul.d     $f12, $f12, $f2
/* 40C888 E01222E8 00000000 */  nop
/* 40C88C E01222EC C6020008 */  lwc1      $f2, 0x8($s0)
/* 40C890 E01222F0 46001080 */  add.s     $f2, $f2, $f0
/* 40C894 E01222F4 E6020008 */  swc1      $f2, 0x8($s0)
/* 40C898 E01222F8 0C080144 */  jal       shim_cos_deg
/* 40C89C E01222FC 46206320 */   cvt.s.d  $f12, $f12
/* 40C8A0 E0122300 C602000C */  lwc1      $f2, 0xC($s0)
/* 40C8A4 E0122304 8E020074 */  lw        $v0, 0x74($s0)
/* 40C8A8 E0122308 46001080 */  add.s     $f2, $f2, $f0
/* 40C8AC E012230C 28420033 */  slti      $v0, $v0, 0x33
/* 40C8B0 E0122310 144000D2 */  bnez      $v0, .LE012265C
/* 40C8B4 E0122314 E602000C */   swc1     $f2, 0xC($s0)
/* 40C8B8 E0122318 24020003 */  addiu     $v0, $zero, 0x3
/* 40C8BC E012231C 16420004 */  bne       $s2, $v0, .LE0122330
/* 40C8C0 E0122320 AE000074 */   sw       $zero, 0x74($s0)
/* 40C8C4 E0122324 24020064 */  addiu     $v0, $zero, 0x64
/* 40C8C8 E0122328 08048997 */  j         .LE012265C
/* 40C8CC E012232C AE020070 */   sw       $v0, 0x70($s0)
.LE0122330:
/* 40C8D0 E0122330 24020001 */  addiu     $v0, $zero, 0x1
/* 40C8D4 E0122334 08048997 */  j         .LE012265C
/* 40C8D8 E0122338 AE020070 */   sw       $v0, 0x70($s0)
.LE012233C:
/* 40C8DC E012233C 8E030074 */  lw        $v1, 0x74($s0)
/* 40C8E0 E0122340 10600005 */  beqz      $v1, .LE0122358
/* 40C8E4 E0122344 24020001 */   addiu    $v0, $zero, 0x1
/* 40C8E8 E0122348 10620007 */  beq       $v1, $v0, .LE0122368
/* 40C8EC E012234C 240200FF */   addiu    $v0, $zero, 0xFF
/* 40C8F0 E0122350 080488DF */  j         .LE012237C
/* 40C8F4 E0122354 AE00004C */   sw       $zero, 0x4C($s0)
.LE0122358:
/* 40C8F8 E0122358 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 40C8FC E012235C 44810000 */  mtc1      $at, $f0
/* 40C900 E0122360 080488DC */  j         .LE0122370
/* 40C904 E0122364 240200FF */   addiu    $v0, $zero, 0xFF
.LE0122368:
/* 40C908 E0122368 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 40C90C E012236C 44810000 */  mtc1      $at, $f0
.LE0122370:
/* 40C910 E0122370 AE02005C */  sw        $v0, 0x5C($s0)
/* 40C914 E0122374 080488E0 */  j         .LE0122380
/* 40C918 E0122378 E600004C */   swc1     $f0, 0x4C($s0)
.LE012237C:
/* 40C91C E012237C AE00005C */  sw        $zero, 0x5C($s0)
.LE0122380:
/* 40C920 E0122380 8E040074 */  lw        $a0, 0x74($s0)
/* 40C924 E0122384 2882001E */  slti      $v0, $a0, 0x1E
/* 40C928 E0122388 10400017 */  beqz      $v0, .LE01223E8
/* 40C92C E012238C 00041880 */   sll      $v1, $a0, 2
/* 40C930 E0122390 3C02E012 */  lui       $v0, %hi(D_E0122BA8)
/* 40C934 E0122394 24422BA8 */  addiu     $v0, $v0, %lo(D_E0122BA8)
/* 40C938 E0122398 00621821 */  addu      $v1, $v1, $v0
/* 40C93C E012239C 94620000 */  lhu       $v0, 0x0($v1)
/* 40C940 E01223A0 3C01E012 */  lui       $at, (0xE0122CB0 >> 16)
/* 40C944 E01223A4 D4202CB0 */  ldc1      $f0, (0xE0122CB0 & 0xFFFF)($at)
/* 40C948 E01223A8 44821000 */  mtc1      $v0, $f2
/* 40C94C E01223AC 00000000 */  nop
/* 40C950 E01223B0 468010A0 */  cvt.s.w   $f2, $f2
/* 40C954 E01223B4 460010A1 */  cvt.d.s   $f2, $f2
/* 40C958 E01223B8 46201082 */  mul.d     $f2, $f2, $f0
/* 40C95C E01223BC 00000000 */  nop
/* 40C960 E01223C0 3C01E012 */  lui       $at, (0xE0122CB8 >> 16)
/* 40C964 E01223C4 D4242CB8 */  ldc1      $f4, (0xE0122CB8 & 0xFFFF)($at)
/* 40C968 E01223C8 44840000 */  mtc1      $a0, $f0
/* 40C96C E01223CC 00000000 */  nop
/* 40C970 E01223D0 46800021 */  cvt.d.w   $f0, $f0
/* 40C974 E01223D4 46240002 */  mul.d     $f0, $f0, $f4
/* 40C978 E01223D8 00000000 */  nop
/* 40C97C E01223DC 90620003 */  lbu       $v0, 0x3($v1)
/* 40C980 E01223E0 0804890E */  j         .LE0122438
/* 40C984 E01223E4 46201080 */   add.d    $f2, $f2, $f0
.LE01223E8:
/* 40C988 E01223E8 3C03E012 */  lui       $v1, %hi(D_E0122BA8)
/* 40C98C E01223EC 24632BA8 */  addiu     $v1, $v1, %lo(D_E0122BA8)
/* 40C990 E01223F0 94620074 */  lhu       $v0, 0x74($v1)
/* 40C994 E01223F4 3C01E012 */  lui       $at, (0xE0122CC0 >> 16)
/* 40C998 E01223F8 D4202CC0 */  ldc1      $f0, (0xE0122CC0 & 0xFFFF)($at)
/* 40C99C E01223FC 44821000 */  mtc1      $v0, $f2
/* 40C9A0 E0122400 00000000 */  nop
/* 40C9A4 E0122404 468010A0 */  cvt.s.w   $f2, $f2
/* 40C9A8 E0122408 460010A1 */  cvt.d.s   $f2, $f2
/* 40C9AC E012240C 46201082 */  mul.d     $f2, $f2, $f0
/* 40C9B0 E0122410 00000000 */  nop
/* 40C9B4 E0122414 3C01E012 */  lui       $at, (0xE0122CC8 >> 16)
/* 40C9B8 E0122418 D4242CC8 */  ldc1      $f4, (0xE0122CC8 & 0xFFFF)($at)
/* 40C9BC E012241C 44840000 */  mtc1      $a0, $f0
/* 40C9C0 E0122420 00000000 */  nop
/* 40C9C4 E0122424 46800021 */  cvt.d.w   $f0, $f0
/* 40C9C8 E0122428 46240002 */  mul.d     $f0, $f0, $f4
/* 40C9CC E012242C 00000000 */  nop
/* 40C9D0 E0122430 46201080 */  add.d     $f2, $f2, $f0
/* 40C9D4 E0122434 90620077 */  lbu       $v0, 0x77($v1)
.LE0122438:
/* 40C9D8 E0122438 46201020 */  cvt.s.d   $f0, $f2
/* 40C9DC E012243C 3C01E012 */  lui       $at, (0xE0122CD0 >> 16)
/* 40C9E0 E0122440 D4222CD0 */  ldc1      $f2, (0xE0122CD0 & 0xFFFF)($at)
/* 40C9E4 E0122444 304200FF */  andi      $v0, $v0, 0xFF
/* 40C9E8 E0122448 AE020054 */  sw        $v0, 0x54($s0)
/* 40C9EC E012244C AE020058 */  sw        $v0, 0x58($s0)
/* 40C9F0 E0122450 8E020074 */  lw        $v0, 0x74($s0)
/* 40C9F4 E0122454 E6000044 */  swc1      $f0, 0x44($s0)
/* 40C9F8 E0122458 46000021 */  cvt.d.s   $f0, $f0
/* 40C9FC E012245C AE000050 */  sw        $zero, 0x50($s0)
/* 40CA00 E0122460 AE000040 */  sw        $zero, 0x40($s0)
/* 40CA04 E0122464 46220000 */  add.d     $f0, $f0, $f2
/* 40CA08 E0122468 24420001 */  addiu     $v0, $v0, 0x1
/* 40CA0C E012246C AE020074 */  sw        $v0, 0x74($s0)
/* 40CA10 E0122470 46200020 */  cvt.s.d   $f0, $f0
/* 40CA14 E0122474 08048997 */  j         .LE012265C
/* 40CA18 E0122478 E6000048 */   swc1     $f0, 0x48($s0)
.LE012247C:
/* 40CA1C E012247C 8E020074 */  lw        $v0, 0x74($s0)
/* 40CA20 E0122480 10400005 */  beqz      $v0, .LE0122498
/* 40CA24 E0122484 00000000 */   nop
/* 40CA28 E0122488 10430007 */  beq       $v0, $v1, .LE01224A8
/* 40CA2C E012248C 240200FF */   addiu    $v0, $zero, 0xFF
/* 40CA30 E0122490 0804892F */  j         .LE01224BC
/* 40CA34 E0122494 AE00004C */   sw       $zero, 0x4C($s0)
.LE0122498:
/* 40CA38 E0122498 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 40CA3C E012249C 44810000 */  mtc1      $at, $f0
/* 40CA40 E01224A0 0804892C */  j         .LE01224B0
/* 40CA44 E01224A4 240200FF */   addiu    $v0, $zero, 0xFF
.LE01224A8:
/* 40CA48 E01224A8 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 40CA4C E01224AC 44810000 */  mtc1      $at, $f0
.LE01224B0:
/* 40CA50 E01224B0 AE02005C */  sw        $v0, 0x5C($s0)
/* 40CA54 E01224B4 08048930 */  j         .LE01224C0
/* 40CA58 E01224B8 E600004C */   swc1     $f0, 0x4C($s0)
.LE01224BC:
/* 40CA5C E01224BC AE00005C */  sw        $zero, 0x5C($s0)
.LE01224C0:
/* 40CA60 E01224C0 8E030074 */  lw        $v1, 0x74($s0)
/* 40CA64 E01224C4 3C02E012 */  lui       $v0, %hi(D_E0122BA8)
/* 40CA68 E01224C8 24422BA8 */  addiu     $v0, $v0, %lo(D_E0122BA8)
/* 40CA6C E01224CC 00031880 */  sll       $v1, $v1, 2
/* 40CA70 E01224D0 00621821 */  addu      $v1, $v1, $v0
/* 40CA74 E01224D4 94620000 */  lhu       $v0, 0x0($v1)
/* 40CA78 E01224D8 3C01E012 */  lui       $at, (0xE0122CD8 >> 16)
/* 40CA7C E01224DC D4202CD8 */  ldc1      $f0, (0xE0122CD8 & 0xFFFF)($at)
/* 40CA80 E01224E0 44821000 */  mtc1      $v0, $f2
/* 40CA84 E01224E4 00000000 */  nop
/* 40CA88 E01224E8 468010A0 */  cvt.s.w   $f2, $f2
/* 40CA8C E01224EC 460010A1 */  cvt.d.s   $f2, $f2
/* 40CA90 E01224F0 46201082 */  mul.d     $f2, $f2, $f0
/* 40CA94 E01224F4 00000000 */  nop
/* 40CA98 E01224F8 3C01E012 */  lui       $at, (0xE0122CE0 >> 16)
/* 40CA9C E01224FC D4242CE0 */  ldc1      $f4, (0xE0122CE0 & 0xFFFF)($at)
/* 40CAA0 E0122500 90630003 */  lbu       $v1, 0x3($v1)
/* 40CAA4 E0122504 AE000050 */  sw        $zero, 0x50($s0)
/* 40CAA8 E0122508 AE000040 */  sw        $zero, 0x40($s0)
/* 40CAAC E012250C 462010A0 */  cvt.s.d   $f2, $f2
/* 40CAB0 E0122510 46001021 */  cvt.d.s   $f0, $f2
/* 40CAB4 E0122514 46240002 */  mul.d     $f0, $f0, $f4
/* 40CAB8 E0122518 00000000 */  nop
/* 40CABC E012251C 8E020074 */  lw        $v0, 0x74($s0)
/* 40CAC0 E0122520 306300FF */  andi      $v1, $v1, 0xFF
/* 40CAC4 E0122524 AE030054 */  sw        $v1, 0x54($s0)
/* 40CAC8 E0122528 AE030058 */  sw        $v1, 0x58($s0)
/* 40CACC E012252C 3C014010 */  lui       $at, (0x40100000 >> 16)
/* 40CAD0 E0122530 44812800 */  mtc1      $at, $f5
/* 40CAD4 E0122534 44802000 */  mtc1      $zero, $f4
/* 40CAD8 E0122538 24420001 */  addiu     $v0, $v0, 0x1
/* 40CADC E012253C AE020074 */  sw        $v0, 0x74($s0)
/* 40CAE0 E0122540 46240000 */  add.d     $f0, $f0, $f4
/* 40CAE4 E0122544 2842001E */  slti      $v0, $v0, 0x1E
/* 40CAE8 E0122548 E6020044 */  swc1      $f2, 0x44($s0)
/* 40CAEC E012254C 46200020 */  cvt.s.d   $f0, $f0
/* 40CAF0 E0122550 14400042 */  bnez      $v0, .LE012265C
/* 40CAF4 E0122554 E6000048 */   swc1     $f0, 0x48($s0)
/* 40CAF8 E0122558 08048988 */  j         .LE0122620
/* 40CAFC E012255C 24020004 */   addiu    $v0, $zero, 0x4
.LE0122560:
/* 40CB00 E0122560 8E030074 */  lw        $v1, 0x74($s0)
/* 40CB04 E0122564 2402001D */  addiu     $v0, $zero, 0x1D
/* 40CB08 E0122568 00431823 */  subu      $v1, $v0, $v1
/* 40CB0C E012256C 10600005 */  beqz      $v1, .LE0122584
/* 40CB10 E0122570 24020001 */   addiu    $v0, $zero, 0x1
/* 40CB14 E0122574 10620007 */  beq       $v1, $v0, .LE0122594
/* 40CB18 E0122578 240200FF */   addiu    $v0, $zero, 0xFF
/* 40CB1C E012257C 0804896A */  j         .LE01225A8
/* 40CB20 E0122580 AE00004C */   sw       $zero, 0x4C($s0)
.LE0122584:
/* 40CB24 E0122584 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 40CB28 E0122588 44810000 */  mtc1      $at, $f0
/* 40CB2C E012258C 08048967 */  j         .LE012259C
/* 40CB30 E0122590 240200FF */   addiu    $v0, $zero, 0xFF
.LE0122594:
/* 40CB34 E0122594 3C014100 */  lui       $at, (0x41000000 >> 16)
/* 40CB38 E0122598 44810000 */  mtc1      $at, $f0
.LE012259C:
/* 40CB3C E012259C AE02005C */  sw        $v0, 0x5C($s0)
/* 40CB40 E01225A0 0804896B */  j         .LE01225AC
/* 40CB44 E01225A4 E600004C */   swc1     $f0, 0x4C($s0)
.LE01225A8:
/* 40CB48 E01225A8 AE00005C */  sw        $zero, 0x5C($s0)
.LE01225AC:
/* 40CB4C E01225AC 3C03E012 */  lui       $v1, %hi(D_E0122C20)
/* 40CB50 E01225B0 24632C20 */  addiu     $v1, $v1, %lo(D_E0122C20)
/* 40CB54 E01225B4 8E020074 */  lw        $v0, 0x74($s0)
/* 40CB58 E01225B8 3C01E012 */  lui       $at, (0xE0122CE8 >> 16)
/* 40CB5C E01225BC D4222CE8 */  ldc1      $f2, (0xE0122CE8 & 0xFFFF)($at)
/* 40CB60 E01225C0 00021080 */  sll       $v0, $v0, 2
/* 40CB64 E01225C4 00431021 */  addu      $v0, $v0, $v1
/* 40CB68 E01225C8 94430000 */  lhu       $v1, 0x0($v0)
/* 40CB6C E01225CC 90440003 */  lbu       $a0, 0x3($v0)
/* 40CB70 E01225D0 8E020074 */  lw        $v0, 0x74($s0)
/* 40CB74 E01225D4 AE000050 */  sw        $zero, 0x50($s0)
/* 40CB78 E01225D8 AE000040 */  sw        $zero, 0x40($s0)
/* 40CB7C E01225DC 44830000 */  mtc1      $v1, $f0
/* 40CB80 E01225E0 00000000 */  nop
/* 40CB84 E01225E4 46800020 */  cvt.s.w   $f0, $f0
/* 40CB88 E01225E8 46000021 */  cvt.d.s   $f0, $f0
/* 40CB8C E01225EC 46220002 */  mul.d     $f0, $f0, $f2
/* 40CB90 E01225F0 00000000 */  nop
/* 40CB94 E01225F4 AE000058 */  sw        $zero, 0x58($s0)
/* 40CB98 E01225F8 AE000048 */  sw        $zero, 0x48($s0)
/* 40CB9C E01225FC 24420001 */  addiu     $v0, $v0, 0x1
/* 40CBA0 E0122600 308400FF */  andi      $a0, $a0, 0xFF
/* 40CBA4 E0122604 AE020074 */  sw        $v0, 0x74($s0)
/* 40CBA8 E0122608 2842001E */  slti      $v0, $v0, 0x1E
/* 40CBAC E012260C AE040054 */  sw        $a0, 0x54($s0)
/* 40CBB0 E0122610 46200020 */  cvt.s.d   $f0, $f0
/* 40CBB4 E0122614 14400011 */  bnez      $v0, .LE012265C
/* 40CBB8 E0122618 E6000044 */   swc1     $f0, 0x44($s0)
/* 40CBBC E012261C 24020005 */  addiu     $v0, $zero, 0x5
.LE0122620:
/* 40CBC0 E0122620 AE000074 */  sw        $zero, 0x74($s0)
/* 40CBC4 E0122624 08048997 */  j         .LE012265C
/* 40CBC8 E0122628 AE020070 */   sw       $v0, 0x70($s0)
.LE012262C:
/* 40CBCC E012262C 8E020074 */  lw        $v0, 0x74($s0)
/* 40CBD0 E0122630 AE000040 */  sw        $zero, 0x40($s0)
/* 40CBD4 E0122634 AE000044 */  sw        $zero, 0x44($s0)
/* 40CBD8 E0122638 AE000048 */  sw        $zero, 0x48($s0)
/* 40CBDC E012263C AE000050 */  sw        $zero, 0x50($s0)
/* 40CBE0 E0122640 AE000054 */  sw        $zero, 0x54($s0)
/* 40CBE4 E0122644 AE000058 */  sw        $zero, 0x58($s0)
/* 40CBE8 E0122648 AE00004C */  sw        $zero, 0x4C($s0)
/* 40CBEC E012264C AE00005C */  sw        $zero, 0x5C($s0)
/* 40CBF0 E0122650 AE00004C */  sw        $zero, 0x4C($s0)
/* 40CBF4 E0122654 24420001 */  addiu     $v0, $v0, 0x1
/* 40CBF8 E0122658 AE020074 */  sw        $v0, 0x74($s0)
.LE012265C:
/* 40CBFC E012265C 0000202D */  daddu     $a0, $zero, $zero
/* 40CC00 E0122660 240500FF */  addiu     $a1, $zero, 0xFF
/* 40CC04 E0122664 44801000 */  mtc1      $zero, $f2
/* 40CC08 E0122668 0200182D */  daddu     $v1, $s0, $zero
.LE012266C:
/* 40CC0C E012266C 8C620050 */  lw        $v0, 0x50($v1)
/* 40CC10 E0122670 28420100 */  slti      $v0, $v0, 0x100
/* 40CC14 E0122674 50400001 */  beql      $v0, $zero, .LE012267C
/* 40CC18 E0122678 AC650050 */   sw       $a1, 0x50($v1)
.LE012267C:
/* 40CC1C E012267C 8C620050 */  lw        $v0, 0x50($v1)
/* 40CC20 E0122680 04420001 */  bltzl     $v0, .LE0122688
/* 40CC24 E0122684 AC600050 */   sw       $zero, 0x50($v1)
.LE0122688:
/* 40CC28 E0122688 C4600040 */  lwc1      $f0, 0x40($v1)
/* 40CC2C E012268C 4602003C */  c.lt.s    $f0, $f2
/* 40CC30 E0122690 00000000 */  nop
/* 40CC34 E0122694 45030001 */  bc1tl     .LE012269C
/* 40CC38 E0122698 E4620040 */   swc1     $f2, 0x40($v1)
.LE012269C:
/* 40CC3C E012269C 24840001 */  addiu     $a0, $a0, 0x1
/* 40CC40 E01226A0 28820004 */  slti      $v0, $a0, 0x4
/* 40CC44 E01226A4 1440FFF1 */  bnez      $v0, .LE012266C
/* 40CC48 E01226A8 24630004 */   addiu    $v1, $v1, 0x4
.LE01226AC:
/* 40CC4C E01226AC 8FBF001C */  lw        $ra, 0x1C($sp)
/* 40CC50 E01226B0 8FB20018 */  lw        $s2, 0x18($sp)
/* 40CC54 E01226B4 8FB10014 */  lw        $s1, 0x14($sp)
/* 40CC58 E01226B8 8FB00010 */  lw        $s0, 0x10($sp)
/* 40CC5C E01226BC 03E00008 */  jr        $ra
/* 40CC60 E01226C0 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void star_spirits_energy_update(EffectInstance* effect) {
    StarSpiritsEnergyFXData* data = effect->data.starSpiritsEnergy;
    s32 unk_04 = data->unk_04;
    s32 unk_18;
    s32 i;
    f32 var_float_1;
    f32 var_float_2;
    f32 var_float_3;
    u8 var_int_1;
    u8 var_int_2;
    u8 var_int_3;

    if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
        effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        data->unk_14 = 16;
    }

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

    data->unk_18++;

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

    unk_18 = data->unk_18;

    if (data->unk_14 < 16) {
        data->unk_28 = data->unk_14 * 16;
    }

    switch (data->unk_70) {
        case 0:
            data->unk_50[0] = (unk_18 & 3) * 30 + 200;
            data->unk_74++;
            data->unk_40[0] = shim_sin_deg(unk_18 * 20) * 0.04 + 0.5;
            if (data->unk_00 != 0) {
                data->unk_08 += shim_sin_deg(unk_18);
                data->unk_0C += shim_cos_deg(unk_18 * 1.235631);
                if (data->unk_74 > 50) {
                    data->unk_74 = 0;
                    if (unk_04 == 3) {
                        data->unk_70 = 100;
                    } else {
                        data->unk_70 = 1;
                    }
                }
            }
            break;
        case 100:
            switch (data->unk_74) {
                case 0:
                    data->unk_40[3] = 4.0f;
                    data->unk_50[3] = 255;
                    break;
                case 1:
                    data->unk_40[3] = 8.0f;
                    data->unk_50[3] = 255;
                    break;
                default:
                    data->unk_40[3] = 0.0f;
                    data->unk_50[3] = 0;
                    break;
            }
            if (data->unk_74 < 30) {
                var_float_1 = (f32) D_E0122BA8[data->unk_74].unk_00 * 0.01 + data->unk_74 * 0.3;
                var_int_1 = D_E0122BA8[data->unk_74].unk_03;
            } else {
                var_float_1 = (f32) D_E0122BA8[29].unk_00 * 0.01 + data->unk_74 * 0.3;
                var_int_1 = D_E0122BA8[29].unk_03;
            }
            data->unk_40[0] = data->unk_50[0] = 0;
            data->unk_50[1] = var_int_1;
            data->unk_50[2] = var_int_1;
            data->unk_40[1] = var_float_1;
            data->unk_40[2] = var_float_1 + 0.6;
            data->unk_74++;
            break;
        case 1:
            switch (data->unk_74) {
                case 0:
                    data->unk_40[3] = 4.0f;
                    data->unk_50[3] = 255;
                    break;
                case 1:
                    data->unk_40[3] = 8.0f;
                    data->unk_50[3] = 255;
                    break;
                default:
                    data->unk_40[3] = 0.0f;
                    data->unk_50[3] = 0;
                    break;
            }
            var_float_2 = (f32) D_E0122BA8[data->unk_74].unk_00 * 0.01;
            var_int_2 = D_E0122BA8[data->unk_74].unk_03;

            data->unk_40[0] = data->unk_50[0] = 0;
            data->unk_50[1] = var_int_2;
            data->unk_50[2] = var_int_2;
            data->unk_40[1] = var_float_2;
            data->unk_40[2] = var_float_2 * 1.2 + 4.0;
            data->unk_74++;
            if (data->unk_74 >= 30) {
                data->unk_74 = 0;
                data->unk_70 = 4;
            }
            break;
        case 4:
            switch (29 - data->unk_74) {
                case 0:
                    data->unk_40[3] = 4.0f;
                    data->unk_50[3] = 255;
                    break;
                case 1:
                    data->unk_40[3] = 8.0f;
                    data->unk_50[3] = 255;
                    break;
                default:
                    data->unk_40[3] = 0;
                    data->unk_50[3] = 0;
                    break;
            }
            var_float_3 = (f32) D_E0122C20[data->unk_74].unk_00 * 0.01;
            var_int_3 = D_E0122C20[data->unk_74].unk_03;
            data->unk_40[0] = data->unk_50[0] = 0;
            data->unk_50[1] = var_int_3;
            data->unk_50[2] = 0;
            data->unk_40[1] = var_float_3;
            data->unk_40[2] = 0.0f;
            data->unk_74++;
            if (data->unk_74 >= 30) {
                data->unk_74 = 0;
                data->unk_70 = 5;
            }
            break;
        case 5:
        default:
            data->unk_40[0] = 0.0f;
            data->unk_40[1] = 0.0f;
            data->unk_40[2] = 0.0f;
            data->unk_50[0] = 0;
            data->unk_50[1] = 0;
            data->unk_50[2] = 0;
            data->unk_40[3] = 0;
            data->unk_50[3] = 0;
            data->unk_40[3] = 0;
            data->unk_74++;
            break;
    }

    for (i = 0; i < 4; i++) {
        if (data->unk_50[i] > 255) {
            data->unk_50[i] = 255;
        }
        if (data->unk_50[i] < 0) {
            data->unk_50[i] = 0;
        }
        if (data->unk_40[i] < 0.0f) {
            data->unk_40[i] = 0.0f;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel gfx_task_main
/* 1564 80026164 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 1568 80026168 3C048007 */  lui       $a0, %hi(gCurrentDisplayContextIndex)
/* 156C 8002616C 8C8441F4 */  lw        $a0, %lo(gCurrentDisplayContextIndex)($a0)
/* 1570 80026170 3C058016 */  lui       $a1, %hi(D_80164000)
/* 1574 80026174 24A54000 */  addiu     $a1, $a1, %lo(D_80164000)
/* 1578 80026178 AFB20020 */  sw        $s2, 0x20($sp)
/* 157C 8002617C 3C12800A */  lui       $s2, %hi(gMainGfxPos)
/* 1580 80026180 2652A66C */  addiu     $s2, $s2, %lo(gMainGfxPos)
/* 1584 80026184 AFBF003C */  sw        $ra, 0x3C($sp)
/* 1588 80026188 AFBE0038 */  sw        $fp, 0x38($sp)
/* 158C 8002618C AFB70034 */  sw        $s7, 0x34($sp)
/* 1590 80026190 AFB60030 */  sw        $s6, 0x30($sp)
/* 1594 80026194 AFB5002C */  sw        $s5, 0x2C($sp)
/* 1598 80026198 AFB40028 */  sw        $s4, 0x28($sp)
/* 159C 8002619C AFB30024 */  sw        $s3, 0x24($sp)
/* 15A0 800261A0 AFB1001C */  sw        $s1, 0x1C($sp)
/* 15A4 800261A4 AFB00018 */  sw        $s0, 0x18($sp)
/* 15A8 800261A8 3C018007 */  lui       $at, %hi(gMatrixListPos)
/* 15AC 800261AC A42041F0 */  sh        $zero, %lo(gMatrixListPos)($at)
/* 15B0 800261B0 00041040 */  sll       $v0, $a0, 1
/* 15B4 800261B4 00441021 */  addu      $v0, $v0, $a0
/* 15B8 800261B8 000210C0 */  sll       $v0, $v0, 3
/* 15BC 800261BC 00441021 */  addu      $v0, $v0, $a0
/* 15C0 800261C0 00021980 */  sll       $v1, $v0, 6
/* 15C4 800261C4 00431021 */  addu      $v0, $v0, $v1
/* 15C8 800261C8 00021080 */  sll       $v0, $v0, 2
/* 15CC 800261CC 00441023 */  subu      $v0, $v0, $a0
/* 15D0 800261D0 00021100 */  sll       $v0, $v0, 4
/* 15D4 800261D4 00451021 */  addu      $v0, $v0, $a1
/* 15D8 800261D8 3C01800A */  lui       $at, %hi(gDisplayContext)
/* 15DC 800261DC AC22A674 */  sw        $v0, %lo(gDisplayContext)($at)
/* 15E0 800261E0 24420230 */  addiu     $v0, $v0, 0x230
/* 15E4 800261E4 AE420000 */  sw        $v0, 0x0($s2)
/* 15E8 800261E8 3C118007 */  lui       $s1, %hi(D_80073E04)
/* 15EC 800261EC 8E313E04 */  lw        $s1, %lo(D_80073E04)($s1)
/* 15F0 800261F0 0C009C68 */  jal       gfx_init_state
/* 15F4 800261F4 3C13070F */   lui      $s3, (0x70FE01C >> 16)
/* 15F8 800261F8 3C06FF10 */  lui       $a2, (0xFF10013F >> 16)
/* 15FC 800261FC 34C6013F */  ori       $a2, $a2, (0xFF10013F & 0xFFFF)
/* 1600 80026200 3C02FE00 */  lui       $v0, (0xFE000000 >> 16)
/* 1604 80026204 8E500000 */  lw        $s0, 0x0($s2)
/* 1608 80026208 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 160C 8002620C 0200282D */  daddu     $a1, $s0, $zero
/* 1610 80026210 26100008 */  addiu     $s0, $s0, 0x8
/* 1614 80026214 AE500000 */  sw        $s0, 0x0($s2)
/* 1618 80026218 ACA20000 */  sw        $v0, 0x0($a1)
/* 161C 8002621C 3C02800A */  lui       $v0, %hi(nuGfxZBuffer)
/* 1620 80026220 8C42A5DC */  lw        $v0, %lo(nuGfxZBuffer)($v0)
/* 1624 80026224 0220202D */  daddu     $a0, $s1, $zero
/* 1628 80026228 00431021 */  addu      $v0, $v0, $v1
/* 162C 8002622C ACA20004 */  sw        $v0, 0x4($a1)
/* 1630 80026230 26020008 */  addiu     $v0, $s0, 0x8
/* 1634 80026234 AE420000 */  sw        $v0, 0x0($s2)
/* 1638 80026238 0C0187A4 */  jal       osVirtualToPhysical
/* 163C 8002623C AE060000 */   sw       $a2, 0x0($s0)
/* 1640 80026240 3C050050 */  lui       $a1, (0x5003C0 >> 16)
/* 1644 80026244 34A503C0 */  ori       $a1, $a1, (0x5003C0 & 0xFFFF)
/* 1648 80026248 3C06D700 */  lui       $a2, (0xD7000002 >> 16)
/* 164C 8002624C 34C60002 */  ori       $a2, $a2, (0xD7000002 & 0xFFFF)
/* 1650 80026250 3C07E300 */  lui       $a3, (0xE3000A01 >> 16)
/* 1654 80026254 34E70A01 */  ori       $a3, $a3, (0xE3000A01 & 0xFFFF)
/* 1658 80026258 3C08E300 */  lui       $t0, (0xE3000C00 >> 16)
/* 165C 8002625C 35080C00 */  ori       $t0, $t0, (0xE3000C00 & 0xFFFF)
/* 1660 80026260 3C09E300 */  lui       $t1, (0xE3001001 >> 16)
/* 1664 80026264 35291001 */  ori       $t1, $t1, (0xE3001001 & 0xFFFF)
/* 1668 80026268 3C0BE200 */  lui       $t3, (0xE200001C >> 16)
/* 166C 8002626C 356B001C */  ori       $t3, $t3, (0xE200001C & 0xFFFF)
/* 1670 80026270 3C0A0F0A */  lui       $t2, (0xF0A4000 >> 16)
/* 1674 80026274 354A4000 */  ori       $t2, $t2, (0xF0A4000 & 0xFFFF)
/* 1678 80026278 3C0CE300 */  lui       $t4, (0xE3001201 >> 16)
/* 167C 8002627C 358C1201 */  ori       $t4, $t4, (0xE3001201 & 0xFFFF)
/* 1680 80026280 3C0DFCFF */  lui       $t5, (0xFCFFFFFF >> 16)
/* 1684 80026284 35ADFFFF */  ori       $t5, $t5, (0xFCFFFFFF & 0xFFFF)
/* 1688 80026288 3C0EE200 */  lui       $t6, (0xE2001E01 >> 16)
/* 168C 8002628C 35CE1E01 */  ori       $t6, $t6, (0xE2001E01 & 0xFFFF)
/* 1690 80026290 3C0FFD88 */  lui       $t7, (0xFD88003F >> 16)
/* 1694 80026294 35EF003F */  ori       $t7, $t7, (0xFD88003F & 0xFFFF)
/* 1698 80026298 3C11F588 */  lui       $s1, (0xF5881000 >> 16)
/* 169C 8002629C 36311000 */  ori       $s1, $s1, (0xF5881000 & 0xFFFF)
/* 16A0 800262A0 3673E01C */  ori       $s3, $s3, (0x70FE01C & 0xFFFF)
/* 16A4 800262A4 3C14F580 */  lui       $s4, (0xF5801000 >> 16)
/* 16A8 800262A8 36941000 */  ori       $s4, $s4, (0xF5801000 & 0xFFFF)
/* 16AC 800262AC 3C15001F */  lui       $s5, (0x1FC01C >> 16)
/* 16B0 800262B0 36B5C01C */  ori       $s5, $s5, (0x1FC01C & 0xFFFF)
/* 16B4 800262B4 0000B02D */  daddu     $s6, $zero, $zero
/* 16B8 800262B8 3C17E400 */  lui       $s7, (0xE4000000 >> 16)
/* 16BC 800262BC 3C19E100 */  lui       $t9, (0xE1000000 >> 16)
/* 16C0 800262C0 3C18F100 */  lui       $t8, (0xF1000000 >> 16)
/* 16C4 800262C4 8E430000 */  lw        $v1, 0x0($s2)
/* 16C8 800262C8 241E0098 */  addiu     $fp, $zero, 0x98
/* 16CC 800262CC AE020004 */  sw        $v0, 0x4($s0)
/* 16D0 800262D0 3C02ED00 */  lui       $v0, (0xED000000 >> 16)
/* 16D4 800262D4 0060202D */  daddu     $a0, $v1, $zero
/* 16D8 800262D8 24630008 */  addiu     $v1, $v1, 0x8
/* 16DC 800262DC AE430000 */  sw        $v1, 0x0($s2)
/* 16E0 800262E0 AC820000 */  sw        $v0, 0x0($a0)
/* 16E4 800262E4 24620008 */  addiu     $v0, $v1, 0x8
/* 16E8 800262E8 AC850004 */  sw        $a1, 0x4($a0)
/* 16EC 800262EC AE420000 */  sw        $v0, 0x0($s2)
/* 16F0 800262F0 2402FFFF */  addiu     $v0, $zero, -0x1
/* 16F4 800262F4 AC620004 */  sw        $v0, 0x4($v1)
/* 16F8 800262F8 24620010 */  addiu     $v0, $v1, 0x10
/* 16FC 800262FC AC660000 */  sw        $a2, 0x0($v1)
/* 1700 80026300 AE420000 */  sw        $v0, 0x0($s2)
/* 1704 80026304 24620018 */  addiu     $v0, $v1, 0x18
/* 1708 80026308 AC670008 */  sw        $a3, 0x8($v1)
/* 170C 8002630C AC60000C */  sw        $zero, 0xC($v1)
/* 1710 80026310 AE420000 */  sw        $v0, 0x0($s2)
/* 1714 80026314 24620020 */  addiu     $v0, $v1, 0x20
/* 1718 80026318 AC680010 */  sw        $t0, 0x10($v1)
/* 171C 8002631C AC600014 */  sw        $zero, 0x14($v1)
/* 1720 80026320 AE420000 */  sw        $v0, 0x0($s2)
/* 1724 80026324 24620028 */  addiu     $v0, $v1, 0x28
/* 1728 80026328 AC690018 */  sw        $t1, 0x18($v1)
/* 172C 8002632C AC60001C */  sw        $zero, 0x1C($v1)
/* 1730 80026330 AE420000 */  sw        $v0, 0x0($s2)
/* 1734 80026334 24620030 */  addiu     $v0, $v1, 0x30
/* 1738 80026338 AC6B0020 */  sw        $t3, 0x20($v1)
/* 173C 8002633C AC6A0024 */  sw        $t2, 0x24($v1)
/* 1740 80026340 AE420000 */  sw        $v0, 0x0($s2)
/* 1744 80026344 24620038 */  addiu     $v0, $v1, 0x38
/* 1748 80026348 AC6C0028 */  sw        $t4, 0x28($v1)
/* 174C 8002634C AC60002C */  sw        $zero, 0x2C($v1)
/* 1750 80026350 AE420000 */  sw        $v0, 0x0($s2)
/* 1754 80026354 2402F3F9 */  addiu     $v0, $zero, -0xC07
/* 1758 80026358 AC620034 */  sw        $v0, 0x34($v1)
/* 175C 8002635C 24620040 */  addiu     $v0, $v1, 0x40
/* 1760 80026360 AC6D0030 */  sw        $t5, 0x30($v1)
/* 1764 80026364 AE420000 */  sw        $v0, 0x0($s2)
/* 1768 80026368 24020001 */  addiu     $v0, $zero, 0x1
/* 176C 8002636C AC62003C */  sw        $v0, 0x3C($v1)
/* 1770 80026370 24620048 */  addiu     $v0, $v1, 0x48
/* 1774 80026374 AC6E0038 */  sw        $t6, 0x38($v1)
/* 1778 80026378 AE420000 */  sw        $v0, 0x0($s2)
/* 177C 8002637C 3C02F900 */  lui       $v0, (0xF9000000 >> 16)
/* 1780 80026380 AC620040 */  sw        $v0, 0x40($v1)
/* 1784 80026384 2402007F */  addiu     $v0, $zero, 0x7F
/* 1788 80026388 AC620044 */  sw        $v0, 0x44($v1)
/* 178C 8002638C 24620050 */  addiu     $v0, $v1, 0x50
/* 1790 80026390 AE420000 */  sw        $v0, 0x0($s2)
/* 1794 80026394 3C028007 */  lui       $v0, %hi(D_80073E10)
/* 1798 80026398 24423E10 */  addiu     $v0, $v0, %lo(D_80073E10)
/* 179C 8002639C AC6F0048 */  sw        $t7, 0x48($v1)
/* 17A0 800263A0 AC62004C */  sw        $v0, 0x4C($v1)
/* 17A4 800263A4 24620058 */  addiu     $v0, $v1, 0x58
/* 17A8 800263A8 AE420000 */  sw        $v0, 0x0($s2)
/* 17AC 800263AC 3C020700 */  lui       $v0, (0x7000000 >> 16)
/* 17B0 800263B0 AC620054 */  sw        $v0, 0x54($v1)
/* 17B4 800263B4 24620060 */  addiu     $v0, $v1, 0x60
/* 17B8 800263B8 AC710050 */  sw        $s1, 0x50($v1)
/* 17BC 800263BC AE420000 */  sw        $v0, 0x0($s2)
/* 17C0 800263C0 3C02E600 */  lui       $v0, (0xE6000000 >> 16)
/* 17C4 800263C4 AC620058 */  sw        $v0, 0x58($v1)
/* 17C8 800263C8 24620068 */  addiu     $v0, $v1, 0x68
/* 17CC 800263CC AC60005C */  sw        $zero, 0x5C($v1)
/* 17D0 800263D0 AE420000 */  sw        $v0, 0x0($s2)
/* 17D4 800263D4 3C02F400 */  lui       $v0, (0xF4000000 >> 16)
/* 17D8 800263D8 AC620060 */  sw        $v0, 0x60($v1)
/* 17DC 800263DC 24620070 */  addiu     $v0, $v1, 0x70
/* 17E0 800263E0 AC730064 */  sw        $s3, 0x64($v1)
/* 17E4 800263E4 AE420000 */  sw        $v0, 0x0($s2)
/* 17E8 800263E8 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 17EC 800263EC AC620068 */  sw        $v0, 0x68($v1)
/* 17F0 800263F0 24620078 */  addiu     $v0, $v1, 0x78
/* 17F4 800263F4 AC60006C */  sw        $zero, 0x6C($v1)
/* 17F8 800263F8 AE420000 */  sw        $v0, 0x0($s2)
/* 17FC 800263FC 24620080 */  addiu     $v0, $v1, 0x80
/* 1800 80026400 AC740070 */  sw        $s4, 0x70($v1)
/* 1804 80026404 AC600074 */  sw        $zero, 0x74($v1)
/* 1808 80026408 AE420000 */  sw        $v0, 0x0($s2)
/* 180C 8002640C 3C02F200 */  lui       $v0, (0xF2000000 >> 16)
/* 1810 80026410 AC620078 */  sw        $v0, 0x78($v1)
/* 1814 80026414 AC75007C */  sw        $s5, 0x7C($v1)
/* 1818 80026418 0000702D */  daddu     $t6, $zero, $zero
.L8002641C:
/* 181C 8002641C 00161C00 */  sll       $v1, $s6, 16
/* 1820 80026420 00031C03 */  sra       $v1, $v1, 16
/* 1824 80026424 2474000E */  addiu     $s4, $v1, 0xE
/* 1828 80026428 000318C0 */  sll       $v1, $v1, 3
/* 182C 8002642C 246200A8 */  addiu     $v0, $v1, 0xA8
/* 1830 80026430 00021080 */  sll       $v0, $v0, 2
/* 1834 80026434 30420FFF */  andi      $v0, $v0, 0xFFF
/* 1838 80026438 00029B00 */  sll       $s3, $v0, 12
/* 183C 8002643C 246200A0 */  addiu     $v0, $v1, 0xA0
/* 1840 80026440 00021080 */  sll       $v0, $v0, 2
/* 1844 80026444 30420FFF */  andi      $v0, $v0, 0xFFF
/* 1848 80026448 00028B00 */  sll       $s1, $v0, 12
/* 184C 8002644C 241500A0 */  addiu     $s5, $zero, 0xA0
/* 1850 80026450 02A31023 */  subu      $v0, $s5, $v1
/* 1854 80026454 00021080 */  sll       $v0, $v0, 2
/* 1858 80026458 30420FFF */  andi      $v0, $v0, 0xFFF
/* 185C 8002645C 00028300 */  sll       $s0, $v0, 12
/* 1860 80026460 03C31823 */  subu      $v1, $fp, $v1
/* 1864 80026464 00031880 */  sll       $v1, $v1, 2
/* 1868 80026468 30630FFF */  andi      $v1, $v1, 0xFFF
/* 186C 8002646C 00037B00 */  sll       $t7, $v1, 12
/* 1870 80026470 000E1400 */  sll       $v0, $t6, 16
.L80026474:
/* 1874 80026474 00023C03 */  sra       $a3, $v0, 16
/* 1878 80026478 02871823 */  subu      $v1, $s4, $a3
/* 187C 8002647C 24020021 */  addiu     $v0, $zero, 0x21
/* 1880 80026480 00431023 */  subu      $v0, $v0, $v1
/* 1884 80026484 00021FC2 */  srl       $v1, $v0, 31
/* 1888 80026488 00431021 */  addu      $v0, $v0, $v1
/* 188C 8002648C 3C038007 */  lui       $v1, %hi(D_80074010)
/* 1890 80026490 94634010 */  lhu       $v1, %lo(D_80074010)($v1)
/* 1894 80026494 00021043 */  sra       $v0, $v0, 1
/* 1898 80026498 2463FFF1 */  addiu     $v1, $v1, -0xF
/* 189C 8002649C 00431023 */  subu      $v0, $v0, $v1
/* 18A0 800264A0 00021400 */  sll       $v0, $v0, 16
/* 18A4 800264A4 00026C03 */  sra       $t5, $v0, 16
/* 18A8 800264A8 29A20010 */  slti      $v0, $t5, 0x10
/* 18AC 800264AC 1040005C */  beqz      $v0, .L80026620
/* 18B0 800264B0 25C20001 */   addiu    $v0, $t6, 0x1
/* 18B4 800264B4 05A2005B */  bltzl     $t5, .L80026624
/* 18B8 800264B8 0040702D */   daddu    $t6, $v0, $zero
/* 18BC 800264BC 3C060400 */  lui       $a2, (0x4000400 >> 16)
/* 18C0 800264C0 34C60400 */  ori       $a2, $a2, (0x4000400 & 0xFFFF)
/* 18C4 800264C4 3C0A0400 */  lui       $t2, (0x400FC00 >> 16)
/* 18C8 800264C8 354AFC00 */  ori       $t2, $t2, (0x400FC00 & 0xFFFF)
/* 18CC 800264CC 3C0BFC00 */  lui       $t3, (0xFC000400 >> 16)
/* 18D0 800264D0 356B0400 */  ori       $t3, $t3, (0xFC000400 & 0xFFFF)
/* 18D4 800264D4 3C0CFC00 */  lui       $t4, (0xFC00FC00 >> 16)
/* 18D8 800264D8 358CFC00 */  ori       $t4, $t4, (0xFC00FC00 & 0xFFFF)
/* 18DC 800264DC 000748C0 */  sll       $t1, $a3, 3
/* 18E0 800264E0 25240008 */  addiu     $a0, $t1, 0x8
/* 18E4 800264E4 00042080 */  sll       $a0, $a0, 2
/* 18E8 800264E8 30840FFF */  andi      $a0, $a0, 0xFFF
/* 18EC 800264EC 00972025 */  or        $a0, $a0, $s7
/* 18F0 800264F0 02641025 */  or        $v0, $s3, $a0
/* 18F4 800264F4 00073940 */  sll       $a3, $a3, 5
/* 18F8 800264F8 30E70FFF */  andi      $a3, $a3, 0xFFF
/* 18FC 800264FC 000D4600 */  sll       $t0, $t5, 24
/* 1900 80026500 8E430000 */  lw        $v1, 0x0($s2)
/* 1904 80026504 02042025 */  or        $a0, $s0, $a0
/* 1908 80026508 0060282D */  daddu     $a1, $v1, $zero
/* 190C 8002650C 24630008 */  addiu     $v1, $v1, 0x8
/* 1910 80026510 AE430000 */  sw        $v1, 0x0($s2)
/* 1914 80026514 ACA20000 */  sw        $v0, 0x0($a1)
/* 1918 80026518 02271025 */  or        $v0, $s1, $a3
/* 191C 8002651C ACA20004 */  sw        $v0, 0x4($a1)
/* 1920 80026520 24620008 */  addiu     $v0, $v1, 0x8
/* 1924 80026524 AE420000 */  sw        $v0, 0x0($s2)
/* 1928 80026528 24620010 */  addiu     $v0, $v1, 0x10
/* 192C 8002652C AC790000 */  sw        $t9, 0x0($v1)
/* 1930 80026530 AC680004 */  sw        $t0, 0x4($v1)
/* 1934 80026534 AE420000 */  sw        $v0, 0x0($s2)
/* 1938 80026538 24620018 */  addiu     $v0, $v1, 0x18
/* 193C 8002653C 240500F0 */  addiu     $a1, $zero, 0xF0
/* 1940 80026540 00A92823 */  subu      $a1, $a1, $t1
/* 1944 80026544 00052880 */  sll       $a1, $a1, 2
/* 1948 80026548 30A50FFF */  andi      $a1, $a1, 0xFFF
/* 194C 8002654C 00B72825 */  or        $a1, $a1, $s7
/* 1950 80026550 AC780008 */  sw        $t8, 0x8($v1)
/* 1954 80026554 AC66000C */  sw        $a2, 0xC($v1)
/* 1958 80026558 AE420000 */  sw        $v0, 0x0($s2)
/* 195C 8002655C 02651025 */  or        $v0, $s3, $a1
/* 1960 80026560 240600E8 */  addiu     $a2, $zero, 0xE8
/* 1964 80026564 00C93023 */  subu      $a2, $a2, $t1
/* 1968 80026568 00063080 */  sll       $a2, $a2, 2
/* 196C 8002656C 30C60FFF */  andi      $a2, $a2, 0xFFF
/* 1970 80026570 AC620010 */  sw        $v0, 0x10($v1)
/* 1974 80026574 02261025 */  or        $v0, $s1, $a2
/* 1978 80026578 AC620014 */  sw        $v0, 0x14($v1)
/* 197C 8002657C 24620020 */  addiu     $v0, $v1, 0x20
/* 1980 80026580 350800E0 */  ori       $t0, $t0, 0xE0
/* 1984 80026584 AE420000 */  sw        $v0, 0x0($s2)
/* 1988 80026588 24620028 */  addiu     $v0, $v1, 0x28
/* 198C 8002658C AC790018 */  sw        $t9, 0x18($v1)
/* 1990 80026590 AC68001C */  sw        $t0, 0x1C($v1)
/* 1994 80026594 AE420000 */  sw        $v0, 0x0($s2)
/* 1998 80026598 24620030 */  addiu     $v0, $v1, 0x30
/* 199C 8002659C 01E73825 */  or        $a3, $t7, $a3
/* 19A0 800265A0 AC780020 */  sw        $t8, 0x20($v1)
/* 19A4 800265A4 AC6A0024 */  sw        $t2, 0x24($v1)
/* 19A8 800265A8 AE420000 */  sw        $v0, 0x0($s2)
/* 19AC 800265AC 24620038 */  addiu     $v0, $v1, 0x38
/* 19B0 800265B0 AC640028 */  sw        $a0, 0x28($v1)
/* 19B4 800265B4 000D2200 */  sll       $a0, $t5, 8
/* 19B8 800265B8 348400E0 */  ori       $a0, $a0, 0xE0
/* 19BC 800265BC 00042400 */  sll       $a0, $a0, 16
/* 19C0 800265C0 AC67002C */  sw        $a3, 0x2C($v1)
/* 19C4 800265C4 AE420000 */  sw        $v0, 0x0($s2)
/* 19C8 800265C8 24620040 */  addiu     $v0, $v1, 0x40
/* 19CC 800265CC AC790030 */  sw        $t9, 0x30($v1)
/* 19D0 800265D0 AC640034 */  sw        $a0, 0x34($v1)
/* 19D4 800265D4 AE420000 */  sw        $v0, 0x0($s2)
/* 19D8 800265D8 24620048 */  addiu     $v0, $v1, 0x48
/* 19DC 800265DC 02052825 */  or        $a1, $s0, $a1
/* 19E0 800265E0 01E63025 */  or        $a2, $t7, $a2
/* 19E4 800265E4 AC780038 */  sw        $t8, 0x38($v1)
/* 19E8 800265E8 AC6B003C */  sw        $t3, 0x3C($v1)
/* 19EC 800265EC AE420000 */  sw        $v0, 0x0($s2)
/* 19F0 800265F0 24620050 */  addiu     $v0, $v1, 0x50
/* 19F4 800265F4 348400E0 */  ori       $a0, $a0, 0xE0
/* 19F8 800265F8 AC650040 */  sw        $a1, 0x40($v1)
/* 19FC 800265FC AC660044 */  sw        $a2, 0x44($v1)
/* 1A00 80026600 AE420000 */  sw        $v0, 0x0($s2)
/* 1A04 80026604 24620058 */  addiu     $v0, $v1, 0x58
/* 1A08 80026608 AC790048 */  sw        $t9, 0x48($v1)
/* 1A0C 8002660C AC64004C */  sw        $a0, 0x4C($v1)
/* 1A10 80026610 AE420000 */  sw        $v0, 0x0($s2)
/* 1A14 80026614 AC780050 */  sw        $t8, 0x50($v1)
/* 1A18 80026618 AC6C0054 */  sw        $t4, 0x54($v1)
/* 1A1C 8002661C 25C20001 */  addiu     $v0, $t6, 0x1
.L80026620:
/* 1A20 80026620 0040702D */  daddu     $t6, $v0, $zero
.L80026624:
/* 1A24 80026624 00021400 */  sll       $v0, $v0, 16
/* 1A28 80026628 00021403 */  sra       $v0, $v0, 16
/* 1A2C 8002662C 2842000F */  slti      $v0, $v0, 0xF
/* 1A30 80026630 1440FF90 */  bnez      $v0, .L80026474
/* 1A34 80026634 000E1400 */   sll      $v0, $t6, 16
/* 1A38 80026638 26C20001 */  addiu     $v0, $s6, 0x1
/* 1A3C 8002663C 0040B02D */  daddu     $s6, $v0, $zero
/* 1A40 80026640 00021400 */  sll       $v0, $v0, 16
/* 1A44 80026644 00021403 */  sra       $v0, $v0, 16
/* 1A48 80026648 28420014 */  slti      $v0, $v0, 0x14
/* 1A4C 8002664C 1440FF73 */  bnez      $v0, .L8002641C
/* 1A50 80026650 0000702D */   daddu    $t6, $zero, $zero
/* 1A54 80026654 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* 1A58 80026658 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* 1A5C 8002665C 3C038007 */  lui       $v1, %hi(D_80074010)
/* 1A60 80026660 24634010 */  addiu     $v1, $v1, %lo(D_80074010)
/* 1A64 80026664 8CC50000 */  lw        $a1, 0x0($a2)
/* 1A68 80026668 3C08800A */  lui       $t0, %hi(gDisplayContext)
/* 1A6C 8002666C 8D08A674 */  lw        $t0, %lo(gDisplayContext)($t0)
/* 1A70 80026670 94620000 */  lhu       $v0, 0x0($v1)
/* 1A74 80026674 00A0382D */  daddu     $a3, $a1, $zero
/* 1A78 80026678 24A50008 */  addiu     $a1, $a1, 0x8
/* 1A7C 8002667C 25040230 */  addiu     $a0, $t0, 0x230
/* 1A80 80026680 24420001 */  addiu     $v0, $v0, 0x1
/* 1A84 80026684 A4620000 */  sh        $v0, 0x0($v1)
/* 1A88 80026688 3C02E900 */  lui       $v0, (0xE9000000 >> 16)
/* 1A8C 8002668C ACC50000 */  sw        $a1, 0x0($a2)
/* 1A90 80026690 ACE20000 */  sw        $v0, 0x0($a3)
/* 1A94 80026694 24A20008 */  addiu     $v0, $a1, 0x8
/* 1A98 80026698 ACE00004 */  sw        $zero, 0x4($a3)
/* 1A9C 8002669C ACC20000 */  sw        $v0, 0x0($a2)
/* 1AA0 800266A0 3C02DF00 */  lui       $v0, (0xDF000000 >> 16)
/* 1AA4 800266A4 ACA20000 */  sw        $v0, 0x0($a1)
/* 1AA8 800266A8 ACA00004 */  sw        $zero, 0x4($a1)
/* 1AAC 800266AC 24A5FDD8 */  addiu     $a1, $a1, -0x228
/* 1AB0 800266B0 00A82823 */  subu      $a1, $a1, $t0
/* 1AB4 800266B4 000528C3 */  sra       $a1, $a1, 3
/* 1AB8 800266B8 000528C0 */  sll       $a1, $a1, 3
/* 1ABC 800266BC 0000302D */  daddu     $a2, $zero, $zero
/* 1AC0 800266C0 0C00B331 */  jal       nuGfxTaskStart
/* 1AC4 800266C4 3C070004 */   lui      $a3, (0x40000 >> 16)
/* 1AC8 800266C8 3C038007 */  lui       $v1, %hi(gCurrentDisplayContextIndex)
/* 1ACC 800266CC 246341F4 */  addiu     $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 1AD0 800266D0 8C620000 */  lw        $v0, 0x0($v1)
/* 1AD4 800266D4 38420001 */  xori      $v0, $v0, 0x1
/* 1AD8 800266D8 AC620000 */  sw        $v0, 0x0($v1)
/* 1ADC 800266DC 8FBF003C */  lw        $ra, 0x3C($sp)
/* 1AE0 800266E0 8FBE0038 */  lw        $fp, 0x38($sp)
/* 1AE4 800266E4 8FB70034 */  lw        $s7, 0x34($sp)
/* 1AE8 800266E8 8FB60030 */  lw        $s6, 0x30($sp)
/* 1AEC 800266EC 8FB5002C */  lw        $s5, 0x2C($sp)
/* 1AF0 800266F0 8FB40028 */  lw        $s4, 0x28($sp)
/* 1AF4 800266F4 8FB30024 */  lw        $s3, 0x24($sp)
/* 1AF8 800266F8 8FB20020 */  lw        $s2, 0x20($sp)
/* 1AFC 800266FC 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1B00 80026700 8FB00018 */  lw        $s0, 0x18($sp)
/* 1B04 80026704 03E00008 */  jr        $ra
/* 1B08 80026708 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void gfx_task_main(void) {
    s16 t;
    s16 i;
    s16 j;
    u16* temp;

    gMatrixListPos = 0;
    gDisplayContext = &D_80164000[gCurrentDisplayContextIndex];
    gMainGfxPos = gDisplayContext->mainGfx;
    temp = D_80073E04;
    gfx_init_state();

    gDPSetDepthImage(gMainGfxPos++, OS_K0_TO_PHYSICAL(nuGfxZBuffer));
    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(temp));
    gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
    gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
    gDPSetTexturePersp(gMainGfxPos++, G_TP_NONE);
    gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
    gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
    gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT);
    gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, 0, 0, 0, TEXEL0, 0, 0, 0, 0, 0, 0, 0, TEXEL0);
    gDPSetAlphaCompare(gMainGfxPos++, G_AC_THRESHOLD);
    gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 127);
    gDPLoadTextureTile_4b(gMainGfxPos++, D_80073E10, G_IM_FMT_I, 128, 8, 0, 0, 127, 7, 0, G_TX_NOMIRROR | G_TX_WRAP,
                          G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);

    for (i = 0; i < 20; i++) {
        for (j = 0; j < 15; j++) {
            s32 s4 = i + 14;
            t = (33 - (s4 - j)) / 2 + 15 - D_80074010;
            if (t >= 16) {
                continue;
            }
            if (t < 0) {
                continue;
            }
            gSPTextureRectangle(gMainGfxPos++, ((i * 8) + 160) * 4,
                                                 ((j * 8)) * 4,
                                                 ((i * 8) + 168) * 4,
                                                 ((j * 8) + 8) * 4,
                                                 G_TX_RENDERTILE,
                                                 (t * 8) * 32, 0, 0x0400, 0x0400);
            gSPTextureRectangle(gMainGfxPos++, ((i * 8) + 160) * 4,
                                                 (232 - (j * 8)) * 4,
                                                 ((i * 8) + 168) * 4,
                                                 (240 - (j * 8)) * 4,
                                                 G_TX_RENDERTILE,
                                                 (t * 8) * 32, 7 * 32, 0x0400, -0x0400);
            gSPTextureRectangle(gMainGfxPos++, (152 - (i * 8)) * 4,
                                                 ((j * 8)) * 4,
                                                 (160 - (i * 8)) * 4,
                                                 ((j * 8) + 8) * 4,
                                                 G_TX_RENDERTILE,
                                                 (t * 8 + 7) * 32, 0, -0x0400, 0x0400);
            gSPTextureRectangle(gMainGfxPos++, (152 - (i * 8)) * 4,
                                                 (232 - (j * 8)) * 4,
                                                 (160 - (i * 8)) * 4,
                                                 (240 - (j * 8)) * 4,
                                                 G_TX_RENDERTILE,
                                                 (t * 8 + 7) * 32, 7 * 32, -0x0400, -0x0400);
        }
    }

    D_80074010++;
    gDPFullSync(gMainGfxPos++);
    gSPEndDisplayList(gMainGfxPos++);
    nuGfxTaskStart(gDisplayContext->mainGfx, (u32)(gMainGfxPos - gDisplayContext->mainGfx) * 8, NU_GFX_UCODE_F3DEX, NU_SC_TASK_LODABLE);
    gCurrentDisplayContextIndex ^= 1;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_E0090444
/* 38FD44 E0090444 27BDFF40 */  addiu     $sp, $sp, -0xC0
/* 38FD48 E0090448 0080482D */  daddu     $t1, $a0, $zero
/* 38FD4C E009044C AFBF00AC */  sw        $ra, 0xAC($sp)
/* 38FD50 E0090450 AFB400A8 */  sw        $s4, 0xA8($sp)
/* 38FD54 E0090454 AFB300A4 */  sw        $s3, 0xA4($sp)
/* 38FD58 E0090458 AFB200A0 */  sw        $s2, 0xA0($sp)
/* 38FD5C E009045C AFB1009C */  sw        $s1, 0x9C($sp)
/* 38FD60 E0090460 AFB00098 */  sw        $s0, 0x98($sp)
/* 38FD64 E0090464 F7B600B8 */  sdc1      $f22, 0xB8($sp)
/* 38FD68 E0090468 F7B400B0 */  sdc1      $f20, 0xB0($sp)
/* 38FD6C E009046C 8D33000C */  lw        $s3, 0xC($t1)
/* 38FD70 E0090470 8E670000 */  lw        $a3, 0x0($s3)
/* 38FD74 E0090474 8E620024 */  lw        $v0, 0x24($s3)
/* 38FD78 E0090478 8E63001C */  lw        $v1, 0x1C($s3)
/* 38FD7C E009047C 10400163 */  beqz      $v0, .LE0090A0C
/* 38FD80 E0090480 3C04DB06 */   lui      $a0, (0xDB060024 >> 16)
/* 38FD84 E0090484 34840024 */  ori       $a0, $a0, (0xDB060024 & 0xFFFF)
/* 38FD88 E0090488 3C05E200 */  lui       $a1, (0xE2001D00 >> 16)
/* 38FD8C E009048C 34A51D00 */  ori       $a1, $a1, (0xE2001D00 & 0xFFFF)
/* 38FD90 E0090490 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 38FD94 E0090494 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 38FD98 E0090498 240200C8 */  addiu     $v0, $zero, 0xC8
/* 38FD9C E009049C 8E880000 */  lw        $t0, 0x0($s4)
/* 38FDA0 E00904A0 00433023 */  subu      $a2, $v0, $v1
/* 38FDA4 E00904A4 0100182D */  daddu     $v1, $t0, $zero
/* 38FDA8 E00904A8 25080008 */  addiu     $t0, $t0, 0x8
/* 38FDAC E00904AC AE880000 */  sw        $t0, 0x0($s4)
/* 38FDB0 E00904B0 C6760028 */  lwc1      $f22, 0x28($s3)
/* 38FDB4 E00904B4 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 38FDB8 E00904B8 AC620000 */  sw        $v0, 0x0($v1)
/* 38FDBC E00904BC AC600004 */  sw        $zero, 0x4($v1)
/* 38FDC0 E00904C0 AD040000 */  sw        $a0, 0x0($t0)
/* 38FDC4 E00904C4 8D230010 */  lw        $v1, 0x10($t1)
/* 38FDC8 E00904C8 25020008 */  addiu     $v0, $t0, 0x8
/* 38FDCC E00904CC AE820000 */  sw        $v0, 0x0($s4)
/* 38FDD0 E00904D0 8C63001C */  lw        $v1, 0x1C($v1)
/* 38FDD4 E00904D4 25020010 */  addiu     $v0, $t0, 0x10
/* 38FDD8 E00904D8 AE820000 */  sw        $v0, 0x0($s4)
/* 38FDDC E00904DC 24020004 */  addiu     $v0, $zero, 0x4
/* 38FDE0 E00904E0 AD02000C */  sw        $v0, 0xC($t0)
/* 38FDE4 E00904E4 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 38FDE8 E00904E8 AD050008 */  sw        $a1, 0x8($t0)
/* 38FDEC E00904EC 00621821 */  addu      $v1, $v1, $v0
/* 38FDF0 E00904F0 04C10002 */  bgez      $a2, .LE00904FC
/* 38FDF4 E00904F4 AD030004 */   sw       $v1, 0x4($t0)
/* 38FDF8 E00904F8 0000302D */  daddu     $a2, $zero, $zero
.LE00904FC:
/* 38FDFC E00904FC 25020018 */  addiu     $v0, $t0, 0x18
/* 38FE00 E0090500 AE820000 */  sw        $v0, 0x0($s4)
/* 38FE04 E0090504 3C02EE00 */  lui       $v0, (0xEE000000 >> 16)
/* 38FE08 E0090508 AD020010 */  sw        $v0, 0x10($t0)
/* 38FE0C E009050C 00061400 */  sll       $v0, $a2, 16
/* 38FE10 E0090510 AD020014 */  sw        $v0, 0x14($t0)
/* 38FE14 E0090514 28E20005 */  slti      $v0, $a3, 0x5
/* 38FE18 E0090518 1040006F */  beqz      $v0, .LE00906D8
/* 38FE1C E009051C 3C120001 */   lui      $s2, (0x11630 >> 16)
/* 38FE20 E0090520 27A40018 */  addiu     $a0, $sp, 0x18
/* 38FE24 E0090524 8E650008 */  lw        $a1, 0x8($s3)
/* 38FE28 E0090528 8E66000C */  lw        $a2, 0xC($s3)
/* 38FE2C E009052C 8E670010 */  lw        $a3, 0x10($s3)
/* 38FE30 E0090530 0C080108 */  jal       shim_guTranslateF
/* 38FE34 E0090534 36521630 */   ori      $s2, $s2, (0x11630 & 0xFFFF)
/* 38FE38 E0090538 27B00058 */  addiu     $s0, $sp, 0x58
/* 38FE3C E009053C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 38FE40 E0090540 4481A000 */  mtc1      $at, $f20
/* 38FE44 E0090544 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 38FE48 E0090548 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 38FE4C E009054C 44800000 */  mtc1      $zero, $f0
/* 38FE50 E0090550 00031080 */  sll       $v0, $v1, 2
/* 38FE54 E0090554 00431021 */  addu      $v0, $v0, $v1
/* 38FE58 E0090558 00021080 */  sll       $v0, $v0, 2
/* 38FE5C E009055C 00431023 */  subu      $v0, $v0, $v1
/* 38FE60 E0090560 000218C0 */  sll       $v1, $v0, 3
/* 38FE64 E0090564 00431021 */  addu      $v0, $v0, $v1
/* 38FE68 E0090568 000210C0 */  sll       $v0, $v0, 3
/* 38FE6C E009056C 44060000 */  mfc1      $a2, $f0
/* 38FE70 E0090570 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 38FE74 E0090574 00220821 */  addu      $at, $at, $v0
/* 38FE78 E0090578 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 38FE7C E009057C 4407A000 */  mfc1      $a3, $f20
/* 38FE80 E0090580 46000007 */  neg.s     $f0, $f0
/* 38FE84 E0090584 44050000 */  mfc1      $a1, $f0
/* 38FE88 E0090588 0200202D */  daddu     $a0, $s0, $zero
/* 38FE8C E009058C 0C080104 */  jal       shim_guRotateF
/* 38FE90 E0090590 AFA60010 */   sw       $a2, 0x10($sp)
/* 38FE94 E0090594 0200202D */  daddu     $a0, $s0, $zero
/* 38FE98 E0090598 27A50018 */  addiu     $a1, $sp, 0x18
/* 38FE9C E009059C 0C080114 */  jal       shim_guMtxCatF
/* 38FEA0 E00905A0 00A0302D */   daddu    $a2, $a1, $zero
/* 38FEA4 E00905A4 0200202D */  daddu     $a0, $s0, $zero
/* 38FEA8 E00905A8 4405B000 */  mfc1      $a1, $f22
/* 38FEAC E00905AC 4407A000 */  mfc1      $a3, $f20
/* 38FEB0 E00905B0 0C080110 */  jal       shim_guScaleF
/* 38FEB4 E00905B4 00A0302D */   daddu    $a2, $a1, $zero
/* 38FEB8 E00905B8 0200202D */  daddu     $a0, $s0, $zero
/* 38FEBC E00905BC 27A50018 */  addiu     $a1, $sp, 0x18
/* 38FEC0 E00905C0 0C080114 */  jal       shim_guMtxCatF
/* 38FEC4 E00905C4 00A0302D */   daddu    $a2, $a1, $zero
/* 38FEC8 E00905C8 27A40018 */  addiu     $a0, $sp, 0x18
/* 38FECC E00905CC 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 38FED0 E00905D0 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 38FED4 E00905D4 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* 38FED8 E00905D8 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* 38FEDC E00905DC 96050000 */  lhu       $a1, 0x0($s0)
/* 38FEE0 E00905E0 8E220000 */  lw        $v0, 0x0($s1)
/* 38FEE4 E00905E4 00052980 */  sll       $a1, $a1, 6
/* 38FEE8 E00905E8 00B22821 */  addu      $a1, $a1, $s2
/* 38FEEC E00905EC 0C080118 */  jal       shim_guMtxF2L
/* 38FEF0 E00905F0 00452821 */   addu     $a1, $v0, $a1
/* 38FEF4 E00905F4 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 38FEF8 E00905F8 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 38FEFC E00905FC 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 38FF00 E0090600 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 38FF04 E0090604 8E840000 */  lw        $a0, 0x0($s4)
/* 38FF08 E0090608 96020000 */  lhu       $v0, 0x0($s0)
/* 38FF0C E009060C 0080282D */  daddu     $a1, $a0, $zero
/* 38FF10 E0090610 24840008 */  addiu     $a0, $a0, 0x8
/* 38FF14 E0090614 AE840000 */  sw        $a0, 0x0($s4)
/* 38FF18 E0090618 ACA30000 */  sw        $v1, 0x0($a1)
/* 38FF1C E009061C 24430001 */  addiu     $v1, $v0, 0x1
/* 38FF20 E0090620 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 38FF24 E0090624 00021180 */  sll       $v0, $v0, 6
/* 38FF28 E0090628 A6030000 */  sh        $v1, 0x0($s0)
/* 38FF2C E009062C 8E230000 */  lw        $v1, 0x0($s1)
/* 38FF30 E0090630 00521021 */  addu      $v0, $v0, $s2
/* 38FF34 E0090634 00621821 */  addu      $v1, $v1, $v0
/* 38FF38 E0090638 24820008 */  addiu     $v0, $a0, 0x8
/* 38FF3C E009063C ACA30004 */  sw        $v1, 0x4($a1)
/* 38FF40 E0090640 AE820000 */  sw        $v0, 0x0($s4)
/* 38FF44 E0090644 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 38FF48 E0090648 3C05DE00 */  lui       $a1, (0xDE000000 >> 16)
/* 38FF4C E009064C AC820000 */  sw        $v0, 0x0($a0)
/* 38FF50 E0090650 92630017 */  lbu       $v1, 0x17($s3)
/* 38FF54 E0090654 3C020900 */  lui       $v0, %hi(D_090015A8_40E838)
/* 38FF58 E0090658 244215A8 */  addiu     $v0, $v0, %lo(D_090015A8_40E838)
/* 38FF5C E009065C AC82000C */  sw        $v0, 0xC($a0)
/* 38FF60 E0090660 2402FF00 */  addiu     $v0, $zero, -0x100
/* 38FF64 E0090664 AC850008 */  sw        $a1, 0x8($a0)
/* 38FF68 E0090668 AC850010 */  sw        $a1, 0x10($a0)
/* 38FF6C E009066C 00621825 */  or        $v1, $v1, $v0
/* 38FF70 E0090670 AC830004 */  sw        $v1, 0x4($a0)
/* 38FF74 E0090674 8E620004 */  lw        $v0, 0x4($s3)
/* 38FF78 E0090678 24830010 */  addiu     $v1, $a0, 0x10
/* 38FF7C E009067C AE830000 */  sw        $v1, 0x0($s4)
/* 38FF80 E0090680 00021080 */  sll       $v0, $v0, 2
/* 38FF84 E0090684 3C03E009 */  lui       $v1, (0xE0090A40 >> 16)
/* 38FF88 E0090688 00621821 */  addu      $v1, $v1, $v0
/* 38FF8C E009068C 8C630A40 */  lw        $v1, (0xE0090A40 & 0xFFFF)($v1)
/* 38FF90 E0090690 24820018 */  addiu     $v0, $a0, 0x18
/* 38FF94 E0090694 AE820000 */  sw        $v0, 0x0($s4)
/* 38FF98 E0090698 AC850018 */  sw        $a1, 0x18($a0)
/* 38FF9C E009069C AC830014 */  sw        $v1, 0x14($a0)
/* 38FFA0 E00906A0 8E620004 */  lw        $v0, 0x4($s3)
/* 38FFA4 E00906A4 24830020 */  addiu     $v1, $a0, 0x20
/* 38FFA8 E00906A8 AE830000 */  sw        $v1, 0x0($s4)
/* 38FFAC E00906AC 00021080 */  sll       $v0, $v0, 2
/* 38FFB0 E00906B0 3C03E009 */  lui       $v1, (0xE0090A54 >> 16)
/* 38FFB4 E00906B4 00621821 */  addu      $v1, $v1, $v0
/* 38FFB8 E00906B8 8C630A54 */  lw        $v1, (0xE0090A54 & 0xFFFF)($v1)
/* 38FFBC E00906BC 24820028 */  addiu     $v0, $a0, 0x28
/* 38FFC0 E00906C0 AE820000 */  sw        $v0, 0x0($s4)
/* 38FFC4 E00906C4 24020040 */  addiu     $v0, $zero, 0x40
/* 38FFC8 E00906C8 AC860020 */  sw        $a2, 0x20($a0)
/* 38FFCC E00906CC AC820024 */  sw        $v0, 0x24($a0)
/* 38FFD0 E00906D0 08024270 */  j         .LE00909C0
/* 38FFD4 E00906D4 AC83001C */   sw       $v1, 0x1C($a0)
.LE00906D8:
/* 38FFD8 E00906D8 24E7FFFB */  addiu     $a3, $a3, -0x5
/* 38FFDC E00906DC 25020020 */  addiu     $v0, $t0, 0x20
/* 38FFE0 E00906E0 AE820000 */  sw        $v0, 0x0($s4)
/* 38FFE4 E00906E4 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 38FFE8 E00906E8 AD020018 */  sw        $v0, 0x18($t0)
/* 38FFEC E00906EC 3C02E009 */  lui       $v0, %hi(D_E0090A78)
/* 38FFF0 E00906F0 24420A78 */  addiu     $v0, $v0, %lo(D_E0090A78)
/* 38FFF4 E00906F4 00072040 */  sll       $a0, $a3, 1
/* 38FFF8 E00906F8 00872021 */  addu      $a0, $a0, $a3
/* 38FFFC E00906FC 00042040 */  sll       $a0, $a0, 1
/* 390000 E0090700 00822021 */  addu      $a0, $a0, $v0
/* 390004 E0090704 90820000 */  lbu       $v0, 0x0($a0)
/* 390008 E0090708 90850001 */  lbu       $a1, 0x1($a0)
/* 39000C E009070C 90860002 */  lbu       $a2, 0x2($a0)
/* 390010 E0090710 92670017 */  lbu       $a3, 0x17($s3)
/* 390014 E0090714 25030028 */  addiu     $v1, $t0, 0x28
/* 390018 E0090718 AE830000 */  sw        $v1, 0x0($s4)
/* 39001C E009071C 3C03FB00 */  lui       $v1, (0xFB000000 >> 16)
/* 390020 E0090720 AD030020 */  sw        $v1, 0x20($t0)
/* 390024 E0090724 00021600 */  sll       $v0, $v0, 24
/* 390028 E0090728 00052C00 */  sll       $a1, $a1, 16
/* 39002C E009072C 00451025 */  or        $v0, $v0, $a1
/* 390030 E0090730 00063200 */  sll       $a2, $a2, 8
/* 390034 E0090734 00461025 */  or        $v0, $v0, $a2
/* 390038 E0090738 00471025 */  or        $v0, $v0, $a3
/* 39003C E009073C 3C06DE00 */  lui       $a2, (0xDE000000 >> 16)
/* 390040 E0090740 AD02001C */  sw        $v0, 0x1C($t0)
/* 390044 E0090744 90830003 */  lbu       $v1, 0x3($a0)
/* 390048 E0090748 90850004 */  lbu       $a1, 0x4($a0)
/* 39004C E009074C 90840005 */  lbu       $a0, 0x5($a0)
/* 390050 E0090750 3C020900 */  lui       $v0, %hi(D_09001500_40E790)
/* 390054 E0090754 24421500 */  addiu     $v0, $v0, %lo(D_09001500_40E790)
/* 390058 E0090758 AD060028 */  sw        $a2, 0x28($t0)
/* 39005C E009075C AD02002C */  sw        $v0, 0x2C($t0)
/* 390060 E0090760 AD060030 */  sw        $a2, 0x30($t0)
/* 390064 E0090764 00031E00 */  sll       $v1, $v1, 24
/* 390068 E0090768 00052C00 */  sll       $a1, $a1, 16
/* 39006C E009076C 00651825 */  or        $v1, $v1, $a1
/* 390070 E0090770 00042200 */  sll       $a0, $a0, 8
/* 390074 E0090774 00641825 */  or        $v1, $v1, $a0
/* 390078 E0090778 AD030024 */  sw        $v1, 0x24($t0)
/* 39007C E009077C 8E620004 */  lw        $v0, 0x4($s3)
/* 390080 E0090780 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 390084 E0090784 44811000 */  mtc1      $at, $f2
/* 390088 E0090788 00021080 */  sll       $v0, $v0, 2
/* 39008C E009078C 3C01E009 */  lui       $at, (0xE0090A40 >> 16)
/* 390090 E0090790 00220821 */  addu      $at, $at, $v0
/* 390094 E0090794 8C220A40 */  lw        $v0, (0xE0090A40 & 0xFFFF)($at)
/* 390098 E0090798 25030038 */  addiu     $v1, $t0, 0x38
/* 39009C E009079C AD020034 */  sw        $v0, 0x34($t0)
/* 3900A0 E00907A0 C6600008 */  lwc1      $f0, 0x8($s3)
/* 3900A4 E00907A4 46020000 */  add.s     $f0, $f0, $f2
/* 3900A8 E00907A8 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3900AC E00907AC 44811000 */  mtc1      $at, $f2
/* 3900B0 E00907B0 25020030 */  addiu     $v0, $t0, 0x30
/* 3900B4 E00907B4 46020002 */  mul.s     $f0, $f0, $f2
/* 3900B8 E00907B8 00000000 */  nop
/* 3900BC E00907BC AE820000 */  sw        $v0, 0x0($s4)
/* 3900C0 E00907C0 25020040 */  addiu     $v0, $t0, 0x40
/* 3900C4 E00907C4 AE830000 */  sw        $v1, 0x0($s4)
/* 3900C8 E00907C8 AE820000 */  sw        $v0, 0x0($s4)
/* 3900CC E00907CC 4600010D */  trunc.w.s $f4, $f0
/* 3900D0 E00907D0 44022000 */  mfc1      $v0, $f4
/* 3900D4 E00907D4 00000000 */  nop
/* 3900D8 E00907D8 00021400 */  sll       $v0, $v0, 16
/* 3900DC E00907DC 00021403 */  sra       $v0, $v0, 16
/* 3900E0 E00907E0 18400006 */  blez      $v0, .LE00907FC
/* 3900E4 E00907E4 0060202D */   daddu    $a0, $v1, $zero
/* 3900E8 E00907E8 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3900EC E00907EC 00021300 */  sll       $v0, $v0, 12
/* 3900F0 E00907F0 3C03E400 */  lui       $v1, (0xE4000000 >> 16)
/* 3900F4 E00907F4 08024200 */  j         .LE0090800
/* 3900F8 E00907F8 00431025 */   or       $v0, $v0, $v1
.LE00907FC:
/* 3900FC E00907FC 3C02E400 */  lui       $v0, (0xE4000000 >> 16)
.LE0090800:
/* 390100 E0090800 C660000C */  lwc1      $f0, 0xC($s3)
/* 390104 E0090804 3C014280 */  lui       $at, (0x42800000 >> 16)
/* 390108 E0090808 44811000 */  mtc1      $at, $f2
/* 39010C E009080C 00000000 */  nop
/* 390110 E0090810 46020000 */  add.s     $f0, $f0, $f2
/* 390114 E0090814 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 390118 E0090818 44811000 */  mtc1      $at, $f2
/* 39011C E009081C 00000000 */  nop
/* 390120 E0090820 46020002 */  mul.s     $f0, $f0, $f2
/* 390124 E0090824 00000000 */  nop
/* 390128 E0090828 0040182D */  daddu     $v1, $v0, $zero
/* 39012C E009082C 4600010D */  trunc.w.s $f4, $f0
/* 390130 E0090830 44022000 */  mfc1      $v0, $f4
/* 390134 E0090834 00000000 */  nop
/* 390138 E0090838 00021400 */  sll       $v0, $v0, 16
/* 39013C E009083C 00021403 */  sra       $v0, $v0, 16
/* 390140 E0090840 18400002 */  blez      $v0, .LE009084C
/* 390144 E0090844 30420FFF */   andi     $v0, $v0, 0xFFF
/* 390148 E0090848 00621825 */  or        $v1, $v1, $v0
.LE009084C:
/* 39014C E009084C AC830000 */  sw        $v1, 0x0($a0)
/* 390150 E0090850 C6600008 */  lwc1      $f0, 0x8($s3)
/* 390154 E0090854 46020002 */  mul.s     $f0, $f0, $f2
/* 390158 E0090858 00000000 */  nop
/* 39015C E009085C 4600010D */  trunc.w.s $f4, $f0
/* 390160 E0090860 44022000 */  mfc1      $v0, $f4
/* 390164 E0090864 00000000 */  nop
/* 390168 E0090868 00021400 */  sll       $v0, $v0, 16
/* 39016C E009086C 00021403 */  sra       $v0, $v0, 16
/* 390170 E0090870 18400004 */  blez      $v0, .LE0090884
/* 390174 E0090874 24860004 */   addiu    $a2, $a0, 0x4
/* 390178 E0090878 30420FFF */  andi      $v0, $v0, 0xFFF
/* 39017C E009087C 08024222 */  j         .LE0090888
/* 390180 E0090880 00021300 */   sll      $v0, $v0, 12
.LE0090884:
/* 390184 E0090884 0000102D */  daddu     $v0, $zero, $zero
.LE0090888:
/* 390188 E0090888 C660000C */  lwc1      $f0, 0xC($s3)
/* 39018C E009088C 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 390190 E0090890 44811000 */  mtc1      $at, $f2
/* 390194 E0090894 00000000 */  nop
/* 390198 E0090898 46020002 */  mul.s     $f0, $f0, $f2
/* 39019C E009089C 00000000 */  nop
/* 3901A0 E00908A0 0040202D */  daddu     $a0, $v0, $zero
/* 3901A4 E00908A4 4600010D */  trunc.w.s $f4, $f0
/* 3901A8 E00908A8 44022000 */  mfc1      $v0, $f4
/* 3901AC E00908AC 00000000 */  nop
/* 3901B0 E00908B0 00021400 */  sll       $v0, $v0, 16
/* 3901B4 E00908B4 00021403 */  sra       $v0, $v0, 16
/* 3901B8 E00908B8 18400002 */  blez      $v0, .LE00908C4
/* 3901BC E00908BC 30420FFF */   andi     $v0, $v0, 0xFFF
/* 3901C0 E00908C0 00822025 */  or        $a0, $a0, $v0
.LE00908C4:
/* 3901C4 E00908C4 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 3901C8 E00908C8 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 3901CC E00908CC 8CA30000 */  lw        $v1, 0x0($a1)
/* 3901D0 E00908D0 3C02E100 */  lui       $v0, (0xE1000000 >> 16)
/* 3901D4 E00908D4 ACC40000 */  sw        $a0, 0x0($a2)
/* 3901D8 E00908D8 0060202D */  daddu     $a0, $v1, $zero
/* 3901DC E00908DC AC820000 */  sw        $v0, 0x0($a0)
/* 3901E0 E00908E0 C6600008 */  lwc1      $f0, 0x8($s3)
/* 3901E4 E00908E4 46020002 */  mul.s     $f0, $f0, $f2
/* 3901E8 E00908E8 00000000 */  nop
/* 3901EC E00908EC 24630008 */  addiu     $v1, $v1, 0x8
/* 3901F0 E00908F0 24860004 */  addiu     $a2, $a0, 0x4
/* 3901F4 E00908F4 4600010D */  trunc.w.s $f4, $f0
/* 3901F8 E00908F8 44022000 */  mfc1      $v0, $f4
/* 3901FC E00908FC 00000000 */  nop
/* 390200 E0090900 00021400 */  sll       $v0, $v0, 16
/* 390204 E0090904 00021403 */  sra       $v0, $v0, 16
/* 390208 E0090908 04410007 */  bgez      $v0, .LE0090928
/* 39020C E009090C ACA30000 */   sw       $v1, 0x0($a1)
/* 390210 E0090910 00021080 */  sll       $v0, $v0, 2
/* 390214 E0090914 5C400001 */  bgtzl     $v0, .LE009091C
/* 390218 E0090918 0000102D */   daddu    $v0, $zero, $zero
.LE009091C:
/* 39021C E009091C 00021023 */  negu      $v0, $v0
/* 390220 E0090920 0802424B */  j         .LE009092C
/* 390224 E0090924 00022400 */   sll      $a0, $v0, 16
.LE0090928:
/* 390228 E0090928 0000202D */  daddu     $a0, $zero, $zero
.LE009092C:
/* 39022C E009092C C660000C */  lwc1      $f0, 0xC($s3)
/* 390230 E0090930 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 390234 E0090934 44811000 */  mtc1      $at, $f2
/* 390238 E0090938 00000000 */  nop
/* 39023C E009093C 46020082 */  mul.s     $f2, $f0, $f2
/* 390240 E0090940 00000000 */  nop
/* 390244 E0090944 44800000 */  mtc1      $zero, $f0
/* 390248 E0090948 00000000 */  nop
/* 39024C E009094C 4600103C */  c.lt.s    $f2, $f0
/* 390250 E0090950 00000000 */  nop
/* 390254 E0090954 4500000E */  bc1f      .LE0090990
/* 390258 E0090958 34830400 */   ori      $v1, $a0, 0x400
/* 39025C E009095C 4600110D */  trunc.w.s $f4, $f2
/* 390260 E0090960 44022000 */  mfc1      $v0, $f4
/* 390264 E0090964 00000000 */  nop
/* 390268 E0090968 00021400 */  sll       $v0, $v0, 16
/* 39026C E009096C 000211C3 */  sra       $v0, $v0, 7
/* 390270 E0090970 00021023 */  negu      $v0, $v0
/* 390274 E0090974 000219C3 */  sra       $v1, $v0, 7
/* 390278 E0090978 04620001 */  bltzl     $v1, .LE0090980
/* 39027C E009097C 0000182D */   daddu    $v1, $zero, $zero
.LE0090980:
/* 390280 E0090980 24020400 */  addiu     $v0, $zero, 0x400
/* 390284 E0090984 00431023 */  subu      $v0, $v0, $v1
/* 390288 E0090988 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 39028C E009098C 00821825 */  or        $v1, $a0, $v0
.LE0090990:
/* 390290 E0090990 3C050200 */  lui       $a1, (0x200FE00 >> 16)
/* 390294 E0090994 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 390298 E0090998 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 39029C E009099C 8C820000 */  lw        $v0, 0x0($a0)
/* 3902A0 E00909A0 34A5FE00 */  ori       $a1, $a1, (0x200FE00 & 0xFFFF)
/* 3902A4 E00909A4 ACC30000 */  sw        $v1, 0x0($a2)
/* 3902A8 E00909A8 0040182D */  daddu     $v1, $v0, $zero
/* 3902AC E00909AC 24420008 */  addiu     $v0, $v0, 0x8
/* 3902B0 E00909B0 AC820000 */  sw        $v0, 0x0($a0)
/* 3902B4 E00909B4 3C02F100 */  lui       $v0, (0xF1000000 >> 16)
/* 3902B8 E00909B8 AC620000 */  sw        $v0, 0x0($v1)
/* 3902BC E00909BC AC650004 */  sw        $a1, 0x4($v1)
.LE00909C0:
/* 3902C0 E00909C0 3C06E200 */  lui       $a2, (0xE2001D00 >> 16)
/* 3902C4 E00909C4 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 3902C8 E00909C8 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 3902CC E00909CC 34C61D00 */  ori       $a2, $a2, (0xE2001D00 & 0xFFFF)
/* 3902D0 E00909D0 8C820000 */  lw        $v0, 0x0($a0)
/* 3902D4 E00909D4 3C05E700 */  lui       $a1, (0xE7000000 >> 16)
/* 3902D8 E00909D8 0040182D */  daddu     $v1, $v0, $zero
/* 3902DC E00909DC 24420008 */  addiu     $v0, $v0, 0x8
/* 3902E0 E00909E0 AC820000 */  sw        $v0, 0x0($a0)
/* 3902E4 E00909E4 AC650000 */  sw        $a1, 0x0($v1)
/* 3902E8 E00909E8 AC600004 */  sw        $zero, 0x4($v1)
/* 3902EC E00909EC 24430008 */  addiu     $v1, $v0, 0x8
/* 3902F0 E00909F0 AC830000 */  sw        $v1, 0x0($a0)
/* 3902F4 E00909F4 24430010 */  addiu     $v1, $v0, 0x10
/* 3902F8 E00909F8 AC460000 */  sw        $a2, 0x0($v0)
/* 3902FC E00909FC AC400004 */  sw        $zero, 0x4($v0)
/* 390300 E0090A00 AC830000 */  sw        $v1, 0x0($a0)
/* 390304 E0090A04 AC450008 */  sw        $a1, 0x8($v0)
/* 390308 E0090A08 AC40000C */  sw        $zero, 0xC($v0)
.LE0090A0C:
/* 39030C E0090A0C 8FBF00AC */  lw        $ra, 0xAC($sp)
/* 390310 E0090A10 8FB400A8 */  lw        $s4, 0xA8($sp)
/* 390314 E0090A14 8FB300A4 */  lw        $s3, 0xA4($sp)
/* 390318 E0090A18 8FB200A0 */  lw        $s2, 0xA0($sp)
/* 39031C E0090A1C 8FB1009C */  lw        $s1, 0x9C($sp)
/* 390320 E0090A20 8FB00098 */  lw        $s0, 0x98($sp)
/* 390324 E0090A24 D7B600B8 */  ldc1      $f22, 0xB8($sp)
/* 390328 E0090A28 D7B400B0 */  ldc1      $f20, 0xB0($sp)
/* 39032C E0090A2C 03E00008 */  jr        $ra
/* 390330 E0090A30 27BD00C0 */   addiu    $sp, $sp, 0xC0
/* 390334 E0090A34 00000000 */  nop
/* 390338 E0090A38 00000000 */  nop
/* 39033C E0090A3C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void func_E0090444(EffectInstance* effect) {
    AttackResultTextFXData* data = effect->data.attackResultText;
    s32 type = data->type;
    s32 unk_1C = data->lifetime;
    Matrix4f mtxA;
    Matrix4f mtxB;
    s32 z;
    f32 scale;

    if (data->isVisible) {
        scale = data->scale;
        gDPPipeSync(gMainGfxPos++);
        gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
        gDPSetDepthSource(gMainGfxPos++, G_ZS_PRIM);
        z = 200 - unk_1C;
        if (z < 0) {
            z = 0;
        }
        gDPSetPrimDepth(gMainGfxPos++, z, 0);

        if (type < 5) {
            shim_guTranslateF(mtxA, data->pos.x, data->pos.y, data->pos.z);
            shim_guRotateF(mtxB, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
            shim_guMtxCatF(mtxB, mtxA, mtxA);
            shim_guScaleF(mtxB, scale, scale, 1.0f);
            shim_guMtxCatF(mtxB, mtxA, mtxA);
            shim_guMtxF2L(mtxA, &gDisplayContext->matrixStack[gMatrixListPos]);
            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                      G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
            gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->alpha);
            gSPDisplayList(gMainGfxPos++, D_090015A8_391978);
            gSPDisplayList(gMainGfxPos++, D_E0090A40[data->unk_04]);
            gSPDisplayList(gMainGfxPos++, D_E0090A54[data->unk_04]);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        } else {
            type -= 5;
            gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0090A78[type][0], D_E0090A78[type][1], D_E0090A78[type][2], data->alpha);
            gDPSetEnvColor(gMainGfxPos++, D_E0090A78[type][3], D_E0090A78[type][4], D_E0090A78[type][5], 0);
            gSPDisplayList(gMainGfxPos++, D_09001500_3918D0);
            gSPDisplayList(gMainGfxPos++, D_E0090A40[data->unk_04]);

            gSPScisTextureRectangle(gMainGfxPos++,
                data->pos.x * 4.0f,
                data->pos.y * 4.0f,
                (data->pos.x + 128.0f) * 4.0f,
                (data->pos.y + 64.0f) * 4.0f,
                G_TX_RENDERTILE, 0, 1024, 512, 65024);
        }
        gDPPipeSync(gMainGfxPos++);
        gDPSetDepthSource(gMainGfxPos++, G_ZS_PIXEL);
        gDPPipeSync(gMainGfxPos++);
    }
}