### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802601BC
/* 18EA9C 802601BC 3C02800E */  lui       $v0, %hi(gBattleSubState)
/* 18EAA0 802601C0 8C42C4DC */  lw        $v0, %lo(gBattleSubState)($v0)
/* 18EAA4 802601C4 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 18EAA8 802601C8 AFBF0028 */  sw        $ra, 0x28($sp)
/* 18EAAC 802601CC AFB50024 */  sw        $s5, 0x24($sp)
/* 18EAB0 802601D0 AFB40020 */  sw        $s4, 0x20($sp)
/* 18EAB4 802601D4 AFB3001C */  sw        $s3, 0x1C($sp)
/* 18EAB8 802601D8 AFB20018 */  sw        $s2, 0x18($sp)
/* 18EABC 802601DC AFB10014 */  sw        $s1, 0x14($sp)
/* 18EAC0 802601E0 2443FFF9 */  addiu     $v1, $v0, -0x7
/* 18EAC4 802601E4 2C62000F */  sltiu     $v0, $v1, 0xF
/* 18EAC8 802601E8 10400193 */  beqz      $v0, .L80260838
/* 18EACC 802601EC AFB00010 */   sw       $s0, 0x10($sp)
/* 18EAD0 802601F0 00031080 */  sll       $v0, $v1, 2
/* 18EAD4 802601F4 3C01802A */  lui       $at, %hi(jtbl_8029D550)
/* 18EAD8 802601F8 00220821 */  addu      $at, $at, $v0
/* 18EADC 802601FC 8C22D550 */  lw        $v0, %lo(jtbl_8029D550)($at)
/* 18EAE0 80260200 00400008 */  jr        $v0
/* 18EAE4 80260204 00000000 */   nop
glabel .L80260208
/* 18EAE8 80260208 0C097FE3 */  jal       func_8025FF8C
/* 18EAEC 8026020C 0000202D */   daddu    $a0, $zero, $zero
/* 18EAF0 80260210 24050080 */  addiu     $a1, $zero, 0x80
/* 18EAF4 80260214 00A0302D */  daddu     $a2, $a1, $zero
/* 18EAF8 80260218 00A0382D */  daddu     $a3, $a1, $zero
/* 18EAFC 8026021C 0000982D */  daddu     $s3, $zero, $zero
/* 18EB00 80260220 3C15802A */  lui       $s5, %hi(LevelUpStatTextIDs)
/* 18EB04 80260224 26B5FA90 */  addiu     $s5, $s5, %lo(LevelUpStatTextIDs)
/* 18EB08 80260228 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18EB0C 8026022C 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18EB10 80260230 8E110000 */  lw        $s1, 0x0($s0)
/* 18EB14 80260234 0260A02D */  daddu     $s4, $s3, $zero
/* 18EB18 80260238 0C0513BF */  jal       hud_element_set_tint
/* 18EB1C 8026023C 0220202D */   daddu    $a0, $s1, $zero
/* 18EB20 80260240 0C0511EA */  jal       hud_element_draw_clipped
/* 18EB24 80260244 0220202D */   daddu    $a0, $s1, $zero
/* 18EB28 80260248 24050080 */  addiu     $a1, $zero, 0x80
/* 18EB2C 8026024C 00A0302D */  daddu     $a2, $a1, $zero
/* 18EB30 80260250 8E11000C */  lw        $s1, 0xC($s0)
/* 18EB34 80260254 00A0382D */  daddu     $a3, $a1, $zero
/* 18EB38 80260258 0C0513BF */  jal       hud_element_set_tint
/* 18EB3C 8026025C 0220202D */   daddu    $a0, $s1, $zero
/* 18EB40 80260260 0C0511EA */  jal       hud_element_draw_clipped
/* 18EB44 80260264 0220202D */   daddu    $a0, $s1, $zero
/* 18EB48 80260268 24050080 */  addiu     $a1, $zero, 0x80
/* 18EB4C 8026026C 00A0302D */  daddu     $a2, $a1, $zero
/* 18EB50 80260270 8E110004 */  lw        $s1, 0x4($s0)
/* 18EB54 80260274 00A0382D */  daddu     $a3, $a1, $zero
/* 18EB58 80260278 0C0513BF */  jal       hud_element_set_tint
/* 18EB5C 8026027C 0220202D */   daddu    $a0, $s1, $zero
/* 18EB60 80260280 0C0511EA */  jal       hud_element_draw_clipped
/* 18EB64 80260284 0220202D */   daddu    $a0, $s1, $zero
/* 18EB68 80260288 24050080 */  addiu     $a1, $zero, 0x80
/* 18EB6C 8026028C 00A0302D */  daddu     $a2, $a1, $zero
/* 18EB70 80260290 8E110008 */  lw        $s1, 0x8($s0)
/* 18EB74 80260294 00A0382D */  daddu     $a3, $a1, $zero
/* 18EB78 80260298 0C0513BF */  jal       hud_element_set_tint
/* 18EB7C 8026029C 0220202D */   daddu    $a0, $s1, $zero
/* 18EB80 802602A0 0C0511EA */  jal       hud_element_draw_clipped
/* 18EB84 802602A4 0220202D */   daddu    $a0, $s1, $zero
.L802602A8:
/* 18EB88 802602A8 0000902D */  daddu     $s2, $zero, $zero
/* 18EB8C 802602AC 0280802D */  daddu     $s0, $s4, $zero
/* 18EB90 802602B0 02151021 */  addu      $v0, $s0, $s5
.L802602B4:
/* 18EB94 802602B4 8C510000 */  lw        $s1, 0x0($v0)
/* 18EB98 802602B8 24050080 */  addiu     $a1, $zero, 0x80
/* 18EB9C 802602BC 00A0302D */  daddu     $a2, $a1, $zero
/* 18EBA0 802602C0 00A0382D */  daddu     $a3, $a1, $zero
/* 18EBA4 802602C4 26100004 */  addiu     $s0, $s0, 0x4
/* 18EBA8 802602C8 26520001 */  addiu     $s2, $s2, 0x1
/* 18EBAC 802602CC 0C0513BF */  jal       hud_element_set_tint
/* 18EBB0 802602D0 0220202D */   daddu    $a0, $s1, $zero
/* 18EBB4 802602D4 0C0511EA */  jal       hud_element_draw_clipped
/* 18EBB8 802602D8 0220202D */   daddu    $a0, $s1, $zero
/* 18EBBC 802602DC 2A420007 */  slti      $v0, $s2, 0x7
/* 18EBC0 802602E0 1440FFF4 */  bnez      $v0, .L802602B4
/* 18EBC4 802602E4 02151021 */   addu     $v0, $s0, $s5
/* 18EBC8 802602E8 26730001 */  addiu     $s3, $s3, 0x1
/* 18EBCC 802602EC 2A620003 */  slti      $v0, $s3, 0x3
/* 18EBD0 802602F0 1440FFED */  bnez      $v0, .L802602A8
/* 18EBD4 802602F4 2694001C */   addiu    $s4, $s4, 0x1C
/* 18EBD8 802602F8 0809820E */  j         .L80260838
/* 18EBDC 802602FC 00000000 */   nop
glabel .L80260300
/* 18EBE0 80260300 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 18EBE4 80260304 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 18EBE8 80260308 80430048 */  lb        $v1, 0x48($v0)
/* 18EBEC 8026030C 24020001 */  addiu     $v0, $zero, 0x1
/* 18EBF0 80260310 1062006B */  beq       $v1, $v0, .L802604C0
/* 18EBF4 80260314 28620002 */   slti     $v0, $v1, 0x2
/* 18EBF8 80260318 104000A9 */  beqz      $v0, .L802605C0
/* 18EBFC 8026031C 241500D0 */   addiu    $s5, $zero, 0xD0
/* 18EC00 80260320 146000A8 */  bnez      $v1, .L802605C4
/* 18EC04 80260324 24050080 */   addiu    $a1, $zero, 0x80
/* 18EC08 80260328 24150098 */  addiu     $s5, $zero, 0x98
/* 18EC0C 8026032C 240500FF */  addiu     $a1, $zero, 0xFF
/* 18EC10 80260330 00A0302D */  daddu     $a2, $a1, $zero
/* 18EC14 80260334 00A0382D */  daddu     $a3, $a1, $zero
/* 18EC18 80260338 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18EC1C 8026033C 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18EC20 80260340 8E040000 */  lw        $a0, 0x0($s0)
/* 18EC24 80260344 3C11802A */  lui       $s1, %hi(LevelUpStatTextIDs)
/* 18EC28 80260348 2631FA90 */  addiu     $s1, $s1, %lo(LevelUpStatTextIDs)
/* 18EC2C 8026034C 0C0513BF */  jal       hud_element_set_tint
/* 18EC30 80260350 0000902D */   daddu    $s2, $zero, $zero
/* 18EC34 80260354 24050080 */  addiu     $a1, $zero, 0x80
/* 18EC38 80260358 00A0302D */  daddu     $a2, $a1, $zero
/* 18EC3C 8026035C 8E04000C */  lw        $a0, 0xC($s0)
/* 18EC40 80260360 0C0513BF */  jal       hud_element_set_tint
/* 18EC44 80260364 00A0382D */   daddu    $a3, $a1, $zero
/* 18EC48 80260368 24050080 */  addiu     $a1, $zero, 0x80
/* 18EC4C 8026036C 00A0302D */  daddu     $a2, $a1, $zero
/* 18EC50 80260370 8E040004 */  lw        $a0, 0x4($s0)
/* 18EC54 80260374 0C0513BF */  jal       hud_element_set_tint
/* 18EC58 80260378 00A0382D */   daddu    $a3, $a1, $zero
/* 18EC5C 8026037C 24050080 */  addiu     $a1, $zero, 0x80
/* 18EC60 80260380 00A0302D */  daddu     $a2, $a1, $zero
/* 18EC64 80260384 8E040008 */  lw        $a0, 0x8($s0)
/* 18EC68 80260388 0C0513BF */  jal       hud_element_set_tint
/* 18EC6C 8026038C 00A0382D */   daddu    $a3, $a1, $zero
.L80260390:
/* 18EC70 80260390 8E240000 */  lw        $a0, 0x0($s1)
/* 18EC74 80260394 24050080 */  addiu     $a1, $zero, 0x80
/* 18EC78 80260398 00A0302D */  daddu     $a2, $a1, $zero
/* 18EC7C 8026039C 00A0382D */  daddu     $a3, $a1, $zero
/* 18EC80 802603A0 26310004 */  addiu     $s1, $s1, 0x4
/* 18EC84 802603A4 0C0513BF */  jal       hud_element_set_tint
/* 18EC88 802603A8 26520001 */   addiu    $s2, $s2, 0x1
/* 18EC8C 802603AC 2A420007 */  slti      $v0, $s2, 0x7
/* 18EC90 802603B0 1440FFF7 */  bnez      $v0, .L80260390
/* 18EC94 802603B4 00000000 */   nop
/* 18EC98 802603B8 0000902D */  daddu     $s2, $zero, $zero
/* 18EC9C 802603BC 3C10802A */  lui       $s0, %hi(LevelUpStatTextIDs)
/* 18ECA0 802603C0 2610FA90 */  addiu     $s0, $s0, %lo(LevelUpStatTextIDs)
.L802603C4:
/* 18ECA4 802603C4 8E04001C */  lw        $a0, 0x1C($s0)
/* 18ECA8 802603C8 240500FF */  addiu     $a1, $zero, 0xFF
/* 18ECAC 802603CC 00A0302D */  daddu     $a2, $a1, $zero
/* 18ECB0 802603D0 00A0382D */  daddu     $a3, $a1, $zero
/* 18ECB4 802603D4 26100004 */  addiu     $s0, $s0, 0x4
/* 18ECB8 802603D8 0C0513BF */  jal       hud_element_set_tint
/* 18ECBC 802603DC 26520001 */   addiu    $s2, $s2, 0x1
/* 18ECC0 802603E0 2A420007 */  slti      $v0, $s2, 0x7
/* 18ECC4 802603E4 1440FFF7 */  bnez      $v0, .L802603C4
/* 18ECC8 802603E8 00000000 */   nop
/* 18ECCC 802603EC 0000902D */  daddu     $s2, $zero, $zero
/* 18ECD0 802603F0 3C10802A */  lui       $s0, %hi(LevelUpStatTextIDs)
/* 18ECD4 802603F4 2610FA90 */  addiu     $s0, $s0, %lo(LevelUpStatTextIDs)
.L802603F8:
/* 18ECD8 802603F8 8E040038 */  lw        $a0, 0x38($s0)
/* 18ECDC 802603FC 24050080 */  addiu     $a1, $zero, 0x80
/* 18ECE0 80260400 00A0302D */  daddu     $a2, $a1, $zero
/* 18ECE4 80260404 00A0382D */  daddu     $a3, $a1, $zero
/* 18ECE8 80260408 26100004 */  addiu     $s0, $s0, 0x4
/* 18ECEC 8026040C 0C0513BF */  jal       hud_element_set_tint
/* 18ECF0 80260410 26520001 */   addiu    $s2, $s2, 0x1
/* 18ECF4 80260414 2A420007 */  slti      $v0, $s2, 0x7
/* 18ECF8 80260418 1440FFF7 */  bnez      $v0, .L802603F8
/* 18ECFC 8026041C 00000000 */   nop
/* 18ED00 80260420 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18ED04 80260424 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18ED08 80260428 8E110000 */  lw        $s1, 0x0($s0)
/* 18ED0C 8026042C 0C05122C */  jal       hud_element_get_script
/* 18ED10 80260430 0220202D */   daddu    $a0, $s1, $zero
/* 18ED14 80260434 3C05802B */  lui       $a1, %hi(D_802A9F34_7B18D4)
/* 18ED18 80260438 24A59F34 */  addiu     $a1, $a1, %lo(D_802A9F34_7B18D4)
/* 18ED1C 8026043C 10450003 */  beq       $v0, $a1, .L8026044C
/* 18ED20 80260440 00000000 */   nop
/* 18ED24 80260444 0C0511FF */  jal       hud_element_set_script
/* 18ED28 80260448 0220202D */   daddu    $a0, $s1, $zero
.L8026044C:
/* 18ED2C 8026044C 8E11000C */  lw        $s1, 0xC($s0)
/* 18ED30 80260450 0C05122C */  jal       hud_element_get_script
/* 18ED34 80260454 0220202D */   daddu    $a0, $s1, $zero
/* 18ED38 80260458 3C05802B */  lui       $a1, %hi(.L802A9F84_7B1924)
/* 18ED3C 8026045C 24A59F84 */  addiu     $a1, $a1, %lo(.L802A9F84_7B1924)
/* 18ED40 80260460 10450003 */  beq       $v0, $a1, .L80260470
/* 18ED44 80260464 00000000 */   nop
/* 18ED48 80260468 0C0511FF */  jal       hud_element_set_script
/* 18ED4C 8026046C 0220202D */   daddu    $a0, $s1, $zero
.L80260470:
/* 18ED50 80260470 8E110004 */  lw        $s1, 0x4($s0)
/* 18ED54 80260474 0C05122C */  jal       hud_element_get_script
/* 18ED58 80260478 0220202D */   daddu    $a0, $s1, $zero
/* 18ED5C 8026047C 3C05802B */  lui       $a1, %hi(D_802A9F5C_7B18FC)
/* 18ED60 80260480 24A59F5C */  addiu     $a1, $a1, %lo(D_802A9F5C_7B18FC)
/* 18ED64 80260484 10450003 */  beq       $v0, $a1, .L80260494
/* 18ED68 80260488 00000000 */   nop
/* 18ED6C 8026048C 0C0511FF */  jal       hud_element_set_script
/* 18ED70 80260490 0220202D */   daddu    $a0, $s1, $zero
.L80260494:
/* 18ED74 80260494 8E110008 */  lw        $s1, 0x8($s0)
/* 18ED78 80260498 0C05122C */  jal       hud_element_get_script
/* 18ED7C 8026049C 0220202D */   daddu    $a0, $s1, $zero
/* 18ED80 802604A0 3C05802B */  lui       $a1, %hi(D_802A9FAC_7B194C)
/* 18ED84 802604A4 24A59FAC */  addiu     $a1, $a1, %lo(D_802A9FAC_7B194C)
/* 18ED88 802604A8 10450082 */  beq       $v0, $a1, .L802606B4
/* 18ED8C 802604AC 00000000 */   nop
/* 18ED90 802604B0 0C0511FF */  jal       hud_element_set_script
/* 18ED94 802604B4 0220202D */   daddu    $a0, $s1, $zero
/* 18ED98 802604B8 080981AD */  j         .L802606B4
/* 18ED9C 802604BC 00000000 */   nop
.L802604C0:
/* 18EDA0 802604C0 241500B4 */  addiu     $s5, $zero, 0xB4
/* 18EDA4 802604C4 24050080 */  addiu     $a1, $zero, 0x80
/* 18EDA8 802604C8 00A0302D */  daddu     $a2, $a1, $zero
/* 18EDAC 802604CC 00A0382D */  daddu     $a3, $a1, $zero
/* 18EDB0 802604D0 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18EDB4 802604D4 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18EDB8 802604D8 8E040000 */  lw        $a0, 0x0($s0)
/* 18EDBC 802604DC 3C11802A */  lui       $s1, %hi(LevelUpStatTextIDs)
/* 18EDC0 802604E0 2631FA90 */  addiu     $s1, $s1, %lo(LevelUpStatTextIDs)
/* 18EDC4 802604E4 0C0513BF */  jal       hud_element_set_tint
/* 18EDC8 802604E8 0000902D */   daddu    $s2, $zero, $zero
/* 18EDCC 802604EC 240500FF */  addiu     $a1, $zero, 0xFF
/* 18EDD0 802604F0 00A0302D */  daddu     $a2, $a1, $zero
/* 18EDD4 802604F4 8E04000C */  lw        $a0, 0xC($s0)
/* 18EDD8 802604F8 0C0513BF */  jal       hud_element_set_tint
/* 18EDDC 802604FC 00A0382D */   daddu    $a3, $a1, $zero
/* 18EDE0 80260500 240500FF */  addiu     $a1, $zero, 0xFF
/* 18EDE4 80260504 00A0302D */  daddu     $a2, $a1, $zero
/* 18EDE8 80260508 8E040004 */  lw        $a0, 0x4($s0)
/* 18EDEC 8026050C 0C0513BF */  jal       hud_element_set_tint
/* 18EDF0 80260510 00A0382D */   daddu    $a3, $a1, $zero
/* 18EDF4 80260514 24050080 */  addiu     $a1, $zero, 0x80
/* 18EDF8 80260518 00A0302D */  daddu     $a2, $a1, $zero
/* 18EDFC 8026051C 8E040008 */  lw        $a0, 0x8($s0)
/* 18EE00 80260520 0C0513BF */  jal       hud_element_set_tint
/* 18EE04 80260524 00A0382D */   daddu    $a3, $a1, $zero
.L80260528:
/* 18EE08 80260528 8E240000 */  lw        $a0, 0x0($s1)
/* 18EE0C 8026052C 240500FF */  addiu     $a1, $zero, 0xFF
/* 18EE10 80260530 00A0302D */  daddu     $a2, $a1, $zero
/* 18EE14 80260534 00A0382D */  daddu     $a3, $a1, $zero
/* 18EE18 80260538 26310004 */  addiu     $s1, $s1, 0x4
/* 18EE1C 8026053C 0C0513BF */  jal       hud_element_set_tint
/* 18EE20 80260540 26520001 */   addiu    $s2, $s2, 0x1
/* 18EE24 80260544 2A420007 */  slti      $v0, $s2, 0x7
/* 18EE28 80260548 1440FFF7 */  bnez      $v0, .L80260528
/* 18EE2C 8026054C 00000000 */   nop
/* 18EE30 80260550 0000902D */  daddu     $s2, $zero, $zero
/* 18EE34 80260554 3C10802A */  lui       $s0, %hi(LevelUpStatTextIDs)
/* 18EE38 80260558 2610FA90 */  addiu     $s0, $s0, %lo(LevelUpStatTextIDs)
.L8026055C:
/* 18EE3C 8026055C 8E04001C */  lw        $a0, 0x1C($s0)
/* 18EE40 80260560 24050080 */  addiu     $a1, $zero, 0x80
/* 18EE44 80260564 00A0302D */  daddu     $a2, $a1, $zero
/* 18EE48 80260568 00A0382D */  daddu     $a3, $a1, $zero
/* 18EE4C 8026056C 26100004 */  addiu     $s0, $s0, 0x4
/* 18EE50 80260570 0C0513BF */  jal       hud_element_set_tint
/* 18EE54 80260574 26520001 */   addiu    $s2, $s2, 0x1
/* 18EE58 80260578 2A420007 */  slti      $v0, $s2, 0x7
/* 18EE5C 8026057C 1440FFF7 */  bnez      $v0, .L8026055C
/* 18EE60 80260580 00000000 */   nop
/* 18EE64 80260584 0000902D */  daddu     $s2, $zero, $zero
/* 18EE68 80260588 3C10802A */  lui       $s0, %hi(LevelUpStatTextIDs)
/* 18EE6C 8026058C 2610FA90 */  addiu     $s0, $s0, %lo(LevelUpStatTextIDs)
.L80260590:
/* 18EE70 80260590 8E040038 */  lw        $a0, 0x38($s0)
/* 18EE74 80260594 24050080 */  addiu     $a1, $zero, 0x80
/* 18EE78 80260598 00A0302D */  daddu     $a2, $a1, $zero
/* 18EE7C 8026059C 00A0382D */  daddu     $a3, $a1, $zero
/* 18EE80 802605A0 26100004 */  addiu     $s0, $s0, 0x4
/* 18EE84 802605A4 0C0513BF */  jal       hud_element_set_tint
/* 18EE88 802605A8 26520001 */   addiu    $s2, $s2, 0x1
/* 18EE8C 802605AC 2A420007 */  slti      $v0, $s2, 0x7
/* 18EE90 802605B0 10400040 */  beqz      $v0, .L802606B4
/* 18EE94 802605B4 00000000 */   nop
/* 18EE98 802605B8 08098164 */  j         .L80260590
/* 18EE9C 802605BC 00000000 */   nop
.L802605C0:
/* 18EEA0 802605C0 24050080 */  addiu     $a1, $zero, 0x80
.L802605C4:
/* 18EEA4 802605C4 00A0302D */  daddu     $a2, $a1, $zero
/* 18EEA8 802605C8 00A0382D */  daddu     $a3, $a1, $zero
/* 18EEAC 802605CC 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18EEB0 802605D0 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18EEB4 802605D4 8E040000 */  lw        $a0, 0x0($s0)
/* 18EEB8 802605D8 3C11802A */  lui       $s1, %hi(LevelUpStatTextIDs)
/* 18EEBC 802605DC 2631FA90 */  addiu     $s1, $s1, %lo(LevelUpStatTextIDs)
/* 18EEC0 802605E0 0C0513BF */  jal       hud_element_set_tint
/* 18EEC4 802605E4 0000902D */   daddu    $s2, $zero, $zero
/* 18EEC8 802605E8 24050080 */  addiu     $a1, $zero, 0x80
/* 18EECC 802605EC 00A0302D */  daddu     $a2, $a1, $zero
/* 18EED0 802605F0 8E04000C */  lw        $a0, 0xC($s0)
/* 18EED4 802605F4 0C0513BF */  jal       hud_element_set_tint
/* 18EED8 802605F8 00A0382D */   daddu    $a3, $a1, $zero
/* 18EEDC 802605FC 24050080 */  addiu     $a1, $zero, 0x80
/* 18EEE0 80260600 00A0302D */  daddu     $a2, $a1, $zero
/* 18EEE4 80260604 8E040004 */  lw        $a0, 0x4($s0)
/* 18EEE8 80260608 0C0513BF */  jal       hud_element_set_tint
/* 18EEEC 8026060C 00A0382D */   daddu    $a3, $a1, $zero
/* 18EEF0 80260610 240500FF */  addiu     $a1, $zero, 0xFF
/* 18EEF4 80260614 00A0302D */  daddu     $a2, $a1, $zero
/* 18EEF8 80260618 8E040008 */  lw        $a0, 0x8($s0)
/* 18EEFC 8026061C 0C0513BF */  jal       hud_element_set_tint
/* 18EF00 80260620 00A0382D */   daddu    $a3, $a1, $zero
.L80260624:
/* 18EF04 80260624 8E240000 */  lw        $a0, 0x0($s1)
/* 18EF08 80260628 24050080 */  addiu     $a1, $zero, 0x80
/* 18EF0C 8026062C 00A0302D */  daddu     $a2, $a1, $zero
/* 18EF10 80260630 00A0382D */  daddu     $a3, $a1, $zero
/* 18EF14 80260634 26310004 */  addiu     $s1, $s1, 0x4
/* 18EF18 80260638 0C0513BF */  jal       hud_element_set_tint
/* 18EF1C 8026063C 26520001 */   addiu    $s2, $s2, 0x1
/* 18EF20 80260640 2A420007 */  slti      $v0, $s2, 0x7
/* 18EF24 80260644 1440FFF7 */  bnez      $v0, .L80260624
/* 18EF28 80260648 00000000 */   nop
/* 18EF2C 8026064C 0000902D */  daddu     $s2, $zero, $zero
/* 18EF30 80260650 3C10802A */  lui       $s0, %hi(LevelUpStatTextIDs)
/* 18EF34 80260654 2610FA90 */  addiu     $s0, $s0, %lo(LevelUpStatTextIDs)
.L80260658:
/* 18EF38 80260658 8E04001C */  lw        $a0, 0x1C($s0)
/* 18EF3C 8026065C 24050080 */  addiu     $a1, $zero, 0x80
/* 18EF40 80260660 00A0302D */  daddu     $a2, $a1, $zero
/* 18EF44 80260664 00A0382D */  daddu     $a3, $a1, $zero
/* 18EF48 80260668 26100004 */  addiu     $s0, $s0, 0x4
/* 18EF4C 8026066C 0C0513BF */  jal       hud_element_set_tint
/* 18EF50 80260670 26520001 */   addiu    $s2, $s2, 0x1
/* 18EF54 80260674 2A420007 */  slti      $v0, $s2, 0x7
/* 18EF58 80260678 1440FFF7 */  bnez      $v0, .L80260658
/* 18EF5C 8026067C 00000000 */   nop
/* 18EF60 80260680 0000902D */  daddu     $s2, $zero, $zero
/* 18EF64 80260684 3C10802A */  lui       $s0, %hi(LevelUpStatTextIDs)
/* 18EF68 80260688 2610FA90 */  addiu     $s0, $s0, %lo(LevelUpStatTextIDs)
.L8026068C:
/* 18EF6C 8026068C 8E040038 */  lw        $a0, 0x38($s0)
/* 18EF70 80260690 240500FF */  addiu     $a1, $zero, 0xFF
/* 18EF74 80260694 00A0302D */  daddu     $a2, $a1, $zero
/* 18EF78 80260698 00A0382D */  daddu     $a3, $a1, $zero
/* 18EF7C 8026069C 26100004 */  addiu     $s0, $s0, 0x4
/* 18EF80 802606A0 0C0513BF */  jal       hud_element_set_tint
/* 18EF84 802606A4 26520001 */   addiu    $s2, $s2, 0x1
/* 18EF88 802606A8 2A420007 */  slti      $v0, $s2, 0x7
/* 18EF8C 802606AC 1440FFF7 */  bnez      $v0, .L8026068C
/* 18EF90 802606B0 00000000 */   nop
.L802606B4:
/* 18EF94 802606B4 0C097FE3 */  jal       func_8025FF8C
/* 18EF98 802606B8 24040001 */   addiu    $a0, $zero, 0x1
/* 18EF9C 802606BC 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18EFA0 802606C0 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18EFA4 802606C4 8E040000 */  lw        $a0, 0x0($s0)
/* 18EFA8 802606C8 0C0511EA */  jal       hud_element_draw_clipped
/* 18EFAC 802606CC 0000982D */   daddu    $s3, $zero, $zero
/* 18EFB0 802606D0 8E04000C */  lw        $a0, 0xC($s0)
/* 18EFB4 802606D4 0C0511EA */  jal       hud_element_draw_clipped
/* 18EFB8 802606D8 0260882D */   daddu    $s1, $s3, $zero
/* 18EFBC 802606DC 8E040004 */  lw        $a0, 0x4($s0)
/* 18EFC0 802606E0 3C14802A */  lui       $s4, %hi(LevelUpStatTextIDs)
/* 18EFC4 802606E4 2694FA90 */  addiu     $s4, $s4, %lo(LevelUpStatTextIDs)
/* 18EFC8 802606E8 0C0511EA */  jal       hud_element_draw_clipped
/* 18EFCC 802606EC 00000000 */   nop
/* 18EFD0 802606F0 0C0511EA */  jal       hud_element_draw_clipped
/* 18EFD4 802606F4 8E040008 */   lw       $a0, 0x8($s0)
.L802606F8:
/* 18EFD8 802606F8 0000902D */  daddu     $s2, $zero, $zero
/* 18EFDC 802606FC 0220802D */  daddu     $s0, $s1, $zero
/* 18EFE0 80260700 02141021 */  addu      $v0, $s0, $s4
.L80260704:
/* 18EFE4 80260704 8C440000 */  lw        $a0, 0x0($v0)
/* 18EFE8 80260708 26100004 */  addiu     $s0, $s0, 0x4
/* 18EFEC 8026070C 0C0511EA */  jal       hud_element_draw_clipped
/* 18EFF0 80260710 26520001 */   addiu    $s2, $s2, 0x1
/* 18EFF4 80260714 2A420007 */  slti      $v0, $s2, 0x7
/* 18EFF8 80260718 1440FFFA */  bnez      $v0, .L80260704
/* 18EFFC 8026071C 02141021 */   addu     $v0, $s0, $s4
/* 18F000 80260720 26730001 */  addiu     $s3, $s3, 0x1
/* 18F004 80260724 2A620003 */  slti      $v0, $s3, 0x3
/* 18F008 80260728 1440FFF3 */  bnez      $v0, .L802606F8
/* 18F00C 8026072C 2631001C */   addiu    $s1, $s1, 0x1C
/* 18F010 80260730 0C051086 */  jal       func_80144218
/* 18F014 80260734 2404FFFF */   addiu    $a0, $zero, -0x1
/* 18F018 80260738 44951000 */  mtc1      $s5, $f2
/* 18F01C 8026073C 00000000 */  nop
/* 18F020 80260740 468010A0 */  cvt.s.w   $f2, $f2
/* 18F024 80260744 44071000 */  mfc1      $a3, $f2
/* 18F028 80260748 44800000 */  mtc1      $zero, $f0
/* 18F02C 8026074C 3C11802A */  lui       $s1, %hi(D_8029FAE8)
/* 18F030 80260750 8E31FAE8 */  lw        $s1, %lo(D_8029FAE8)($s1)
/* 18F034 80260754 44050000 */  mfc1      $a1, $f0
/* 18F038 80260758 0220202D */  daddu     $a0, $s1, $zero
/* 18F03C 8026075C 0C051489 */  jal       hud_element_set_transform_rotation
/* 18F040 80260760 00A0302D */   daddu    $a2, $a1, $zero
/* 18F044 80260764 0C05108E */  jal       func_80144238
/* 18F048 80260768 0220202D */   daddu    $a0, $s1, $zero
/* 18F04C 8026076C 0809820E */  j         .L80260838
/* 18F050 80260770 00000000 */   nop
glabel .L80260774
/* 18F054 80260774 0C097FE3 */  jal       func_8025FF8C
/* 18F058 80260778 24040001 */   addiu    $a0, $zero, 0x1
/* 18F05C 8026077C 3C10802A */  lui       $s0, %hi(LevelUpStatEmblemIDs)
/* 18F060 80260780 2610FA80 */  addiu     $s0, $s0, %lo(LevelUpStatEmblemIDs)
/* 18F064 80260784 8E040000 */  lw        $a0, 0x0($s0)
/* 18F068 80260788 0C0511EA */  jal       hud_element_draw_clipped
/* 18F06C 8026078C 0000982D */   daddu    $s3, $zero, $zero
/* 18F070 80260790 8E04000C */  lw        $a0, 0xC($s0)
/* 18F074 80260794 0C0511EA */  jal       hud_element_draw_clipped
/* 18F078 80260798 0260882D */   daddu    $s1, $s3, $zero
/* 18F07C 8026079C 8E040004 */  lw        $a0, 0x4($s0)
/* 18F080 802607A0 3C14802A */  lui       $s4, %hi(LevelUpStatTextIDs)
/* 18F084 802607A4 2694FA90 */  addiu     $s4, $s4, %lo(LevelUpStatTextIDs)
/* 18F088 802607A8 0C0511EA */  jal       hud_element_draw_clipped
/* 18F08C 802607AC 00000000 */   nop
/* 18F090 802607B0 0C0511EA */  jal       hud_element_draw_clipped
/* 18F094 802607B4 8E040008 */   lw       $a0, 0x8($s0)
.L802607B8:
/* 18F098 802607B8 0000902D */  daddu     $s2, $zero, $zero
/* 18F09C 802607BC 0220802D */  daddu     $s0, $s1, $zero
/* 18F0A0 802607C0 02141021 */  addu      $v0, $s0, $s4
.L802607C4:
/* 18F0A4 802607C4 8C440000 */  lw        $a0, 0x0($v0)
/* 18F0A8 802607C8 26100004 */  addiu     $s0, $s0, 0x4
/* 18F0AC 802607CC 0C0511EA */  jal       hud_element_draw_clipped
/* 18F0B0 802607D0 26520001 */   addiu    $s2, $s2, 0x1
/* 18F0B4 802607D4 2A420007 */  slti      $v0, $s2, 0x7
/* 18F0B8 802607D8 1440FFFA */  bnez      $v0, .L802607C4
/* 18F0BC 802607DC 02141021 */   addu     $v0, $s0, $s4
/* 18F0C0 802607E0 26730001 */  addiu     $s3, $s3, 0x1
/* 18F0C4 802607E4 2A620003 */  slti      $v0, $s3, 0x3
/* 18F0C8 802607E8 1440FFF3 */  bnez      $v0, .L802607B8
/* 18F0CC 802607EC 2631001C */   addiu    $s1, $s1, 0x1C
/* 18F0D0 802607F0 3C018028 */  lui       $at, %hi(D_80284150)
/* 18F0D4 802607F4 C4224150 */  lwc1      $f2, %lo(D_80284150)($at)
/* 18F0D8 802607F8 0809820B */  j         .L8026082C
/* 18F0DC 802607FC 468010A0 */   cvt.s.w  $f2, $f2
glabel .L80260800
/* 18F0E0 80260800 3C018028 */  lui       $at, %hi(D_80284150)
/* 18F0E4 80260804 C4224150 */  lwc1      $f2, %lo(D_80284150)($at)
/* 18F0E8 80260808 0809820B */  j         .L8026082C
/* 18F0EC 8026080C 468010A0 */   cvt.s.w  $f2, $f2
glabel .L80260810
/* 18F0F0 80260810 3C058028 */  lui       $a1, %hi(D_80284150)
/* 18F0F4 80260814 8CA54150 */  lw        $a1, %lo(D_80284150)($a1)
/* 18F0F8 80260818 10A00007 */  beqz      $a1, .L80260838
/* 18F0FC 8026081C 00000000 */   nop
/* 18F100 80260820 44851000 */  mtc1      $a1, $f2
/* 18F104 80260824 00000000 */  nop
/* 18F108 80260828 468010A0 */  cvt.s.w   $f2, $f2
.L8026082C:
/* 18F10C 8026082C 44051000 */  mfc1      $a1, $f2
/* 18F110 80260830 0C04DF62 */  jal       set_screen_overlay_params_front
/* 18F114 80260834 0000202D */   daddu    $a0, $zero, $zero
glabel .L80260838
/* 18F118 80260838 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 18F11C 8026083C 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 18F120 80260840 28620007 */  slti      $v0, $v1, 0x7
/* 18F124 80260844 14400037 */  bnez      $v0, .L80260924
/* 18F128 80260848 2862000A */   slti     $v0, $v1, 0xA
/* 18F12C 8026084C 14400005 */  bnez      $v0, .L80260864
/* 18F130 80260850 2402000A */   addiu    $v0, $zero, 0xA
/* 18F134 80260854 1062001B */  beq       $v1, $v0, .L802608C4
/* 18F138 80260858 00000000 */   nop
/* 18F13C 8026085C 08098249 */  j         .L80260924
/* 18F140 80260860 00000000 */   nop
.L80260864:
/* 18F144 80260864 3C06802A */  lui       $a2, %hi(LevelUpSelectTextVelX)
/* 18F148 80260868 24C6FB8C */  addiu     $a2, $a2, %lo(LevelUpSelectTextVelX)
/* 18F14C 8026086C 3C05802A */  lui       $a1, %hi(LevelUpSelectTextOffsetX)
/* 18F150 80260870 24A5FB88 */  addiu     $a1, $a1, %lo(LevelUpSelectTextOffsetX)
/* 18F154 80260874 8CC30000 */  lw        $v1, 0x0($a2)
/* 18F158 80260878 8CA20000 */  lw        $v0, 0x0($a1)
/* 18F15C 8026087C 24640002 */  addiu     $a0, $v1, 0x2
/* 18F160 80260880 00441021 */  addu      $v0, $v0, $a0
/* 18F164 80260884 ACC40000 */  sw        $a0, 0x0($a2)
/* 18F168 80260888 ACA20000 */  sw        $v0, 0x0($a1)
/* 18F16C 8026088C 284200C9 */  slti      $v0, $v0, 0xC9
/* 18F170 80260890 5440001C */  bnel      $v0, $zero, .L80260904
/* 18F174 80260894 240600B0 */   addiu    $a2, $zero, 0xB0
/* 18F178 80260898 3C035555 */  lui       $v1, (0x55555556 >> 16)
/* 18F17C 8026089C 34635556 */  ori       $v1, $v1, (0x55555556 & 0xFFFF)
/* 18F180 802608A0 00041023 */  negu      $v0, $a0
/* 18F184 802608A4 00430018 */  mult      $v0, $v1
/* 18F188 802608A8 240300C8 */  addiu     $v1, $zero, 0xC8
/* 18F18C 802608AC 000217C3 */  sra       $v0, $v0, 31
/* 18F190 802608B0 ACA30000 */  sw        $v1, 0x0($a1)
/* 18F194 802608B4 00004010 */  mfhi      $t0
/* 18F198 802608B8 01021023 */  subu      $v0, $t0, $v0
/* 18F19C 802608BC 08098240 */  j         .L80260900
/* 18F1A0 802608C0 ACC20000 */   sw       $v0, 0x0($a2)
.L802608C4:
/* 18F1A4 802608C4 3C02802A */  lui       $v0, %hi(LevelUpSelectTextVelX)
/* 18F1A8 802608C8 2442FB8C */  addiu     $v0, $v0, %lo(LevelUpSelectTextVelX)
/* 18F1AC 802608CC 3C05802A */  lui       $a1, %hi(LevelUpSelectTextOffsetX)
/* 18F1B0 802608D0 24A5FB88 */  addiu     $a1, $a1, %lo(LevelUpSelectTextOffsetX)
/* 18F1B4 802608D4 8C430000 */  lw        $v1, 0x0($v0)
/* 18F1B8 802608D8 8CA40000 */  lw        $a0, 0x0($a1)
/* 18F1BC 802608DC 24630004 */  addiu     $v1, $v1, 0x4
/* 18F1C0 802608E0 00832021 */  addu      $a0, $a0, $v1
/* 18F1C4 802608E4 AC430000 */  sw        $v1, 0x0($v0)
/* 18F1C8 802608E8 ACA40000 */  sw        $a0, 0x0($a1)
/* 18F1CC 802608EC 288401F5 */  slti      $a0, $a0, 0x1F5
/* 18F1D0 802608F0 14800004 */  bnez      $a0, .L80260904
/* 18F1D4 802608F4 240600B0 */   addiu    $a2, $zero, 0xB0
/* 18F1D8 802608F8 240201F4 */  addiu     $v0, $zero, 0x1F4
/* 18F1DC 802608FC ACA20000 */  sw        $v0, 0x0($a1)
.L80260900:
/* 18F1E0 80260900 240600B0 */  addiu     $a2, $zero, 0xB0
.L80260904:
/* 18F1E4 80260904 3C11802A */  lui       $s1, %hi(LevelUpSelectTextID)
/* 18F1E8 80260908 8E31FB48 */  lw        $s1, %lo(LevelUpSelectTextID)($s1)
/* 18F1EC 8026090C 8CA50000 */  lw        $a1, 0x0($a1)
/* 18F1F0 80260910 0220202D */  daddu     $a0, $s1, $zero
/* 18F1F4 80260914 0C051261 */  jal       hud_element_set_render_pos
/* 18F1F8 80260918 24A5FFD5 */   addiu    $a1, $a1, -0x2B
/* 18F1FC 8026091C 0C0511EA */  jal       hud_element_draw_clipped
/* 18F200 80260920 0220202D */   daddu    $a0, $s1, $zero
.L80260924:
/* 18F204 80260924 8FBF0028 */  lw        $ra, 0x28($sp)
/* 18F208 80260928 8FB50024 */  lw        $s5, 0x24($sp)
/* 18F20C 8026092C 8FB40020 */  lw        $s4, 0x20($sp)
/* 18F210 80260930 8FB3001C */  lw        $s3, 0x1C($sp)
/* 18F214 80260934 8FB20018 */  lw        $s2, 0x18($sp)
/* 18F218 80260938 8FB10014 */  lw        $s1, 0x14($sp)
/* 18F21C 8026093C 8FB00010 */  lw        $s0, 0x10($sp)
/* 18F220 80260940 03E00008 */  jr        $ra
/* 18F224 80260944 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void btl_state_draw_celebration(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    s32 rotZ;
    s32 id;
    s32 i;
    s32 j;

    switch (gBattleSubState) {
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD:
            btl_draw_upgrade_windows(0);
            id = LevelUpStatEmblemIDs[0];
            hud_element_set_tint(id, 128, 128, 128);
            hud_element_draw_clipped(id);
            id = LevelUpStatEmblemIDs[3];
            hud_element_set_tint(id, 128, 128, 128);
            hud_element_draw_clipped(id);
            id = LevelUpStatEmblemIDs[1];
            hud_element_set_tint(id, 128, 128, 128);
            hud_element_draw_clipped(id);
            id = LevelUpStatEmblemIDs[2];
            hud_element_set_tint(id, 128, 128, 128);
            hud_element_draw_clipped(id);

            for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs); j++) {
                for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) {
                    id = LevelUpStatTextIDs[j][i];

                    hud_element_set_tint(id, 128, 128, 128);
                    hud_element_draw_clipped(id);
                }
            }
            break;
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE:
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID:
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID_DELAY:
            switch (battleStatus->currentSubmenu) {
                case 0:
                    rotZ = 152;
                    hud_element_set_tint(LevelUpStatEmblemIDs[0], 255, 255, 255);
                    hud_element_set_tint(LevelUpStatEmblemIDs[3], 128, 128, 128);
                    hud_element_set_tint(LevelUpStatEmblemIDs[1], 128, 128, 128);
                    hud_element_set_tint(LevelUpStatEmblemIDs[2], 128, 128, 128);

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_FP][i];

                        hud_element_set_tint(id, 128, 128, 128);
                    }

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_HP][i];

                        hud_element_set_tint(id, 255, 255, 255);
                    }

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_BP][i];

                        hud_element_set_tint(id, 128, 128, 128);
                    }

                    id = LevelUpStatEmblemIDs[0];
                    if (hud_element_get_script(id) != &HES_level_up_heart_copy) {
                        hud_element_set_script(id, &HES_level_up_heart_copy);
                    }
                    id = LevelUpStatEmblemIDs[3];
                    if (hud_element_get_script(id) != &HES_level_up_leaves) {
                        hud_element_set_script(id, &HES_level_up_leaves);
                    }
                    id = LevelUpStatEmblemIDs[1];
                    if (hud_element_get_script(id) != &HES_level_up_flower) {
                        hud_element_set_script(id, &HES_level_up_flower);
                    }
                    id = LevelUpStatEmblemIDs[2];
                    if (hud_element_get_script(id) != &HES_level_up_badge) {
                        hud_element_set_script(id, &HES_level_up_badge);
                    }
                    break;
                case 1:
                    rotZ = 180;
                    hud_element_set_tint(LevelUpStatEmblemIDs[0], 128, 128, 128);
                    hud_element_set_tint(LevelUpStatEmblemIDs[3], 255, 255, 255);
                    hud_element_set_tint(LevelUpStatEmblemIDs[1], 255, 255, 255);
                    hud_element_set_tint(LevelUpStatEmblemIDs[2], 128, 128, 128);

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_FP][i];

                        hud_element_set_tint(id, 255, 255, 255);
                    }

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_HP][i];

                        hud_element_set_tint(id, 128, 128, 128);
                    }

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_BP][i];

                        hud_element_set_tint(id, 128, 128, 128);
                    }
                    break;
                case 2:
                default:
                    rotZ = 208;
                    hud_element_set_tint(LevelUpStatEmblemIDs[0], 128, 128, 128);
                    hud_element_set_tint(LevelUpStatEmblemIDs[3], 128, 128, 128);
                    hud_element_set_tint(LevelUpStatEmblemIDs[1], 128, 128, 128);
                    hud_element_set_tint(LevelUpStatEmblemIDs[2], 255, 255, 255);

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_FP][i];

                        hud_element_set_tint(id, 128, 128, 128);
                    }

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_HP][i];

                        hud_element_set_tint(id, 128, 128, 128);
                    }

                    for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) {
                        id = LevelUpStatTextIDs[LVL_UP_BP][i];

                        hud_element_set_tint(id, 255, 255, 255);
                    }
                    break;
            }

            btl_draw_upgrade_windows(1);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[0]);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[3]);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[1]);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[2]);

            for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs); j++) {
                for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) {
                    hud_element_draw_clipped(LevelUpStatTextIDs[j][i]);
                }
            }

            func_80144218(-1);
            id = LevelUpSpotlightID;
            hud_element_set_transform_rotation(id, 0.0f, 0.0f, rotZ);
            func_80144238(id);
            break;
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE:
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_FADE_OUT:
            btl_draw_upgrade_windows(1);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[0]);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[3]);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[1]);
            hud_element_draw_clipped(LevelUpStatEmblemIDs[2]);

            for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs); j++) {
                for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) {
                    hud_element_draw_clipped(LevelUpStatTextIDs[j][i]);
                }
            }

            set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, bFadeToBlackAmt);
            break;
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_DESTROY_HUD:
            set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, bFadeToBlackAmt);
            break;
        case BTL_SUBSTATE_CELEBRATE_WALK_AWAY:
            if (bFadeToBlackAmt != 0) {
                set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, bFadeToBlackAmt);
            }
            break;
    }

    switch (gBattleSubState) {
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD:
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE:
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE:
            LevelUpSelectTextVelX += 2;
            LevelUpSelectTextOffsetX += LevelUpSelectTextVelX;
            if (LevelUpSelectTextOffsetX > 200) {
                LevelUpSelectTextOffsetX = 200;
                LevelUpSelectTextVelX = -LevelUpSelectTextVelX / 3; // rebounding
            }
            id = LevelUpSelectTextID;
            hud_element_set_render_pos(id, LevelUpSelectTextOffsetX - 43, 176);
            hud_element_draw_clipped(id);
            break;
        case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_FADE_OUT:
            LevelUpSelectTextVelX += 4;
            LevelUpSelectTextOffsetX += LevelUpSelectTextVelX;
            if (LevelUpSelectTextOffsetX > 500) {
                LevelUpSelectTextOffsetX = 500;
            }
            id = LevelUpSelectTextID;
            hud_element_set_render_pos(id, LevelUpSelectTextOffsetX - 43, 176);
            hud_element_draw_clipped(id);
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel underwater_appendGfx
/* 3B91F0 E00BA620 27BDFF28 */  addiu     $sp, $sp, -0xD8
/* 3B91F4 E00BA624 3C06DB06 */  lui       $a2, (0xDB060024 >> 16)
/* 3B91F8 E00BA628 34C60024 */  ori       $a2, $a2, (0xDB060024 & 0xFFFF)
/* 3B91FC E00BA62C 3C07FF10 */  lui       $a3, (0xFF10013F >> 16)
/* 3B9200 E00BA630 34E7013F */  ori       $a3, $a3, (0xFF10013F & 0xFFFF)
/* 3B9204 E00BA634 0000682D */  daddu     $t5, $zero, $zero
/* 3B9208 E00BA638 3C02800A */  lui       $v0, %hi(gMainGfxPos)
/* 3B920C E00BA63C 2442A66C */  addiu     $v0, $v0, %lo(gMainGfxPos)
/* 3B9210 E00BA640 0040402D */  daddu     $t0, $v0, $zero
/* 3B9214 E00BA644 AFB200B8 */  sw        $s2, 0xB8($sp)
/* 3B9218 E00BA648 3C12FD10 */  lui       $s2, (0xFD10013F >> 16)
/* 3B921C E00BA64C 3652013F */  ori       $s2, $s2, (0xFD10013F & 0xFFFF)
/* 3B9220 E00BA650 3C18800A */  lui       $t8, %hi(nuGfxCfb_ptr)
/* 3B9224 E00BA654 2718A64C */  addiu     $t8, $t8, %lo(nuGfxCfb_ptr)
/* 3B9228 E00BA658 3C0CF510 */  lui       $t4, (0xF510A000 >> 16)
/* 3B922C E00BA65C 358CA000 */  ori       $t4, $t4, (0xF510A000 & 0xFFFF)
/* 3B9230 E00BA660 AFB700CC */  sw        $s7, 0xCC($sp)
/* 3B9234 E00BA664 3C170700 */  lui       $s7, (0x7000000 >> 16)
/* 3B9238 E00BA668 AFB500C4 */  sw        $s5, 0xC4($sp)
/* 3B923C E00BA66C 3C15F400 */  lui       $s5, (0xF4000000 >> 16)
/* 3B9240 E00BA670 AFB100B4 */  sw        $s1, 0xB4($sp)
/* 3B9244 E00BA674 3C11074F */  lui       $s1, (0x74FC014 >> 16)
/* 3B9248 E00BA678 3631C014 */  ori       $s1, $s1, (0x74FC014 & 0xFFFF)
/* 3B924C E00BA67C 3C0EE700 */  lui       $t6, (0xE7000000 >> 16)
/* 3B9250 E00BA680 AFB300BC */  sw        $s3, 0xBC($sp)
/* 3B9254 E00BA684 3C13F200 */  lui       $s3, (0xF2000000 >> 16)
/* 3B9258 E00BA688 AFB000B0 */  sw        $s0, 0xB0($sp)
/* 3B925C E00BA68C 3C10004F */  lui       $s0, (0x4FC014 >> 16)
/* 3B9260 E00BA690 3610C014 */  ori       $s0, $s0, (0x4FC014 & 0xFFFF)
/* 3B9264 E00BA694 3C0FE44F */  lui       $t7, (0xE44FC000 >> 16)
/* 3B9268 E00BA698 35EFC000 */  ori       $t7, $t7, (0xE44FC000 & 0xFFFF)
/* 3B926C E00BA69C 01A0582D */  daddu     $t3, $t5, $zero
/* 3B9270 E00BA6A0 240A0014 */  addiu     $t2, $zero, 0x14
/* 3B9274 E00BA6A4 01A0482D */  daddu     $t1, $t5, $zero
/* 3B9278 E00BA6A8 01C0102D */  daddu     $v0, $t6, $zero
/* 3B927C E00BA6AC AFBF00D4 */  sw        $ra, 0xD4($sp)
/* 3B9280 E00BA6B0 AFBE00D0 */  sw        $fp, 0xD0($sp)
/* 3B9284 E00BA6B4 AFB600C8 */  sw        $s6, 0xC8($sp)
/* 3B9288 E00BA6B8 AFB400C0 */  sw        $s4, 0xC0($sp)
/* 3B928C E00BA6BC 8D030000 */  lw        $v1, 0x0($t0)
/* 3B9290 E00BA6C0 8C94000C */  lw        $s4, 0xC($a0)
/* 3B9294 E00BA6C4 0060282D */  daddu     $a1, $v1, $zero
/* 3B9298 E00BA6C8 9299001F */  lbu       $t9, 0x1F($s4)
/* 3B929C E00BA6CC 24630008 */  addiu     $v1, $v1, 0x8
/* 3B92A0 E00BA6D0 AD030000 */  sw        $v1, 0x0($t0)
/* 3B92A4 E00BA6D4 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B92A8 E00BA6D8 24620008 */  addiu     $v0, $v1, 0x8
/* 3B92AC E00BA6DC ACA00004 */  sw        $zero, 0x4($a1)
/* 3B92B0 E00BA6E0 AD020000 */  sw        $v0, 0x0($t0)
/* 3B92B4 E00BA6E4 AC660000 */  sw        $a2, 0x0($v1)
/* 3B92B8 E00BA6E8 8C840010 */  lw        $a0, 0x10($a0)
/* 3B92BC E00BA6EC 24620010 */  addiu     $v0, $v1, 0x10
/* 3B92C0 E00BA6F0 AD020000 */  sw        $v0, 0x0($t0)
/* 3B92C4 E00BA6F4 3C05800A */  lui       $a1, %hi(nuGfxZBuffer)
/* 3B92C8 E00BA6F8 8CA5A5DC */  lw        $a1, %lo(nuGfxZBuffer)($a1)
/* 3B92CC E00BA6FC 8C84001C */  lw        $a0, 0x1C($a0)
/* 3B92D0 E00BA700 24620018 */  addiu     $v0, $v1, 0x18
/* 3B92D4 E00BA704 AD020000 */  sw        $v0, 0x0($t0)
/* 3B92D8 E00BA708 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3B92DC E00BA70C AC620010 */  sw        $v0, 0x10($v1)
/* 3B92E0 E00BA710 3C020900 */  lui       $v0, %hi(D_09000528_415588)
/* 3B92E4 E00BA714 24420528 */  addiu     $v0, $v0, %lo(D_09000528_415588)
/* 3B92E8 E00BA718 AC620014 */  sw        $v0, 0x14($v1)
/* 3B92EC E00BA71C 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 3B92F0 E00BA720 AC670008 */  sw        $a3, 0x8($v1)
/* 3B92F4 E00BA724 AC65000C */  sw        $a1, 0xC($v1)
/* 3B92F8 E00BA728 00822021 */  addu      $a0, $a0, $v0
/* 3B92FC E00BA72C AC640004 */  sw        $a0, 0x4($v1)
.LE00BA730:
/* 3B9300 E00BA730 3C071000 */  lui       $a3, (0x10000400 >> 16)
/* 3B9304 E00BA734 34E70400 */  ori       $a3, $a3, (0x10000400 & 0xFFFF)
/* 3B9308 E00BA738 31660FFF */  andi      $a2, $t3, 0xFFF
/* 3B930C E00BA73C 256B0018 */  addiu     $t3, $t3, 0x18
/* 3B9310 E00BA740 31450FFF */  andi      $a1, $t2, 0xFFF
/* 3B9314 E00BA744 254A0018 */  addiu     $t2, $t2, 0x18
/* 3B9318 E00BA748 25AD0001 */  addiu     $t5, $t5, 0x1
/* 3B931C E00BA74C 00AF2825 */  or        $a1, $a1, $t7
/* 3B9320 E00BA750 8D020000 */  lw        $v0, 0x0($t0)
/* 3B9324 E00BA754 8F030000 */  lw        $v1, 0x0($t8)
/* 3B9328 E00BA758 0040202D */  daddu     $a0, $v0, $zero
/* 3B932C E00BA75C 24420008 */  addiu     $v0, $v0, 0x8
/* 3B9330 E00BA760 00691821 */  addu      $v1, $v1, $t1
/* 3B9334 E00BA764 AD020000 */  sw        $v0, 0x0($t0)
/* 3B9338 E00BA768 AC830004 */  sw        $v1, 0x4($a0)
/* 3B933C E00BA76C 24430008 */  addiu     $v1, $v0, 0x8
/* 3B9340 E00BA770 AC920000 */  sw        $s2, 0x0($a0)
/* 3B9344 E00BA774 AD030000 */  sw        $v1, 0x0($t0)
/* 3B9348 E00BA778 24430010 */  addiu     $v1, $v0, 0x10
/* 3B934C E00BA77C 3C16E600 */  lui       $s6, (0xE6000000 >> 16)
/* 3B9350 E00BA780 AC4C0000 */  sw        $t4, 0x0($v0)
/* 3B9354 E00BA784 AC570004 */  sw        $s7, 0x4($v0)
/* 3B9358 E00BA788 AD030000 */  sw        $v1, 0x0($t0)
/* 3B935C E00BA78C 24430018 */  addiu     $v1, $v0, 0x18
/* 3B9360 E00BA790 AC560008 */  sw        $s6, 0x8($v0)
/* 3B9364 E00BA794 AC40000C */  sw        $zero, 0xC($v0)
/* 3B9368 E00BA798 AD030000 */  sw        $v1, 0x0($t0)
/* 3B936C E00BA79C 24430020 */  addiu     $v1, $v0, 0x20
/* 3B9370 E00BA7A0 AC550010 */  sw        $s5, 0x10($v0)
/* 3B9374 E00BA7A4 AC510014 */  sw        $s1, 0x14($v0)
/* 3B9378 E00BA7A8 AD030000 */  sw        $v1, 0x0($t0)
/* 3B937C E00BA7AC 24430028 */  addiu     $v1, $v0, 0x28
/* 3B9380 E00BA7B0 AC4E0018 */  sw        $t6, 0x18($v0)
/* 3B9384 E00BA7B4 AC40001C */  sw        $zero, 0x1C($v0)
/* 3B9388 E00BA7B8 AD030000 */  sw        $v1, 0x0($t0)
/* 3B938C E00BA7BC 24430030 */  addiu     $v1, $v0, 0x30
/* 3B9390 E00BA7C0 AC4C0020 */  sw        $t4, 0x20($v0)
/* 3B9394 E00BA7C4 AC400024 */  sw        $zero, 0x24($v0)
/* 3B9398 E00BA7C8 AD030000 */  sw        $v1, 0x0($t0)
/* 3B939C E00BA7CC 24430038 */  addiu     $v1, $v0, 0x38
/* 3B93A0 E00BA7D0 AC530028 */  sw        $s3, 0x28($v0)
/* 3B93A4 E00BA7D4 AC50002C */  sw        $s0, 0x2C($v0)
/* 3B93A8 E00BA7D8 AD030000 */  sw        $v1, 0x0($t0)
/* 3B93AC E00BA7DC 24430040 */  addiu     $v1, $v0, 0x40
/* 3B93B0 E00BA7E0 AC450030 */  sw        $a1, 0x30($v0)
/* 3B93B4 E00BA7E4 AC460034 */  sw        $a2, 0x34($v0)
/* 3B93B8 E00BA7E8 AD030000 */  sw        $v1, 0x0($t0)
/* 3B93BC E00BA7EC 3C03E100 */  lui       $v1, (0xE1000000 >> 16)
/* 3B93C0 E00BA7F0 AC430038 */  sw        $v1, 0x38($v0)
/* 3B93C4 E00BA7F4 24430048 */  addiu     $v1, $v0, 0x48
/* 3B93C8 E00BA7F8 AC40003C */  sw        $zero, 0x3C($v0)
/* 3B93CC E00BA7FC AD030000 */  sw        $v1, 0x0($t0)
/* 3B93D0 E00BA800 3C03F100 */  lui       $v1, (0xF1000000 >> 16)
/* 3B93D4 E00BA804 AC430040 */  sw        $v1, 0x40($v0)
/* 3B93D8 E00BA808 24430050 */  addiu     $v1, $v0, 0x50
/* 3B93DC E00BA80C AC470044 */  sw        $a3, 0x44($v0)
/* 3B93E0 E00BA810 AD030000 */  sw        $v1, 0x0($t0)
/* 3B93E4 E00BA814 AC4E0048 */  sw        $t6, 0x48($v0)
/* 3B93E8 E00BA818 AC40004C */  sw        $zero, 0x4C($v0)
/* 3B93EC E00BA81C 29A20028 */  slti      $v0, $t5, 0x28
/* 3B93F0 E00BA820 1440FFC3 */  bnez      $v0, .LE00BA730
/* 3B93F4 E00BA824 25290F00 */   addiu    $t1, $t1, 0xF00
/* 3B93F8 E00BA828 3C06FF10 */  lui       $a2, (0xFF10013F >> 16)
/* 3B93FC E00BA82C 34C6013F */  ori       $a2, $a2, (0xFF10013F & 0xFFFF)
/* 3B9400 E00BA830 3C0AE300 */  lui       $t2, (0xE3000A01 >> 16)
/* 3B9404 E00BA834 354A0A01 */  ori       $t2, $t2, (0xE3000A01 & 0xFFFF)
/* 3B9408 E00BA838 3C0CFC35 */  lui       $t4, (0xFC357E6A >> 16)
/* 3B940C E00BA83C 358C7E6A */  ori       $t4, $t4, (0xFC357E6A & 0xFFFF)
/* 3B9410 E00BA840 3C0BFFFC */  lui       $t3, (0xFFFCF87C >> 16)
/* 3B9414 E00BA844 356BF87C */  ori       $t3, $t3, (0xFFFCF87C & 0xFFFF)
/* 3B9418 E00BA848 3C0DFD10 */  lui       $t5, (0xFD10013F >> 16)
/* 3B941C E00BA84C 35AD013F */  ori       $t5, $t5, (0xFD10013F & 0xFFFF)
/* 3B9420 E00BA850 3C0FE200 */  lui       $t7, (0xE200001C >> 16)
/* 3B9424 E00BA854 35EF001C */  ori       $t7, $t7, (0xE200001C & 0xFFFF)
/* 3B9428 E00BA858 3C0E0F0A */  lui       $t6, (0xF0A4300 >> 16)
/* 3B942C E00BA85C 35CE4300 */  ori       $t6, $t6, (0xF0A4300 & 0xFFFF)
/* 3B9430 E00BA860 3C11E300 */  lui       $s1, (0xE3000C00 >> 16)
/* 3B9434 E00BA864 36310C00 */  ori       $s1, $s1, (0xE3000C00 & 0xFFFF)
/* 3B9438 E00BA868 3C12E300 */  lui       $s2, (0xE3001201 >> 16)
/* 3B943C E00BA86C 36521201 */  ori       $s2, $s2, (0xE3001201 & 0xFFFF)
/* 3B9440 E00BA870 27A40020 */  addiu     $a0, $sp, 0x20
/* 3B9444 E00BA874 3C130001 */  lui       $s3, (0x11630 >> 16)
/* 3B9448 E00BA878 36731630 */  ori       $s3, $s3, (0x11630 & 0xFFFF)
/* 3B944C E00BA87C 3C10800A */  lui       $s0, %hi(gMainGfxPos)
/* 3B9450 E00BA880 2610A66C */  addiu     $s0, $s0, %lo(gMainGfxPos)
/* 3B9454 E00BA884 8E080000 */  lw        $t0, 0x0($s0)
/* 3B9458 E00BA888 3C05C2A0 */  lui       $a1, (0xC2A00000 >> 16)
/* 3B945C E00BA88C 3C03800A */  lui       $v1, %hi(nuGfxCfb_ptr)
/* 3B9460 E00BA890 8C63A64C */  lw        $v1, %lo(nuGfxCfb_ptr)($v1)
/* 3B9464 E00BA894 3C01C270 */  lui       $at, (0xC2700000 >> 16)
/* 3B9468 E00BA898 44810000 */  mtc1      $at, $f0
/* 3B946C E00BA89C 3C014320 */  lui       $at, (0x43200000 >> 16)
/* 3B9470 E00BA8A0 44811000 */  mtc1      $at, $f2
/* 3B9474 E00BA8A4 3C014420 */  lui       $at, (0x44200000 >> 16)
/* 3B9478 E00BA8A8 44812000 */  mtc1      $at, $f4
/* 3B947C E00BA8AC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3B9480 E00BA8B0 44813000 */  mtc1      $at, $f6
/* 3B9484 E00BA8B4 0100102D */  daddu     $v0, $t0, $zero
/* 3B9488 E00BA8B8 25080008 */  addiu     $t0, $t0, 0x8
/* 3B948C E00BA8BC AE080000 */  sw        $t0, 0x0($s0)
/* 3B9490 E00BA8C0 AC460000 */  sw        $a2, 0x0($v0)
/* 3B9494 E00BA8C4 AC430004 */  sw        $v1, 0x4($v0)
/* 3B9498 E00BA8C8 25020008 */  addiu     $v0, $t0, 0x8
/* 3B949C E00BA8CC AE020000 */  sw        $v0, 0x0($s0)
/* 3B94A0 E00BA8D0 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3B94A4 E00BA8D4 AD020000 */  sw        $v0, 0x0($t0)
/* 3B94A8 E00BA8D8 9289001C */  lbu       $t1, 0x1C($s4)
/* 3B94AC E00BA8DC 9286001D */  lbu       $a2, 0x1D($s4)
/* 3B94B0 E00BA8E0 9287001E */  lbu       $a3, 0x1E($s4)
/* 3B94B4 E00BA8E4 25020010 */  addiu     $v0, $t0, 0x10
/* 3B94B8 E00BA8E8 AE020000 */  sw        $v0, 0x0($s0)
/* 3B94BC E00BA8EC 25020018 */  addiu     $v0, $t0, 0x18
/* 3B94C0 E00BA8F0 AD0A0008 */  sw        $t2, 0x8($t0)
/* 3B94C4 E00BA8F4 AD00000C */  sw        $zero, 0xC($t0)
/* 3B94C8 E00BA8F8 AE020000 */  sw        $v0, 0x0($s0)
/* 3B94CC E00BA8FC 25020020 */  addiu     $v0, $t0, 0x20
/* 3B94D0 E00BA900 AD0C0010 */  sw        $t4, 0x10($t0)
/* 3B94D4 E00BA904 AD0B0014 */  sw        $t3, 0x14($t0)
/* 3B94D8 E00BA908 AE020000 */  sw        $v0, 0x0($s0)
/* 3B94DC E00BA90C 3C02800A */  lui       $v0, %hi(nuGfxZBuffer)
/* 3B94E0 E00BA910 8C42A5DC */  lw        $v0, %lo(nuGfxZBuffer)($v0)
/* 3B94E4 E00BA914 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3B94E8 E00BA918 AD0D0018 */  sw        $t5, 0x18($t0)
/* 3B94EC E00BA91C 00431021 */  addu      $v0, $v0, $v1
/* 3B94F0 E00BA920 AD02001C */  sw        $v0, 0x1C($t0)
/* 3B94F4 E00BA924 25020028 */  addiu     $v0, $t0, 0x28
/* 3B94F8 E00BA928 AE020000 */  sw        $v0, 0x0($s0)
/* 3B94FC E00BA92C 25020030 */  addiu     $v0, $t0, 0x30
/* 3B9500 E00BA930 AD0F0020 */  sw        $t7, 0x20($t0)
/* 3B9504 E00BA934 AD0E0024 */  sw        $t6, 0x24($t0)
/* 3B9508 E00BA938 AE020000 */  sw        $v0, 0x0($s0)
/* 3B950C E00BA93C 3C020008 */  lui       $v0, (0x80000 >> 16)
/* 3B9510 E00BA940 AD02002C */  sw        $v0, 0x2C($t0)
/* 3B9514 E00BA944 25020038 */  addiu     $v0, $t0, 0x38
/* 3B9518 E00BA948 AD110028 */  sw        $s1, 0x28($t0)
/* 3B951C E00BA94C AE020000 */  sw        $v0, 0x0($s0)
/* 3B9520 E00BA950 24022000 */  addiu     $v0, $zero, 0x2000
/* 3B9524 E00BA954 00094E00 */  sll       $t1, $t1, 24
/* 3B9528 E00BA958 00063400 */  sll       $a2, $a2, 16
/* 3B952C E00BA95C 01264825 */  or        $t1, $t1, $a2
/* 3B9530 E00BA960 00073A00 */  sll       $a3, $a3, 8
/* 3B9534 E00BA964 01274825 */  or        $t1, $t1, $a3
/* 3B9538 E00BA968 AD020034 */  sw        $v0, 0x34($t0)
/* 3B953C E00BA96C 00191042 */  srl       $v0, $t9, 1
/* 3B9540 E00BA970 3C0642A0 */  lui       $a2, (0x42A00000 >> 16)
/* 3B9544 E00BA974 3C074270 */  lui       $a3, (0x42700000 >> 16)
/* 3B9548 E00BA978 01224825 */  or        $t1, $t1, $v0
/* 3B954C E00BA97C AD120030 */  sw        $s2, 0x30($t0)
/* 3B9550 E00BA980 AD090004 */  sw        $t1, 0x4($t0)
/* 3B9554 E00BA984 E7A00010 */  swc1      $f0, 0x10($sp)
/* 3B9558 E00BA988 E7A20014 */  swc1      $f2, 0x14($sp)
/* 3B955C E00BA98C E7A40018 */  swc1      $f4, 0x18($sp)
/* 3B9560 E00BA990 0C080188 */  jal       shim_guFrustumF
/* 3B9564 E00BA994 E7A6001C */   swc1     $f6, 0x1C($sp)
/* 3B9568 E00BA998 27A40020 */  addiu     $a0, $sp, 0x20
/* 3B956C E00BA99C 3C118007 */  lui       $s1, %hi(gMatrixListPos)
/* 3B9570 E00BA9A0 263141F0 */  addiu     $s1, $s1, %lo(gMatrixListPos)
/* 3B9574 E00BA9A4 3C12800A */  lui       $s2, %hi(gDisplayContext)
/* 3B9578 E00BA9A8 2652A674 */  addiu     $s2, $s2, %lo(gDisplayContext)
/* 3B957C E00BA9AC 96250000 */  lhu       $a1, 0x0($s1)
/* 3B9580 E00BA9B0 8E420000 */  lw        $v0, 0x0($s2)
/* 3B9584 E00BA9B4 00052980 */  sll       $a1, $a1, 6
/* 3B9588 E00BA9B8 00B32821 */  addu      $a1, $a1, $s3
/* 3B958C E00BA9BC 0C080118 */  jal       shim_guMtxF2L
/* 3B9590 E00BA9C0 00452821 */   addu     $a1, $v0, $a1
/* 3B9594 E00BA9C4 3C03DA38 */  lui       $v1, (0xDA380007 >> 16)
/* 3B9598 E00BA9C8 34630007 */  ori       $v1, $v1, (0xDA380007 & 0xFFFF)
/* 3B959C E00BA9CC 3C06D9FD */  lui       $a2, (0xD9FDF9FF >> 16)
/* 3B95A0 E00BA9D0 34C6F9FF */  ori       $a2, $a2, (0xD9FDF9FF & 0xFFFF)
/* 3B95A4 E00BA9D4 3C08D9FF */  lui       $t0, (0xD9FFFFFF >> 16)
/* 3B95A8 E00BA9D8 3508FFFF */  ori       $t0, $t0, (0xD9FFFFFF & 0xFFFF)
/* 3B95AC E00BA9DC 3C070020 */  lui       $a3, (0x200004 >> 16)
/* 3B95B0 E00BA9E0 34E70004 */  ori       $a3, $a3, (0x200004 & 0xFFFF)
/* 3B95B4 E00BA9E4 3C090101 */  lui       $t1, (0x1010020 >> 16)
/* 3B95B8 E00BA9E8 35290020 */  ori       $t1, $t1, (0x1010020 & 0xFFFF)
/* 3B95BC E00BA9EC 0000702D */  daddu     $t6, $zero, $zero
/* 3B95C0 E00BA9F0 3C150218 */  lui       $s5, (0x2180000 >> 16)
/* 3B95C4 E00BA9F4 24190018 */  addiu     $t9, $zero, 0x18
/* 3B95C8 E00BA9F8 8E040000 */  lw        $a0, 0x0($s0)
/* 3B95CC E00BA9FC 96220000 */  lhu       $v0, 0x0($s1)
/* 3B95D0 E00BAA00 0080282D */  daddu     $a1, $a0, $zero
/* 3B95D4 E00BAA04 24840008 */  addiu     $a0, $a0, 0x8
/* 3B95D8 E00BAA08 AE040000 */  sw        $a0, 0x0($s0)
/* 3B95DC E00BAA0C ACA30000 */  sw        $v1, 0x0($a1)
/* 3B95E0 E00BAA10 24430001 */  addiu     $v1, $v0, 0x1
/* 3B95E4 E00BAA14 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3B95E8 E00BAA18 00021180 */  sll       $v0, $v0, 6
/* 3B95EC E00BAA1C A6230000 */  sh        $v1, 0x0($s1)
/* 3B95F0 E00BAA20 8E430000 */  lw        $v1, 0x0($s2)
/* 3B95F4 E00BAA24 00531021 */  addu      $v0, $v0, $s3
/* 3B95F8 E00BAA28 00621821 */  addu      $v1, $v1, $v0
/* 3B95FC E00BAA2C 24820008 */  addiu     $v0, $a0, 0x8
/* 3B9600 E00BAA30 ACA30004 */  sw        $v1, 0x4($a1)
/* 3B9604 E00BAA34 AE020000 */  sw        $v0, 0x0($s0)
/* 3B9608 E00BAA38 24820010 */  addiu     $v0, $a0, 0x10
/* 3B960C E00BAA3C AC860000 */  sw        $a2, 0x0($a0)
/* 3B9610 E00BAA40 AC800004 */  sw        $zero, 0x4($a0)
/* 3B9614 E00BAA44 AE020000 */  sw        $v0, 0x0($s0)
/* 3B9618 E00BAA48 00991021 */  addu      $v0, $a0, $t9
/* 3B961C E00BAA4C AC880008 */  sw        $t0, 0x8($a0)
/* 3B9620 E00BAA50 AC87000C */  sw        $a3, 0xC($a0)
/* 3B9624 E00BAA54 AE020000 */  sw        $v0, 0x0($s0)
/* 3B9628 E00BAA58 3C020900 */  lui       $v0, %hi(D_09000428_415488)
/* 3B962C E00BAA5C 24420428 */  addiu     $v0, $v0, %lo(D_09000428_415488)
/* 3B9630 E00BAA60 AC890010 */  sw        $t1, 0x10($a0)
/* 3B9634 E00BAA64 AC820014 */  sw        $v0, 0x14($a0)
.LE00BAA68:
/* 3B9638 E00BAA68 15C00004 */  bnez      $t6, .LE00BAA7C
/* 3B963C E00BAA6C 0000902D */   daddu    $s2, $zero, $zero
/* 3B9640 E00BAA70 2404FFFC */  addiu     $a0, $zero, -0x4
/* 3B9644 E00BAA74 0802EAA0 */  j         .LE00BAA80
/* 3B9648 E00BAA78 24120001 */   addiu    $s2, $zero, 0x1
.LE00BAA7C:
/* 3B964C E00BAA7C 0000202D */  daddu     $a0, $zero, $zero
.LE00BAA80:
/* 3B9650 E00BAA80 2402000B */  addiu     $v0, $zero, 0xB
/* 3B9654 E00BAA84 15C20003 */  bne       $t6, $v0, .LE00BAA94
/* 3B9658 E00BAA88 0000182D */   daddu    $v1, $zero, $zero
/* 3B965C E00BAA8C 24030004 */  addiu     $v1, $zero, 0x4
/* 3B9660 E00BAA90 24120001 */  addiu     $s2, $zero, 0x1
.LE00BAA94:
/* 3B9664 E00BAA94 0000682D */  daddu     $t5, $zero, $zero
/* 3B9668 E00BAA98 03241021 */  addu      $v0, $t9, $a0
/* 3B966C E00BAA9C 0002C080 */  sll       $t8, $v0, 2
/* 3B9670 E00BAAA0 33020FFF */  andi      $v0, $t8, 0xFFF
/* 3B9674 E00BAAA4 3C16F400 */  lui       $s6, (0xF4000000 >> 16)
/* 3B9678 E00BAAA8 0056B025 */  or        $s6, $v0, $s6
/* 3B967C E00BAAAC AFB600A0 */  sw        $s6, 0xA0($sp)
/* 3B9680 E00BAAB0 03231821 */  addu      $v1, $t9, $v1
/* 3B9684 E00BAAB4 24620010 */  addiu     $v0, $v1, 0x10
/* 3B9688 E00BAAB8 00029880 */  sll       $s3, $v0, 2
/* 3B968C E00BAABC 32620FFF */  andi      $v0, $s3, 0xFFF
/* 3B9690 E00BAAC0 3C160700 */  lui       $s6, (0x7000000 >> 16)
/* 3B9694 E00BAAC4 0056F025 */  or        $fp, $v0, $s6
/* 3B9698 E00BAAC8 2463001F */  addiu     $v1, $v1, 0x1F
/* 3B969C E00BAACC 00031880 */  sll       $v1, $v1, 2
/* 3B96A0 E00BAAD0 30770FFF */  andi      $s7, $v1, 0xFFF
/* 3B96A4 E00BAAD4 0012B023 */  negu      $s6, $s2
/* 3B96A8 E00BAAD8 AFB600A8 */  sw        $s6, 0xA8($sp)
.LE00BAADC:
/* 3B96AC E00BAADC 0000502D */  daddu     $t2, $zero, $zero
/* 3B96B0 E00BAAE0 000D1100 */  sll       $v0, $t5, 4
/* 3B96B4 E00BAAE4 15A00004 */  bnez      $t5, .LE00BAAF8
/* 3B96B8 E00BAAE8 244F0010 */   addiu    $t7, $v0, 0x10
/* 3B96BC E00BAAEC 240BFFFC */  addiu     $t3, $zero, -0x4
/* 3B96C0 E00BAAF0 0802EABF */  j         .LE00BAAFC
/* 3B96C4 E00BAAF4 240A0001 */   addiu    $t2, $zero, 0x1
.LE00BAAF8:
/* 3B96C8 E00BAAF8 0000582D */  daddu     $t3, $zero, $zero
.LE00BAAFC:
/* 3B96CC E00BAAFC 24020011 */  addiu     $v0, $zero, 0x11
/* 3B96D0 E00BAB00 15A20003 */  bne       $t5, $v0, .LE00BAB10
/* 3B96D4 E00BAB04 0000882D */   daddu    $s1, $zero, $zero
/* 3B96D8 E00BAB08 24110004 */  addiu     $s1, $zero, 0x4
/* 3B96DC E00BAB0C 240A0001 */  addiu     $t2, $zero, 0x1
.LE00BAB10:
/* 3B96E0 E00BAB10 3C080709 */  lui       $t0, (0x7098260 >> 16)
/* 3B96E4 E00BAB14 35088260 */  ori       $t0, $t0, (0x7098260 & 0xFFFF)
/* 3B96E8 E00BAB18 3C090009 */  lui       $t1, (0x98260 >> 16)
/* 3B96EC E00BAB1C 35298260 */  ori       $t1, $t1, (0x98260 & 0xFFFF)
/* 3B96F0 E00BAB20 01F13021 */  addu      $a2, $t7, $s1
/* 3B96F4 E00BAB24 01EB2021 */  addu      $a0, $t7, $t3
/* 3B96F8 E00BAB28 2483FFF0 */  addiu     $v1, $a0, -0x10
/* 3B96FC E00BAB2C 00C31823 */  subu      $v1, $a2, $v1
/* 3B9700 E00BAB30 24630001 */  addiu     $v1, $v1, 0x1
/* 3B9704 E00BAB34 00031840 */  sll       $v1, $v1, 1
/* 3B9708 E00BAB38 24630007 */  addiu     $v1, $v1, 0x7
/* 3B970C E00BAB3C 000318C3 */  sra       $v1, $v1, 3
/* 3B9710 E00BAB40 306301FF */  andi      $v1, $v1, 0x1FF
/* 3B9714 E00BAB44 00031A40 */  sll       $v1, $v1, 9
/* 3B9718 E00BAB48 3C02F510 */  lui       $v0, (0xF5100000 >> 16)
/* 3B971C E00BAB4C 00621825 */  or        $v1, $v1, $v0
/* 3B9720 E00BAB50 00042080 */  sll       $a0, $a0, 2
/* 3B9724 E00BAB54 30840FFF */  andi      $a0, $a0, 0xFFF
/* 3B9728 E00BAB58 8E050000 */  lw        $a1, 0x0($s0)
/* 3B972C E00BAB5C 00042300 */  sll       $a0, $a0, 12
/* 3B9730 E00BAB60 00A0382D */  daddu     $a3, $a1, $zero
/* 3B9734 E00BAB64 24A50008 */  addiu     $a1, $a1, 0x8
/* 3B9738 E00BAB68 24A20008 */  addiu     $v0, $a1, 0x8
/* 3B973C E00BAB6C AE050000 */  sw        $a1, 0x0($s0)
/* 3B9740 E00BAB70 ACE30000 */  sw        $v1, 0x0($a3)
/* 3B9744 E00BAB74 ACE80004 */  sw        $t0, 0x4($a3)
/* 3B9748 E00BAB78 AE020000 */  sw        $v0, 0x0($s0)
/* 3B974C E00BAB7C 3C02E600 */  lui       $v0, (0xE6000000 >> 16)
/* 3B9750 E00BAB80 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B9754 E00BAB84 24A20010 */  addiu     $v0, $a1, 0x10
/* 3B9758 E00BAB88 ACA00004 */  sw        $zero, 0x4($a1)
/* 3B975C E00BAB8C AE020000 */  sw        $v0, 0x0($s0)
/* 3B9760 E00BAB90 24C20010 */  addiu     $v0, $a2, 0x10
/* 3B9764 E00BAB94 00021080 */  sll       $v0, $v0, 2
/* 3B9768 E00BAB98 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3B976C E00BAB9C 00021300 */  sll       $v0, $v0, 12
/* 3B9770 E00BABA0 8FB600A0 */  lw        $s6, 0xA0($sp)
/* 3B9774 E00BABA4 005E1025 */  or        $v0, $v0, $fp
/* 3B9778 E00BABA8 ACA2000C */  sw        $v0, 0xC($a1)
/* 3B977C E00BABAC 24A20018 */  addiu     $v0, $a1, 0x18
/* 3B9780 E00BABB0 24C6001F */  addiu     $a2, $a2, 0x1F
/* 3B9784 E00BABB4 00063080 */  sll       $a2, $a2, 2
/* 3B9788 E00BABB8 30C60FFF */  andi      $a2, $a2, 0xFFF
/* 3B978C E00BABBC 00063300 */  sll       $a2, $a2, 12
/* 3B9790 E00BABC0 00D73025 */  or        $a2, $a2, $s7
/* 3B9794 E00BABC4 00962025 */  or        $a0, $a0, $s6
/* 3B9798 E00BABC8 3C16E700 */  lui       $s6, (0xE7000000 >> 16)
/* 3B979C E00BABCC ACA40008 */  sw        $a0, 0x8($a1)
/* 3B97A0 E00BABD0 AE020000 */  sw        $v0, 0x0($s0)
/* 3B97A4 E00BABD4 24A20020 */  addiu     $v0, $a1, 0x20
/* 3B97A8 E00BABD8 ACB60010 */  sw        $s6, 0x10($a1)
/* 3B97AC E00BABDC ACA00014 */  sw        $zero, 0x14($a1)
/* 3B97B0 E00BABE0 AE020000 */  sw        $v0, 0x0($s0)
/* 3B97B4 E00BABE4 24A20028 */  addiu     $v0, $a1, 0x28
/* 3B97B8 E00BABE8 ACA30018 */  sw        $v1, 0x18($a1)
/* 3B97BC E00BABEC ACA9001C */  sw        $t1, 0x1C($a1)
/* 3B97C0 E00BABF0 AE020000 */  sw        $v0, 0x0($s0)
/* 3B97C4 E00BABF4 3C02F200 */  lui       $v0, (0xF2000000 >> 16)
/* 3B97C8 E00BABF8 ACA20020 */  sw        $v0, 0x20($a1)
/* 3B97CC E00BABFC 11400003 */  beqz      $t2, .LE00BAC0C
/* 3B97D0 E00BAC00 ACA60024 */   sw       $a2, 0x24($a1)
/* 3B97D4 E00BAC04 16400005 */  bnez      $s2, .LE00BAC1C
/* 3B97D8 E00BAC08 240C000C */   addiu    $t4, $zero, 0xC
.LE00BAC0C:
/* 3B97DC E00BAC0C 15400003 */  bnez      $t2, .LE00BAC1C
/* 3B97E0 E00BAC10 240C0004 */   addiu    $t4, $zero, 0x4
/* 3B97E4 E00BAC14 8FB600A8 */  lw        $s6, 0xA8($sp)
/* 3B97E8 E00BAC18 32CC0008 */  andi      $t4, $s6, 0x8
.LE00BAC1C:
/* 3B97EC E00BAC1C 000D2840 */  sll       $a1, $t5, 1
/* 3B97F0 E00BAC20 00AD2821 */  addu      $a1, $a1, $t5
/* 3B97F4 E00BAC24 00052880 */  sll       $a1, $a1, 2
/* 3B97F8 E00BAC28 00AD2821 */  addu      $a1, $a1, $t5
/* 3B97FC E00BAC2C 25A20001 */  addiu     $v0, $t5, 0x1
/* 3B9800 E00BAC30 0040682D */  daddu     $t5, $v0, $zero
/* 3B9804 E00BAC34 000C5040 */  sll       $t2, $t4, 1
/* 3B9808 E00BAC38 01551025 */  or        $v0, $t2, $s5
/* 3B980C E00BAC3C 01EB4821 */  addu      $t1, $t7, $t3
/* 3B9810 E00BAC40 00094C80 */  sll       $t1, $t1, 18
/* 3B9814 E00BAC44 258B0001 */  addiu     $t3, $t4, 0x1
/* 3B9818 E00BAC48 000B5840 */  sll       $t3, $t3, 1
/* 3B981C E00BAC4C 25880002 */  addiu     $t0, $t4, 0x2
/* 3B9820 E00BAC50 00084040 */  sll       $t0, $t0, 1
/* 3B9824 E00BAC54 01F13821 */  addu      $a3, $t7, $s1
/* 3B9828 E00BAC58 24E70010 */  addiu     $a3, $a3, 0x10
/* 3B982C E00BAC5C 00073C80 */  sll       $a3, $a3, 18
/* 3B9830 E00BAC60 8E060000 */  lw        $a2, 0x0($s0)
/* 3B9834 E00BAC64 000A5400 */  sll       $t2, $t2, 16
/* 3B9838 E00BAC68 00C0202D */  daddu     $a0, $a2, $zero
/* 3B983C E00BAC6C 24C60008 */  addiu     $a2, $a2, 0x8
/* 3B9840 E00BAC70 AE060000 */  sw        $a2, 0x0($s0)
/* 3B9844 E00BAC74 AC820000 */  sw        $v0, 0x0($a0)
/* 3B9848 E00BAC78 01C51021 */  addu      $v0, $t6, $a1
/* 3B984C E00BAC7C 02821021 */  addu      $v0, $s4, $v0
/* 3B9850 E00BAC80 80430023 */  lb        $v1, 0x23($v0)
/* 3B9854 E00BAC84 24C20008 */  addiu     $v0, $a2, 0x8
/* 3B9858 E00BAC88 AE020000 */  sw        $v0, 0x0($s0)
/* 3B985C E00BAC8C 01751025 */  or        $v0, $t3, $s5
/* 3B9860 E00BAC90 24A50001 */  addiu     $a1, $a1, 0x1
/* 3B9864 E00BAC94 01C52821 */  addu      $a1, $t6, $a1
/* 3B9868 E00BAC98 02852821 */  addu      $a1, $s4, $a1
/* 3B986C E00BAC9C 03031821 */  addu      $v1, $t8, $v1
/* 3B9870 E00BACA0 01231825 */  or        $v1, $t1, $v1
/* 3B9874 E00BACA4 AC830004 */  sw        $v1, 0x4($a0)
/* 3B9878 E00BACA8 000D1840 */  sll       $v1, $t5, 1
/* 3B987C E00BACAC 006D1821 */  addu      $v1, $v1, $t5
/* 3B9880 E00BACB0 00031880 */  sll       $v1, $v1, 2
/* 3B9884 E00BACB4 006D1821 */  addu      $v1, $v1, $t5
/* 3B9888 E00BACB8 ACC20000 */  sw        $v0, 0x0($a2)
/* 3B988C E00BACBC 01C31021 */  addu      $v0, $t6, $v1
/* 3B9890 E00BACC0 02821021 */  addu      $v0, $s4, $v0
/* 3B9894 E00BACC4 80440023 */  lb        $a0, 0x23($v0)
/* 3B9898 E00BACC8 24C20010 */  addiu     $v0, $a2, 0x10
/* 3B989C E00BACCC AE020000 */  sw        $v0, 0x0($s0)
/* 3B98A0 E00BACD0 01151025 */  or        $v0, $t0, $s5
/* 3B98A4 E00BACD4 ACC20008 */  sw        $v0, 0x8($a2)
/* 3B98A8 E00BACD8 24C20018 */  addiu     $v0, $a2, 0x18
/* 3B98AC E00BACDC 24630001 */  addiu     $v1, $v1, 0x1
/* 3B98B0 E00BACE0 01C31821 */  addu      $v1, $t6, $v1
/* 3B98B4 E00BACE4 02831821 */  addu      $v1, $s4, $v1
/* 3B98B8 E00BACE8 00084200 */  sll       $t0, $t0, 8
/* 3B98BC E00BACEC 03042021 */  addu      $a0, $t8, $a0
/* 3B98C0 E00BACF0 00E42025 */  or        $a0, $a3, $a0
/* 3B98C4 E00BACF4 ACC40004 */  sw        $a0, 0x4($a2)
/* 3B98C8 E00BACF8 80A40023 */  lb        $a0, 0x23($a1)
/* 3B98CC E00BACFC 25850003 */  addiu     $a1, $t4, 0x3
/* 3B98D0 E00BAD00 00052840 */  sll       $a1, $a1, 1
/* 3B98D4 E00BAD04 AE020000 */  sw        $v0, 0x0($s0)
/* 3B98D8 E00BAD08 00B51025 */  or        $v0, $a1, $s5
/* 3B98DC E00BAD0C ACC20010 */  sw        $v0, 0x10($a2)
/* 3B98E0 E00BAD10 24C20020 */  addiu     $v0, $a2, 0x20
/* 3B98E4 E00BAD14 02642021 */  addu      $a0, $s3, $a0
/* 3B98E8 E00BAD18 01244825 */  or        $t1, $t1, $a0
/* 3B98EC E00BAD1C ACC9000C */  sw        $t1, 0xC($a2)
/* 3B98F0 E00BAD20 80640023 */  lb        $a0, 0x23($v1)
/* 3B98F4 E00BAD24 30A500FF */  andi      $a1, $a1, 0xFF
/* 3B98F8 E00BAD28 AE020000 */  sw        $v0, 0x0($s0)
/* 3B98FC E00BAD2C 00051200 */  sll       $v0, $a1, 8
/* 3B9900 E00BAD30 01421025 */  or        $v0, $t2, $v0
/* 3B9904 E00BAD34 004B1025 */  or        $v0, $v0, $t3
/* 3B9908 E00BAD38 3C030600 */  lui       $v1, (0x6000000 >> 16)
/* 3B990C E00BAD3C 00431025 */  or        $v0, $v0, $v1
/* 3B9910 E00BAD40 01485025 */  or        $t2, $t2, $t0
/* 3B9914 E00BAD44 01455025 */  or        $t2, $t2, $a1
/* 3B9918 E00BAD48 ACC20018 */  sw        $v0, 0x18($a2)
/* 3B991C E00BAD4C 24C20028 */  addiu     $v0, $a2, 0x28
/* 3B9920 E00BAD50 3C16E700 */  lui       $s6, (0xE7000000 >> 16)
/* 3B9924 E00BAD54 ACCA001C */  sw        $t2, 0x1C($a2)
/* 3B9928 E00BAD58 AE020000 */  sw        $v0, 0x0($s0)
/* 3B992C E00BAD5C 29A20012 */  slti      $v0, $t5, 0x12
/* 3B9930 E00BAD60 ACD60020 */  sw        $s6, 0x20($a2)
/* 3B9934 E00BAD64 ACC00024 */  sw        $zero, 0x24($a2)
/* 3B9938 E00BAD68 02642021 */  addu      $a0, $s3, $a0
/* 3B993C E00BAD6C 00E43825 */  or        $a3, $a3, $a0
/* 3B9940 E00BAD70 1440FF5A */  bnez      $v0, .LE00BAADC
/* 3B9944 E00BAD74 ACC70014 */   sw       $a3, 0x14($a2)
/* 3B9948 E00BAD78 25CE0001 */  addiu     $t6, $t6, 0x1
/* 3B994C E00BAD7C 29C2000C */  slti      $v0, $t6, 0xC
/* 3B9950 E00BAD80 1440FF39 */  bnez      $v0, .LE00BAA68
/* 3B9954 E00BAD84 27390010 */   addiu    $t9, $t9, 0x10
/* 3B9958 E00BAD88 3C06FF10 */  lui       $a2, (0xFF10013F >> 16)
/* 3B995C E00BAD8C 34C6013F */  ori       $a2, $a2, (0xFF10013F & 0xFFFF)
/* 3B9960 E00BAD90 3C07DA38 */  lui       $a3, (0xDA380007 >> 16)
/* 3B9964 E00BAD94 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 3B9968 E00BAD98 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 3B996C E00BAD9C 8CA30000 */  lw        $v1, 0x0($a1)
/* 3B9970 E00BADA0 3C04800A */  lui       $a0, %hi(nuGfxZBuffer)
/* 3B9974 E00BADA4 8C84A5DC */  lw        $a0, %lo(nuGfxZBuffer)($a0)
/* 3B9978 E00BADA8 0060102D */  daddu     $v0, $v1, $zero
/* 3B997C E00BADAC 24630008 */  addiu     $v1, $v1, 0x8
/* 3B9980 E00BADB0 ACA30000 */  sw        $v1, 0x0($a1)
/* 3B9984 E00BADB4 AC460000 */  sw        $a2, 0x0($v0)
/* 3B9988 E00BADB8 AC440004 */  sw        $a0, 0x4($v0)
/* 3B998C E00BADBC 24620008 */  addiu     $v0, $v1, 0x8
/* 3B9990 E00BADC0 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B9994 E00BADC4 3C04800A */  lui       $a0, %hi(nuGfxCfb_ptr)
/* 3B9998 E00BADC8 8C84A64C */  lw        $a0, %lo(nuGfxCfb_ptr)($a0)
/* 3B999C E00BADCC 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3B99A0 E00BADD0 AC620000 */  sw        $v0, 0x0($v1)
/* 3B99A4 E00BADD4 3C020900 */  lui       $v0, %hi(D_09000570_4155D0)
/* 3B99A8 E00BADD8 24420570 */  addiu     $v0, $v0, %lo(D_09000570_4155D0)
/* 3B99AC E00BADDC AC620004 */  sw        $v0, 0x4($v1)
/* 3B99B0 E00BADE0 24620010 */  addiu     $v0, $v1, 0x10
/* 3B99B4 E00BADE4 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B99B8 E00BADE8 24620018 */  addiu     $v0, $v1, 0x18
/* 3B99BC E00BADEC AC660008 */  sw        $a2, 0x8($v1)
/* 3B99C0 E00BADF0 02C0302D */  daddu     $a2, $s6, $zero
/* 3B99C4 E00BADF4 AC64000C */  sw        $a0, 0xC($v1)
/* 3B99C8 E00BADF8 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B99CC E00BADFC 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* 3B99D0 E00BAE00 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* 3B99D4 E00BAE04 24620020 */  addiu     $v0, $v1, 0x20
/* 3B99D8 E00BAE08 AC660010 */  sw        $a2, 0x10($v1)
/* 3B99DC E00BAE0C AC600014 */  sw        $zero, 0x14($v1)
/* 3B99E0 E00BAE10 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B99E4 E00BAE14 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 3B99E8 E00BAE18 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 3B99EC E00BAE1C 34E70007 */  ori       $a3, $a3, (0xDA380007 & 0xFFFF)
/* 3B99F0 E00BAE20 AC670018 */  sw        $a3, 0x18($v1)
/* 3B99F4 E00BAE24 00042180 */  sll       $a0, $a0, 6
/* 3B99F8 E00BAE28 24840030 */  addiu     $a0, $a0, 0x30
/* 3B99FC E00BAE2C 00441021 */  addu      $v0, $v0, $a0
/* 3B9A00 E00BAE30 AC62001C */  sw        $v0, 0x1C($v1)
/* 3B9A04 E00BAE34 24620028 */  addiu     $v0, $v1, 0x28
/* 3B9A08 E00BAE38 ACA20000 */  sw        $v0, 0x0($a1)
/* 3B9A0C E00BAE3C AC660020 */  sw        $a2, 0x20($v1)
/* 3B9A10 E00BAE40 AC600024 */  sw        $zero, 0x24($v1)
/* 3B9A14 E00BAE44 8FBF00D4 */  lw        $ra, 0xD4($sp)
/* 3B9A18 E00BAE48 8FBE00D0 */  lw        $fp, 0xD0($sp)
/* 3B9A1C E00BAE4C 8FB700CC */  lw        $s7, 0xCC($sp)
/* 3B9A20 E00BAE50 8FB600C8 */  lw        $s6, 0xC8($sp)
/* 3B9A24 E00BAE54 8FB500C4 */  lw        $s5, 0xC4($sp)
/* 3B9A28 E00BAE58 8FB400C0 */  lw        $s4, 0xC0($sp)
/* 3B9A2C E00BAE5C 8FB300BC */  lw        $s3, 0xBC($sp)
/* 3B9A30 E00BAE60 8FB200B8 */  lw        $s2, 0xB8($sp)
/* 3B9A34 E00BAE64 8FB100B4 */  lw        $s1, 0xB4($sp)
/* 3B9A38 E00BAE68 8FB000B0 */  lw        $s0, 0xB0($sp)
/* 3B9A3C E00BAE6C 03E00008 */  jr        $ra
/* 3B9A40 E00BAE70 27BD00D8 */   addiu    $sp, $sp, 0xD8
/* 3B9A44 E00BAE74 00000000 */  nop
/* 3B9A48 E00BAE78 00000000 */  nop
/* 3B9A4C E00BAE7C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void underwater_appendGfx(void* effect) {
    UnderwaterFXData* data = ((EffectInstance*)effect)->data.underwater;
    s32 alpha = data->waterColor.a;
    s32 x, y;
    s32 dxRight, dxLeft, dyTop, dyBottom;
    s32 edgeX, edgeY;
    s32 vtxIdx;
    Matrix4f mtx;
    Matrix4f unused_matrix;
    s32 i, j;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxZBuffer);
    gSPDisplayList(gMainGfxPos++, D_09000528_3B9F98);

    // copy image from framebuffer to zbuffer
    for (i = 0; i < 40; i++) {
        gDPLoadTextureTile(
            gMainGfxPos++, nuGfxCfb_ptr + SCREEN_WIDTH * i * 6,
            G_IM_FMT_RGBA, G_IM_SIZ_16b,
            SCREEN_WIDTH, 6,
            0, 0, SCREEN_WIDTH - 1, 5, 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);
        gSPTextureRectangle(
            gMainGfxPos++,
            0 * 4, (i * 6) * 4,
            (SCREEN_WIDTH - 1) * 4, (i * 6 + 5) * 4,
            G_TX_RENDERTILE, 0, 0, 0x1000, 0x0400);
        gDPPipeSync(gMainGfxPos++);
    }

    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxCfb_ptr);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->waterColor.r, data->waterColor.g, data->waterColor.b, alpha >> 1);
    gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
    gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE, PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE);
    gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, OS_K0_TO_PHYSICAL(nuGfxZBuffer));
    gDPSetRenderMode(gMainGfxPos++, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
    gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
    gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);

    shim_guFrustumF(mtx, -80.0f, 80.0f, 60.0f, -60.0f, 160.0f, 640.0f, 1.0f);
    shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
    gSPClearGeometryMode(gMainGfxPos++, G_CULL_BOTH | G_LIGHTING);
    gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
    gSPVertex(gMainGfxPos++, D_09000428_3B9E98, 16, 0);

    for (j = 0; j < 12; j++) {
        y = j * 16 + 24;
        edgeY = FALSE;

        if (j == 0) {
            dyTop = -4;
            edgeY = TRUE;
        } else {
            dyTop = 0;
        }

        if (j == 11) {
            dyBottom = 4;
            edgeY = TRUE;
        } else {
            dyBottom = 0;
        }

        for (i = 0; i < 18; i++) {
            x = i * 16 + 16;
            edgeX = FALSE;

            if (i == 0) {
                dxLeft = -4;
                edgeX = TRUE;
            } else {
                dxLeft = 0;
            }

            if (i == 17) {
                dxRight = 4;
                edgeX = TRUE;
            } else {
                dxRight = 0;
            }

            gDPSetTile(
                gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b,
                (((((x + dxRight + 16) - (x + dxLeft)) + 1) * 2) + 7) >> 3, 0x0000,
                G_TX_LOADTILE, 0,
                G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD,
                G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD);
            gDPLoadSync(gMainGfxPos++);
            gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE,
                (x + dxLeft) * 4,
                (y + dyTop) * 4,
                (x + dxRight + 16) * 4,
                (y + dyBottom + 16) * 4);
            gDPPipeSync(gMainGfxPos++);
            gDPSetTile(
                gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b,
                (((((x + dxRight + 16) - (x + dxLeft)) + 1) * 2) + 7) >> 3, 0x0000,
                G_TX_RENDERTILE, 0,
                G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD,
                G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD);
            gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE,
                0, 0, (x + dxRight + 31) * 4, (y + dyBottom + 31) * 4);

            if (edgeX && edgeY) {
                vtxIdx = 12;
            } else {
                vtxIdx = 4;
                if (!edgeX) {
                    if (!edgeY) {
                        vtxIdx = 0;
                    } else {
                        vtxIdx = 8;
                    }
                }
            }

            gSPModifyVertex(gMainGfxPos++, vtxIdx    , G_MWO_POINT_XYSCREEN, ((x + dxLeft        ) << 0x12) | ((y + dyTop          ) * 4 + data->unk_23[i    ][j    ]));
            gSPModifyVertex(gMainGfxPos++, vtxIdx + 1, G_MWO_POINT_XYSCREEN, ((x + dxRight + 0x10) << 0x12) | ((y + dyTop          ) * 4 + data->unk_23[i + 1][j    ]));
            gSPModifyVertex(gMainGfxPos++, vtxIdx + 2, G_MWO_POINT_XYSCREEN, ((x + dxLeft        ) << 0x12) | ((y + dyBottom + 0x10) * 4 + data->unk_23[i    ][j + 1]));
            gSPModifyVertex(gMainGfxPos++, vtxIdx + 3, G_MWO_POINT_XYSCREEN, ((x + dxRight + 0x10) << 0x12) | ((y + dyBottom + 0x10) * 4 + data->unk_23[i + 1][j + 1]));
            gSP2Triangles(gMainGfxPos++, vtxIdx, vtxIdx + 3, vtxIdx + 1, 0, vtxIdx, vtxIdx + 2, vtxIdx + 3, 0);
            gDPPipeSync(gMainGfxPos++);
        }
    }

    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxZBuffer);
    gSPDisplayList(gMainGfxPos++, D_09000570_3B9FE0);
    gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxCfb_ptr);
    gDPPipeSync(gMainGfxPos++);
    gSPMatrix(gMainGfxPos++, &gDisplayContext->camPerspMatrix[gCurrentCameraID], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
    gDPPipeSync(gMainGfxPos++);
}